• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece!🔗 Click here to enter!

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