player name as variable need to be set for every conversation?

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
fkkcloud
Posts: 298
Joined: Mon Oct 05, 2020 6:00 am

player name as variable need to be set for every conversation?

Post 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?
User avatar
Tony Li
Posts: 22051
Joined: Thu Jul 18, 2013 1:27 pm

Re: player name as variable need to be set for every conversation?

Post by Tony Li »

Hi,

No. Once the variable value is set, it stays set. You only need to set it once.
fkkcloud
Posts: 298
Joined: Mon Oct 05, 2020 6:00 am

Re: player name as variable need to be set for every conversation?

Post 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?
User avatar
Tony Li
Posts: 22051
Joined: Thu Jul 18, 2013 1:27 pm

Re: player name as variable need to be set for every conversation?

Post 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"]
Post Reply