Page 1 of 1

Dynamic Actor/Conversant Name

Posted: Sun Jun 11, 2023 10:10 am
by fr4231
Hi,
I would like to change the displayed names of my actors and conversants in specific dialogues, but can't really find a way to do it properly.

To make it easier to understand, in the dialogue database I have a few actors.
Let's say Actor A and Actor B.

In general I would like to display their names in most of the dialogues as set in the database (A and B), but in certain exceptional dialogues I want use these same actors and only change their displayed names during the dialoguess to something else (A and B for example).

What would be a good way to do that?
Thanks!

Re: Dynamic Actor/Conversant Name

Posted: Sun Jun 11, 2023 11:04 am
by fr4231
Simply adding this script to a node didn't seem to solve the situation.

Actor["Player_X"].Name = "My Custom Name";

Re: Dynamic Actor/Conversant Name

Posted: Sun Jun 11, 2023 11:20 am
by fr4231
Actor["Player_X"].Display_Name = "My Custom Name"

was the other thing I've tried (most likely much closer to what I want to do), and actually it seems both are working, but not initially.
If you trigger the conversation the second time it works, but in my case that's not really ideal.
Is there any way to display the set name in the first conversation as well correctly?

I set the script on the start node, but still no luck.

Re: Dynamic Actor/Conversant Name

Posted: Sun Jun 11, 2023 11:34 am
by fr4231
Got it, must set it from the dialogue trigger before starting the conversation and not from the dialogue editor through a sequence.
Now it seems to be working fine.

Re: Dynamic Actor/Conversant Name

Posted: Sun Jun 11, 2023 3:47 pm
by Tony Li
Sounds good. Yes, conversations identify the primary actor & conversant GameObjects when the conversation starts, so they should be set in the Dialogue System Trigger.

Re: Dynamic Actor/Conversant Name

Posted: Mon Jun 12, 2023 4:15 am
by fr4231
Thanks!
One more extra question.
Is it possible to set the name with this approach to variable and assign it from a script (for example in case of randomly generated names)?

Thanks!

Re: Dynamic Actor/Conversant Name

Posted: Mon Jun 12, 2023 7:47 am
by Tony Li
Yes. Use DialogueLua.SetActorField():

Code: Select all

DialogueLua.SetActorField("NPC1", "Display Name", "Fred");