Change Actor's name with a Number variable

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
ste
Posts: 15
Joined: Wed Aug 07, 2019 2:45 am

Change Actor's name with a Number variable

Post by ste »

Hi,

is there a way to change the Actor's name according to the state of a Number variable?

Thank you in advance for your help!
User avatar
Tony Li
Posts: 22054
Joined: Thu Jul 18, 2013 1:27 pm

Re: Change Actor's name with a Number variable

Post by Tony Li »

Hi,

Sure. You can use [var=variable] and [lua(code)] tags in actors' Display Names. Let's say you have a variable named "PlayerLevel". You could set the player's Display Name to something like: "Bilbo Baggins the Level [var=PlayerLevel] Thief".

Conversations cache actors' Display Names at the beginning of the conversation. If you change the variable during the conversation and want to immediately update the name in the dialogue UI, use the Lua function in the "Discover Name Example" example package on the Dialogue System Extras page. Otherwise the variable change will apply to the display name in the next conversation.
ste
Posts: 15
Joined: Wed Aug 07, 2019 2:45 am

Re: Change Actor's name with a Number variable

Post by ste »

Great! Thank you very much :)
User avatar
Tony Li
Posts: 22054
Joined: Thu Jul 18, 2013 1:27 pm

Re: Change Actor's name with a Number variable

Post by Tony Li »

Happy to help! :-)
Post Reply