playMaker

Author Topic: How to setup/use/expose a enum as named Fsm variable?  (Read 6178 times)

Andy22

  • Junior Playmaker
  • **
  • Posts: 99
How to setup/use/expose a enum as named Fsm variable?
« 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

Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2511
  • Mender of the past
    • Cleverous
Re: How to setup/use/expose a enum as named Fsm variable?
« Reply #1 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.
Products by Cleverous
|| Vault Core : Database
|| Vault Inventory : Multiplayer Inventory
|| Vault Attributes : Character Stats
|| That Hurt! : Dmg Floaties
|| Quinn : 3D

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: How to setup/use/expose a enum as named Fsm variable?
« Reply #2 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

Andy22

  • Junior Playmaker
  • **
  • Posts: 99
Re: How to setup/use/expose a enum as named Fsm variable?
« Reply #3 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

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: How to setup/use/expose a enum as named Fsm variable?
« Reply #4 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

4ppleseed

  • Full Member
  • ***
  • Posts: 226
Re: How to setup/use/expose a enum as named Fsm variable?
« Reply #5 on: November 14, 2013, 07:35:12 AM »
+1 for ENUM support in Playmaker please  8)

vidjogamer

  • Playmaker Newbie
  • *
  • Posts: 10
Re: How to setup/use/expose a enum as named Fsm variable?
« Reply #6 on: January 09, 2014, 11:50:04 PM »
+1 for FsmEnum

haregi

  • Playmaker Newbie
  • *
  • Posts: 1
Re: How to setup/use/expose a enum as named Fsm variable?
« Reply #7 on: February 06, 2014, 05:46:24 AM »
+1 for FsmEnum too!  :P

playb0t

  • Playmaker Newbie
  • *
  • Posts: 5
Re: How to setup/use/expose a enum as named Fsm variable?
« Reply #8 on: March 06, 2014, 06:39:28 PM »
Please, we really need this!

Marsh

  • Full Member
  • ***
  • Posts: 227
  • Comfort the disturbed, disturb the comfortable

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 4002
  • Official Playmaker Support
    • LinkedIn
Re: How to setup/use/expose a enum as named Fsm variable?
« Reply #10 on: March 07, 2014, 12:59:41 AM »
I'll try to get this into the next update...

xunxun

  • Junior Playmaker
  • **
  • Posts: 53
Re: How to setup/use/expose a enum as named Fsm variable?
« Reply #11 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...