Forum rules - please read before posting.

An objective "Started" state type becomes "completed" for no reason.

Hi, I realized one of my objective Started state has the state type marked as Complete after several runs. I have no idea why and I don't know what I can do to solve it. I tried to make another objective but that objective also has the same problem after several runs.

I am using AC 1.72.4 and Unity 2019.4.6f1. Thanks.

Comments

  • By "runs", do you mean entering/exiting Play mode within the Editor?

    Best way is to attach a tempoarary custom script to your PersistentEngine that prints a message in the Console whenever an Objective is set to Complete:

    using UnityEngine;
    using AC;
    
    public class ObjectiveUpdateRecorder : MonoBehaviour
    {
    
        private void OnEnable () { EventManager.OnObjectiveUpdate += OnObjectiveUpdate; }
        private void OnDisable () { EventManager.OnObjectiveUpdate += OnObjectiveUpdate; }
    
        private void OnObjectiveUpdate (Objective objective, ObjectiveState state)
        {
            if (state.stateType == ObjectiveStateType.Complete) Debug.Log ("Objective " + objective.ID + " set to Complete");
        }
    
    }
    

    When the message appears, copy/paste the full message that appears (stacktrace included), and I'll try to see what's causing it.

  • edited January 2023

    I found my mistake:
    I was suppose to set the objective state by KickStarter.runtimeObjectives.SetObjectiveState(21,1);

    but I wrongly used
    KickStarter.runtimeObjectives.GetObjective(21).CurrentState.stateType == ObjectiveStateType.Complete

    instead. So the Started state status become Completed.

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.