Changing Character Name

So I have a scenario where my characters are in a dark room and I currently have the alias set to "a dark figure" on the non player character. I want to have it where after they talk to the figure the name changes to Jim and stays that way for the rest of the game. Is there a way to change the name mid game?

add new script -> 'variables' section/category -> 'set a variable or attribute' Script -> (see below)


replace my caps with the 'name' of your non-playable character Object

do this scripting within your 'talk' (or whatever) Verb for that non-playable character Object

Code = "Teddy"
player.alias = "Ted" = "Ethan"
npc.alias = "CJ"

(noting that jmnevil's code will generate an error, because you can't change an object's name)

An object's name is how you refer to it in the code; it is read only within a game, and can only be changed in the editor.

An object's alias is the name that the player sees, and you can change that the same way you change any other attribute. If you don't set the alias, it will by default be the same as the name.

Log in to post a reply.