• 💀 Happy Halloween! 💀 It's time to vote for the best terrain! Check out the entries to Hive's HD Terrain Contest #2 - Vampire Folklore.❗️Poll closes on November 14, 2023. 🔗Click here to cast your vote!
  • 🏆 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!
  • 🏆 HD Level Design Contest #1 is OPEN! Contestants must create a maze with at least one entry point, and at least one exit point. The map should be made in HD mode, and should not be openable in SD. Only custom models from Hive's HD model and texture sections are allowed. The only exceptions are DNC models and omnilights. This is mainly a visual and design oriented contest, not technical. The UI and video walkthrough rules are there to give everyone an equal shot at victory by standardizing how viewers see the terrain. 🔗Click here to enter!

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