• 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.
  • Create a faction for Warcraft 3 and enter Hive's 19th Techtree Contest: Co-Op Commanders! Click here to enter!
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 21st Texturing Contest: Upgrade is now concluded, time to vote for your favourite set of icons! Click here to vote!

[Solved] String to floating text/variable

Status
Not open for further replies.
Level 5
Joined
Jul 18, 2010
Messages
159
Hello, I'm going to make a trigger for my map, and I need to change Chat String entered by player to Variable and/or floating text.

For example:
Player types chat message "Hello" now the trigger sets variable to be used later and/or creates floating text "Hello".

I hope you will help me =)!
 
I guess you want a chat system displayed above the character.
You would need a floating text and a timer.
Once the player types something, check if FloatingText[Player number of(Triggering player)] is not null. If it is, create a floating text with the message (Entered chat string) and fire a timer. When the timer expires, destroy the floating text. If the FloatingText[Player number of (Triggering player)] is not null, use the Floating Text - Change text instead, to save extra calls and reset the timer attached to that player.

You use also use a recycling method of floating texts, to prevent creation and destruction all the time or Hide Floating text, when the text is supposed to be destroyed and move it to the character's location, by unhiding it, once something is typed by its owner.
 

Chaosy

Tutorial Reviewer
Level 41
Joined
Jun 9, 2011
Messages
13,247
do like this
  • Untitled Trigger 001
    • Events
      • Player - Player 1 (Red) types a chat message containing <Empty String> as A substring
    • Conditions
    • Actions
      • Set string_variable = (Entered chat string)
      • Floating Text - Create floating text that reads (Entered chat string) at (Center of (Playable map area)) with Z offset 0.00, using font size 10.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
or like this (RECOMENDED)
  • Untitled Trigger 001 Copy
    • Events
      • Player - Player 1 (Red) types a chat message containing <Empty String> as A substring
    • Conditions
    • Actions
      • Set string_variable = (Entered chat string)
      • Floating Text - Create floating text that reads string_variable at (Center of (Playable map area)) with Z offset 0.00, using font size 10.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
 
Status
Not open for further replies.
Top