HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Odd Trigger loop

01-30-2004, 12:14 AM#1
Mink
Something in my triggers is makingit loop 3 times. I have a difficulty vote with 4 settings, and it goes fine until it tallies the results. somewhere after that it loops 3 times creating 3 sets of units and I can't figure out where. Hopefully someone can spot the bug. If you need any more info than this please let me know!


Code:
Vote Results 5 Legends
    Events
        Time - Dumb_Triggers expires
    Conditions
    Actions
        For each (Integer A) from 1 to 4, do (If (Dificulty_Vote[(Integer A)] Less than Dificulty_Vote[1]) then do (Trigger - Run Setup Timid 5 Legends <gen> (ignoring conditions)) else do (Do nothing))
        For each (Integer A) from 1 to 4, do (If (Dificulty_Vote[(Integer A)] Less than Dificulty_Vote[2]) then do (Trigger - Run Setup Normal 5 Legends <gen> (ignoring conditions)) else do (Do nothing))
        For each (Integer A) from 1 to 4, do (If (Dificulty_Vote[(Integer A)] Less than Dificulty_Vote[3]) then do (Trigger - Run Setup Heroic 5 Legends <gen> (ignoring conditions)) else do (Do nothing))
        For each (Integer A) from 1 to 4, do (If (Dificulty_Vote[(Integer A)] Less than Dificulty_Vote[4]) then do (Trigger - Run Setup Legendary 5 Legends <gen> (ignoring conditions)) else do (Do nothing))


Setup Timid 5 Legends
    Events
    Conditions
    Actions
        Game - Display to (All players) the text: Difficulty has been...
        Trigger - Run Create Units 5 Legends <gen> (ignoring conditions)
        Trigger - Run Neutral Vision <gen> (ignoring conditions)
        Trigger - Turn on You Win <gen>
        Trigger - Turn on No units left <gen>
        Trigger - Turn on Transfer Units to P1 <gen>
        Trigger - Turn on Transfer Units to P2 <gen>
        Trigger - Turn on Transfer Units to P3 <gen>
        Trigger - Turn on Transfer Units to P4 <gen>
        Trigger - Turn on Transfer Units to P5 <gen>
        Trigger - Turn on Transfer Units to P6 <gen>
        Trigger - Turn on Transfer Units to P7 <gen>
        Trigger - Turn on Transfer Units to P8 <gen>
        Trigger - Turn on Transfer Units to P9 <gen>
        Trigger - Turn on Transfer Units to P10 <gen>
        Trigger - Turn on Transfer Units to P11 <gen>
        Trigger - Run Planning Time <gen> (ignoring conditions)
        Wait 30.00 game-time seconds
        Trigger - Run Evil Waves Timid <gen> (ignoring conditions)
01-30-2004, 01:33 AM#2
Narwanza
The way you have it done is very strange. It makes sense why it loops three times. You are telling it to run the trigger three times. What are you trying to accomplish with running loops there? It makes absolutly no sense. You are telling the game basically to run each trigger three times if there was one vote placed, 2 if there were 2, and 1 if there were 3. It just doesn't make any sense. I can't help until I know more about what you are trying to do with the loops.
01-30-2004, 01:38 AM#3
Mink
Can you explain to me how I looped it? I am not understanding what looped it. It was based on another trigger (below) that runs without looping.

Code:
Vote Results
    Events
        Time - Difficulty_Vote expires
    Conditions
    Actions
        For each (Integer A) from 1 to 4, do (If (Dificulty_Vote[(Integer A)] Less than Dificulty_Vote[1]) then do (Trigger - Run Setup Timid <gen> (ignoring conditions)) else do (Do nothing))
        For each (Integer A) from 1 to 4, do (If (Dificulty_Vote[(Integer A)] Less than Dificulty_Vote[2]) then do (Trigger - Run Setup Normal <gen> (ignoring conditions)) else do (Do nothing))
        For each (Integer A) from 1 to 4, do (If (Dificulty_Vote[(Integer A)] Less than Dificulty_Vote[3]) then do (Trigger - Run Setup Heroic <gen> (ignoring conditions)) else do (Do nothing))
        For each (Integer A) from 1 to 4, do (If (Dificulty_Vote[(Integer A)] Less than Dificulty_Vote[4]) then do (Trigger - Run Setup Legendary <gen> (ignoring conditions)) else do (Do nothing))
01-30-2004, 08:52 AM#4
Alakafizz
Quote:
Originally posted by Mink
Can you explain to me how I looped it? I am not understanding what looped it. It was based on another trigger (below) that runs without looping.

Code:
        For each (Integer A) from 1 to 4, do (If (Dificulty_Vote[(Integer A)] Less than Dificulty_Vote[1]) then do (Trigger - Run Setup Timid <gen> (ignoring conditions)) else do (Do nothing))


If im not mistaken; if the value of Dificulty_Vote[2, 3 or 4] is smaller than Dificulty_Vote[1], then you tell it to execute up to 3 times.

Edit:
Breaking it down a bit.

In reality, this is what you call:

If Dificulty_Vote[1] > Dificulty_Vote[1]
Then Run Setup Timid <gen>
If Dificulty_Vote[1] > Dificulty_Vote[2]
Then Run Setup Timid <gen>
If Dificulty_Vote[1] > Dificulty_Vote[3]
Then Run Setup Timid <gen>
If Dificulty_Vote[1] > Dificulty_Vote[4]
Then Run Setup Timid <gen>

So if [1] is the highest value in your array, you'll loop 3 times.

Hope it helps
Ala