System Floating Text/String System

Mr.Tutorial

Hard in the Paint.
Reaction score
42
~Floating Text/String System~
Well, I don't know if this is a snippet or system because it might be used both ways.

Download Sample Map Here
What does it do?


This system/snippet displays floating text above a unit or any unit that you are using, in this case it is a hero, so a hero would be the most necessary. You should mostly be using this for RPG's, unless you want a spam of floating text above all your units that kill. The system is a bit hard to explain, so I have a download to help us all out. (Displays Random Color) *Posted at top*

The trigger:

**REQUIRED** Make sure you change your hero proper name to it's actual name. EX: Paladin scroll down to the Paladin's proper name and make it just Paladin, and nothing else.
The variables:
Name: Game Text ; Type: String ; Array: Yes (1)
Name: TempPoint ; Type: Point ; Array: No

Floating String Text
Events
Unit - A unit Dies
Conditions
(Owner of (Dying unit)) Not equal to (Owner of (Killing unit))
Actions
Set GameText[1] = ((((Name of (Owner of (Killing unit))) + 's ) + (Proper name of (Killing unit))) + (( has killed + (Name of (Owner of (Dying unit)))) + ('s + (Name of (Dying unit)))))
Set GameText[2] = ((((Name of (Owner of (Killing unit))) + 's ) + (Proper name of (Killing unit))) + ((( has taken + (Name of (Owner of (Dying unit)))) + 's ) + ((Name of (Dying unit)) + back through preschool!)))
Set TempPoint = (Position of (Killing unit))
Floating Text - Create floating text that reads GameText[(Random integer number between 1 and 2)] at TempPoint with Z offset 0.00, using font size 10.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
Floating Text - Change the color of (Last created floating text) to ((Random real number between 0.00 and 100.00)%, (Random real number between 0.00 and 100.00)%, (Random real number between 0.00 and 100.00)%) with 0.00% transparency
Floating Text - Change (Last created floating text): Disable permanence
Floating Text - Change the lifespan of (Last created floating text) to 3.00 seconds
Floating Text - Change the fading age of (Last created floating text) to 2.00 seconds
Custom script: call RemoveLocation (udg_TempPoint)

Remember to remove the location of the TempPoint variable, make sure it is exact!

What you need to change in this trigger to fit your map:

1: You may change the actual text to whatever you feel is best for your fitting.
2: You may also add more variables with different strings/text's for how many you want to display, but if you do so, you must change the "Random integer between 1 - 2" to the amount of your variables.
3: Fade time is also not needed, you may change that also, what it does is fades the text over 2 seconds.
4: Life span can be changed to however long you want the text to last.
5: If you don't want color just set the random integers to 100% for "Change the color of ... etc." Trigger function.

~ Report Bugs, Leaks, Unwanted Triggers. ~

Thanks, constructive criticism wanted, as is feedback.

Mr.Tutorial
 

Mr.Tutorial

Hard in the Paint.
Reaction score
42
Well you could... if you wanted, just don't use the variable... you can do it either way. No it wouldn't cause leaks.
 

Seannny

Why GUI when you can Jass?
Reaction score
46
i dont quite understand what this is supposed to do...?

could you explain a bit further?
 

Mr.Tutorial

Hard in the Paint.
Reaction score
42
It's hard to explain because their are a lot of different strings... you can test it though. (I'll try and make the explanation better :))

At least someone commented..
 

Sim

Forum Administrator
Staff member
Reaction score
534
> Make sure you change your hero proper name to it's actual name.

In RPGs though heroes should be able to have proper names... ;)
 

Mr.Tutorial

Hard in the Paint.
Reaction score
42
Hehe well... Just make the name a proper name.. and why would you need 10 extra names :p. I believe 1 name would be the best :)

Thanks for commenting! :D at least...
 
General chit-chat
Help Users

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top