• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Why doesnt this work?

Status
Not open for further replies.
Level 21
Joined
Jan 5, 2005
Messages
3,515
im not sure why but this trigger doesn work

[trigger:1:e756908aa5]
Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)
Loop - Actions
For each (Integer A) from 1 to 3, do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Owner of (Picked unit)) Equal to Player 11 (Dark Green)
((Picked unit) is in AttackerGroups[(Integer A)]) Equal to False
(((Picked unit) is in AttackerGroups[7]) Equal to False) and (((Picked unit) is in AttackerGroups[8]) Equal to False)
(Current order of (Picked unit)) Equal to (Order(stop))
Then - Actions
Unit - Order (Picked unit) to Attack-Move To (Position of HQ[2])
Else - Actions
Do nothing
For each (Integer B) from 4 to 6, do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Owner of (Picked unit)) Equal to Player 12 (Brown)
((Picked unit) is in AttackerGroups[(Integer B)]) Equal to False
(((Picked unit) is in AttackerGroups[7]) Equal to False) and (((Picked unit) is in AttackerGroups[8]) Equal to False)
(Current order of (Picked unit)) Equal to (Order(stop))
Then - Actions
Unit - Order (Picked unit) to Attack-Move To (Position of HQ[1])
Else - Actions
Do nothing
[/trigger:1:e756908aa5]

im fairly sure its having the game pic every unit on the map when doing if then elses around those units. its probably gunna cause lag and i dont plan to use it, but i just want to know why it doesnt. for some reason it causes all my units to do really random stuff. eigther too early or too late or not at all. its very odd.
 

ventuz

V

ventuz

It's complex... perhap "For each A 1 to 3, for each B 4 to 6" making it doesn't work.

I made a trigger to make it less complex.

[trigger:1:347546ef6e]
Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
((Picked unit) is in AttackerGroups[1]) Equal to False
((Picked unit) is in AttackerGroups[2]) Equal to False
((Picked unit) is in AttackerGroups[3]) Equal to False
((Picked unit) is in AttackerGroups[4]) Equal to False
((Picked unit) is in AttackerGroups[5]) Equal to False
((Picked unit) is in AttackerGroups[6]) Equal to False
((Picked unit) is in AttackerGroups[7]) Equal to False
((Picked unit) is in AttackerGroups[8]) Equal to False
Then - Actions
If ((Owner of (Picked unit)) Equal to Player 11 (Dark Green)) then do (Unit - Order (Picked unit) to Attack-Move To (Position of HQ[2])) else do (Do nothing)
If ((Owner of (Picked unit)) Equal to Player 12 (Brown)) then do (Unit - Order (Picked unit) to Attack-Move To (Position of HQ[1])) else do (Do nothing)
Else - Actions
Do nothing

[/trigger:1:347546ef6e]

if it lags, then do this.

[trigger:1:347546ef6e]Actions
Unit Group - Pick every unit in (Units in (Playable map area) owned by Player 11 (Dark Green)) and do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
((Picked unit) is in AttackerGroups[1]) Equal to False
((Picked unit) is in AttackerGroups[2]) Equal to False
((Picked unit) is in AttackerGroups[3]) Equal to False
((Picked unit) is in AttackerGroups[4]) Equal to False
((Picked unit) is in AttackerGroups[5]) Equal to False
((Picked unit) is in AttackerGroups[6]) Equal to False
((Picked unit) is in AttackerGroups[7]) Equal to False
((Picked unit) is in AttackerGroups[8]) Equal to False
Then - Actions
Unit - Order (Picked unit) to Attack-Move To (Position of HQ[2])
Else - Actions
Do nothing
Unit Group - Pick every unit in (Units in (Playable map area) owned by Player 12 (Brown)) and do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
((Picked unit) is in AttackerGroups[1]) Equal to False
((Picked unit) is in AttackerGroups[2]) Equal to False
((Picked unit) is in AttackerGroups[3]) Equal to False
((Picked unit) is in AttackerGroups[4]) Equal to False
((Picked unit) is in AttackerGroups[5]) Equal to False
((Picked unit) is in AttackerGroups[6]) Equal to False
((Picked unit) is in AttackerGroups[7]) Equal to False
((Picked unit) is in AttackerGroups[8]) Equal to False
Then - Actions
Unit - Order (Picked unit) to Attack-Move To (Position of HQ[1])
Else - Actions
Do nothing

[/trigger:1:347546ef6e]

See if these helps?.. I don't know if it will work or not, because I don't know how do you work with unit in AttackerGroups being True or False.

@ Ralle, ah.. maybe that the problem, try change to "(Order(wait))" ?
 
Level 21
Joined
Jan 5, 2005
Messages
3,515
well as i said im not using that, so its no big deal. i thought it might have been the double loop which stops it working. ie every unit has a loop of 6 on it which means if i have alot of units it loops 6 x number of units which is alot of units!!!

the order stop works in the trigger im using. it basically means if the unit isnt doing anything, ie if it is stopped. im surprised blizzard didnt create a seperate trigger or function for an idle unit, instead they decided to use unit is stopped. i think this is true anyways, if there is a better way plz tell me.
 
Status
Not open for further replies.
Top