playMaker

Author Topic: Playmaker is changing the name of a global variable  (Read 36445 times)

dasbin

  • Junior Playmaker
  • **
  • Posts: 92
Playmaker is changing the name of a global variable
« on: May 09, 2013, 03:50:03 PM »
Really weird bug here.

Occasionally, after pressing play, Playmaker will actually change the name of a particular global variable (playerGO) to an incorrect one (hitObject). hitObject is the name of a local variable I use in one particular game object to store a collision. I can't see any particular relation between this variable and my playerGO.

Anyway, somehow this change persists after stopping, and most of my prefabs somehow update themselves to reference this new, incorrect variable name. However, some don't, and they reference null.

I've corrected its name in the global variables list a few times, but it keeps changing back on its own.

AtomicJoe

  • Playmaker Newbie
  • *
  • Posts: 10
Re: Playmaker is changing the name of a global variable
« Reply #1 on: June 04, 2013, 12:05:49 PM »
I'm having the same issue here with 2 GameObjects variables.
The weird thing is, I finally gave up and created new variables to change them, since they keept changing, but after changing all the old variable references in all the FSMs and deleting the old variables, I'm still having the same issue with the new ones!
This bug is really killing me since I have LOTS of FSMs that reference this two variables (as they are the pointer variables for player 1 and player 2) and every time this happens, some states change thi reference from one variable to the other, others don't and others even lose any reference at all.

This is happening only for global variables when your run the game, but keep changes after you stop!
What makes this a REAL problem is: it persists even if you close unity and reload the project without saving!

AtomicJoe

  • Playmaker Newbie
  • *
  • Posts: 10
Re: Playmaker is changing the name of a global variable
« Reply #2 on: June 05, 2013, 05:15:43 AM »
It seems to happen if you:

1- have the playmaker editor open and
2- press apply on a child of a prefab object with a playmaker component
3- press "run game" with the game view not maximized and the playmaker editor open at the same time.

