Hi,
I was wondering it was possible to create a quest that has multiple start point depending on who is giving you the quest.
The example I have is a quest where the player must either capture or kill a thief.
There are two ways to start this quest:
1 - Talk to the victim who will ask you to find the thief.
2 - Find the thief by yourself (without talking to the victim first).
In the first case, there's an extra condition to "Find the thief". And once you find the thief, the same two conditions (Capture or Kill) are active.
So, there are two quest givers, the victim or the thief himself, but right now, whether I write down GiveQuest("Victim","ThiefQuest") or GiveQuest("Thief","ThiefQuest"), I have no way to tell them which "Start" I want to activate and they will both activate the same one regardless.
I saw a place I could put "Quest Giver ID" in the Quest Info, but it seems to be for the whole quest and not specifically for each different Start node.
I guess I could create two different quests, or I could manually input stuff like "SetQuestNodeState("ThiefQuest","Start (Victim)","active"), to explicitly tell Quest Machine which node I want active and inactive, but I was wondering if there was already another simpler implementation for those cases.
PS: I haven't encountered that situation yet in my quests, but I could also see a situation where a single NPC could give a quest that starts at a different Start Node depending on the situation. (Ex: The sheriff normally asks you to go talk to the victim, which would start the quest at "Talk to the victim", but if you have already talked to the victim before you talked to the sheriff, he would instead start the quest at "Find the thief").
I don't know if the solution would be the same for both cases.
Thanks again!
Starting at different start nodes (with multiple quest givers or a single quest giver)
-
- Posts: 20
- Joined: Sun Apr 04, 2021 11:54 am
Re: Starting at different start nodes (with multiple quest givers or a single quest giver)
Hi,
Quests should only have one Start node. You could set up the quest like this:
where the "Is Victim" and "Is Thief" nodes have a custom quest condition that check the quest giver ID, something like:
Note that I also used a passthrough node. It doesn't do anything on its own (although it can have text content and actions). In this case, it just reduces the number of link lines.
Quests should only have one Start node. You could set up the quest like this:
where the "Is Victim" and "Is Thief" nodes have a custom quest condition that check the quest giver ID, something like:
Code: Select all
public class IsQuestGiverQuestCondition : QuestCondition
{
public StringField requiredQuestGiver;
public override void StartChecking(System.Action trueAction)
{
base.StartChecking(trueAction);
if (quest.questGiverID == requiredQuestGiverID) SetTrue();
}
}