Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: Andy22 on November 13, 2013, 08:55:00 AM

Title: How to setup/use/expose a enum as named Fsm variable?
Post by: Andy22 on November 13, 2013, 08:55:00 AM
Hi,

Playmaker has no "FsmEnum" type, so whats the general method to expose/use a enum field for a custom action as a named fsm variable?

I also cant find/use my enum using the Object type, since a enum is not a "Unity.Object".

thx Andy
Title: Re: How to setup/use/expose a enum as named Fsm variable?
Post by: Lane on November 13, 2013, 12:59:57 PM
I'm not very code savvy so I don't have a direct answer, but check out the Vector3 Operator action, there is some enum stuff in there that you may be able to examine and deduce an answer from.
Title: Re: How to setup/use/expose a enum as named Fsm variable?
Post by: jeanfabre on November 14, 2013, 12:48:34 AM
Hi,

 Playmaker doesn't support enum this way unfortunatly.

 The way to go is to compose a string base list of enum with the real enum, if you build a custom editor, then you can build something around that, but simply saving your enum selection either by its index or string ( index is very dangerou if you plan on adding more enum items, so prefer string)

What is the enum look like? can you give a bit of context?

 Bye,

 Jean
Title: Re: How to setup/use/expose a enum as named Fsm variable?
Post by: Andy22 on November 14, 2013, 04:35:36 AM
Ah i see, maybe u can add enum support later on. We use those all over the place and like i noted in my other thread, its not practically to create customs editors per enum/action.

We use enums for our event system, so u don't guess what event string to send or make errors writing it. So u just use "EventType.EventXY.ToString()". This also solves the problem to understand what events are actually "supported/available", since u can select/see them from a enum. We also ensure the same event names are used over several event systems this way, so u can easily send events across different systems. Than ofc its much more flexible than hardcode event string names.

So as i noted we have a ToggleLinked action, that can "Toggle", "ToggleOn", "ToggleOff" Linked objects, if they support those events. So ofc we would like to give the level-designer the ability to select what event to send to those linked objects, so we would like to expose those enums to the inspector, so the level-designer can change the setup easily, without needing to know what state to change/look.
We also use the same system to setup EventMask's, which basically allow multiple events to-be set in one drop-down field or do multiple data selections.

thx Andy
Title: Re: How to setup/use/expose a enum as named Fsm variable?
Post by: jeanfabre on November 14, 2013, 05:50:38 AM
Hi,

 Yes, I hope this will become supported too. FsmEnum would be very handy for sure!

bye,

 Jean
Title: Re: How to setup/use/expose a enum as named Fsm variable?
Post by: 4ppleseed on November 14, 2013, 07:35:12 AM
+1 for ENUM support in Playmaker please  8)
Title: Re: How to setup/use/expose a enum as named Fsm variable?
Post by: vidjogamer on January 09, 2014, 11:50:04 PM
+1 for FsmEnum
Title: Re: How to setup/use/expose a enum as named Fsm variable?
Post by: haregi on February 06, 2014, 05:46:24 AM
+1 for FsmEnum too!  :P
Title: Re: How to setup/use/expose a enum as named Fsm variable?
Post by: playb0t on March 06, 2014, 06:39:28 PM
Please, we really need this!
Title: Re: How to setup/use/expose a enum as named Fsm variable?
Post by: Marsh on March 06, 2014, 07:38:37 PM
+1 for FsmEnum
Title: Re: How to setup/use/expose a enum as named Fsm variable?
Post by: Alex Chouls on March 07, 2014, 12:59:41 AM
I'll try to get this into the next update...
Title: Re: How to setup/use/expose a enum as named Fsm variable?
Post by: xunxun on May 13, 2014, 11:55:45 PM
+ 1 for FsmEnum. This is so handy!

I'll try to get this into the next update...