How to – create and run a FSM at runtime

Forums 💬 NodeCanvas ⚙️ Support How to – create and run a FSM at runtime

  • This topic has 0 replies, 2 voices, and was last updated 6 years ago by Gavalakis.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #16345
    zsoik
    Participant

      We’re currently doing some experiments with procedurally generating game content, and we need to procedurally generate a FSM for quest logic as well. As the generation happens at runtime, we’re trying to create and then run the FSM in playmode. But we haven’t yet found a way to do it properly. Our current approach looks like this:

      But even though it looks like it should work, we’ve not managed to get the FSM to run. We always run into issues during initialization, like:

      What are we missing here? Do we need to construct the FSM in a different way?

      #16348
      Gavalakis
      Keymaster

        Hello again 🙂

        After looking into this for a bit, the initial source of the problem is the fact that serialization is no happening in playmode. Digging into this a bit more, I decided to remove this restriction for now unless I find any problems by doing so (which I haven’t yet).
        So, please open up Graph.cs and change line # 67 to be like this:

        (we basically remove the application playing check).

        Then for creating an fsm in runtime you can do something like this (which is similar to what you are already doing by the way 🙂 )

        Please let me know if the above work for you.
        Thanks!

        #16347
        zsoik
        Participant

          So far this works and hasn’t brought any new problems, thanks for the quick solution!

          #16346
          Gavalakis
          Keymaster

            Great. Thanks for letting me know!
            You are very welcome 🙂

          Viewing 4 posts - 1 through 4 (of 4 total)
          • You must be logged in to reply to this topic.