ID:266253
 
I have a verb called set_title and it changes the usr's name t an input of theirs plus hteir name. I dont know if i am making sense, but here is the code:
mob
var
title
mob/verb/set_category()
usr.title=""
usr.title=input("Your Title.","Title")
usr.name="[usr.name] [usr.title]"

It changes their name, but when you change the title to something else it says: title title name. I think its because the name is set to that and it keeps adding the title to the name.
PLEASE HELP,
Air _King
Air _King wrote:
It changes their name, but when you change the title to something else it says: title title name. I think its because the name is set to that and it keeps adding the title to the name.

Yep, you're exactly right. The way I get around this is to make a new mob variable called realname. Then just be sure to initialize it in mob/Login():

mob
var
realname

Login()
// your stuff
src.realname = src.name
. = ..()

Then use realname in place of name in your verb.
In response to Air Mapster
Air Mapster wrote:
Air _King wrote:
It changes their name, but when you change the title to something else it says: title title name. I think its because the name is set to that and it keeps adding the title to the name.

Yep, you're exactly right. The way I get around this is to make a new mob variable called realname. Then just be sure to initialize it in mob/Login():

mob
var
realname

Login()
// your stuff
src.realname = src.name
. = ..()

Then use realname in place of name in your verb.

Thanks I was thinking about that, but i thought that it would set the realname to the name with the tite will it?
In response to Air _King
Thanks I was thinking about that, but i thought that it would set the realname to the name with the tite will it?

Whenever you change their title, set their name to the following:

[title] [realname]

and it should work fine.
In response to Spuzzum
Spuzzum wrote:
Thanks I was thinking about that, but i thought that it would set the realname to the name with the tite will it?

Whenever you change their title, set their name to the following:

[title] [realname]

and it should work fine.

No it changes the name to just the title. I think its because the realname= the name and the name is changed to the title and realname, but the realname equals the title so it is just the title
In response to Air _King
What I mean is if you set realname only once when they first log in, you will never experience any problems, except possibly with saving, but that's not my area.

src.name = "[title] [realname]"

will always produce the result "Sir Alayus Proudmoon" if my name was "Alayus Proudmoon" when I logged in and my title was "Sir".
In response to Spuzzum
Spuzzum wrote:
What I mean is if you set realname only once when they first log in, you will never experience any problems, except possibly with saving, but that's not my area.

src.name = "[title] [realname]"

will always produce the result "Sir Alayus Proudmoon" if my name was "Alayus Proudmoon" when I logged in and my title was "Sir".

do i have to have the new version of BYOND?
In response to Air _King
Air _King wrote:
Spuzzum wrote:
What I mean is if you set realname only once when they first log in, you will never experience any problems, except possibly with saving, but that's not my area.

src.name = "[title] [realname]"

will always produce the result "Sir Alayus Proudmoon" if my name was "Alayus Proudmoon" when I logged in and my title was "Sir".

do i have to have the new version of BYOND?

Um, no. That same thing would have held true as of version 201.
In response to Spuzzum
Spuzzum wrote:
Air _King wrote:
Spuzzum wrote:
What I mean is if you set realname only once when they first log in, you will never experience any problems, except possibly with saving, but that's not my area.

src.name = "[title] [realname]"

will always produce the result "Sir Alayus Proudmoon" if my name was "Alayus Proudmoon" when I logged in and my title was "Sir".

do i have to have the new version of BYOND?

Um, no. That same thing would have held true as of version 201.

Then why wont it work??? Have you tried it?
In response to Air _King
Air _King wrote:
Spuzzum wrote:
Air _King wrote:
Spuzzum wrote:
What I mean is if you set realname only once when they first log in, you will never experience any problems, except possibly with saving, but that's not my area.

src.name = "[title] [realname]"

will always produce the result "Sir Alayus Proudmoon" if my name was "Alayus Proudmoon" when I logged in and my title was "Sir".

do i have to have the new version of BYOND?

Um, no. That same thing would have held true as of version 201.

Then why wont it work??? Have you tried it?


Nevermind, i put
usr.name="[usr.title]"
usr.name+=" [usr.realname]"