Reply To: Save state and the current active node in State Machine

NodeCanvas Forums Support Save state and the current active node in State Machine Reply To: Save state and the current active node in State Machine

#11761
adib
Participant

Whoops this is also happened to me. Imagine this scenario, i have a node named “add money” that responsible for adding money to the player, the next node won’t be trigger for a while so the currentStateName is “add money”. Before the next node triggered, the player exit the game, and the game manager save currentStateName (which is “add money”). When player load the game, the game manager will load the last node using ‘FSMOwner.TriggerState(‘add money)’. This where the problem arise, the FSM will trigger the “add money” node, and the player will get another money. Is there any way to set the FSM state without trigger it?

Exactly what we do, too ? But we found lots of problems with a more generic approach because we have more complex conditions and actions that store state and we can’t reliably just enter any state without running into race conditions. Ideally each action and condition would support storing its state (like timeouts etc.) or store state directly in the blackboard so we could restore the exact FSM execution state. If you make any progress there I really like to hear about it!