Hi,
Assuming you have a reference to the instantiated NPC object, try this:
Code: Select all
using PixelCrushers.DialogueSystem; // (Add to top of your script.)
...
DialogueActor dialogueActor = npcObject.GetComponent<DialogueActor>();
if (dialogueActor != null)
{
dialogueActor.actor = "someone";
}
Here's another tip that I'm not sure is relevant, but I'll mention it. You can include [var=
variable] and [lua(
code)]
markup tags in your Dialogue Actor's actor value.
For example, say you have a DS variable named "Number_Of_Kingdoms_Conquered". You could set an NPC's actor field to:
Code: Select all
dialogueActor.actor = "Emperor of the [var=Number_Of_Kingdoms_Conquered] Kingdoms";