• 🏆 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!

[Solved] Visible Floating Names

Status
Not open for further replies.
Level 20
Joined
Jun 27, 2011
Messages
1,864
I have a problem in my trigger (Test map attached), it only shows Player 1 name not the whole players.

  • Setup
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set Player_Unit[1] = Mountain King 0000 <gen>
      • Set Player_Unit[2] = Mountain King 0001 <gen>
      • Set Player_Unit[3] = Mountain King 0002 <gen>
      • Set Player_Unit[4] = Mountain King 0003 <gen>
      • Set Player_Unit[5] = Blademaster 0004 <gen>
      • Set Player_Unit[6] = Tauren Chieftain 0005 <gen>
      • Set Player_Unit[7] = Dreadlord 0006 <gen>
      • Set Player_Unit[8] = Lich 0007 <gen>
      • Set Player_Unit[9] = Demon Hunter 0008 <gen>
      • Set Player_Unit[10] = Warden 0009 <gen>
      • Set Player_Unit[11] = Archmage 0010 <gen>
      • Set Player_Unit[12] = Dreadlord 0011 <gen>
      • For each (Integer i) from 1 to 12, do (Actions)
        • Loop - Actions
          • Set Player_Name[i] = (Name of (Player(i)))
  • Loop
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • -------- Checking which players can see which units --------
      • For each (Integer i) from 1 to 12, do (Actions)
        • Loop - Actions
          • Player Group - Pick every player in (All players) and do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Player_Unit[(Player number of (Picked player))] is visible to (Player(i))) Equal to True
                • Then - Actions
                  • Player Group - Add (Player(i)) to PlayerGroup_Show[(Player number of (Picked player))]
                • Else - Actions
      • -------- Creating the Floating Text Names --------
      • For each (Integer i) from 1 to 12, do (Actions)
        • Loop - Actions
          • Floating Text - Destroy Player_FloatingText[i]
          • Set PlayerUnit_Point = (Position of Player_Unit[i])
          • Floating Text - Create floating text that reads Player_Name[i] at PlayerUnit_Point with Z offset 0.00, using font size 10.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
          • Floating Text - Hide (Last created floating text) for (All players)
          • Floating Text - Show (Last created floating text) for PlayerGroup_Show[i]
          • Player Group - Remove all players from PlayerGroup_Show[i]
          • Set Player_FloatingText[i] = (Last created floating text)
          • Custom script: call RemoveLocation( udg_PlayerUnit_Point )
What could possibly be wrong?
 

Attachments

  • Visible Floating Names v2.w3x
    15.5 KB · Views: 48
Status
Not open for further replies.
Top