Change NPC Name During Dialogue

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
WizardMonke
Posts: 2
Joined: Thu Apr 21, 2022 6:07 pm

Change NPC Name During Dialogue

Post by WizardMonke »

Hello!

I'm new to the dialogue system and I was wondering if there was a way to change the name of an NPC that the player is talking to after they engage in dialogue? For example, the player may walk up to someone named "Stranger", and then in the dialogue, the NPC introduces themselves, and so now the player can see their name when looking at them.

Any help is appreciated. Thank you!
Last edited by WizardMonke on Tue Apr 26, 2022 1:09 pm, edited 1 time in total.
User avatar
Tony Li
Posts: 22110
Joined: Thu Jul 18, 2013 1:27 pm

Re: Change NPC Name During Dialogue

Post by Tony Li »

Hi,

Please see the "Discover Name" example package (direct download) on the Dialogue System Extras page.
WizardMonke
Posts: 2
Joined: Thu Apr 21, 2022 6:07 pm

Re: Change NPC Name During Dialogue

Post by WizardMonke »

This is exactly what I was looking for. Thank you!
User avatar
Tony Li
Posts: 22110
Joined: Thu Jul 18, 2013 1:27 pm

Re: Change NPC Name During Dialogue

Post by Tony Li »

Glad to help!
suisei
Posts: 10
Joined: Tue Aug 22, 2023 7:45 am

Re: Change NPC Name During Dialogue

Post by suisei »

How can I localize this new Display Name?
User avatar
Tony Li
Posts: 22110
Joined: Thu Jul 18, 2013 1:27 pm

Re: Change NPC Name During Dialogue

Post by Tony Li »

Hi,

Set the field "Display Name LN" where LN is the language, such as "Display Name zh" for Chinese, "Display Name es" for Spanish, etc.
suisei
Posts: 10
Joined: Tue Aug 22, 2023 7:45 am

Re: Change NPC Name During Dialogue

Post by suisei »

Sorry Tony, I should give more details for the question.

I'm asking about localizing new display name, changed in lua function:

Code: Select all

ChangeActorName("Mephistopheles", "Mephistopheles")
Display Name localization can only localize "Stranger", but not "Mephistopheles".

Obviously this new name is not going through localization system... What is the best way to properly localize it?
User avatar
Tony Li
Posts: 22110
Joined: Thu Jul 18, 2013 1:27 pm

Re: Change NPC Name During Dialogue

Post by Tony Li »

Hi,

You will need to set it for each language in this case, such as:

Code: Select all

Actor["Captain"].Display_Name_es = "El capitán";
Actor["Captain"].Display_Name_zh = "船長";
ChangeActorName("Captain", "The Captain")
Use the ChangeActorName() function last, since it also updates the active conversation's UI.
Post Reply