playMaker

Author Topic: Changing Action Parameter Namespaces  (Read 2357 times)

LoftyTheMetroid

  • Playmaker Newbie
  • *
  • Posts: 11
Changing Action Parameter Namespaces
« on: August 07, 2015, 02:30:27 PM »
We've been using namespaces in our current project and recently decided we'd like to change the name of one of them. Unity MonoBehaviours seem to have no problem with changing namespaces and retain all of their parameters and data.

However, the public variables in my custom PlayMaker Actions seem to have trouble with their namespace being changed. I'm getting an error similar to the following: "Action has changed since FSM was saved. Could not recover parameters. Parameters reset to default values."

Is there a way to fix this? If not, I'll want to rethink how I use PlayMaker with namespaced code in the future. It'd be disappointing if PlayMaker was inflexible in this regard, considering how much we use it...

LoftyTheMetroid

  • Playmaker Newbie
  • *
  • Posts: 11
Re: Changing Action Parameter Namespaces
« Reply #1 on: August 12, 2015, 11:19:54 AM »
Thought I'd give this one last bump before I let it die.

To summarize: How can I change the namespace of a class in Unity without PlayMaker losing references/data associated with parameters of that class type?

Again, I can do this with MonoBehaviour components without issue, it's only PlayMaker that I'm having this problem with.

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 4000
  • Official Playmaker Support
    • LinkedIn
Re: Changing Action Parameter Namespaces
« Reply #2 on: August 12, 2015, 04:31:13 PM »
Unfortunately this is not supported yet.

I'd like to add support for this in the 1.8.x cycle.

In the meantime, you could hack the FSM data format to change the parameter type name. The type names are stored as strings in FsmState.ActionData.CustomTypeNames. The classes are protected, so you would have to use reflection in a custom tool. It might be tricky!

Or if you're interested in joining the beta group, I could work on a build with you to test adding this feature. You would have to upgrade your project to 1.8.0. PM me if you want to do this.

LoftyTheMetroid

  • Playmaker Newbie
  • *
  • Posts: 11
Re: Changing Action Parameter Namespaces
« Reply #3 on: August 12, 2015, 10:06:49 PM »
Cool! Just glad to know it's on the horizon. Thanks for the reply!

I think for now I might just look into the reflection hack you mentioned. Time to fire up ILSpy!