Having trouble with Multiboard and Timers

Eyonix

TH.net Regular
Reaction score
16
Im making a King of the Hill map, and if you control the hill for so long you win.

but my multiboard won't add all the players to it, it adds red and then adds blue but no one else....

Also my other problem is when a unit leaves the area even if you are the only one on the hill and have like 5 more units on it, the timer still stops.

Heres the triggers, sorry they are pretty long.
I think the problems are in the 2nd and 4th trigger, but im not sure because I didn't make this trigger.
Trigger:
  • Map Initialization for Muiltiboard
    • Events
      • Map initialization
    • Conditions
    • Actions
      • For each (Integer A) from 1 to (Number of players in (All players controlled by a User player)), do (Actions)
        • Loop - Actions
          • Set timeKeeper[(Player number of ownerOfMostUnits)] = 300
      • Set Players_Playing = (All players matching (((Matching player) slot status) Equal to Is playing))
      • -------- Gold Color --------
      • Set Players_ColorCodes[0] = |cffffcc00
      • -------- Players Colors --------
      • Set Players_ColorCodes[1] = |c00ff0303
      • Set Players_ColorCodes[2] = |c000042ff
      • Set Players_ColorCodes[3] = |c001ce6b9
      • Set Players_ColorCodes[4] = |c00540081
      • Set Players_ColorCodes[5] = |c00fffc01
      • Set Players_ColorCodes[6] = |c00feba0e
      • Set Players_ColorCodes[7] = |c0020c000
      • Set Players_ColorCodes[8] = |c00e55bb0
      • Set Players_ColorCodes[9] = |cFF7EBFF1
      • Set Players_ColorCodes[10] = |cFF106246
      • Set Players_ColorCodes[11] = |CFF4E2A04
      • Set Players_ColorCodes[12] = |cFF4E2A04
      • Set ColorCodes_EndTag = |r
      • Set Tier[Player_Number] = 1

Trigger:
  • Create MultiBoard
    • Events
      • Time - Elapsed game time is 0.03 seconds
    • Conditions
    • Actions
      • Leaderboard - Create a leaderboard for (All players controlled by a User player) titled ownerOfMostNumberOf...
      • Set leaderBoardTimerKeeper = (Last created leaderboard)
      • Player Group - Pick every player in (All players) and do (Actions)
        • Loop - Actions
          • Leaderboard - Add (Picked player) to leaderBoardTimerKeeper with label (Name of (Picked player)) and value (Number of units in (Units within 5000.00 of (Center of Hill <gen>) matching (((Matching unit) is alive) Equal to True))) Leaderboard - Hide leaderBoardTimerKeeper
      • -------- Column 1 --------
      • Multiboard - Create a multiboard with 4 columns and (1 + (Number of players in Players_Playing)) rows, titled Score
      • Set Multiboard = (Last created multiboard)
      • Multiboard - Hide Multiboard
      • Multiboard - Set the text for Multiboard item in column 1, row 1 to (Players_ColorCodes[0] + ([Players] + ColorCodes_EndTag))
      • Multiboard - Set the text for Multiboard item in column 2, row 1 to (Players_ColorCodes[0] + ([Tier] + ColorCodes_EndTag))
      • Multiboard - Set the text for Multiboard item in column 3, row 1 to (Players_ColorCodes[0] + ([Kills] + ColorCodes_EndTag))
      • Multiboard - Set the text for Multiboard item in column 4, row 1 to (Players_ColorCodes[0] + ([Time In Control] + ColorCodes_EndTag))
      • -------- Width --------
      • Multiboard - Set the width for Multiboard item in column 1, row 0 to 7.00% of the total screen width
      • Multiboard - Set the width for Multiboard item in column 2, row 0 to 4.00% of the total screen width
      • Multiboard - Set the width for Multiboard item in column 3, row 0 to 4.00% of the total screen width
      • Multiboard - Set the width for Multiboard item in column 4, row 0 to 9.00% of the total screen width
      • For each (Integer A) from 1 to (Number of players in Players_Playing), do (Actions)
        • Loop - Actions
          • -------- Adding Players --------
          • Set Player_Row = (Player_Row + 1)
          • Set playerRow[(Integer A)] = (Player((Integer A)))
          • Set Player_Color = (Player_Color + 1)
          • Multiboard - Set the text for Multiboard item in column 1, row Player_Row to (Players_ColorCodes[Player_Color] + ((Name of (Player(Player_Color))) + ColorCodes_EndTag))
          • -------- Tier --------
          • Multiboard - Set the text for Multiboard item in column 2, row Player_Row to (Players_ColorCodes[Player_Color] + ((String(Tier[Player_Number])) + ColorCodes_EndTag))
          • -------- Kills --------
          • Multiboard - Set the text for Multiboard item in column 3, row Player_Row to (Players_ColorCodes[Player_Color] + ((String(Kill_Count[Player_Number])) + ColorCodes_EndTag))
      • Multiboard - Set the display style for Multiboard item in column 0, row 0 to Show text and Hide icons
      • Multiboard - Show Multiboard

