HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

City Capture

08-15-2004, 11:20 PM#1
IgeniousMask
How do I make a trigger for city capture like in diplomacy or europa?
Basically, a city can be attacked but when it is less than 10% health it regains its life and becomes owned by the player who was attacking the city?
08-16-2004, 01:09 AM#2
HEZZA
Quote:
Originally Posted by IgeniousMask
How do I make a trigger for city capture like in diplomacy or europa?
Basically, a city can be attacked but when it is less than 10% health it regains its life and becomes owned by the player who was attacking the city?

i done a map like that, but havent released it because i halted work on it.

it goes something like:

Event:
time - period 2 secs of game

condtion:
depends on the map

Action:
If then else multiple functions
If number of units around unit equal to or less then X owned by player

then do:
Unit change ownership of UNIT - to owner of triggerin unit (u can make this more specific)

Else :
nothing
08-16-2004, 03:29 AM#3
Alenz Sictifer
Well, another way of doing this is to calculate the percentage life of a Castle or City (or whatever you use) if your going by "10%." For example: if you had a normal Human Castle, (life is 2500) which would mean that 10% of life would be 250. Then, you could start this triger:

Events:
Unit - A unit is attacked
Conditions:
Actions:
If (All conditions are true) then do (Then Actions) else do (Else Actions)
-> If - Conditions:
--> And All (Conditions) are true
---> (Unit type of(Attacked Unit)) Equal to Castle
---> (Life of (Attacked Unit)) Less than or equal to 250.00
-> Then - Actions:
--> Unit - Change Ownership of (attacked unit) to (Owner of (Attacking Unit)) and change color
--> Unit - Set Life of (Attacked Unit) to 2500.00
-> Else - Actions:
--> Do nothing

I tested this out and it worked for me. You will have to change several of the values so that what is said above will fit with the custom units in your map.

I hope this will help a bit. :D