Text over Unit Tutorial
Introduction
The way this tutorial works is that it will put your chat over your unit...
also adding a name infront (optional)
It works by using floating text and variable arrays
The Triggers: II. Setting up the chat system
- 1 called Init and one called Talking
Creating the "INIT" trigger will setup the triggers for map initialization.
Once you created the "INIT" trigger, create a variable, if you are new to variables click the glowing orange "X" at the toolbar.
Now create a unit variable with an Array.
Arrays store extra information for several units.
Okay, create a "UNIT" [Array] Variable named PlayerUnits or whatever you want to name it. And now go back to your trigger make a number for each players (automatically done in the next trigger) 1-12 or whatever you want.
Set the variable to the unit for the player you want them to chat over.
Your trigger should at least have something like this:
II. Setting up the chat system
Now as I think you have created a trigger for the chat to be operated on.
Now add this, which will turn on the trigger:
EVENTS
Player - Player 1 (red) types in . as a substring
CONDITIONS
(substring((Entered Chat String) 1, 1) Equal to .
ACTIONS
Floating Text - Create a floating text that reads (((Player name of Triggering Player) + |r + (substring(entered chat string) 2, 40))) above PlayerUnits [Player number of (triggering player)] with Z offset 0.00, size 8.00, color (100.00% and 100.00% and 100.00%) and 0% transparency.
Floating Text - Change (Last Created Floating Text): Disable Permanence
Floating Text - Change the Lifespan of (Last Created Floating Text) to 3.50 seconds.
Floating Text - Change the fading age of (Last Created Floating Text) to 0.00 seconds.
Floating Text - Set the velocity of (Last Created Floating Text) to 15.00 to 90.00 degrees.
If you're having problems reading the text, then here is a picture showing you how it looks like
And some more help, Here is how the floating text is coded:
If this worked, it should look like this:
Some credits goes to: ban-lord
-------------------------------------------------
I hope you liked it, and that its usefull

Enjoy!