Page 1 of 1
player name as variable need to be set for every conversation?
Posted: Tue Nov 24, 2020 12:16 am
by fkkcloud
Hi,
I am setting [var=Player_Name] somewhere in a conversation.
After it is set, I am using that name for the rest of the game for all conversations.
Should I set its value every time I start the conversation?
Re: player name as variable need to be set for every conversation?
Posted: Tue Nov 24, 2020 8:38 am
by Tony Li
Hi,
No. Once the variable value is set, it stays set. You only need to set it once.
Re: player name as variable need to be set for every conversation?
Posted: Tue Nov 24, 2020 9:07 am
by fkkcloud
What about applying it to Play Display Name? should I set it every time I start conversation or at least everytime it is Awake() even if its singleton through out the game?
Re: player name as variable need to be set for every conversation?
Posted: Tue Nov 24, 2020 1:27 pm
by Tony Li
Hi,
Set the actor's "Display Name" field once. This will be recorded in the Lua environment. When you start a new conversation, or save and load a game, the value will still be there.
Example of setting Display Name in C#:
Code: Select all
DialogueLua.SetActorField("Player", "Display Name", GetVariable("Player_Name").asString);
Example of setting Display Name in Lua (e.g., Script field):
Code: Select all
Actor["Player"].Display_Name = Variable["Player_Name"]