• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

Chat Over Unit With Hero Selection System

Status
Not open for further replies.
Level 8
Joined
Feb 17, 2007
Messages
368
How do I make chat appear over a unit when the unit hasn't already been pre-placed into the map, and is instead created through a hero selection system?

For example, this system is for units that are ALREADY preplaced in the game:

Actions
  • Map initialization
  • -------- SET VARIABLES --------
    • -------- Setting the unit variable makes it so the chat goes over the exact unit you want it to go over. --------
    • -------- To make it easier, you can make it so when they create a hero, or buy one, it sets the variable to that. --------
    • -------- The system will not work if you don't have it over the correct unit. --------
    • Set c_unit[1] = Footman 0000 <gen>
    • Set c_unit[2] = Footman 0001 <gen>
  • Player - Player 1 (Red) types a chat message containing <Empty String> as A substring
  • Actions
    • Floating Text - Create floating text that reads ((|cffffcc00 + (Name of (Owner of c_unit[(Player number of (Triggering player))]))) + (:|r + (Substring((Entered chat string), 2, 255)))) above c_unit[(Player number of (Triggering player))] with Z offset 0.00, using font size 10.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 7.00 seconds
    • Floating Text - Change the fading age of (Last created floating text) to 3.00 seconds
    • Floating Text - Set the velocity of (Last created floating text) to 15.00 towards 90.00 degrees
After a hero in my map is selected, it automatically goes into this unit group:
  • Unit Group - Add (Last created unit) to Hero_Selected_Unit_Group
I'm not sure if that above trigger would help though. Anyone have any ideas and see where I'm going with this?
 
It depends on the way you will create your heroes. If you are buying them, it will look like this:
  • Trigger
  • Events
    • Unit - A unit sells a unit
  • Conditions
    • ((Sold unit) is a Hero) Equal to True
  • Actions
    • Set Hero[Player Number of (Owner of (Sold unit))] = (Sold Unit)
If you create them via triggers, it will look like this:
  • Trigger
  • Events
    • //Your event
  • Conditions
  • Actions
    • Set Point1 = ((Triggering player)'s Start Location)
    • Unit - Create 1 Paladin for (Triggering player) at Point1 facing default building facing degrees
    • Set Hero[Player number of (Triggering player)] = (Last created unit)
    • Custom script: call RemoveLocation (udg_Point1)
 
Level 8
Joined
Feb 17, 2007
Messages
368
Ah never mind, I figured it out, lol. I had to change the ((Entered chat string), 2, 255)))) to ((Entered chat string), 1, 255)))) and that seemed to work. :thumbs_up:

EDIT: Oh, 1 more thing. How would I change the floating text to have each players names as their player colors?
 
Status
Not open for further replies.
Top