- Joined
- Aug 15, 2012
- Messages
- 139
My trigger looks like this:
As you can see, i used the same actions two times.
USBFX Dummy Unit is name of unit in the unit group, that i stored in a hashtable. But, that appears instead:
Actions under the condition, and under that unit group loop DON'T WORK.
But, in the second use, that should clean the unit group and hashtable after the RemainingTime hits 0.00 (buff ends), it shows this:
That means it works correctly. I also tried moving the first unit group actions, the ones that DONT work, out of the condition, and they worked. But i need it to be *under* condition. I don't want it to apply every 0.03 if the buff is on. I have tried something like:
Does anyone know what should i do to make this sh*t run properly?
-
Events
- Time - Every 0.03 seconds of game-time
- Conditions
-
Actions
-
For Each Integer B from 1 to USBFX_BuffCount, do Actions
-
Loop - Actions
-
Unit Group - Pick every unit in BuffedUnitsGroup[(Integer B)] and do (Actions)
-
Loop - Actions
- Set USBFX_PerOldPickedUnitHandle = (Key (Picked unit))
- Set USBFX_PerRemainingTime = (Load 0 of (Key (Picked unit)) from USBFX_Hashtable)
- Set USBFX_PerDummyUG = (Load 2 of (Key (Picked unit)) from USBFX_Hashtable)
-
If (All Conditions Are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- USBFX_PerRemainingTime Greater than 0.00
-
Then - Actions
- Hashtable - Save (USBFX_PerRemainingTime - 0.03) as 0 of (Key (Picked unit)) in USBFX_Hashtable
-
If (All Conditions Are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Number of units in (Load 2 of (Key (Picked unit))) in USBFX_Hashtable)) Not equal to (Load 3 of (Key (Picked unit)) in USBFX_Hashtable)
-
Then - Actions
- Game - Display to (All players) the text: ============
-
Unit Group - Pick every unit in (Load 2 of (Key (Picked unit)) in USBFX_Hashtable) and do (Actions)
-
Loop - Actions
- -------- THESE ACTIONS DONT WORK! --------
- Game - Display to (All players) the text: (Name of (Picked unit)
- Unit - Remove (Picked unit) from the game
-
Loop - Actions
- Game - Display to (All players) the text: ============
- Unit Group - Remove all units of (Load 2 of (Key (Picked unit)) in USBFX_Hashtable) from (Load 2 of (Key (Picked unit)) in USBFX_Hashtable)
- Hashtable - Save 0.00 as 4 of (Key (Picked unit)) in USBFX_Hashtable
-
For each (USBFX_PerIntegerC) from 1 to (Load 3 of (Key (Picked unit)) in USBFX_Hashtable), do (Actions)
-
Loop - Actions
- Unit - Create 1 USBFX Dummy Unit for (Owner of (Picked unit)) at ALocationItDoesntMatterHere, facing X degrees
- Unit Group - Add (Last created unit) to (Load 2 of (Key (Picked unit)) in USBFX_Hashtable)
- Special Effect - Create a special effect attached to, etc...
-
Loop - Actions
-
Else - Actions
- -------- It doesn't really matter what is there, it has nothing to do with the problem --------
-
If - Conditions
-
Else - Actions
- Game - Display to (All players) the text: TIME OUT!!!
- Game - Display to (All players) the text: !!!!!!!!!!!!!!!!
-
Unit Group - Pick every unit in (Load 2 of (Key (Picked unit)) in USBFX_Hashtable) and do (Actions)
-
Loop - Actions
- -------- AND THESE ACTIONS WORK! WTF --------
- Game - Display to (All players) the text: (Name of (Picked unit)
- Unit - Remove (Picked unit) from the game
- Unit Group - Remove all units of (Load 2 of (Key (Picked unit)) in USBFX_Hashtable) from (Load 2 of (Key (Picked unit)) in USBFX_Hashtable)
- Unit Group - Remove (Picked unit) from USBFX_UnitGroups[(Integer B)]
- Hashtable - Clear all chlid hashtables of child (Key (Picked unit)) in USBFX_Hashtable
-
Loop - Actions
-
If - Conditions
-
Loop - Actions
-
Unit Group - Pick every unit in BuffedUnitsGroup[(Integer B)] and do (Actions)
-
Loop - Actions
-
For Each Integer B from 1 to USBFX_BuffCount, do Actions
-
Unit Group - Pick every unit in (Load 2 of (Key (Picked unit)) in USBFX_Hashtable) and do (Actions)
-
Loop - Actions
- Game - Display to (All players) the text: (Name of (Picked unit)
- Unit - Remove (Picked unit) from the game
-
Loop - Actions
Code:
===========
USBFX Dummy Unit
USBFX Dummy Unit
USBFX Dummy Unit
===========
Code:
===========
===========
But, in the second use, that should clean the unit group and hashtable after the RemainingTime hits 0.00 (buff ends), it shows this:
Code:
TIMEOUT!!!
!!!!!!!!!!!!!!
USBFX Dummy Unit
USBFX Dummy Unit
USBFX Dummy Unit
!!!!!!!!!!!!!!
-
If (All Conditions Are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Number of units in (Load 2 of (Key (Picked unit))) in USBFX_Hashtable)) Not equal to (Load 3 of (Key (Picked unit)) in USBFX_Hashtable)
-
Then - Actions
- Set UBSFX_RemoveGroup = TRUE
-
Else - Actions
- Set UBSFX_RemoveGroup = FALSE
-
If - Conditions
- Trigger - Run USBFX Clean Unit Group <gen> (ignoring conditions)
- If (UBSFX_RemoveGroup = FALSE) then do (Skip remaining actions) else do (Do nothing)
-
Unit Group - Pick every unit in (Load 2 of USBFX_PerOldPickedUnitHandle in USBFX_Hashtable) and do (Actions)
-
Loop - Actions
- Game - Display to (All players) the text: (Name of (Picked unit))
- Unit - Remove (Picked unit) from the game
-
Loop - Actions
- Set USBFX_PerCount = 0
-
Unit Group - Pick every unit in (Load 2 of (Key (Picked unit)) in USBFX_Hashtable) and do (Actions)
-
Loop - Actions
- Set USBFX_PerCount = (USBFX_PerCount + 1)
- Set USBFX_PerDummyUnits[USBFX_PerCount] = (Picked unit)
-
Loop - Actions
-
If (All Conditions Are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Number of units in (Load 2 of (Key (Picked unit))) in USBFX_Hashtable)) Not equal to (Load 3 of (Key (Picked unit)) in USBFX_Hashtable)
-
Then - Actions
-
For each (USBFX_PerIntegerD) from 1 to USBFX_PerCount do (Actions)
-
Loop - Actions
- Game - Display to (All players) the text: (Name of USBFX_PerDummyUnits[USBFX_PerIntegerD])
- Unit - Remove USBFX_PerDummyUnits[USBFX_PerIntegerD] from the game
-
Loop - Actions
-
For each (USBFX_PerIntegerD) from 1 to USBFX_PerCount do (Actions)
-
If - Conditions
Does anyone know what should i do to make this sh*t run properly?