• 🏆 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] Multiboard Help

Status
Not open for further replies.
Level 4
Joined
Feb 28, 2009
Messages
73
So i'm making a multiboard and i'm not really sure how to make a multiboard ONLY show up for one player. So information only meant for player 1, other players can't see it.

How would i go about doing this? Thanks!
 
  • //Your previous actions here
  • Set Multiboard = (Last created multiboard)
  • Set Player = (The player you want to have the multiboard visible for)
  • Set ShowMultiboard = False //This is a boolean variable
  • Custom script: if GetLocalPlayer() == udg_Player then
  • Set ShowMultiboard = True
  • Custom script: endif
  • Custom script: call MultiboardDisplay (udg_Multiboard, udg_ShowMultiboard)
 
Level 4
Joined
Feb 28, 2009
Messages
73
Alright that works, but now im wondering something else. In the multiboard, i have the heros health mana and % mana and health. But all the values are like, 123.000, how would i go about getting rid of those zeros? so its just 123.
 
Last edited:
When you need to place that value, go to "Conversion - Convert Real to Integer". Create an integer variable and go to the action Set variable. Let's say the variable's name is "Health". Then, when it asks you for a value, go up, where it says "Hashtable - Get Handle ID" and scroll to Conversion - Convert Real to Integer. Then, in the new window go to "Unit - Unit property" and that's it.
Your result should look like this:
  • Set Health = (Integer(Life of (your unit)))
Edit: Meh, I had the page opened for ages, but replied late. Anyway, you got your answer ;)
 
Level 4
Joined
Feb 28, 2009
Messages
73
Ok now im not even seeing the Conversion - Convert Real to Integer. All i see is real to string. Im under the menu:
  • Multiboard - Set the text for (Last created multiboard) item in column 2, row 2 to (((String((Integer((Life of Heros[2]))))) + / ) + (String((Integer((Max life of Heros[2]))))))
.
 
Level 9
Joined
May 27, 2006
Messages
498
And that's how it should look, you've got it correctly. Unless the zeroes are still displayed, then we'd need to find another solution.

Oh, and sorry for my previous post, was in a bit of rush and didn't describe everything properly...
 

Dr Super Good

Spell Reviewer
Level 63
Joined
Jan 18, 2005
Messages
27,197
Use get local player to run the code asyncrnously.

Basically, all trigger code is run simultaniously on every humans computer in the game. GetLocalPlayer returns an asyncrnous value, the player of whoever's pc runs it meaning each human player gets a different player valuye back from it. It can never return AI players for the logical reason AI players are code run of human player's computers and so can not run their own code instances.

Comparing GetLocalPlayer() with any player like this for player 0 red.
GetLocalPlayer() == Player(0)
will return a boolean which is true when the computer for human player 0 (red) runs the code but false for everyone else (like human player (1) blue will get false from this statement.

Putting 1 and 1 together it is logical you just put it into a conditional statement and you can now run code locally for player 0 red only. Most code will cause the player to drop (split) which is not a good thing to happen and will ruin the game but in the case of displaying graphic elements, it can be run without a risk of splitting.

So simply....
Hide board.
Check if local player is 0 red
If so then...
Show board


Logically GUI can not support this but no one should be using GUI anymore.
 
Status
Not open for further replies.
Top