Reply To: Using Node Canvas as a state machine

Forums 💬 NodeCanvas 🗨️ General Discussion Using Node Canvas as a state machine Reply To: Using Node Canvas as a state machine

#14665
Gavalakis
Keymaster

    Hello,

    The way I see it, you are mostly after a data container from where to get the various variables changed within the progress of the novel. The only way I see visualizing this with an FSM, would be to create a state for each “page”/cutscene and then based on some conditions applied to the transitions, proceed to the next page and set some variables for you to get and check later on.
    If you need these check questions for changing the flow and thus playing a different cutscene, then these conditions can as well be your “questions”.

    Personaly suggetion is, that if you aren’t going to use an FSM for its functionality, then you may probably be best with creating a simply variable container (probably what you do now?). But you could leverage the FSM functionality so that each state executes the coresponding cutscene, then when that is done based on some conditions continue to the next page/cutscene, like for example in the screenshot.

    Of course these variables checked have to be set somehow as well, so that the FSM can read them and react accordingly.
    Most probably you are going to do this manualy through the GUI shown to the player when he has to choose something.
    Setting such a variable is simple as calling SetDataValue(“ChosePoliceStation”, true);

    Again, Im not exactly sure what you are after and maybe Im completely off 🙂

    Let me know if you have any questions.
    Cheers!