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

changing playernames

Status
Not open for further replies.
Level 2
Joined
Jul 29, 2007
Messages
12
my internet was slow so i couldnt browse through all the pages of threads to look for changing your name

so my question is, how do you change your name in a game?
like, just saying name othername so it would show up as
othername: hi
instead of
13th_Blank: hi

please helpp
 
Level 9
Joined
May 28, 2007
Messages
365
There is a trigger that changes player names.

Player - Change Name

If you want to allow players to change it it has to look something like this...

  • Event - Player 1 types "-name " as a substring
  • Action - Player - Change Name for (Player 1) to ((Entered Chat String, 7, 18))
This takes the entered chat string, and only change the player name from the 7th character to the 18th character.
 
Level 9
Joined
May 28, 2007
Messages
365
I took the courtesy to go into WorldEdit to get the exact code.

  • Player - Player 1 (Red) types a chat message containing -name as A substring
  • Player - Set name of (Triggering player) to (Substring((Entered chat string), 7, 18))
The trigger works when a player type any message that starts off with "-name "
(Yes there is a space in there)

WordEdit then gets only certain letters from the string that was entered, so only what the player typed is what the name change would be.
Because the player types, "-name " we don't want the new name to contain that part either. We only want certain parts of the entered chat string

"- n a m e "
1 2 3 4 5 6

Those are the characters used in the entered chat string, but we don't want them.

For example

Player 1 types -name Overload119

- n a m e o v e r l o a d 1 1 9 <- entered chat string.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 <- digits

By taking only the substrings of the string, we only take from 7 to 18, so only the highlighted parts is what the name change will be.

The reason it is 18 is to cap it, I understand that in the example only 16 character we used, but say if you change 18 to 99 then a player can have a ridiculously long name.

If I helped +rep.
 
Status
Not open for further replies.
Top