Quest NPCs

The QuestNPC class is meant for connecting quests with characters, and defining their relevancy to the quest.

Creating a Quest NPC

A QuestNPC object needs a reference to a quest and a QTCharacter. The NPCObjectName should be the name of the character scriptable object.

var quest = QT.GetQuest("MyQuestKey");
var questNPC = new QuestNPC(quest.ID, "MyCharacterObject", QuestNPC.QuestRelevancy.ProviderAndRecipient);

Adding a Quest NPC

quest.AddNPC(questNPC);

Removing a Quest NPC

You can remove a QuestNPC by the object itself, the QTCharacter object name, and the index.

quest.RemoveNPC("MyCharacterObject");

Getting a Quest NPC

A QuestNPC object contains character data with other relevant information related to the quest. You can get the quest NPC with the name of the character scriptable object.

var npc = quest.GetNPC("MyCharacterObject");

You can get the full list of NPCs with the quest.npcs field.

Here's how you can get the character data object from a QuestNPC:

var character = npc.NPC;

Last updated