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

[Trigger] Floating Text help

Status
Not open for further replies.
Level 13
Joined
Mar 29, 2012
Messages
530
You can do like this :
  • Example
    • Events
    • Conditions
    • Actions
      • -------- -------------------------------------------------------- --------
      • -------- Create your floating text here --------
      • -------- -------------------------------------------------------- --------
      • -------- Hide it for all players --------
      • Floating Text - Hide (Last created floating text) for (All Players)
      • -------- Show it to a player --------
      • Set TempForce = (Player group(Player 1 (Red)))
      • Floating Text - Show (Last created floating text) for TempForce
      • Custom script: call DestroyForce(udg_TempForce)
Or like this :
  • Example
    • Events
    • Conditions
    • Actions
      • -------- -------------------------------------------------------- --------
      • -------- Create your floating text here --------
      • -------- -------------------------------------------------------- --------
      • -------- Hide it for all players --------
      • Floating Text - Hide (Last created floating text) for (All Players)
      • -------- Show it to a player --------
      • Set TempForce = (Player group(Player 1 (Red)))
      • Floating Text - Show (Last created floating text) for TempForce
      • Custom script: call DestroyForce(udg_TempForce)
In trigger there is leaks that cause lags, and of course there's a way to remove it. Here is some leaks that many times not removed and the way to fix it :

Point leaks :
  • Example
    • Events
    • Conditions
    • Actions
      • -------- Leaks --------
      • Unit - Move SomeUnit instantly to (Center of (Playable map area))
      • -------- Fix the leaks --------
      • Set SomePoint = (Center of (Playable map area))
      • Unit - Move SomeUnit instantly to SomePoint
      • Custom script: call RemoveLocation(udg_SomeUnit)
Unit Group leaks :
  • Example
    • Events
    • Conditions
    • Actions
      • -------- Leaks --------
      • Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)
        • Loop - Actions
      • -------- Fix the leaks --------
      • Custom script: set bj_wantDestroyGroup = true
      • Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)
        • Loop - Actions
There is more...but i forgot:grin:
 
Last edited:
Level 18
Joined
May 11, 2012
Messages
2,103
Here, that should do the trick ;)

  • Melee Initialization
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Floating Text - Create floating text that reads Blah at (Center of (Playable map area)) with Z offset 4.00, using font size 10.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
      • Floating Text - Change the lifespan of (Last created floating text) to 4.00 seconds
      • Floating Text - Change the fading age of (Last created floating text) to 1.75 seconds
      • Floating Text - Set the velocity of (Last created floating text) to 64.00 towards 90.00 degrees
      • Floating Text - Change (Last created floating text): Disable permanence
      • Floating Text - Hide (Last created floating text) for (All players)
      • Floating Text - Show (Last created floating text) for Player Group - Player 1 (Red)
 
Level 18
Joined
May 11, 2012
Messages
2,103
You can do like this :
  • Example
    • Events
    • Conditions
    • Actions
      • -------- -------------------------------------------------------- --------
      • -------- Create your floating text here --------
      • -------- -------------------------------------------------------- --------
      • -------- Hide it for all players --------
      • Set TempForce = (All players)
      • Floating Text - Hide (Last created floating text) for TempForce
      • -------- Show it to a player --------
      • Set TempForce2 = (Player group(Player 1 (Red)))
      • Floating Text - Show (Last created floating text) for TempForce2
      • Custom script: call DestroyForce(udg_TempForce)
      • Custom script: call DestroyForce(udg_TempForce2)
Or like this :
  • Example
    • Events
    • Conditions
    • Actions
      • -------- -------------------------------------------------------- --------
      • -------- Create your floating text here --------
      • -------- -------------------------------------------------------- --------
      • -------- Hide it for all players --------
      • Set TempForce = (All players)
      • Floating Text - Hide (Last created floating text) for TempForce
      • Custom script: call DestroyForce(udg_TempForce)
      • -------- Show it to a player --------
      • Set TempForce = (Player group(Player 1 (Red)))
      • Floating Text - Show (Last created floating text) for TempForce
      • Custom script: call DestroyForce(udg_TempForce)

''All Players'' does not leaks AFAIK, so it's not nessesary to destroy it
 
Level 33
Joined
Mar 27, 2008
Messages
8,035
@Radamantus
When Blizzard gave us the function to hide Floating Text for all Players - and later we can only show it to one player, just use it.

Don't overcomplicate things by creating it locally, stick to the simple.
 
Status
Not open for further replies.
Top