- Joined
- May 9, 2009
- Messages
- 735
Hello, I am trying to figure out how exactly the PickAllUnits in a group line in GUI works... The trigger I am trying to make has multiple of these inside each other. According to my brain it should work but for some reason it doesn't. I really want to understand where the issue is because I just can't seem to get it... It looks like one of the If/Then/Else line doesn't run the way it should.
What I am trying to make: a new system where Siege Engines require to be pushed. Siege engines can be used as long as there's a unit nearby (that's not dead, or is a building, or is a horseman) but if that unit goes away it should turn passive. If an enemy comes near than there should be a chance for the siege engine to become 'contested' (pick random unit around it) and if it is 'contested' it becomes passive. Passive engines should be given to any unit who comes near as long as two hostile units aren't next to each other... so if an enemy unit and your unit are both near at the same time (after the engine is contested for example) it should remain passive until the conflict is resolved.
What I am trying to make: a new system where Siege Engines require to be pushed. Siege engines can be used as long as there's a unit nearby (that's not dead, or is a building, or is a horseman) but if that unit goes away it should turn passive. If an enemy comes near than there should be a chance for the siege engine to become 'contested' (pick random unit around it) and if it is 'contested' it becomes passive. Passive engines should be given to any unit who comes near as long as two hostile units aren't next to each other... so if an enemy unit and your unit are both near at the same time (after the engine is contested for example) it should remain passive until the conflict is resolved.
-
System 1 Copy
-
Events
-
Time - Every 1.00 seconds of game time
-
-
Conditions
-
Actions
-
Unit Group - Pick every unit in SiegeUnits and do (Actions)
-
Loop - Actions
-
Set SiegeUN = (Picked unit)
-
Set AAAPositionSiege = (Position of SiegeUN)
-
Set AnyUnitsAtAll = (Units within 500.00 of AAAPositionSiege)
-
Unit Group - Pick every unit in AnyUnitsAtAll and do (Actions)
-
Loop - Actions
-
Set PusherUN = (Picked unit)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(PusherUN is in SiegeUnits) Equal to False
-
(Owner of PusherUN) Not equal to Neutral Passive
-
(Owner of PusherUN) Not equal to Neutral Hostile
-
(PusherUN is alive) Equal to True
-
((Unit-type of PusherUN) is A structure) Equal to False
-
(PusherUN is in ALLcavalryGROUP) Equal to False
-
-
Then - Actions
-
Unit Group - Add PusherUN to AAAGroupUnitsAroundSiege
-
-
Else - Actions
-
-
Unit Group - Pick every unit in AAAGroupUnitsAroundSiege and do (Actions)
-
Loop - Actions
-
Set tempU = (Picked unit)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Owner of SiegeUN) Equal to Neutral Passive
-
-
Then - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
Or - Any (Conditions) are true
-
Conditions
-
(Owner of tempU) Equal to (Owner of tempU)
-
(tempU belongs to an ally of (Owner of tempU)) Equal to True
-
-
-
-
Then - Actions
-
Unit - Change ownership of SiegeUN to (Owner of tempU) and Change color
-
-
Else - Actions
-
-
-
Else - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
Or - Any (Conditions) are true
-
Conditions
-
(Owner of tempU) Equal to (Owner of tempU)
-
(tempU belongs to an ally of (Owner of tempU)) Equal to True
-
-
-
-
Then - Actions
-
Else - Actions
-
Unit Group - Pick every unit in (Random 1 units from AAAGroupUnitsAroundSiege) and do (Actions)
-
Loop - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
((Picked unit) belongs to an enemy of (Owner of SiegeUN)) Equal to True
-
-
Then - Actions
-
Unit - Change ownership of SiegeUN to Neutral Passive and Change color
-
-
Else - Actions
-
-
-
-
-
-
-
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
Or - Any (Conditions) are true
-
Conditions
-
(Owner of tempU) Equal to (Owner of SiegeUN)
-
(tempU belongs to an ally of (Owner of SiegeUN)) Equal to True
-
-
-
-
Then - Actions
-
Set tempCOUNT = (tempCOUNT + 1)
-
-
Else - Actions
-
-
-
-
-
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
tempCOUNT Equal to 0
-
-
Then - Actions
-
Unit - Change ownership of SiegeUN to Neutral Passive and Change color
-
-
Else - Actions
-
-
-
-
Set moonshrine = 0
-
Custom script: call RemoveLocation(udg_AAAPositionSiege)
-
Custom script: call DestroyGroup (udg_AnyUnitsAtAll)
-
Custom script: call DestroyGroup (udg_AAAGroupUnitsAroundSiege)
-
-