Page 1 of 1
Change Actor's name with a Number variable
Posted: Wed Mar 25, 2020 7:00 am
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!
Re: Change Actor's name with a Number variable
Posted: Wed Mar 25, 2020 8:05 am
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.
Re: Change Actor's name with a Number variable
Posted: Wed Mar 25, 2020 8:09 am
by ste
Great! Thank you very much
Re: Change Actor's name with a Number variable
Posted: Wed Mar 25, 2020 8:39 am
by Tony Li
Happy to help!