If you press "apply" on the prefab root object instead of the child you just modified it seems to avoid the corruption (my root object doesn't have a playmaker component on it thought. This could be important.).
Also, running the game maximized seems to avoid this behaviour too, however, as it's not always happening in a consistent way, only time will tell.

Just be sure to make backups of the full project folder every day, just in case the playmaker components got corrupted...

dasbin

  • Junior Playmaker
  • **
  • Posts: 92
Re: Playmaker is changing the name of a global variable
« Reply #3 on: June 05, 2013, 11:53:54 AM »
Good sleuthing, I think you are right except for one thing. In my case, I am editing the root of the prefab and pushing Apply on the root - so it still happens there.

I suspect what makes it happen is having an FSM window open at all when you push Apply (as you said, your root object doesn't have an FSM so the editor window wouldn't be showing an FSM when you press apply on the root).

AtomicJoe

  • Playmaker Newbie
  • *
  • Posts: 10
Re: Playmaker is changing the name of a global variable
« Reply #4 on: June 05, 2013, 02:35:43 PM »
It just happened again.
I can confirm it happens when pushing the "apply" button to apply the changes of a prefab instance to the prefab object.
However, there was no playmaker fsm showing in the editor, but I had loose the prefab conection due to changing childs inside the prefab. My two variables got messed up again when I hit the "apply" button.

It's important to note the variables got messed up in objects outside of the prefab I was updating too, not only in the prefab.

I just lost 2 hours of programming because of this...  :-\

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Playmaker is changing the name of a global variable
« Reply #5 on: June 06, 2013, 01:34:37 AM »
Hi,

 Have you filed a bug report for this? This will Help tracking this issue.

bye,

 Jean

AtomicJoe

  • Playmaker Newbie
  • *
  • Posts: 10
Re: Playmaker is changing the name of a global variable
« Reply #6 on: June 06, 2013, 05:15:04 AM »
Hi,

 Have you filed a bug report for this? This will Help tracking this issue.

bye,

 Jean

Yes, it's the case 730.
By the way, I have noticed the variable change/switch in the actions can happen in less flagrant ways, changing only a few variable references here and there without you noticing it until bugs start to happen. Then you check the FSMs and notice instead of the original variable there is another one assigned or even none!

FritsLyn

  • Full Member
  • ***
  • Posts: 191
Re: Playmaker is changing the name of a global variable
« Reply #7 on: July 07, 2013, 06:21:16 AM »
Related bug here:

I (also) can confirm it happens when pushing the "apply" button to apply the changes of a prefab instance to the prefab object. (It's inconsistent I have not found a distinct way of provoking it, but it surely has something to do with that)

But what I have, is a Global Bool that flips to True! No name changing.

FritsLyn

  • Full Member
  • ***
  • Posts: 191
Re: Playmaker is changing the name of a global variable
« Reply #8 on: July 07, 2013, 06:40:46 AM »
Hmm. This is fishy  :o

I now notice that other global variables start to "keep counting" between game runs - Global variables should not remember state from previous game run, should they?

I have to "admit" that I recently upgraded to PlayMaker 1.6.2.f3 from a slight older version, in the same game.

I'll try and export everything and start over.. (crap - I really hope this does the trick)

Horror

  • Junior Playmaker
  • **
  • Posts: 79
Re: Playmaker is changing the name of a global variable
« Reply #9 on: July 09, 2013, 12:34:55 AM »
Same here! None of my global variables are reverting to their original values after I run and stop the game in the editor. Not good at all.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Playmaker is changing the name of a global variable
« Reply #10 on: July 09, 2013, 02:56:46 AM »
Hi,

 uhm, I can't repro this. Do you have a repro project I could look at?

bye,

 Jean

Horror

  • Junior Playmaker
  • **
  • Posts: 79
Re: Playmaker is changing the name of a global variable
« Reply #11 on: July 09, 2013, 09:38:20 AM »
Hi Jean, try this:

[ADMIN: Download link removed. Please don't share projects that include the Playmaker dlls]

[HORROR: Removed the file as well!]

On my PC at least, the global variable isn't being reset to 0 after the game has been stopped in the editor.
« Last Edit: July 09, 2013, 05:54:29 PM by Horror »

FritsLyn

  • Full Member
  • ***
  • Posts: 191
Re: Playmaker is changing the name of a global variable
« Reply #12 on: July 09, 2013, 03:10:20 PM »
I When I make changes in prefabs and apply, specially things related to other prefabs are only sometimes applied - and apparently sometimes they are.

When things fail, it acts as if I am making changes of the sort that should not apply to other prefabs (such as rotation as an example) on things that _should_ be applied. Updates are partly working (I hit Apply, and things do change in the other instances), and some things are applied. But not all. And it appears to be linked to prefabs vs prefabs.

I also get annoying error messages of missing links in prefabs - this may be a feature, but it's annoying to have 9 "Setup errors" flashing, when in fact nothing IMO is wrong.

I have reported this as a bug as well, I am just stuck with this issue often now, and I figured I'd share so others can see that they are not alone and crazy ;)

FritsLyn

  • Full Member
  • ***
  • Posts: 191
Re: Playmaker is changing the name of a global variable
« Reply #13 on: July 09, 2013, 03:29:49 PM »
Argh! This is bad ;/

Even when I "manually" apply all changes in prefabs to call an event in another GameObject FSM - they..

A: Do not work - it appears as if the manual setup I made in Playmaker are just ghosts - they do not run.

B: Do not all show up when I right click in that global event that they all link to.

Even after pressing Apply, all the "ghosts" update visually nice, but under the hood - when I run the game, or when I check if the global event they should link to list them as "send by" - they do not work/do not appear. (Only some of them do)

The only way out of this mess is stop working with prefabs - they are a mess.

Manual updates on all individual objects for me till this is fixed, no more blue text.

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 3985
  • Official Playmaker Support
    • LinkedIn
Re: Playmaker is changing the name of a global variable
« Reply #14 on: July 09, 2013, 03:35:12 PM »
On my PC at least, the global variable isn't being reset to 0 after the game has been stopped in the editor.

It looks like this is a bug when the Globals Window is open. In my tests it works properly if I don't have the Globals Window open - can you confirm the same?

I'll look into this. It might be related to other problems editing globals. Try keeping the Globals Window closed to see if that helps...

I'll try to get a fix out asap.