HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

What's wrong with this trigger?

03-06-2005, 03:52 PM#1
Skwee
Code:
Update
Events
    Time - Every 0.20 seconds of game time
Conditions
Actions
    For each (Integer A) from 2 to 12, do (Actions)
        Loop - Actions
            For each (Integer B) from 1 to 11, do (Actions)
                Loop - Actions
                    Multiboard - Set the text for (Last created multiboard) item in column 2, row (Integer A) to (String(kills[(Integer B)]))
                    Multiboard - Set the text for Multiboard item in column 3, row (Integer A) to (String((Count structures controlled by (Player((Integer B))) (Exclude incomplete structures))))
                    Multiboard - Set the text for Multiboard item in column 4, row (Integer A) to (String(((Player((Integer B))) Current gold)))


What's wrong with that trigger? none of my numbers on my multiboard update. they all stay zero, except the gold which doesn't even show up. any help?
03-06-2005, 04:36 PM#2
Anitarf
Well, let's take a look at what your trigger does. Basically, it goes through your multiboard from row 2 to 12, and for each row it sets it's value for all players from 1 to 11: the data for each player overwrites the data for the previous one, and since it ends with player 11, that means that the multiboard will display in all rows the data for player 11.

I assume that's not what you want, I believe you want it to display in row 2 the data for player 1, in row 3 the data for player 2 etc... If that is the case, this trigger should work for you:

Code:
Update
Events
    Time - Every 0.20 seconds of game time
Conditions
Actions
    For each (Integer A) from 1 to 11, do (Actions)
        Loop - Actions
            Multiboard - Set the text for (Last created multiboard) item in column 2, row ((Integer A) + 1) to (String(kills[(Integer A)]))
            Multiboard - Set the text for Multiboard item in column 3, row ((Integer A) + 1) to (String((Count structures controlled by (Player((Integer A))) (Exclude incomplete structures))))
            Multiboard - Set the text for Multiboard item in column 4, row ((Integer A) + 1) to (String(((Player((Integer A))) Current gold)))
03-06-2005, 06:36 PM#3
Skwee
thanks worked like a charm, except it shows player two in the player one spot, and player 12 is on the list when i dont want it there, how do i fix that?
03-06-2005, 07:22 PM#4
Anitarf
From what you've described, it would seem you put ((Integer A) + 1) everywhere, instead of just for rows. The player number should still be just (Integer A), check again the trigger I posted.
03-06-2005, 10:33 PM#5
johnfn
Actually he might be refering to the fact that player 12 isnt playing (I'm not sure about this) but you could fix this problem like so:

Code:
    For each (Integer A) from 1 to 11, do (Actions)
        Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    If - Conditions
        ((Player((Integer A))) slot status) Equal to Is playing
    Then - Actions
            Multiboard - Set the text for (Last created multiboard) item in column 2, row ((Integer A) + 1) to (String(kills[(Integer A)]))
            Multiboard - Set the text for Multiboard item in column 3, row ((Integer A) + 1) to (String((Count structures controlled by (Player((Integer A))) (Exclude incomplete structures))))
            Multiboard - Set the text for Multiboard item in column 4, row ((Integer A) + 1) to (String(((Player((Integer A))) Current gold)))
    Else - Actions

so that you check if the player exists first.