|
|
#1 |
|
User
Join Date: Jul 2010
Posts: 1
|
I have one trigger which replaces units of one type with different units (trigger 1)
Then, later, I have a trigger which checks of a user owns more than 5 units of a given type. For some reason, (trigger 1) is not actually removnig the units I replace "in memory" because (trigger 2) is finding all the removed units and all the newly created ones. TRIGGER 1: Trigger: Actions
![]() -------- Randomize them --------
![]() For each (Integer tmpInt) from 0 to 4, do (Actions)
![]() ![]() Loop - Actions
![]() ![]() ![]() Set tempUnitGroup2 = (Units of type mobsAvatar[tmpInt])
![]() ![]() ![]() Unit Group - Pick every unit in tempUnitGroup2 and do (Actions)
![]() ![]() ![]() ![]() Loop - Actions
![]() ![]() ![]() ![]() ![]() Set tmpUnit = (Picked unit)
![]() ![]() ![]() ![]() ![]() -------- Store starting information --------
![]() ![]() ![]() ![]() ![]() Set tmpPoint = (Position of tmpUnit)
![]() ![]() ![]() ![]() ![]() Set tmpPlayer = (Owner of tmpUnit)
![]() ![]() ![]() ![]() ![]() Set tempi = (Custom value of tmpUnit)
![]() ![]() ![]() ![]() ![]() Unit - Remove tmpUnit from the game
![]() ![]() ![]() ![]() ![]() -------- Replace the Unit --------
![]() ![]() ![]() ![]() ![]() Set tmpInt2 = (Random integer number between 0 and 3)
![]() ![]() ![]() ![]() ![]() Unit - Create 1 mobsAvatar[tmpInt2] for tmpPlayer at tmpPoint facing tmpPoint
![]() ![]() ![]() ![]() ![]() Set tmpUnit = (Last created unit)
![]() ![]() ![]() ![]() ![]() Selection - Add tmpUnit to selection
![]() ![]() ![]() ![]() ![]() -------- Set new unit with the pre-existing values --------
![]() ![]() ![]() ![]() ![]() Unit - Set the custom value of tmpUnit to tempi
![]() ![]() ![]() ![]() ![]() Trigger - Run Cripple specific Avatar <gen> (checking conditions)
![]() ![]() ![]() Custom script: call DestroyGroup (udg_tempUnitGroup2)Trigger 2: Trigger: Actions
![]() Set tempBool = False
![]() For each (Integer tmpInt) from 0 to 3, do (Actions)
![]() ![]() Loop - Actions
![]() ![]() ![]() Set tempUnitGroup2 = (Units owned by CurrentPlayer matching (((Unit-type of (Matching unit)) Equal to mobsAvatar[tmpInt]) and (((Matching unit) is alive) Equal to True)))
![]() ![]() ![]() Game - Display to players_playing the text: ((String(mobsAvatar[tmpInt])) + (String((Number of units in tempUnitGroup2))))
![]() ![]() ![]() If (All Conditions are True) then do (Then Actions) else do (Else Actions)
![]() ![]() ![]() Custom script: call DestroyGroup (udg_tempUnitGroup2)
![]() -------- Play sound if we got an achievement --------
![]() If (tempBool Equal to True) then do (Sound - Play SorceressPissed6 <gen>) else do (Do nothing) |
|
|
|
| Sponsored Links - Login to hide this ad! |
|
|
|
|
#2 |
|
†6†
Join Date: Oct 2008
Posts: 841
![]()
|
Trigger: Set tmpPoint = (Position of tmpUnit)Trigger: Unit - Remove tmpUnit from the gameyou could also try to replace this Trigger: Set tempUnitGroup2 = (Units owned by CurrentPlayer matching (((Unit-type of (Matching unit)) Equal to mobsAvatar[tmpInt]) and (((Matching unit) is alive) Equal to True)))cause i vaguely remember something special about unit-enumeration with Trigger: Units owned by <player>Last edited by Tot : 07-21-2010 at 08:31 PM. |
|
|
|
|
|
#3 | |
|
Procrastination Incarnate
Development Director
|
Quote:
|
|
|
|
|
![]() |
| Thread Tools | Search this Thread |
|
|
|
Donate |