Saving Action Trigger

I tried to implement a save to my dialogue actions, but I cant’. The trigger variable always return 0, since after capture state. Have a better way to solve this? Even without the lazzy value, the triggered variable continues to start as 0.

So it looks like you’re trying to ensure that a DialogueTrigger will only fire once.

Everything looks right on this, though I’m curious as to why this is an int instead of a bool value.

First thing is to make sure everything is wired correctly. Let’s add a couple debugs to see what’s going on.

public object CaptureState()
    Debug.Log($"{} DialogueTrigger {action} Capturing triggered = {triggered.value}");
    return triggered.value;
public void RestoreState(object state)
    triggered.value = (int)state;
    Debug.Log($"{} DialogueTrigger {action} Restoring triggered = {triggered.value}");
1 Like

The conditions handle this for me. I dont want save more the dialogue trigger. Thanks Brian.

Privacy & Terms