playMaker

Author Topic: State corrupted after deleting a variable in a custom action  (Read 3508 times)

fbeyrouti

  • Playmaker Newbie
  • *
  • Posts: 9
State corrupted after deleting a variable in a custom action
« on: September 19, 2013, 02:33:03 PM »
Hello,

I have a custom action in which I no longer used one of its public variables. However, since I deleted the variable I am having trouble with many (not all) of the states containing the action. Most importantly, it seems that values set on other variables in the action are changing/getting lost.

Please help.

Thanks,

fbeyrouti

  • Playmaker Newbie
  • *
  • Posts: 9
Re: State corrupted after deleting a variable in a custom action
« Reply #1 on: September 19, 2013, 02:36:10 PM »
To avoid confusion, what I meant is deleting a public member variable in the action itself and not an FSM variable.

pjrm1470

  • Playmaker Newbie
  • *
  • Posts: 13
Re: State corrupted after deleting a variable in a custom action
« Reply #2 on: September 19, 2013, 02:56:12 PM »
Have you tried to recreate the variable? or replace the slot which use the "deleted variable" to a new variable!?
can you show us Print Screen?

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 4145
  • Official Playmaker Support
    • LinkedIn
Re: State corrupted after deleting a variable in a custom action
« Reply #3 on: September 19, 2013, 03:07:24 PM »
Is this in a standalone build or in the editor? FSMs that were saved with the old version of the action will need to be re-saved in the editor before you make a standalone build.

The editor tries to preserve unchanged parameters when you edit an action, but maybe it's getting confused in this case...?

Can you send me the custom action before and after editing?

fbeyrouti

  • Playmaker Newbie
  • *
  • Posts: 9
Re: State corrupted after deleting a variable in a custom action
« Reply #4 on: September 19, 2013, 03:16:44 PM »
Alex, it is all in the editor. I did not work in standalone.

So Here is a snapshot of before and after, in the action code

and in the playmaker editor.

Alex let me know if you need more.

Thanks,

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 4145
  • Official Playmaker Support
    • LinkedIn
Re: State corrupted after deleting a variable in a custom action
« Reply #5 on: September 19, 2013, 04:13:08 PM »
Is Spawner derived from BaseSpawner?

I'll need to look into the code, but it's possible that it's getting confused in this case about what old data to keep in the refactored action.

If you have the project saved before the refactor (or in version control), you could try a workaround:

Instead of removing the parameter, replace it with a parameter of a different type (e.g., bool tempBool). Load/Save FSMs that use the action. Then remove the replaced parameter.

Or it might be easier to just re-fill the SpawnList...

I'll let you know what I find in the refactoring code...

fbeyrouti

  • Playmaker Newbie
  • *
  • Posts: 9
Re: State corrupted after deleting a variable in a custom action
« Reply #6 on: September 19, 2013, 04:56:24 PM »
No Spawner is a completely different MonoBehaviour.

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 4145
  • Official Playmaker Support
    • LinkedIn
Re: State corrupted after deleting a variable in a custom action
« Reply #7 on: September 19, 2013, 05:00:35 PM »
Hmmm, it might still be confused about the arrays. Haven't had a chance to look at that code yet...

If it is a problem in the refactoring code I'll fix it for the next update, but that doesn't help you right now! So you might want to try the workaround above...

fbeyrouti

  • Playmaker Newbie
  • *
  • Posts: 9
Re: State corrupted after deleting a variable in a custom action
« Reply #8 on: September 19, 2013, 05:03:07 PM »
OK, I will tomorrow. In the meantime, I'll see what I can do to send you the action.

Thanks,