• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Chat over Unit

Level 8
Joined
May 26, 2007
Messages
214
Text over Unit over Unit Tutorial

INTRODUCTION

The way this tutorial works is it will put chat over your unit...


also adding a name infront (optional)

It works by using floating text and variable arrays.


STEPS
I. Trigger Creation
IV. Setting up the chat system

THE TRIGGERS
I. Create "2" triggers
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

init2gx.jpg


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.



it will turn on this trigger

the condition will be

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 couldnt read the top text you can use ...

Chat Layout ...
chat8ax.jpg


Floating Text Full...

chat26kj.jpg


If this worked it should look like this!

chat39uw.jpg


Thanks for reading my tutorial!
 
Level 16
Joined
Oct 30, 2004
Messages
1,277
I dont think a single (and simple) trigger explaining only how to do one thing qualifies as a tutorial. I could imagine this as an example in a tutorial about floating texts. I would recommend graveyarding this.
 
Level 32
Joined
Oct 23, 2006
Messages
5,291
I would also like to hear the opinions of our spell moderators regarding this tutorial.

At any rate banlord, you'll have to edit the document to format it properly:

General Tutorial Submitting Rules and Guidelines
  • If you're using triggers in your tutorial, use the Trigger tags.
  • All image files must be attached to your post. We don't wish to be dependent on other sites (to avoid situations in which the server that hosts images fails, thus damaging the tutorial).
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,258
Currently this is just too simple to be worth anything. And the most complex part (the floating text system) you leave out describing how it works entirly.

Ways you can improve this tutorial.
  • Include a demo map that allows people to see this system in work.
  • Include a JASS guide for making this system.
  • Include a section saying how to make the chat appear above more than 1 unit per player.
  • Include a guide of how to make special effects appear above the unit if it contains certian substrings aswell as the text.
  • Include more detail about how the trigger will work.
  • Include a short cut system at the top of the tutorial to enable faster linking to infomation.
  • Remove the pictures of GUI triggers and use THW's "TRIGGER" vB code.
  • Describe what each action does clearly so that "noobs" who understand little, if not nothing about triggers can learn from it.

If you do a large number of the above it should be worth approving.
 
Level 3
Joined
Aug 3, 2006
Messages
45
Click to Variables then left click in the square were is says array and you'll be avalible to make [1][2][3][4][5][6][7][8][9][10] up to 9999999 i think.
 
Top