ORK integration

Announcements, support questions, and discussion for Quest Machine.
dlevel
Posts: 183
Joined: Wed Nov 16, 2016 6:17 pm

Re: ORK integration

Post by dlevel »

Made a change on the QuestJournal that chatgpr proposed, this is the new method that seems to work, lmk if its enough or you have another solution:

Code: Select all

protected virtual void VerifyTrueNodeChildrenAreActive()
{
    // Create a copy of the quest list to iterate over safely
    var questListCopy = new List<Quest>(questList);

    foreach (var quest in questListCopy)
    {
        // Only process active quests
        if (quest.GetState() != QuestState.Active) continue;

        var processed = new HashSet<QuestNode>();
        foreach (var node in quest.nodeList)
        {
            if (processed.Contains(node)) continue;
            processed.Add(node);

            // Check for True nodes
            if (node.GetState() == QuestNodeState.True)
            {
                foreach (var child in node.childList)
                {
                    // Activate inactive children
                    if (child.GetState() == QuestNodeState.Inactive)
                    {
                        child.SetState(QuestNodeState.Active);
                    }
                }
            }
        }
    }
}
User avatar
Tony Li
Posts: 22110
Joined: Thu Jul 18, 2013 1:27 pm

Re: ORK integration

Post by Tony Li »

There's some code in there that you probably don't need, but if it works I say leave it be.
Post Reply