Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: Krileon on February 16, 2014, 11:01:39 AM

Title: FsmProperty limitations, workaround?
Post by: Krileon on February 16, 2014, 11:01:39 AM
FsmProperty only displays the properties that PM can store as FSM variables. My issue is I don't want to store it as an FSM variable. I have a playmaker action for my JSON.Net implementation that takes property and encodes it. All I want to do is send that property to the FSM. I don't actually want to store it as an FSM variable (I'll store the JSON string output by the FSM).

How can I have a property dropdown that shows all of a components properties regardless if PM can store them or not? Can I implement my own type like FsmProperty that'd handle this? If so can you provide an example? I decompiled the FsmProperty, but am unsure if copy/paste/modify into a new script will even work.

Edit: Ok, copy/paste/modify of FsmProperty doesn't work for sure. So I guess that's not an option unfortunately.
Title: Re: FsmProperty limitations, workaround?
Post by: Krileon on February 16, 2014, 06:26:07 PM
Ok, I just used an FsmString and grabbed the property from the object based off the string. It's not as elegant as a nice dropdown, but it'll work.
Title: Re: FsmProperty limitations, workaround?
Post by: jeanfabre on February 17, 2014, 10:27:37 AM
json... uhm :)

working on some json actions as well, curious to see how to are tackling this :) is it going to be available sometime?

bye,

 Jean
Title: Re: FsmProperty limitations, workaround?
Post by: Krileon on February 18, 2014, 08:47:35 AM
I'm using JSON .Net asset from the asset store as it provides the best implementation compared to JSON .Net free DLL. It works perfectly fine and I'm already working on custom converters to handle data properly (my PM action can filter to or exclude object properties as well). So far I've JSON for an object property (good for array object properties or just to JSON a single property) and I'll be working on others to encode entire components, etc..

No, I had no plans to release it. I don't have time, or even the desire, to provide support so if I released it there's a bit of obligation to do so. It also uses a custom converter I wrote so that'd need to be released too.

There's also a current bug with it handling Texture2D properties that I'm working on resolving (it should encode it to name property, but fails).

I also plan to extend this to handle arrays of data, because I hate having to use a proxy for array maker. If I encode/decode on the fly it should be pretty reasonable to have arrays of data. Obviously I can't encode everything, but it should work for most cases (like inventory data, etc..).
Title: Re: FsmProperty limitations, workaround?
Post by: jeanfabre on February 18, 2014, 11:48:55 PM
Hi,

 It's up to you really, some assets on the wiki are not really supported neither. It's just for others to get inspired. But no worries, members willing to use json most likely can create everything they need to implement it in PlayMaker anyway.


Bye,

 Jean