Tracking kills without implementing the "Improved Conditions"

So just that I get it right. I set up a quest normaly with a Reference and a Description. Then you get this quest by the quest giver via the dialogue

kill the arcvhers

And then I am having the Quest Completion By Predicates script. Is it hooked up correctly? Or does the Objective in the bottom (Kill the Archers) have to match with the Reference (1) from the quest?

I’m not sure. My own implementation is very different from the course. I looked at the github and it looks like it should be the reference

public bool IsComplete()
{
    foreach (var objective in quest.GetObjectives())
    {
        if (!completedObjectives.Contains(objective.reference)) // <- looks at the reference
        {
            return false;
        }
    }
    return true;
}

Okai, so I think I got it! The Reference from the quest and the objective in the Quest Completion By Predicates need to have the same name! Is it right, that after killing the Archers, that the quest is completed imideatly?

Well, that depends on your quest definition. The QuestCompletionByPredicates will complete any objectives that are completed, so if killing 3 archers is the only objective, then the quest will complete. If there are other objectives that are not completed, then the quest will not be completed. If you want the quest to rather be completed by dialog, you won’t use QuestCompletionByPredicates, but do the normal thing from the course.

Yes, that exactly sums it up! It is working smoothly now and I am so thankfull that you put the time and effort into this, to help me out. Really appreciate it. I figured out, that those RPG course was a number to big for me and I still have to learn a lot about basic C# coding. So when I finish the game this week, its going back to study haha :slight_smile: Thank you so much for your help!

Wow, good job working through this, guys! I considered stepping in earlier, but I think my input in this case might have muddied up the water.

This is the coding experience in a nutshell. Tackling a specific problem, and often adapting code others have written to suit your specific needs. Often, as you solve one issue, the “problem” moves to another issue, causing a cascade of refactors.

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms