visible for only one team

mapguy

New Member
Reaction score
46
how can I make something (like a special effect, floating text or unit) visible for only ONE team or only one player?
 

Accname

2D-Graphics enthusiast
Reaction score
1,462
Floating texts got an own GUI function to show/hide them for certain players.
For special effects you would need to use jass in the form of "GetLocalPlayer()" comparison.
This is a little more complicated issue since the function can cause desync errors in your map if used incorrectly.
I bet you can find plenty of material for the topic if you search in this forum for "GetLocalPlayer()", most likely there will even be a turtorial based on it.
 

GFreak45

I didnt slap you, i high 5'd your face.
Reaction score
130
do something like this: (note: comments are behind a //)
Trigger:
  • Show stuffs for only one player
    • Events
    • Conditions
    • Actions
      • Floating Text - Create a floating text that reads "" at (some location) //blank floating text
      • For loop integer A from 1 to 12 do actions
        • Loop - Actions
          • Set StringVariable = "Player " + String(Integer A) //we do this outside of the if GetLocalPlayer() part so that we dont create a string inside it which can cause desyncs
          • Set PlayerVariable = Player(Integer A) //this is the local player for the current string that we want to display it to
          • Custom Script: if GetLocalPlayer() == udg_PlayerVariable then //if statement start, case sensitive
          • Floating Text - Set Text of Last Created Floating Text to StringVariable //set the text of the floating text from before to the string variable we saved, but only for the local player
          • Custom Script: endif //end of the if statement, this is required and must be case-sensitive


basically this sets the text of the floating text we created to: "Player " + Number of Player, so the text displays differently for every single player

Trigger:
  • actions you can use inside a GetLocalPlayer() if statement:
    • Set Visibility (multiboards, text, etc, BUT NOT units/doodads, etc)
    • Set Text (works for multiboards floating text game text etc, but MUST use a string variable to change the text, not a direct string like "Hi")
    • Special effects
 
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