It was 1000 range but i changed it to 5000 and it still only adds red and blue, and all the players' units are the same distance away or pretty close to it.


Trigger:
  • Add To Kills
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Owner of (Dying unit)) Not equal to (Owner of (Killing unit))
    • Actions
      • Set Kill_Count[Player_Number] = (Kill_Count[Player_Number] + 1)
      • Multiboard - Set the text for Multiboard item in column 3, row ((Player number of (Owner of (Killing unit))) + 1) to (Players_ColorCodes[Player_Color] + ((String(Kill_Count[Player_Number])) + ColorCodes_EndTag))


Trigger:
  • activateTimer
    • Events
      • Unit - A unit enters Hill <gen>
      • Unit - A unit leaves Hill <gen>
    • Conditions
    • Actions
      • Leaderboard - Sort leaderBoardTimerKeeper by Value in Descending order
      • Set ownerOfMostUnits = (Player in position 1 of leaderBoardTimerKeeper)
      • Unit Group - Pick every unit in (Units owned by ownerOfMostUnits) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Entering unit) is in (Units owned by ownerOfMostUnits)) Equal to True
            • Then - Actions
              • Trigger - Turn on timer <gen>
            • Else - Actions
              • Trigger - Turn off timer <gen>
      • Unit Group - Pick every unit in (Units owned by ownerOfMostUnits) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Leaving unit) is in (Units owned by ownerOfMostUnits)) Equal to True
            • Then - Actions
              • Trigger - Turn off timer <gen>
            • Else - Actions

