Nureru
New Member
- Reaction score
- 1
Everything I've tried has broken the trigger, and I'm getting frustrated.
I know using the Position of (Matching Unit) is bad, but I can't figure out how to set that manually before I need to use it there.
Code:
Set Did_Chain_Propagate = False
Unit Group - Pick every unit in Chain and do (Actions)
Loop - Actions
Player Group - Pick every player in team and do (Actions)
Loop - Actions
Set chainlocation = (Position of (Picked unit))
Unit Group - Pick every unit in (Units owned by (Owner of (Triggering unit)) matching (((Unit-type of (Matching unit)) Not equal to Builder) and ((((Matching unit) is in Chain) Equal to False) and ((Distance between chainlocation and (Position of (Matching unit))) Less than 182.00)))) and do (Actions)
Loop - Actions
Unit Group - Add (Picked unit) to Chain
If ((Y of chainlocation) Less than Chain_min_y) then do (Set Chain_min_y = (Y of chainlocation)) else do (Do nothing)
If ((Y of chainlocation) Greater than Chain_max_y) then do (Set Chain_max_y = (Y of chainlocation)) else do (Do nothing)
Set Did_Chain_Propagate = True
Custom script: call RemoveLocation( udg_chainlocation )
If (Did_Chain_Propagate Equal to True) then do (Trigger - Run (This trigger) (checking conditions)) else do (Trigger - Run Chain finished propagating <gen> (checking conditions))
I know using the Position of (Matching Unit) is bad, but I can't figure out how to set that manually before I need to use it there.