Page 2 of 2

Re: Only one quest tracked and active at the same time

Posted: Tue Feb 26, 2019 5:34 am
by GorkaGames
sorry, can you please elaborate a bit more on here:

I suggest that you leave the quest state active, but reset the node states.

What do you mean with reset the node states? One example?
And I need to disconnect the gamebjects or at least the listeners somehow...

Re: Only one quest tracked and active at the same time

Posted: Tue Feb 26, 2019 8:45 am
by Tony Li
Use QuestNode.SetState:

Code: Select all

// Set all except Start node to Inactive, in reverse order:
for (int i = quest.nodeList.Count - 1; i > 0; i--)
{
    quest.nodeList[i].SetState(QuestNodeState.Inactive);
}
The loop above sets it in reverse order (e.g., node 4, node 3, node 2, node 1) because it's less likely to cause side effects when changing states. It's like rewinding the quest back to its original state. It leaves node 0 (the Start node) untouched.

(BTW, there are also Set Quest State and Set Quest Node Action actions that you can add to quests' Actions lists.)

Re: Only one quest tracked and active at the same time

Posted: Tue Feb 26, 2019 10:54 am
by GorkaGames
ok, but this is not similar to "abandone"? when you abandone and accept again in starts form the beginning, as far as I know....

Re: Only one quest tracked and active at the same time

Posted: Tue Feb 26, 2019 11:05 am
by Tony Li
It's similar, but the manual script keeps the quest in the active state and doesn't send "quest abandoned" messages (in case something is listening for those messages). It's really up to what you want. I think it's better to keep it in the active state so it appears in the quest journal.