playMaker

Author Topic: Custom FsmTypes  (Read 2095 times)

Grofit

  • Junior Playmaker
  • **
  • Posts: 73
Custom FsmTypes
« on: March 24, 2014, 11:21:58 AM »
I thought this may have been asked before but cannot find an answer, so just wanted to ask it explicitly.

So I have a few custom types lets say FsmMyObject which I will want FSMs to store as a variable and be passed in as arguments.

So for example I want to be able to make a POCO which houses my type, lets call it FsmMyObject. Then I want to be able to use this type to create a variable of that type, then also create a custom action which takes an argument which is that type.

Currently it seems people just use FsmObject with the ObjectType attribute to infer the type then manually cast objects around but it seems a bit verbose. So is there some best practices around this?

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15620
  • Official Playmaker Support
Re: Custom FsmTypes
« Reply #1 on: March 27, 2014, 05:59:58 AM »
Hi,

 yep, that's the technic I would recommand too. The other technic ( as in the Parse PlayMaker port I did) is to cache everything using a string reference, so withint PlayMaker all your objects are just referenced by string with appropriate set of custom actions toi go with it).

 other then that, using FsmObjevt is a bit of work up front, but this, coupled with DFUI, I am currently achieving a very advanced MVC architecture with PlayMaker and it works very well indeed, DfGUI doesn't necessarly need to be used as the ui, I just use the property and event binding behaviors it features, incredible stuff and amayzing potential, even with playmaker.

Stay tune, because I have created a additional set of custom actions for DFGUI that address few missing features, and then you'll be able to see how I use FsmObjevt in very advanced situations ( binging at runtime, prefabs acting as MVC views, PlayMaker as the component, etc etc)

Bye,

 Jean