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

Floating Text above an unit

Status
Not open for further replies.

hdm

hdm

Level 9
Joined
Nov 19, 2011
Messages
384
how can I make a floating text above an unit but following this unit forever? When I try to make it doesn't work cuz when the unit walks the floating text stays on its last position. How to make it walk along with the unit above it?
 

hdm

hdm

Level 9
Joined
Nov 19, 2011
Messages
384
Store the floating text and the unit into a variable. And refresh the position of the floating text each 0.04 seconds. (or something like that)

Can u give trigger [tiger] example ? plz :*
 
Create a unit and a floating text variable in variable editor.

Trigger 1:

Event:
Player 1 types "test" // or what ever

Actions:
Set unitVariable = YourUnit
FloatingText - Create A Floating Text Above unitVariable
Set floatingVariable = LastCreatedFloatingText
___________________________

Trigger 2

Event:
Every 0.03 seconds of the game

Actions:
FloatingText - Change Position of floatingVariable to Position of unitVariable
___________________________

Read this tutorial if you don't know about memory leaks yet: http://www.hiveworkshop.com/forums/triggers-scripts-269/things-leak-35124/

(periodic triggers that fire so often always have to be leakless)
 
  • Like
Reactions: hdm
Status
Not open for further replies.
Top