playMaker

Author Topic: Hide/Show FSMVariables in custom action[SOLVED]  (Read 1771 times)

ratamorph

  • Playmaker Newbie
  • *
  • Posts: 16
    • View Profile
Hide/Show FSMVariables in custom action[SOLVED]
« on: July 31, 2013, 02: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?
« Last Edit: August 06, 2013, 12:31:44 AM by jeanfabre »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 12342
  • Official Playmaker Support
    • View Profile
Re: Hide/Show FSMVariables in custom action
« Reply #1 on: August 02, 2013, 12:58:13 AM »
Hi,

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

Bye,

 Jean

ratamorph

  • Playmaker Newbie
  • *
  • Posts: 16
    • View Profile
Re: Hide/Show FSMVariables in custom action
« Reply #2 on: August 02, 2013, 01: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.

ratamorph

  • Playmaker Newbie
  • *
  • Posts: 16
    • View Profile
Re: Hide/Show FSMVariables in custom action
« Reply #3 on: August 02, 2013, 05: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?

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 12342
  • Official Playmaker Support
    • View Profile
Re: Hide/Show FSMVariables in custom action
« Reply #4 on: August 05, 2013, 01: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

ratamorph

  • Playmaker Newbie
  • *
  • Posts: 16
    • View Profile
Re: Hide/Show FSMVariables in custom action
« Reply #5 on: August 05, 2013, 08:19:36 AM »
This worked like a charm. Thanks a bunch!

dt1000

  • Playmaker Newbie
  • *
  • Posts: 18
    • View Profile
Re: Hide/Show FSMVariables in custom action[SOLVED]
« Reply #6 on: November 01, 2017, 06:36:02 PM »
Hi there! I would like to do the same thing - where do I find this "XMLMaker"?
Cheers,
Dan

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 12342
  • Official Playmaker Support
    • View Profile
Re: Hide/Show FSMVariables in custom action[SOLVED]
« Reply #7 on: November 01, 2017, 11:29:21 PM »
Hi,

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

 Bye,

 Jean