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

[Trigger] player name change

Status
Not open for further replies.
Level 3
Joined
Aug 14, 2006
Messages
29
Hey!

guys/girls, how do i make a trigger that will be like

event: player 1 (red) is typing a chat msg equal to setname (string)

conditions: [no conditions]

action: set name of player 1 (red) to (string)

is this possible, if yes how to?

*cheers* zero
 
Level 8
Joined
Feb 4, 2007
Messages
389
I'm pretty sure you just answered your own question.

You use substings. "Set Player Name = ((Substring) entered chat string) 7, 22)"

You start the substring at 7 because generally you have the command "-name (Desired Name)," thus, the 7th letter is where you want to start. 22 is just a random number, you can set it to whatever. (I suggest less than 17, because it's not too long.)

Other than that, it should be pretty obvious.
 
Level 11
Joined
Jul 12, 2005
Messages
764
the action is under 'Player'. - > Set Player Name

substring is a part of a string... the two numbers mean the place of the first caracter of the substring, the second is the end.

Take the example "paskovich" :p
Substring("paskovich", 3, 7) == "skovi"
Ouch, are the numbers correct? I was always messing with them when working with substrings... :S
 
Level 3
Joined
Aug 14, 2006
Messages
29
so i will add a command like:

event: play chat msg - -setname (substring 3, 7)

action: player - set name (substring 3, 7)


but what im supposed to type instead of substring?
 
Level 2
Joined
Dec 16, 2006
Messages
12
you might want to use the 6th string depending on what you're having them type


ex:

6, 20

-name I-Like-Bannana-Pie-With-Pudding

it will change your name to this

I-Like-Bannana-Pie-W

and like..

7, 20

it will change it to

-Like-Bannana-Pie-Wi

and

6, 400

I-Like-Bannana-Pie-With-Pudding

and

0, 400

-name I-Like-Bannana-Pie-With-Pudding

it will make the name have the -name in it.


I hope this helps ya.
 
Level 3
Joined
Aug 14, 2006
Messages
29
this is nice guys, however i have the following "config"

event: player 1 types a msg containing -setname as a substring.

condition: (substring (((entered chat string) 1, 8)) equal to-setname

action: setname of player 1 to (substring (-setname, 8, 40))

when i type -setname(no matter what here) my name is = e..

how to slove this guys?
 
Level 10
Joined
Jan 21, 2007
Messages
576
Holy shit are you serous lol. You can do
Player - Player 1 (Red) types a chat message containing setname as A substring
Instead of
Player - Player 1 (Red) types a chat message containing setname as A Exact Match
Wow damn i need to pay more attention to the blue text, this would have saved me hourse of triggering ><
 
Status
Not open for further replies.
Top