FSM implementation

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By muchacho


i’m trying to implement a fsm for my already started project (that has horrible spaghetti code). I made a diagram so you could see what i’m trying to do but i do have some trouble with a few things.
enter image description here

ok so as it’s said in the diagram, transition only occurs when a certain condition is met (i’ll put it at the top of the do function) and not really to event. I guess i should use signals but i don’t know if i should mix both conditions and signals or switch fully to signals. Also about signals, i have a hard time trying to visualize how it would go at runtime and i don’t know if it’s a really good idea to hook my states to a bunch of signals and then let some code execute (and the states would have to have a ref. to the fsm node that’d make a lot ref. inside a lot of nodes) and most importantly i don’t know if it would fit with the current diagram even though i know it should be the logic to adopt (events that triggers transitions).
Ok that’s it if you have any suggestion or help to offer…

comment to get notified about this question since I am interested in the same thing.

nooberdev | 2018-08-29 14:09