Quest Conditions related to how many enemys have been defeated

how could i go about making a condition that sets and updates how many enemys have been defeated and complete it once it reaches that certain ammount? i was thinking it has something to do with onDie and when that gets called or the enemy dies/ plays an animation is updates the quest?

As it happens, I’ve done a bit of work on this idea.
https://community.gamedev.tv/t/tracking-kills-for-quests/194127/36

1 Like

i noticed this EPredicate and your passing IPreducateEvaluator as teh predicate string where should the Epredicate and has killed be located

    public bool? Evaluate(string predicate, string[] parameters)
    {
        if (predicate == EPredicate.HasKilled)
        {
            if (int.TryParse(parameters[1], out int intParameter))
            {
                RegisterCounter(parameters[0]);
                return counts[parameters[0]] >= intParameter;
            }
            return false;
        }
        return null;
    }

LOL, mixed things up there, didn’t I?
I also have a section on converting the entire condition system into something a bit more robust that uses an Enum for the Predicate… If you’re using the EPredicate enum, change the header to EPredicate predicate, string parameters) otherwise, simply change the if statement to “HasKilled”

Privacy & Terms