• 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.

How to create floating text from player typing?

Status
Not open for further replies.
Level 7
Joined
Jul 1, 2008
Messages
1,025
Hi, I have seen this cool effect in other maps where everything the player typed poped above his character in floating text, then the text floated upwards a little as it disappeared.

Does anyone know how I would go about creating this effect myself?
 
Level 10
Joined
Apr 18, 2009
Messages
601
This is the general idea in triggers:
  • Floating Text Chat
    • Events
      • Player - Player 1 (Red) types a chat message containing <Empty String> as A substring
    • Conditions
    • Actions
      • Floating Text - Create floating text that reads (Entered chat string) at (Position of Hero Unit 0000 <gen>) with Z offset 250.00, using font size 10.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
      • Floating Text - Set the velocity of (Last created floating text) to 20.00 towards 90.00 degrees
      • Floating Text - Change (Last created floating text): Disable permanence
      • Floating Text - Change the fading age of (Last created floating text) to 4.00 seconds
      • Floating Text - Change the lifespan of (Last created floating text) to 5.00 seconds
You might want to clear memory leaks in your implementation of the code. Maybe you'll also want to adjust the spawning position (center the text over the unit based on some formula depending on the length of the message) and duration (change the fading age and lifespan based on some formula depending on the length of the message).

Do you need help with anything of the above? Do you have any questions?
 

Attachments

  • Floating Chat Text Example Map.w3x
    12.3 KB · Views: 30
Status
Not open for further replies.
Top