• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[Trigger] Multiboards

Status
Not open for further replies.
Level 17
Joined
Nov 26, 2007
Messages
1,964
I got a little bug in my multiboard sys..

  • Multiboard
    • Events
      • Time - Elapsed game time is 6.00 seconds
    • Conditions
    • Actions
      • For each (Integer A) from 1 to 10, do (Actions)
        • Loop - Actions
          • Multiboard - Create a multiboard with 2 columns and 6 rows, titled |c00FF8000Status|r
          • Set Multiboard[(Integer A)] = (Last created multiboard)
          • Multiboard - Set the text for (Last created multiboard) item in column 1, row 1 to |c00FEBA0EHealth:|r
          • Multiboard - Set the text for Multiboard[(Integer A)] item in column 2, row 1 to (String((Percentage life of Playermarine[(Integer A)])))
          • Multiboard - Set the text for Multiboard[(Integer A)] item in column 2, row 2 to (String((Percentage mana of Playermarine[(Integer A)])))
          • Multiboard - Set the text for Multiboard[(Integer A)] item in column 2, row 4 to (String((Unit-type of Playermarine[(Integer A)])))
          • Multiboard - Set the text for (Last created multiboard) item in column 1, row 2 to |c00FEBA0EBattery:|...
          • Multiboard - Set the icon for (Last created multiboard) item in column 1, row 1 to ReplaceableTextures\CommandButtons\BTNSkillz.tga
          • Multiboard - Set the icon for (Last created multiboard) item in column 1, row 2 to ReplaceableTextures\CommandButtons\BTNLament.blp
          • Multiboard - Set the icon for (Last created multiboard) item in column 1, row 3 to ReplaceableTextures\CommandButtons\BTNAuraOfDarkness.blp
          • Multiboard - Set the icon for (Last created multiboard) item in column 2, row 1 to UI\MiniMap\MinimapIcon\MinimapIconStartLoc.blp
          • Multiboard - Set the icon for (Last created multiboard) item in column 2, row 2 to UI\MiniMap\MinimapIcon\MinimapIconStartLoc.blp
          • Multiboard - Set the icon for (Last created multiboard) item in column 2, row 3 to UI\MiniMap\MinimapIcon\MinimapIconStartLoc.blp
          • Multiboard - Set the icon for (Last created multiboard) item in column 2, row 4 to UI\MiniMap\MinimapIcon\MinimapIconStartLoc.blp
          • Multiboard - Set the icon for (Last created multiboard) item in column 1, row 4 to UI\MiniMap\MinimapIcon\MinimapIconStartLoc.blp
          • Multiboard - Set the icon for (Last created multiboard) item in column 1, row 5 to UI\MiniMap\MinimapIcon\MinimapIconStartLoc.blp
          • Multiboard - Set the icon for (Last created multiboard) item in column 1, row 6 to UI\MiniMap\MinimapIcon\MinimapIconStartLoc.blp
          • Multiboard - Set the icon for (Last created multiboard) item in column 2, row 6 to UI\MiniMap\MinimapIcon\MinimapIconStartLoc.blp
          • Multiboard - Set the icon for (Last created multiboard) item in column 2, row 5 to UI\MiniMap\MinimapIcon\MinimapIconStartLoc.blp
          • Multiboard - Set the text for (Last created multiboard) item in column 1, row 3 to |c00FEBA0EFear:|r
          • Multiboard - Set the text for (Last created multiboard) item in column 1, row 4 to |c00FEBA0EWeapon:|r
          • Multiboard - Set the text for (Last created multiboard) item in column 2, row 1 to (String((Percentage life of Playermarine[(Integer A)])))
          • Multiboard - Set the text for (Last created multiboard) item in column 2, row 2 to (String((Percentage mana of Playermarine[(Integer A)])))
          • Multiboard - Set the text for (Last created multiboard) item in column 2, row 3 to (String((Unit-type of Playermarine[(Integer A)])))
          • Multiboard - Set the width for (Last created multiboard) item in column 0, row 0 to 10.00% of the total screen width
          • Multiboard - Minimize (Last created multiboard)
          • Multiboard - Maximize (Last created multiboard)
          • Custom script: if( GetLocalPlayer() == ConvertedPlayer(bj_forLoopAIndex) ) then
          • Multiboard - Show Multiboard[(Integer A)]
          • Custom script: endif
          • Wait 0.20 seconds
          • Trigger - Turn on Updating Multiboard <gen>
          • Trigger - Destroy (This trigger)
  • Updating Multiboard
    • Events
      • Time - Every 0.30 seconds of game time
    • Conditions
    • Actions
      • For each (Integer A) from 1 to 10, do (Actions)
        • Loop - Actions
      • -------- Player 1 --------
      • Multiboard - Set the text for Multiboard[(Integer A)] item in column 2, row 1 to (String((Percentage life of Playermarine[(Integer A)])))
      • Multiboard - Set the text for Multiboard[(Integer A)] item in column 2, row 2 to (String((Percentage mana of Playermarine[(Integer A)])))
What this is supposed to do is create a multiboard for each player, and then continuosly update its stats with the stats of the player (playermarine is a Unit array)

