• Check out the results of the Techtree Contest #19!
  • Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!

Player Name Plates Problem

Status
Not open for further replies.
Level 8
Joined
Jun 26, 2019
Messages
318
Hello you all. I need help with this trigger. For player 1, I want the player names to be shown only to player 1 and player 1's team on their hero units, and enemy players cannot see their player names above their hero units. Same thing for player 2 and player 2's team.

  • startgame
    • Events
      • Time - Elapsed game time is 1.00 seconds
    • Conditions
    • Actions
      • Set VariableSet TempPoint = (Random point in Team1start <gen>)
      • Unit - Create 1 Footman for Player 1 (Red) at TempPoint facing Default building facing degrees
      • Set VariableSet TempPoint = (Random point in Team2start <gen>)
      • Unit - Create 1 Footman for Player 2 (Blue) at TempPoint facing Default building facing degrees
      • Game - Enable selection and deselection functionality (Disable selection circles)
      • Game - Disable pre-selection functionality (Disable pre-selection circles, life bars, and object info)
      • Visibility - Disable black mask
      • Visibility - Disable fog of war
      • Wait 1.00 seconds
      • Visibility - Enable fog of war
      • Custom script: call RemoveLocation(udg_TempPoint)
      • Trigger - Turn off (This trigger)
  • PlayersNameText
    • Events
      • Time - Every 0.01 seconds of game time
    • Conditions
    • Actions
      • Set VariableSet TempGroup = (Units in (Playable map area) matching (((Unit-type of (Matching unit)) Equal to Peasant) or ((Unit-type of (Matching unit)) Equal to Footman)))
      • Unit Group - Pick every unit in TempGroup and do (Actions)
        • Loop - Actions
          • Set VariableSet TempString = (Name of (Owner of (Picked unit)))
          • Set VariableSet TempPoint = (Position of (Picked unit))
          • Set VariableSet TempPoint2 = (TempPoint offset by (5.25 x (Real((Length of TempString)))) towards 180.00 degrees.)
          • Set VariableSet TempFtext = (Load (Key text.) of (Key (Picked unit).) in Hashtable)
          • Floating Text - Destroy TempFtext
          • Floating Text - Create floating text that reads (|cffffcc00 + (TempString + |r)) at TempPoint2 with Z offset ((Current flying height of (Picked unit)) + 130.00), using font size 7.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
          • Hashtable - Save Handle Of(Last created floating text) as (Key text.) of (Key (Picked unit).) in Hashtable.
          • Custom script: call RemoveLocation(udg_TempPoint)
          • Custom script: call RemoveLocation(udg_TempPoint2)
      • Custom script: call DestroyGroup(udg_TempGroup)

giphy.gif
 
Why are you using floating texts on point when there is an option for "above units"? You're make it harder.
I didn't really understand your problem with hiding the floating text to enemies, since all you had to do was scroll down and find:
  • Floating Text - Hide (Last created floating text) for (All enemies of (Owner of MyUnit))
Just remember that when you create a floating text it initially shows to all, so no need extras "show" for allies, just "hide" for enemies, since it's your objective.
 
Last edited:
Status
Not open for further replies.
Back
Top