playMaker

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

allornothing

  • Playmaker Newbie
  • *
  • Posts: 17
    • View Profile
Re: Playmaker is changing the name of a global variable
« Reply #45 on: August 11, 2017, 03:54:02 AM »
Just to add a +1 for this issue happening in 1.8.2 with 5.6.0p2

We're finding variables referenced in actions change of their own accord. Looking at the thread it might be related to applying changes to a prefab when it's a child of another object (although with UI prefabs this is hard to avoid). We don't have global window open, but do have PM window open.

It's a very nasty bug! We've been spending days fixing issues caused by this without us knowing why.

HeathClose

  • Full Member
  • ***
  • Posts: 223
    • View Profile
Re: Playmaker is changing the name of a global variable
« Reply #46 on: August 12, 2017, 01:29:33 PM »
just had this happen.

I changed a prefab to reference a new global variable Checkpoint game object, and when I went to test the checkpoint system... my player wouldn't move... and what happened was that my buttons changed their reference from the global "player" to this new checkpoint game object..


However.. the global "player" is gone, and now there are two checkpoint globals

one of these is supposed to be player...



I checked the collaboration changes... looks like my player prefab changed also.  the get owner says player in the action.. but player is not listed in the globals.  I had to create a new player global

also, anything that referenced that changed player global now reads the double of the checkpoint global...

furthermore... the double of that global is not listed, since I just made the change I will just delete them both and see what happens



1.8.5
2017.1.0f3
« Last Edit: August 12, 2017, 01:40:37 PM by HeathClose »

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 2280
    • View Profile
    • jinxtergames
Re: Playmaker is changing the name of a global variable
« Reply #47 on: August 12, 2017, 07:05:25 PM »
Hi,
Thanks for the detailed info.
did you change the prefab inside a scene (hierarchy) or in the project folder?

Can you try yours steps to see if it happens again?

Can you submit a bug report inside unity (go to playmaker/tools)
and add a link to this thread.

nazbee

  • Playmaker Newbie
  • *
  • Posts: 5
    • View Profile
Re: Playmaker is changing the name of a global variable
« Reply #48 on: August 15, 2017, 06:49:37 AM »
i had something similar happen today, was very strange. Playmaker 1.8.4 Unity 5.6.2f1

One of my global variables just poof, disappeared. Stopped showing up in the global variables list but was still showing inside some actions which disappeared when selected.

Ended up creating a new global with the same name and manually reconnecting.

Sorry- no steps to reproduce, caught me completely off guard. Its a little worrying now whether can trust playmaker wont just spontaneously break the project ...

HeathClose

  • Full Member
  • ***
  • Posts: 223
    • View Profile
Re: Playmaker is changing the name of a global variable
« Reply #49 on: August 15, 2017, 06:58:22 AM »
Hi,
Thanks for the detailed info.
did you change the prefab inside a scene (hierarchy) or in the project folder?

Can you try yours steps to see if it happens again?

Can you submit a bug report inside unity (go to playmaker/tools)
and add a link to this thread.

I tried to submit the bug report and get this error

Error Submitting Report:
Cannot connect to destination host

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 2280
    • View Profile
    • jinxtergames
Re: Playmaker is changing the name of a global variable
« Reply #50 on: August 16, 2017, 09:18:56 PM »
HI,
ok so i guess you are on unity 2017.1

do you have playmaker 1.8.5?

HeathClose

  • Full Member
  • ***
  • Posts: 223
    • View Profile
Re: Playmaker is changing the name of a global variable
« Reply #51 on: August 17, 2017, 06:19:50 AM »
HI,
ok so i guess you are on unity 2017.1

do you have playmaker 1.8.5?
yes

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 2280
    • View Profile
    • jinxtergames
Re: Playmaker is changing the name of a global variable
« Reply #52 on: August 17, 2017, 09:47:55 PM »
HI,
It is a unity bug and should be resolved in 2017.2,
but i have contacted Alex already :)

Dakk

  • Playmaker Newbie
  • *
  • Posts: 10
    • View Profile
Re: Playmaker is changing the name of a global variable
« Reply #53 on: September 21, 2017, 09:24:54 AM »
+1 to this frustrating bug.

PM arbitrarily switches global variables.  Switching them back only results in the problem re-surfacing in another FSM or template. 

Yes, I use version control, but this went unnoticed this time for at least 5 days of work because I was focused on a different section of my game that was unaffected.  I don't want to lose all the work.

I have tried replacing the vars with new ones- it just happens now on the new vars.  I even tried re-structuring the setup so those vars weren't used- corruption crept into the new setup.

Has anyone found a fix?  Editing the global vars file?  Replacing actions?

Does anyone know where the corruption resides so I can track it in source control and maybe patch it myself? 

How sure are you that it will be fixed in the next Unity release, and will that fix corrupted files, or just prevent 'clean' files from getting corrupted?

Any help appreciated!



djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 2280
    • View Profile
    • jinxtergames
Re: Playmaker is changing the name of a global variable
« Reply #54 on: September 21, 2017, 09:39:30 AM »
Hi,
Globals are stored in playmaker/Resources/PlayMakerGlobals.asset

The corrupted files will probably not be fixed on updating.

Dakk

  • Playmaker Newbie
  • *
  • Posts: 10
    • View Profile
Re: Playmaker is changing the name of a global variable
« Reply #55 on: September 21, 2017, 10:07:07 AM »
Thanks for the reply, I am quite familiar now with the globals file (unfortunately).
I have compared the history in version control- but I am not certain how to locate the corruption. In fact, I am not even certain that file is where the corruption lies.

Dakk

  • Playmaker Newbie
  • *
  • Posts: 10
    • View Profile
Re: Playmaker is changing the name of a global variable
« Reply #56 on: September 21, 2017, 02:37:35 PM »
A follow-up in case someone finds themselves in a similar situation where they do not catch it in time for a simple version control rollback (the safest fix)-  I believe I have removed the corruption from my project. 

It didn't seem like the corruption was in the actual global variable file- I couldn't see any problems in the syntax going through the version history. 

It seems to have something to do with the relationship between prefabs and scene instances- like others have noted.  I was not ever editing the scene instance, only the prefabs, but I still encountered this corruption.  To fix it, I broke all my prefab connections then deleted the prefabs from the project.  I then painstakingly re-set the correct variables in all the FSMs in the scene and all the templates. 
This seems to have worked.  At some point I will need to convert the scene objects back to prefabs- hopefully that will not bring back the corruption.