Page 27 of 27

Re: ORK integration

Posted: Sun Nov 24, 2024 12:25 am
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);
                    }
                }
            }
        }
    }
}

Re: ORK integration

Posted: Sun Nov 24, 2024 5:04 am
by Tony Li
There's some code in there that you probably don't need, but if it works I say leave it be.