• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Change Name? [Trigger]

Status
Not open for further replies.

Zulabar

Z

Zulabar

So hi. ^^

I'm making an edit (a hard version with more heroes - in german) of WarChasers.
So, that's just the background story, I also wanted to put some additional
Functions into the map.
E.g. a name-change-trigger.
So U can change your Name from <Battle.Net-Account> into <custom name>
for example Odair-Oh into Admiral Awesome.

And here comes the question.
How to create a Trigger to change names?

I hope you can help me. ^^
LG
 
Level 19
Joined
Feb 25, 2009
Messages
2,004
  • Change Name
    • Events
      • Player - Player 1 (Red) types a chat message containing -name as A substring
    • Conditions
    • Actions
      • Set Custom_Name = (Substring((Entered chat string), 6, 99))
      • Player - Set name of (Player((Player number of (Triggering player)))) to Custom_Name
      • Game - Display to (Player group((Player((Player number of (Triggering player)))))) for 5.00 seconds the text: (Name changed to + Custom_Name)
This will change the name of the specific player when he types "-name <something>".
There's a space after "-name <here>".
To limit the length of the names, simply change 99 to a specific number, but remember that it starts from 6 to X.
For example, if its 6, 12 it will change the name for the first 6 characters being type.
 

Zulabar

Z

Zulabar

Thank you, it worked and I completely understood the little Tutorial. :D
+ Rep :)

LG
 
Level 9
Joined
Aug 27, 2009
Messages
473
MortAr, you're doing strange stuff now..

This is correct and working
  • Change Name
    • Events
      • Player - Player 1 (Red) types a chat message containing -name as A substring
    • Conditions
    • Actions
      • Player - Set name of (Triggering player) to (Substring((Entered chat string), 7, 22))
Add the Game - Text Message if you want to.
Note that I changed the first Substring value from 6 to 7, this is because -nameMyNewName will work with 6; With 7 you have the space between -name MyNewName.. You can change the value 22 to something else; But the max name length in WC3 is 15. I'm not sure if this also is a rule for the Set Name Trigger, but this will follow the WC3 laws.. :)
 
Level 9
Joined
Aug 27, 2009
Messages
473
Yes it work with 6, but as I said -nameMyNewName works and will set your name to MyNewName.. If you then say -name MyNewName using 6 you get the name " MyNewName".. Therefor 7 will work if you don't want the space. Other then that the Max Name Length in WC3 is 15, so no need to explain that. (As I said, I'm not sure if this law will be considered using the Set Name action)
 
Level 9
Joined
Aug 4, 2021
Messages
42
  • Change Name
    • Events
      • Player - Player 1 (Red) types a chat message containing -name as A substring
    • Conditions
    • Actions
      • Set Custom_Name = (Substring((Entered chat string), 6, 99))
      • Player - Set name of (Player((Player number of (Triggering player)))) to Custom_Name
      • Game - Display to (Player group((Player((Player number of (Triggering player)))))) for 5.00 seconds the text: (Name changed to + Custom_Name)
This will change the name of the specific player when he types "-name <something>".
There's a space after "-name <here>".
To limit the length of the names, simply change 99 to a specific number, but remember that it starts from 6 to X.
For example, if its 6, 12 it will change the name for the first 6 characters being type.
ik its too late but , i cant do the variable what it is the type of variable?
 
Status
Not open for further replies.
Top