Page 1 of 1

Increase time according to spawn entities.

Posted: Fri Jul 19, 2024 6:03 am
by cyber
can somebody help me please. Here is my issue. When the player accept the quest, 3 object spawn somewhere in map. I calculate the distance between (player to spawn 1 + spawn1 to spawn2 + spawn2 to spawn 3 + spwan3 to player). Now I want to set this distance as a timer for this quest.

Re: Increase time according to spawn entities.

Posted: Fri Jul 19, 2024 12:08 pm
by Tony Li
Hi,

You can make a subclass of TimerQuestCondition. You could override the StartChecking() method to determine a time based on the distance. Then set the counter value to that time. Rough example:

Code: Select all

public class DistanceTimerQuestCondition : TimerQuestCondition
{
    public override void StartChecking(System.Action trueAction)
    {
        base.StartChecking(trueAction);
        m_counter.currentValue = ComputeTimeBasedOnDistance();
    }
}
Then use this custom condition instead of the base TimerQuestCondition in your quest.