playMaker

Author Topic: Dynamically create FSM with script  (Read 1123 times)

playtide

  • Playmaker Newbie
  • *
  • Posts: 2
Dynamically create FSM with script
« on: December 27, 2022, 12:16:01 AM »
Is it possible to dynamically create FSM with c# script.

I see there is a API, however that only allows access to FSM's that have been made in the editor. (Correct me if I'm wrong but this is what is seems).

I'm not sure if there is any other way, I looked around the documentation but couldn't find one.

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7618
    • jinxtergames
Re: Dynamically create FSM with script
« Reply #1 on: December 27, 2022, 12:51:12 AM »
Hi.
You can make custom action, but I don't think its possible to do dynamically @runtime (it might work in editor)
I think it will follow the same rules as standard C# scripts

playtide

  • Playmaker Newbie
  • *
  • Posts: 2
Re: Dynamically create FSM with script
« Reply #2 on: December 27, 2022, 04:16:52 AM »
Quote from: djaydino link=topic=25391.msg109192#msg109192
I think it will follow the same rules as standard C# scripts

Can you please, elaborate on the quoted statement, I'm not quite sure I follow it.

Does the API have any way of creating FSM's dynamically.
« Last Edit: December 27, 2022, 06:39:12 AM by playtide »

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7618
    • jinxtergames
Re: Dynamically create FSM with script
« Reply #3 on: December 28, 2022, 12:07:22 AM »
Hi.
I might have misunderstood.

Theoretically you should be able to create a FSM (Add Component) from an "Editor" script (not during runtime) and setup actions and connections but I know some have tried and failed to do so due to the complexity.

Maybe you can make templates and add those the the fsm, which would simplify a lot as you do not need to create states/action/connects.

if i still misunderstood please give more details on what you want to do.