RequestObjectiveCompletion returns false
Check ObjectiveId, Linked status, and whether that record is active rather than merely present.
Scripting
Implement, link, test, repeat, and reset a project-specific detector derived from the real Objective base class.
This tutorial builds a relic detector that completes the active Objective after three pickup notifications. A Chapter may contain many Ordered Objectives, but it activates only the next eligible record. Your subclass detects game-specific evidence; Chapter still decides whether identity, state, and sequence position allow advancement.
The real public type is OverFuture.ChapterObjectiveSystem.Objectives.Objective. Its protected RequestObjectiveCompletion() returns true only when the Chapter accepts the request.
using OverFuture.ChapterObjectiveSystem.Objectives; and derive from Objective.requiredRelics field and a private transient counter.IsCompleted, increment the counter, and call RequestObjectiveCompletion() at the threshold.ResetObjective(), call base.ResetObjective() first, then clear the counter.CollectRelicObjective to the generated Objective XX container.NotifyRelicCollected(). The third accepted notification completes the active record.false and must not repeat On Completed.ResetObjective() from a test, or use progression reset that resets physical components. Confirm that the counter returns to zero.You do not need a CustomEditor to receive Objective Link, Completion, and common diagnostics. The supported fallback Editor applies to Objective subclasses and then draws their own serialized fields. Create a CustomEditor only for specialized controls; if you do, preserve the link surface and do not embed another Editor's Inspector inside it.
If an external system cannot derive from Objective, do not create a second progression hierarchy. Resolve ChapterManager.Instance, require HasActiveObjective, and call CurrentChapter.TryCompleteObjective(CurrentObjectiveId). This path fits dialogue, inventory, and middleware callbacks.
The call returns false when no Objective is active, the Chapter does not match, or a prior call was already accepted. See the compiled example under Complete and Control Progression.
Check ObjectiveId, Linked status, and whether that record is active rather than merely present.
The subclass did not override ResetObjective(), or omitted the base call.
Do not emit side effects before knowing the result. Run consequences only when RequestObjectiveCompletion() returns true.
using System;
using System.Collections;
using System.Collections.Generic;
using OverFuture.ChapterObjectiveSystem.Chapters;
using OverFuture.ChapterObjectiveSystem.Events;
using OverFuture.ChapterObjectiveSystem.Objectives;
using OverFuture.ChapterObjectiveSystem.Persistence;
using OverFuture.ChapterObjectiveSystem.Progression;
using UnityEngine;
public sealed class CollectRelicObjective : Objective
{
[SerializeField, Min(1)]
private int requiredRelics = 3;
private int collectedRelics;
public bool NotifyRelicCollected()
{
if (IsCompleted)
{
return false;
}
collectedRelics++;
return collectedRelics >= Mathf.Max(1, requiredRelics) &&
RequestObjectiveCompletion();
}
public override void ResetObjective()
{
base.ResetObjective();
collectedRelics = 0;
}
}