Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: ratamorph on July 31, 2013, 05:29:09 PM

Title: Hide/Show FSMVariables in custom action[SOLVED]
Post by: ratamorph on July 31, 2013, 05:29:09 PM
I want to create a custom action that receives either an FSMString or an FSMInt depending on an type defined by an enumeration (string type or numeric type).

I know how to do this much, but I want to hide the FSMString field when I set the type to numeric and vice versa.

I asume this is done using custom action editors, but it's not very clear to me how. I know how to create custom inspectors for my unity scripts, from what I've read it's similar to how Playmaker custom editors work. The issue is that I want to use FSMString and FSMInt so I can assign Playmaker variables to them and these types have their own editors.

Anyone knows how to do this?
Title: Re: Hide/Show FSMVariables in custom action
Post by: jeanfabre on August 02, 2013, 03:58:13 AM
Hi,

Are you using FsmVariable? I think this could be your way out.

Bye,

 Jean
Title: Re: Hide/Show FSMVariables in custom action
Post by: ratamorph on August 02, 2013, 04:03:36 PM
Not sure if that's what I need, I looked into it and as far as I can tell FsmVariable is a generic variable that I can represent the other Fsm variable types.

I might not be understanding how that's supposed to work, but what I want is the action UI to change based on a choice I make on the action. The GetProperty and SetProperty actions do exactly this, sadly I can't find source code for those actions so I can see how it's done.
Title: Re: Hide/Show FSMVariables in custom action
Post by: ratamorph on August 02, 2013, 08:01:12 PM
I guess all I need to know is how to draw the FsmVariable inspector inside my custom action UI.

Anyone know how to do this?
Title: Re: Hide/Show FSMVariables in custom action
Post by: jeanfabre on August 05, 2013, 04:13:19 AM
Hi,

Have you studied my XmlMaker asset? it has some pretty advanced action editor and custom UI, this should give you a good headstart.

 In your case, you may simply in the end have regular Fsm variable public vars that you simply hide show in your custom editor by not displaying the one that do not fit the current context.

for example: use EditField("MyField") in your custom action editor, and simply have "MyField" be the right variable name for the current context. So let's say you have "MyString" and "MyFloat" as public fsms ( FsmString and FsmFloat), you either do EditField("MyString") OR EditField("MyFloat"), and it will only show that one.

Does that make sense?

bye,

 Jean
Title: Re: Hide/Show FSMVariables in custom action
Post by: ratamorph on August 05, 2013, 11:19:36 AM
This worked like a charm. Thanks a bunch!
Title: Re: Hide/Show FSMVariables in custom action[SOLVED]
Post by: dt1000 on November 01, 2017, 09:36:02 PM
Hi there! I would like to do the same thing - where do I find this "XMLMaker"?
Cheers,
Dan
Title: Re: Hide/Show FSMVariables in custom action[SOLVED]
Post by: jeanfabre on November 02, 2017, 02:29:21 AM
Hi,

 it's on the ecosystem, search for DataMaker or xmlmaker ( just added the keyword)

 Bye,

 Jean