I'm using a modified version of the JRPG template:
I have a GameObject that I've named NPC and intend to use as a generic prefab. I have an npcName variable set in a script on that object as a string value.
I'd like to either use that npcName variable somehow via script or set the name that shows up in portrait name -- the "(Name)" text. As is it just uses the GameObject's name, so it always shows "NPC" as the speaker. I've tried using the DialogueActor and Usable's "Override Name" field, but to no avail. Is there something else I should be doing?
If you assign the NPC GameObject to the Dialogue System Trigger's Start Conversation > Conversation Conversant field, and add a Dialogue Actor component to the NPC GameObject, then you should be able to set the DialogueActor.actor variable to the value of your npcName variable. Note that you must do this before starting the conversation. The conversation will cache the character's name as soon as the conversation starts so it doesn't have to continually look it up.
If you can't set it before starting the conversation, let me know. There are other options.
Side note: If you're setting DialogueActor.actor from code, you should be able to assign any string to it. As long as that GameObject is assigned to the trigger's Conversation Conversant, it will use whatever string you assign to actor.
Extra tangent side note: You can include [var=variable] and [lua(code)] tags in the actor string (or the actor's Display Name in the Dialogue Editor for that matter). This is useful is actor names, or even parts of actor names, can change.
Side note: If you're setting DialogueActor.actor from code, you should be able to assign any string to it. As long as that GameObject is assigned to the trigger's Conversation Conversant, it will use whatever string you assign to actor.