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

Custom Names

Status
Not open for further replies.
Level 5
Joined
Aug 2, 2004
Messages
65
Can someone help me plz, im doing a map and i want the players to be able to change their name (like in those village kind of maps) Can someone help me cos i cant find anything on the trigger list and im not up to learning jass (im gonna be learning c+ at college but not yet)

Its the classic name thing

player types message with -name ---------
the --------- is what then want it to be, and they are now called ---------.
 
Level 16
Joined
Oct 30, 2004
Messages
1,277
Hi.

This trigger is actually quite simple. It goes like this: Make a variable type String, lets name for excample Player1_Name. Then do this trigger:

Player - Player1 types chat message containing -name as A Substring.
Conditions
--------
Actions
Set variable Player1_Name = (Substring((Entered chat string),7,20))
Player - Set name of Player1 (red) to Player1_Name


And thats it, you are set to go. If u are wondering about the numbers in the substring, the number 7 tells the trigger that it takes the letters from seventh letter on, up to the twentieth letter, so with this setting u can have a name with maximum of 13 letters. If u want players to have a longer name just adjust the number 20 to any number u wish, making it 30 would mean u can have a name with 23 letters and so on. Just dont touch the number 7.
 
Status
Not open for further replies.
Top