ID:149638
 
Mloren wrote:
I have gone for a combination of those ideas:

obj/changename
icon=null
name = "Name:"
Click()
var/T = input("","") as text
src.suffix = T
usr << "[T]"
usr << "[suffix]"


mob
Stat()
if(statpanel("Name Changer"))
stat(new/obj/changename)

now, I know this isnt changing usr.name
but its not even setting the suffix right.
both the usr << "[T]" and usr << "[suffix]" return the new value properly, but the suffix doesnt actually appear in the stat pannel. any idea why?

The problem is in this line:

stat(new/obj/changename)

You are creating a new changename obj every time the Stat() proc executes. Not only does the new obj contain the default value for suffix (""), it is also producing extra overhead to create the new objs and delete them. If you want a single, non-name-specific name change button, use Zilal's method ( [link] ). Super16's method looks easier, but it is a very ineffiencient use of processor power, creating and deleting new objs every 7-8 ticks.

Please refer to my original answer ( [link] ) to see a method to preserve the name obj between Stat() calls. It may not look like "an easy approach", but it allows every player to have a unique name obj with their name on it.