• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Trigger Not Updaing All Integers

Status
Not open for further replies.
Level 6
Joined
Aug 12, 2007
Messages
201
I'm not totally sure what is causing this but for some reason the last player in my multiboard doesn't get updated. Everyone else works fine except him. Here are the two triggers related to the multiboard in question:

  • PeriodicFatigueGain
    • Events
      • Time - Every 10.00 seconds of game time
    • Conditions
    • Actions
      • Set PlayersArray = 1
      • Player Group - Pick every player in (All players) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked player) slot status) Equal to Is playing
            • Then - Actions
              • Set FatigueIndex[PlayersArray] = (FatigueIndex[PlayersArray] + 1)
              • Set PlayersArray = (PlayersArray + 1)
            • Else - Actions
  • UpdateFatigueMultiboard
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • Set PlayersArray = 1
      • Player Group - Pick every player in (All players) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked player) slot status) Equal to Is playing
            • Then - Actions
              • Set PlayersArray = (PlayersArray + 1)
              • Multiboard - Set the text for (Last created multiboard) item in column 4, row PlayersArray to (String(FatigueIndex[(Player number of (Picked player))]))
            • Else - Actions
The reason the multiboard updates so often compared to the first trigger is because many other things change the value in the multiboard. The 'Set PlayersArray = 1' at the start of each serves to both reset PlayersArray to it's default 1 as well offsets the mutiboard so that it doesn't try to add stuff into the first row where the headers of each column are.

I can't figure out where it is not updating the last row of the multiboard, or rather the values in that spot simply aren't changing at all.

Oh, and PlayersArray isn't actually an Array. That might be a little misleading.

EDIT: Fixed it while messing around. I hate it when my own triggers start getting to the point I lose track of what does what in relation to what. The proper trigger was:

  • PeriodicFatigueGain
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • Set PlayersArray = 1
      • Player Group - Pick every player in (All players) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked player) slot status) Equal to Is playing
            • Then - Actions
              • Set FatigueIndex[(Player number of (Picked player))] = (FatigueIndex[(Player number of (Picked player))] + 1)
              • Set PlayersArray = (PlayersArray + 1)
            • Else - Actions
 
Status
Not open for further replies.
Top