Showing question marks for the name of an Unknown NPCs

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
jlhacode
Posts: 77
Joined: Fri Jul 03, 2020 6:23 am

Showing question marks for the name of an Unknown NPCs

Post by jlhacode »

I'm trying to add familiarity with NPCs to my name. If the player knows the NPC, then their name will show in the dialogue - if not, then it will show up as "???". I was thinking about making a DialogueActor subclass, and adding a field for "isKnown" or something. Does this approach sound like it would be a good idea? Saving the "isKnown" property would be important as well.
User avatar
Tony Li
Posts: 22144
Joined: Thu Jul 18, 2013 1:27 pm

Re: Showing question marks for the name of an Unknown NPCs

Post by Tony Li »

Hi,

You don't need to write any code.

Set the NPC's Display Name to"???". When the player learns the NPC's name use the ChangeActorName() Lua function to update the Display Name. Note: ChangeActorName() was added in version 2.2.29. If you're on an older version and can't update, use the Lua function provided in the Discover Name Example package on the Dialogue System Extras page.
Post Reply