How to: Create Chat over Unit

Blackveiled

Formerly, Ban-Lord
Reaction score
157
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!

++Rep Appreciated
 

Ambeco

New Member
Reaction score
2
If you really wanted to be fancy:

Floating Text - Create a floating text that reads (((Player name of Triggering Player) + |r + (substring(entered chat string) 2, (Length of(Entered Chat String) - 1)))) at((Position of(PlayerUnits [Player number of (triggering player)])) offset by (-5x(Real((Length of(Entered Chat string)))),0) with Z offset 0.00, size 8.00, color (100.00% and 100.00% and 100.00%) and 0% transparency.

Gets full text instead of first 39 characters, and centers... sorta. Gotta fudge the number a bit, but thats the code anyways.
 

lllidan

New Member
Reaction score
22
yes but this doesnt get rid of the main chat that appears on everyone's screen....

Oh well it's still nice :)
 

Deathbedeli2

New Member
Reaction score
18
IF you want it to be really really fancy

"Floating Text - Create a floating text that reads (((Player name of Triggering Player) + |r + (substring(entered chat string) 2, (Length of(Entered Chat String) - 1)))) at((Position of(PlayerUnits [Player number of (triggering player)])) offset by (-5x(Real((Length of(Entered Chat string)))),0) with Z offset 0.00, size 8.00, color ((Random Number between 0 and 100) and (Random Number between 0 and 100) and (Random Number between 0 and 100) and ((Random Number between 0 and 35) transparency.
 

Blackveiled

Formerly, Ban-Lord
Reaction score
157
Its meant for like RolePlaying, if you wanna act like a game is a world and you wanna make it fancy instead of using the basic chat system you can use this...
 

Ambeco

New Member
Reaction score
2
Deathbedeli2 said:
, color ((Random Number between 0 and 100) and (Random Number between 0 and 100) and (Random Number between 0 and 100) and ((Random Number between 0 and 35) transparency.

lol. Amusing yes, but I'm not sure thats a good idea. Unusual colors can be hard to see, especially with high transperency.
 
S

scmstrack06

Guest
Can you attach the map? Then I can just copy and paste the trig, too long to work it all out myself if you already have it done.
 
S

SlasherXpert

Guest
Can you make it so when you type a ! in front of text it makes it over your head and when you dont use a ! it does normal chat?
Could be useful in Diablo 2 maps...hehe
 

Deathbedeli2

New Member
Reaction score
18
Yeah here slasher

Code:
Chat
    Events
        Player - Player 1 (Red) types a chat message containing ! as A substring
        Player - Player 2 (Blue) types a chat message containing ! as A substring
        Player - Player 3 (Teal) types a chat message containing ! as A substring
        Player - Player 4 (Purple) types a chat message containing ! as A substring
        Player - Player 5 (Yellow) types a chat message containing ! as A substring
        Player - Player 6 (Orange) types a chat message containing ! as A substring
        Player - Player 7 (Green) types a chat message containing ! as A substring
        Player - Player 8 (Pink) types a chat message containing ! as A substring
    Conditions
        (Substring((Entered chat string), 1, 1)) Equal to .
    Actions
        Floating Text - Create floating text that reads ((|cffffcc00 + (Name of (Triggering player))) + (|r:  + (Substring((Entered chat string), 2, 40)))) above ChatUnits[(Player number of (Triggering player))] with Z offset 0.00, using font size 8.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
        Floating Text - Change (Last created floating text): Disable permanence
        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 0.00 seconds
        Floating Text - Set the velocity of (Last created floating text) to 15.00 towards 90.00 degrees
 
S

SlasherXpert

Guest
Wat does the condition do?
And is the "." changable or is it just part of trigger?

For the first action how do you get the ChatUnits[(Player number of (Triggering player))] ?
 

Demonfaze

8 yrs. Hell, it's been a long time.
Reaction score
72
There is a way to make it so that the chat is not displayed... (only the chat above your head is) - without using observer mode.

I have seen it done. I just need to find the map...
 

corvusHaunt

New Member
Reaction score
96
You should set the unit whenever someone selects it. Something like:

Code:
Event
 Selection- Player selects a unit
Condition
 Triggering Player = Owner of selected unit
Action
 Set Units[Player number of triggering player] = Selected Unit

Which can make it alot more dynamic.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top