Trigger:
  • timer
    • Events
      • Time - Every 0.01 seconds of game time
    • Conditions
    • Actions
      • Set timeMilisecs[(Player number of ownerOfMostUnits)] = (timeMilisecs[(Player number of ownerOfMostUnits)] + 1)
      • Set timeMilisecsString[(Player number of ownerOfMostUnits)] = (String(timeMilisecs[(Player number of ownerOfMostUnits)]))
      • Set timeSecondsString[(Player number of ownerOfMostUnits)] = (String(timeSeconds[(Player number of ownerOfMostUnits)]))
      • Set timeMinutesString[(Player number of ownerOfMostUnits)] = (String(timeMinutes[(Player number of ownerOfMostUnits)]))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • timeMilisecs[(Player number of ownerOfMostUnits)] Equal to 100
        • Then - Actions
          • Set timeMilisecs[(Player number of ownerOfMostUnits)] = 0
          • Set timeMilisecsString[(Player number of ownerOfMostUnits)] = (String(timeMilisecs[(Player number of ownerOfMostUnits)]))
          • Set timeSeconds[(Player number of ownerOfMostUnits)] = (timeSeconds[(Player number of ownerOfMostUnits)] + 1)
          • Set timeSecondsString[(Player number of ownerOfMostUnits)] = (String(timeSeconds[(Player number of ownerOfMostUnits)]))
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • timeSeconds[(Player number of ownerOfMostUnits)] Equal to 60
        • Then - Actions
          • Set timeSeconds[(Player number of ownerOfMostUnits)] = 0
          • Set timeSecondsString[(Player number of ownerOfMostUnits)] = (String(timeSeconds[(Player number of ownerOfMostUnits)]))
          • Set timeMinutes[(Player number of ownerOfMostUnits)] = (timeMinutes[(Player number of ownerOfMostUnits)] + 1)
          • Set timeMinutesString[(Player number of ownerOfMostUnits)] = (String(timeMinutes[(Player number of ownerOfMostUnits)]))
        • Else - Actions
      • If ((Integer(timeMilisecsString[(Player number of ownerOfMostUnits)])) Less than 10) then do (Set timeMilisecsString[(Player number of ownerOfMostUnits)] = (0 + (String(timeMilisecs[(Player number of ownerOfMostUnits)])))) else do (Do nothing)
      • If ((Integer(timeSecondsString[(Player number of ownerOfMostUnits)])) Less than 10) then do (Set timeSecondsString[(Player number of ownerOfMostUnits)] = (0 + (String(timeSeconds[(Player number of ownerOfMostUnits)])))) else do (Do nothing)
      • If ((Integer(timeMinutesString[(Player number of ownerOfMostUnits)])) Less than 10) then do (Set timeMinutesString[(Player number of ownerOfMostUnits)] = (0 + (String(timeMinutes[(Player number of ownerOfMostUnits)])))) else do (Do nothing)
      • Multiboard - Set the text for Multiboard item in column 4, row ((Player number of ownerOfMostUnits) + 1) to ((timeMinutesString[(Player number of ownerOfMostUnits)] + <img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="smilie smilie--sprite smilie--sprite1" alt=":)" title="Smile :)" loading="lazy" data-shortname=":)" /> + (timeSecondsString[(Player number of ownerOfMostUnits)] + <img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="smilie smilie--sprite smilie--sprite1" alt=":)" title="Smile :)" loading="lazy" data-shortname=":)" /> + timeMilisecsString[(Player number of ownerOfMostUnits)])))
 

Komaqtion

You can change this now in User CP.
Reaction score
469
Yeah, for multiboards, you really need to see it "in your own eyes" :D
 

Komaqtion

You can change this now in User CP.
Reaction score
469
Well, according to your trigger, it shouldn't add players that aren't playing, and if you test it in single player, only red should be displayed...

But did you test it on b.net with full house ?
 

Eyonix

TH.net Regular
Reaction score
16
No, I tested it on LAN with my brother and he was purple and my multiboard showed me (red) and blue (who wasn't even playing).
 

Komaqtion

You can change this now in User CP.
Reaction score
469
Ok, haven't tested this with more people, but might work :S
 

Eyonix

TH.net Regular
Reaction score
16
Thanks for the effort but I just tested it again on lan and now it only shows red, got any more ideas? ;)
 

2evil

New Member
Reaction score
16
for the first trigger - a caution to doing a loop of 1 - [counted players playing], as many people will change player slots. So wile there is 4 players in the game, some may be in player slot 6 or 7 and be excluded from the loop. You also do this when adding players in the second trigger
 

Eyonix

TH.net Regular
Reaction score
16
I think I get what your saying, because the reason it only shows red and blue when I play with my brother is because he moves to a different slot but joins as blue, could you please point me in a direction to fix it?
 

PrisonLove

Hard Realist
Reaction score
78
My suggestion to you, is to add ALL players to the multiboard so that it always displays every single player, regardless of whether or not they are playing, then change the name of any player whose slot status is = not playing to something like "not playing." That way, you will never exclude anyone who is playing, and there should be no confusion as to who each player is.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top