Warcraft III resources & community, 2003–2006 · archived

Custom Names

3 posts
#1

Custom Names

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 ---------.
#2
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.
#3
You don't need this variable. Couldn't you do:

Player - Set name of Player 1 (Red) to Substring((Entered chat string), 7, (Length of (Entered chat string)))

I write what i remember but I think it will work fine.