Playmaker Forum
PlayMaker Feedback => Action Requests => Topic started by: craigz on February 12, 2018, 10:10:19 AM
-
Wasn't sure if there currently was a way to do this or not...
I'm looking for a way to save current enum values, and best I can find to do is save the index/int for the enum. But then I realized there's no way to actually SET an enum by any value other than an enum.
Could have an int-switch tied to set-enum but that seems like a bit of a workaround. *shrugs* just wasn't sure if there was a better way?
best,
craigz
-
Hi,
Good point. Made an action for this on the Ecosystem. Search for "ConvertIntToEnum"
(https://i.imgur.com/dSQIGt2.png)
bye,
Jean
-
Hi,
and the second one: ConvertStringToEnum
(https://i.imgur.com/G35sI3R.png)
Bye,
Jean
-
BOOM!
As usual Jean, thank you!
You rock :D
-craigz
-
So a follow up question, that I feel you might have answered else, couldnt remember if it was a Unity limitation or not.
But would some sort of a 'FSM Enum Switch' or 'FSM Enum Test' action be possible? (similar to how the FSM Bool Test action tests the bool on another without having to have a local data variable made on the object thats doing the testing)
I find myself needing to test if the enum on other game objects is a certain one. And things have been getting cluttered from making duplicate variables on the manager type gameobject just for the purpose of doing 'Get FSM Enum' then followed by 'Enum Switch' etc :)
-craigz
-
Hi,
yes, I'll see if I can work on this action, it should feasible. Can you bump me mis next week if I haven't delivered?
Bye,
Jean
-
Excellent! :D Thanks Jean! Will do :)
-craigz
-
Just an almost mid-week bump ;D
-
thanks :)
on it!
Bye,
Jean
-
Hi,
ok, done, it's called 'FsmEnumSwitch'
the only bad thing is that you have to manually define the enum type for all your case as there is no mechanism built action to match the type this way.
Let me know how it works for you.
Bye,
Jean
-
You rock Jean! :D
This is working perfect! No worries about having to manual set them, still saves a ton of time :D
Thanks for cranking this out, it means a lot to me! :)
-craigz