System Floating Text Triggers

S

SoCal_420

Guest
This Trigger will a trigger on how to show chat text.
"Chat Text (Text floats over unit)"


The Trigger

This is pretty simple. when you tpye something it shows a floating text over your hero.

1. You will need 1 variables
Type = Floating Text Array
i Named My variable FloatingText


2.First the event should be player 1 types something. make the message = <empty string>. it should look like this:
Code:
.
Events
    Player - Player 1 (Red) types a chat message containing <Empty String> as A substring

.

3.Next You will need to destroy all the other floating texts by that player thats where the variable comes in.

Code:
.
Floating Text - Destroy FloatingText[(Player number of (Triggering player))]
.

4.Then you pick all the units owned by that player of hero. then in that loop create a if/then/else. like sooo

Code:
.

Unit Group - Pick every unit in (Units in (Playable map area) owned by (Triggering player)) and do (Actions)
    Loop - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                ((Picked unit) is A Hero) Equal to True
            Then - Actions
            Else - Actions
and the then actions we are going to show the floating text and set it.
Code:
.
Then - Actions
    Floating Text - Create floating text that reads (Entered chat string) above (Picked unit) with Z offset 0.00, using font size 10.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
    Set FloatingText[(Player number of (Triggering player))] = (Last created floating text)

or for the showing of the text you cuold do this
Code:
.
Floating Text - Create floating text that reads ((Name of (Triggering player)) + (  + (Entered chat string))) above (Picked unit) with Z offset 0.00, using font size 10.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency

.
so that way he floating text is like this
SoCal_420: Test
(it shows your name 2)

4. now do this do destroy the floating text after a certain amount of time.

Code:
.
Wait (Real((Length of (Entered chat string)))) seconds
Floating Text - Destroy FloatingText[(Player number of (Triggering player))]
.


Code:
This is the final trigger:
Show
    Events
        Player - Player 1 (Red) types a chat message containing <Empty String> as A substring
    Conditions
    Actions
        Floating Text - Destroy FloatingText[(Player number of (Triggering player))]
        Unit Group - Pick every unit in (Units in (Playable map area) owned by (Triggering player)) and do (Actions)
            Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        ((Picked unit) is A Hero) Equal to True
                    Then - Actions
                        Floating Text - Create floating text that reads (Entered chat string) above (Picked unit) with Z offset 0.00, using font size 10.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
                        Set FloatingText[(Player number of (Triggering player))] = (Last created floating text)
                    Else - Actions
        Wait (Real((Length of (Entered chat string)))) seconds
        Floating Text - Destroy FloatingText[(Player number of (Triggering player))]

You can modify this to make it mroe fancy with color codes ect..
 

Attachments

  • Floating text.w3x
    16.8 KB · Views: 255

AceHart

Your Friendly Neighborhood Admin
Reaction score
1,495
This is not a system, it's a trigger...


> This is the final trigger:

It shouldn't work with just anything I type. "-talk <text here>" gives me more control.
It might destroy a text that was never there...
It might destroy the same text twice.
It has an inefficient way of finding my Hero.
It assumes I only have one Hero.
It leaks a unit group.
It should use floating text features to remove them.
 
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