• 🏆 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!

[JASS] Hero Name

Status
Not open for further replies.
So, the answer is no, unless you periodically want to move a floating textover your hero:
  • Trigger
  • Events
    • Map Initialization
  • Conditions
  • Actions
    • Hashtable - Create a hashtable
    • Set Hash = (Last created hashtable)
    • For each (Integer A) from 1 to 12, do (Actions)
      • Loop - Actions
        • Trigger - Add to Trigger2 <gen> the event (Player - Player(IntegerA) types -name as A substring
  • Trigger3
  • Events
    • Unit - A unit sells a unit
  • Conditions
    • ((Sold unit) is a Hero) Equal to True
  • Actions
    • Set Hero[Player number of (Owner of (Buying unit))] = (Sold unit)
    • Player Group - Add (Owner of (Buying unit)) in TextGroup
    • Floating Text - Create a floating text above (Sold unit) with the message "(Name of (Sold unit))", using ...
    • Hashtable - Save Handle of (Last created floating text) as Key(text) of (Key(Owner of (Sold unit))) in Hash
    • Trigger - Turn on Trigger4 <gen>
  • Trigger2
  • Events
  • Conditions
    • (Substring((Entered chat string), 1, 5) Equal to -name
  • Actions
    • Floating Text - Change the text of (Load Key(text) of (Key(Triggering player)) from Hash) to (Substring((Entered chat string), 7, (Length of (Entered chat string)))
  • Trigger4
  • Events
    • Time - Every 0.06 seconds of game-time
  • Conditions
  • Actions
    • If (All conditions are true) then do (Actions) else do (Actions)
      • If - Conditions
        • (Number of players in TextGroup) Greater than 0
      • Then - Actions
        • Player - Pick every player in TextGroup and do (Actions)
          • Loop - Actions
            • Set Point1 = (Position of (Hero[Player number of (Picked player)]))
            • Floating Text - Change position of (Load Key(text) of (Key(Picked player)) to Point1
            • Custom script: call RemoveLocation (udg_Point1)
      • Else - Actions
        • Trigger - Turn off (This trigger)
 
Status
Not open for further replies.
Top