playMaker

Author Topic: Updating enum script messes up set enum value in FSM [SOLVED]  (Read 1692 times)

Fat Pug Studio

  • Beta Group
  • Hero Member
  • *
  • Posts: 1294
    • Fat Pug Studio
Updating enum script messes up set enum value in FSM [SOLVED]
« 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.
« Last Edit: November 15, 2019, 10:38:48 AM by krmko »
Available for Playmaker work

Thore

  • Sr. Member
  • ****
  • Posts: 480
Re: Updating enum script messes up set enum value in FSM
« Reply #1 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

Fat Pug Studio

  • Beta Group
  • Hero Member
  • *
  • Posts: 1294
    • Fat Pug Studio
Re: Updating enum script messes up set enum value in FSM
« Reply #2 on: November 15, 2019, 10:38:26 AM »
Ah, great, thanks! Marking this as solved.
Available for Playmaker work