Forums › 💬 NodeCanvas › ⚙️ Support › Problem with upgrade to 3.2.5
Hi, I’ve been very happily using NodeCanvas in my current project but for our next feature I’d also like to add FlowCanvas to the project too. I’ve run into an issue. The latest FlowCanvas (3.2.5) causes a compiler error if I bring it into the project with our older version of NodeCanvas (we’re using 3.2.1).
So I tried to bring our NodeCanvas up to date (3.2.1 -> 3.2.5) but when I do that it breaks at least one of our NodeCanvas graphs. What happens is that some of the condition tasks cause the FSM to appear to be in no state at all (i.e. no highlighted state when the game is running). There are no errors in the console when this happens – the FSM just seems to get stuck and not move into any other state.
Please let me know if there’s anything I can try or any info I can give you that might help.
Edit – More info: It looks like what’s happening is the last nodes (i.e. empty transition list) are still exiting and effectively stopping the whole graph. The previous behaviour was for the last node to stay current – i.e. the last node stays as the current one (as in attached image).
Thanks,
Dan
Hello Dan,
Hmm. The FSM was always designed to work like that, meaning that the FSM stops when a state with no transitions is Finished, unless there is any other node active like an Any State or an On FSM Update (are you using any of those in your FSM please?). If it did stop in 3.2.1 it should be a bug honestly.
With that said, if you want to disable that behaviour, you can delete lines #112-115 in FSM.cs code, but please note that this change will affect how Sub-FSMs work if you use any. This is something I was also considering adding as an option of the FSM in the FSMOwner inspector.
Let me know.
Thank you.
Ok that makes sense. Perhaps I could make my own action state especially for my menu system that has the behaviour of not exiting if there’s no condition tasks?
Edit: Answering your question about Any state or on update – not using either in the problem graph. There are 2 parallel states though that listen for specific events and use TriggerState to force a particular state. One event implements ‘menu back’ and the other allows the state to jump directly to ‘Menus hidden’ when they’re no longer needed on screen.
Hello again,
I think creating a custom fsm state for this would be much of a hassle (and you will need to redesign the FSM … ).
Here are some solutions (apart from changing the code or having an option in FSMOwner):
1 2 3 4 5 6 7 8 9 10 11 12 |
using NodeCanvas.Framework; namespace NodeCanvas.StateMachines { public class KeepFSMAlive : FSMNode, IUpdatable { public override void OnGraphStarted() { status = Status.Running; } public void Update() { } } } |
Let me know.
Thanks.
Thank you very much. These all sound like good solutions. I will try these once I circle back to the NodeCanvas upgrade and let you know.
Edit: Just reporting back. Making it so that the GotoScreen option never ends has solved the issue. Now fully upgraded and can look into having FlowCanvas too now – Thanks!
Thank you for the update! 🙂