- Joined
- Jun 15, 2008
- Messages
- 677
Does it leak ? (SOLVED)
Hello !
What this simple trigger does is to locate the "center of gravity" of a unit group, but I may have a slight leaking problem (Maybe not !).
The original test trigger is this one (it moves a "praetorian" unit in the center of gravity of a group of "legionaries") :
So what I think is that when I created this POINT2 = POSITIONREGIMENT, it actually doesn't create a new point, so when I remove POSITIONREGIMENT, POINT2 is also removed, so I removed the removal and the trigger works nicely !
But just to be sure, does removing POINT2 removes the point created when POSITIONREGIMENT was set ? (does this trigger leak ?) :
Thanks for checking the forums ! and sorry for the remaining french bit in the trigger
Hello !
What this simple trigger does is to locate the "center of gravity" of a unit group, but I may have a slight leaking problem (Maybe not !).
The original test trigger is this one (it moves a "praetorian" unit in the center of gravity of a group of "legionaries") :
-
Test Center of Gravity of Regiment
-

Events
-


Joueur - Joueur 1 (Rouge) skips a cinematic sequence
-
-

Conditions
-

Actions
-


Set UNITGROUP = (Units in TESTREGIMENT <gen> matching ((Unit-type of (Matching unit)) Egal Ã* Legionary))
-


Set UNIT = Pretorian 0122 <gen>
-


Set INTEGER = 0
-


Custom script: set bj_wantDestroyGroup=true
-


Unit Group - Pick every unit in UNITGROUP and do (Actions)
-



Boucle - Actions
-




Set INTEGER = (INTEGER + 1)
-




If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-





If - Conditions
-






INTEGER superior or equal to 2
-
-





Then - Actions
-






Set POINT = (Position of (Picked unit))
-






Set POINT2 = POSITIONREGIMENT
-






Custom script: call RemoveLocation(udg_POSITIONREGIMENT)
-






Set POSITIONREGIMENT = (POINT2 offset by ((Distance between POINT2 and POINT) / (Real(INTEGER))) towards (Angle from POINT2 to POINT) degrees)
-






Custom script: call RemoveLocation(udg_POINT)
-






Custom script: call RemoveLocation(udg_POINT2)
-
-





Else - Actions
-






Set POSITIONREGIMENT = (Position of (Picked unit))
-
-
-
-
-


Unit - Move UNIT instantly to POSITIONREGIMENT
-


Custom script: call RemoveLocation(udg_POSITIONREGIMENT)
-
-
So what I think is that when I created this POINT2 = POSITIONREGIMENT, it actually doesn't create a new point, so when I remove POSITIONREGIMENT, POINT2 is also removed, so I removed the removal and the trigger works nicely !
But just to be sure, does removing POINT2 removes the point created when POSITIONREGIMENT was set ? (does this trigger leak ?) :
-
Test Center of Gravity of Regiment
-

Events
-


Joueur - Joueur 1 (Rouge) skips a cinematic sequence
-
-

Conditions
-

Actions
-


Set UNITGROUP = (Units in TESTREGIMENT <gen> matching ((Unit-type of (Matching unit)) Egal Ã* Legionary))
-


Set UNIT = Pretorian 0122 <gen>
-


Set INTEGER = 0
-


Custom script: set bj_wantDestroyGroup=true
-


Unit Group - Pick every unit in UNITGROUP and do (Actions)
-



Boucle - Actions
-




Set INTEGER = (INTEGER + 1)
-




If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-





If - Conditions
-






INTEGER superior or equal to 2
-
-





Then - Actions
-






Set POINT = (Position of (Picked unit))
-






Set POINT2 = POSITIONREGIMENT
-






Set POSITIONREGIMENT = (POINT2 offset by ((Distance between POINT2 and POINT) / (Real(INTEGER))) towards (Angle from POINT2 to POINT) degrees)
-






Custom script: call RemoveLocation(udg_POINT)
-






Custom script: call RemoveLocation(udg_POINT2)
-
-





Else - Actions
-






Set POSITIONREGIMENT = (Position of (Picked unit))
-
-
-
-
-


Unit - Move UNIT instantly to POSITIONREGIMENT
-


Custom script: call RemoveLocation(udg_POSITIONREGIMENT)
-
-
Thanks for checking the forums ! and sorry for the remaining french bit in the trigger
Last edited:









