setting variable as Portrait name
setting variable as Portrait name
Hi,
How do I set a portrait name with a variable?
[var=PLAYER_NAME] for the portrait name area.
also, is there any place that I can check all the variable's data stored?
Thank you,
How do I set a portrait name with a variable?
[var=PLAYER_NAME] for the portrait name area.
also, is there any place that I can check all the variable's data stored?
Thank you,
Re: setting variable as Portrait name
Hi,
Set the actor's Display Name field. Example in Script field:
Example in C#:
In your Dialogue Text, [var=Actor] will be the Display Name (e.g., "Bob Loblaw").
See also the "Discover Name Example" on the Dialogue System Extras page. It shows how to change the name in the middle of a conversation.
To check the variables' current values, use the Dialogue Editor window's Watches tab (Menu > Add All Runtime Variables) or the Variable Viewer window.
Set the actor's Display Name field. Example in Script field:
Code: Select all
Actor["Player"].Display_Name = "Bob Loblaw";
Code: Select all
DialogueLua.SetActorField("Player", "Display Name", "Bob Loblaw");
See also the "Discover Name Example" on the Dialogue System Extras page. It shows how to change the name in the middle of a conversation.
To check the variables' current values, use the Dialogue Editor window's Watches tab (Menu > Add All Runtime Variables) or the Variable Viewer window.
Re: setting variable as Portrait name
Great.
I am doing
It does not set the display name, it still uses the default value.
But "DialogueLua.GetVariable("PLAYER_NAME").asString"'s value is valid.
also, Does this gets saved for the game or temporarily for the session?
--
I don't have/see "Watches" tab in Dialogue Editor window. Maybe its in different UI? I have the latest Dialogue System version.
I am doing
Code: Select all
DialogueLua.SetVariable("PLAYER_NAME", nameField.text);
DialogueLua.SetActorField("Player", "Display_Name", DialogueLua.GetVariable("PLAYER_NAME").asString);
But "DialogueLua.GetVariable("PLAYER_NAME").asString"'s value is valid.
also, Does this gets saved for the game or temporarily for the session?
--
I don't have/see "Watches" tab in Dialogue Editor window. Maybe its in different UI? I have the latest Dialogue System version.
Re: setting variable as Portrait name
Hi,
Change the second line to:
All Actor fields (including Display Name) are saved in saved games.
The Dialogue Editor's Watches tab is only visible in play mode.
Change the second line to:
Code: Select all
DialogueLua.SetActorField("Player", "Display Name", DialogueLua.GetVariable("PLAYER_NAME").asString);
The Dialogue Editor's Watches tab is only visible in play mode.
Re: setting variable as Portrait name
Still no luck on the Display Name set..
I tried first before.
The variable is valid in console and watches.
Any other thing that I might 've missed?
I tried
Code: Select all
Disaply Name
Code: Select all
Display_Name
The variable is valid in console and watches.
Any other thing that I might 've missed?
Re: setting variable as Portrait name
Are you changing the name while a conversation is active? If so, the new name will not appear until you start a new conversation, unless you use the technique shown in the Discover Name example.
Re: setting variable as Portrait name
Yes, I am changing during the conversation.
Okay I will look into Discover Name example
Edit:
I guess this is the trick
Okay I will look into Discover Name example
Edit:
I guess this is the trick
Code: Select all
if (DialogueDebug.LogInfo) Debug.Log("Dialogue System: Changing " + actorName + "'s Display Name to " + newDisplayName);
DialogueLua.SetActorField(actorName, "Display Name", newDisplayName);
if (DialogueManager.IsConversationActive)
{
var actor = DialogueManager.MasterDatabase.GetActor(actorName);
if (actor != null)
{
var info = DialogueManager.ConversationModel.GetCharacterInfo(actor.id);
if (info != null) info.Name = newDisplayName;
}
}
Re: setting variable as Portrait name
Yes, that's correct.