Playmaker Forum

Bug Reporting => PlayMaker Bug Reporting => Topic started by: Fat Pug Studio on November 15, 2019, 06:39:19 AM

Title: Updating enum script messes up set enum value in FSM [SOLVED]
Post by: Fat Pug Studio on November 15, 2019, 06:39:19 AM
I have a script in which i hold some enum values, but when i add some new ones, Enum Value field in the action gets messed up (another value is shown) so have to redo it every time i add some new enums to the script.
Title: Re: Updating enum script messes up set enum value in FSM
Post by: Thore on November 15, 2019, 07:02:00 AM
That’s likely not a bug. Enums are translated into integers behind the scenes, where the values are just counted up. To prevent problems with reordering, you need to set the value yourself, like so:

Code: [Select]
Monday = 0,
Tuesday = 1,

Seems you missed my post just below yours:
https://hutonggames.com/playmakerforum/index.php?topic=14158.msg73633#msg73633
Title: Re: Updating enum script messes up set enum value in FSM
Post by: Fat Pug Studio on November 15, 2019, 10:38:26 AM
Ah, great, thanks! Marking this as solved.