Getting a chosen hero name next to a player's name in chat

bugbear

New Member
Reaction score
3
A while ago, I saw in a map (perhaps DOTA) where the player's chosen hero was in parentheses next to the player's name when they typed a message. For example it'd say:

Bugbear (Warrior): heya

I know how to determine which hero the player has, but changing the player name in the chat like that I'm not sure how to do. Thanks in advance.
 

blooman

New Member
Reaction score
16
Trigger:
  • Melee Initialization
    • Events
      • Unit - A unit Sells a unit
    • Conditions
      • ((Sold unit) is A Hero) Equal to (==) True
    • Actions
      • Player - Set name of (Owner of (Buying unit)) to ((Name of (Sold unit)) + (Name of (Owner of (Buying unit))))

Edited
 

Danis[h]

New Member
Reaction score
19
A while ago, I saw in a map (perhaps DOTA) where the player's chosen hero was in parentheses next to the player's name when they typed a message. For example it'd say:

Bugbear (Warrior): heya

I know how to determine which hero the player has, but changing the player name in the chat like that I'm not sure how to do. Thanks in advance.

What I would do..

I would have an array of corresponding strings for the hero names stored, then when a hero is picked, I'd check which hero it was, then just append the array number to the player name..

Example.

Player 1 picks hero 5 (I've set the point value of hero 5 in the object editor to 5)
Set Player 1 name to HeroName[Pointvalue picked unit] + Name of player 1 // which in this case is 5
//now lets say HeroName[5] = teddycrusher

then I'd be Teddycrusher Danis[h] now :)
 

blooman

New Member
Reaction score
16
What I would do..

I would have an array of corresponding strings for the hero names stored, then when a hero is picked, I'd check which hero it was, then just append the array number to the player name..

Example.

Player 1 picks hero 5 (I've set the point value of hero 5 in the object editor to 5)
Set Player 1 name to HeroName[Pointvalue picked unit] + Name of player 1 // which in this case is 5
//now lets say HeroName[5] = teddycrusher

then I'd be Teddycrusher Danis[h] now :)
You don't really have to do that
 

Danis[h]

New Member
Reaction score
19
You don't really have to do that

but its what I would do regardless, like if I wanted the heroes displayed name in the chat to be something different than the proper name. Or if there is more than one proper name available, people might get confused since it changes all the time?
 
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