I know playermarine is set to the unit because I've used it in other triggers which work. Its set to player number owner. The multiboard appears, but all the stats (Health, "Battery" or mana) remain 0.0

Why is it not workingz?
 
Level 17
Joined
Nov 26, 2007
Messages
1,964
1. Ok, I guess ill move it. But the Multiboard is created and thats what the trigger does so obviously that isnt the problem.

2. I dunno, Ill take it off.

3. I already mentioned that I moved those into the loop. Those actions are now inside the loop but it hasnt changed anything.
 
Level 27
Joined
Feb 22, 2006
Messages
3,052
Custom script: if( GetLocalPlayer() == ConvertedPlayer(bj_forLoopAIndex) ) then
There's your problem.
JASS player numbers are 1 less than GUI player numbers. Thus, Player 1 (Red) is actually Player Number 0, blue is 1, teal is 2, etc.
When you have a loop running from 1-10, it will only hit from Blue to Dark Green. If you want it to hit red through light blue, loop it from 0-9.
--donut3.5--
 
Level 6
Joined
Sep 4, 2007
Messages
157
Hey i have had this same problem before and what i did to fix it was i had to show the text on the multi board. It looks like your not showing the text so its updating it so it seems like its not. so just add show text for each line
 
Level 17
Joined
Nov 26, 2007
Messages
1,964
I've updated the trigger to this
  • Multiboard
    • Events
      • Time - Elapsed game time is 6.00 seconds
    • Conditions
    • Actions
      • For each (Integer A) from 1 to 6, do (Actions)
        • Loop - Actions
          • Multiboard - Create a multiboard with 1 columns and 3 rows, titled |c00FF8000Status|r
          • Set Multiboard[(Integer A)] = (Last created multiboard)
          • Multiboard - Set the text for Multiboard[(Integer A)] item in column 1, row 1 to (|c00FEBA0EHealth:|r + ( + (String((Life of Playermarine[(Integer A)])))))
          • Multiboard - Set the display style for Multiboard[(Integer A)] item in column 1, row 1 to Show text and Show icons
          • Multiboard - Set the text for Multiboard[(Integer A)] item in column 1, row 2 to (|c00FEBA0EBattery:|r + ( + (String((Mana of Playermarine[(Integer A)])))))
          • Multiboard - Set the display style for Multiboard[(Integer A)] item in column 1, row 2 to Show text and Show icons
          • Multiboard - Set the text for Multiboard[(Integer A)] item in column 1, row 3 to (|c00FEBA0EFear:|r + ( + (String((Real(((Owner of Playermarine[(Integer A)]) Current gold)))))))
          • Multiboard - Set the display style for Multiboard[(Integer A)] item in column 1, row 3 to Show text and Show icons
          • Multiboard - Set the icon for Multiboard[(Integer A)] item in column 1, row 1 to ReplaceableTextures\CommandButtons\BTNSkillz.tga
          • Multiboard - Set the icon for Multiboard[(Integer A)] item in column 1, row 2 to ReplaceableTextures\CommandButtons\BTNLament.blp
          • Multiboard - Set the icon for Multiboard[(Integer A)] item in column 1, row 3 to ReplaceableTextures\CommandButtons\BTNAuraOfDarkness.blp
          • Multiboard - Set the width for Multiboard[(Integer A)] item in column 0, row 0 to 10.00% of the total screen width
          • Multiboard - Minimize Multiboard[(Integer A)]
          • Multiboard - Maximize Multiboard[(Integer A)]
          • Custom script: if( GetLocalPlayer() == ConvertedPlayer(bj_forLoopAIndex) ) then
          • Multiboard - Show Multiboard[(Integer A)]
          • Custom script: endif
      • Trigger - Turn on Updating Multiboard <gen>
      • Trigger - Destroy (This trigger)
================



  • Updating Multiboard
    • Events
      • Time - Every 0.30 seconds of game time
    • Conditions
    • Actions
      • Multiboard - Set the text for Multiboard[1] item in column 1, row 1 to (String((Percentage life of Playermarine[1])))
      • Multiboard - Set the text for Multiboard[1] item in column 1, row 2 to (String((Percentage mana of Playermarine[1])))
      • Multiboard - Set the text for Multiboard[1] item in column 1, row 3 to (String(((Owner of Playermarine[1]) Current gold)))
I changed it to Playermarine [1] temporarly as a test, since thats what player 1 red controls (World editor test).

But still no luck, the multiboard doesnt update.

Oh @ donut and Poot when I changed it to for each integer 0-6 it crashes the game instantly upon the trigger booting.
 

Attachments

  • WC3ScrnShot_091208_164437_04.jpg
    WC3ScrnShot_091208_164437_04.jpg
    49.4 KB · Views: 133
Level 17
Joined
Nov 26, 2007
Messages
1,964
playermarine is set, I know because I've used it plenty in other triggers which function fine.

This is frustrating, I'm going to upload the map soon and see if someone can tinker it. If no one can figure it out this way.

Or better yet, can someone just show me how to trigger a Multiboard for each player that displays the health and mana of a unit (Set to a var array)?
 
Status
Not open for further replies.
Top