thevoden
New Member
- Reaction score
- 5
Basically I want it so that whenever a unit dies (a building; fire, grass or rock edifaces) that the "zone of control" is lost.
The rules are simple:
- Whenever you build an ediface in a region, you "gain" control of that region.
- So lets say you build 3 edifaces in that region, the opponent must destroy 3 in order for you to "lose" control of that region.
The problem comes into play when an opponent only destroys 1 ediface it causes the player to "lose" control of their region (while they have 2 other buildings / edifaces in that same region ). I want it to somehow make the player "lose" control of the region when he / she has no more edifaces built in that certain region.
So far this is what I have.
p.s. - how do you remove the Press Any Key To Continue on your map loading? I want it to start the game automatically.
I tried inserting game texts with this too so I can know when the trigger fires and such.
The rules are simple:
- Whenever you build an ediface in a region, you "gain" control of that region.
- So lets say you build 3 edifaces in that region, the opponent must destroy 3 in order for you to "lose" control of that region.
The problem comes into play when an opponent only destroys 1 ediface it causes the player to "lose" control of their region (while they have 2 other buildings / edifaces in that same region ). I want it to somehow make the player "lose" control of the region when he / she has no more edifaces built in that certain region.
So far this is what I have.
JASS:
Region Control Lost
Events
Unit - A unit Dies
Conditions
And - All (Conditions) are true
Conditions
Or - Any (Conditions) are true
Conditions
(Unit-type of (Dying unit)) Equal to Fire Ediface
(Unit-type of (Dying unit)) Equal to Grass Ediface
(Unit-type of (Dying unit)) Equal to Rock Ediface
Actions
Game - Display to (All players) the text: Step 1 Control Lost...
For each (Integer A) from 1 to 16, do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(start_REGION_set[(Integer A)] contains (Dying unit)) Equal to True
build_REGIONS_controlled[(Integer A)] Equal to True
(start_REGION_set[(Integer A)] contains (Dying unit)) Equal to False
Then - Actions
Game - Display to (All players) the text: Step 2 Control Lost...
Set build_REGIONS_controlled[(Integer A)] = False
Set Player_Number_RegionsControl[(Player number of (Triggering player))] = (Player_Number_RegionsControl[(Player number of (Triggering player))] - 1)
Game - Display to (All players) the text: (You have lost a zone! + (You now control + ((String(Player_Number_RegionsControl[(Player number of (Triggering player))])) + zone(s). )))
Else - Actions
p.s. - how do you remove the Press Any Key To Continue on your map loading? I want it to start the game automatically.
I tried inserting game texts with this too so I can know when the trigger fires and such.