HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Integer A fails hard

09-04-2008, 11:57 PM#1
Dark.Revenant
A trigger in Phase Killer:

Trigger:
For each (Integer A) from 1 to 6, do (Actions)
Collapse Loop - Actions
Game - Display to (All players) for 30.00 seconds the text: Debug1
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
ItemStorage[(((Player number of (Owner of (Triggering unit))) x 7) + (Integer A))] Not equal to No item
Collapse Then - Actions
Game - Display to (All players) for 30.00 seconds the text: DebugA
Trigger - Turn off Left Hand Lose <gen>
Trigger - Turn off Right Hand Lose <gen>
Trigger - Turn off Lose Armor <gen>
Trigger - Turn off Armor Gain <gen>
Trigger - Turn off Soul Expirum Gain <gen>
Trigger - Turn off Soul Expirum Lose <gen>
Game - Display to (All players) for 30.00 seconds the text: DebugB
Hero - Give ItemStorage[(((Player number of (Owner of (Triggering unit))) x 7) + (Integer A))] to (Last replaced unit)
Set ItemStorage[(((Player number of (Owner of (Triggering unit))) x 7) + (Integer A))] = No item
Game - Display to (All players) for 30.00 seconds the text: DebugC
Trigger - Turn on Soul Expirum Lose <gen>
Trigger - Turn on Soul Expirum Gain <gen>
Trigger - Turn on Armor Gain <gen>
Trigger - Turn on Lose Armor <gen>
Trigger - Turn on Left Hand Lose <gen>
Trigger - Turn on Right Hand Lose <gen>
Game - Display to (All players) for 30.00 seconds the text: DebugD
Else - Actions
Game - Display to (All players) for 30.00 seconds the text: Debug2

This is what I get in game:

Debug1
DebugA
DebugB
DebugC
DebugD
Debug2

... For 1 to 6 but it runs once?

The rest of the trigger, before and after this snippet, works fine.

The map has 114 global variables, if that makes a difference. This effect is tested without any 3rd-party tools used whatsoever.

So... What gives?
09-05-2008, 12:22 AM#2
Ammorth
Are you using an IntegerA loop in any triggers that have the event "Unit Aquires an Item?" If you do, the interger A's are probably interfering.

Also, try make a custom variable that you will only use in this loop (integer TempLoopA) then use "Loop for each Variable" and specify the integer you created. Then you can use that integer in the loop (in place of integer A) and it should stay "local" to this trigger.
09-05-2008, 01:40 AM#3
Dark.Revenant
Come to think of it I am, but I thought that was ruled out in the conditions. I guess the conflict is more indirect than I thought but I think your solution will fix it. Thanks.
09-05-2008, 07:26 AM#4
DioD
add CS string as first line of trigger

"local integer bj_forLoopAIndex = 0"
09-05-2008, 05:53 PM#5
Ammorth
won't work for if then else sine GUI get converted to a secnd function (and locals can't me accessed in another function).