playMaker

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

allornothing

  • Playmaker Newbie
  • *
  • Posts: 20
Re: Playmaker is changing the name of a global variable
« Reply #45 on: August 11, 2017, 06: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: 226
Re: Playmaker is changing the name of a global variable
« Reply #46 on: August 12, 2017, 04: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, 04:40:37 PM by HeathClose »

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7614
    • jinxtergames
Re: Playmaker is changing the name of a global variable
« Reply #47 on: August 12, 2017, 10: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
Re: Playmaker is changing the name of a global variable
« Reply #48 on: August 15, 2017, 09: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: 226
Re: Playmaker is changing the name of a global variable
« Reply #49 on: August 15, 2017, 09: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: 7614
    • jinxtergames
Re: Playmaker is changing the name of a global variable
« Reply #50 on: August 17, 2017, 12:18:56 AM »
HI,
ok so i guess you are on unity 2017.1

do you have playmaker 1.8.5?

HeathClose

  • Full Member
  • ***
  • Posts: 226
Re: Playmaker is changing the name of a global variable
« Reply #51 on: August 17, 2017, 09: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: 7614
    • jinxtergames
Re: Playmaker is changing the name of a global variable
« Reply #52 on: August 18, 2017, 12:47:55 AM »
HI,
It is a unity bug and should be resolved in 2017.2,
but i have contacted Alex already :)

Dakk

  • Beta Group
  • Playmaker Newbie
  • *
  • Posts: 21
Re: Playmaker is changing the name of a global variable
« Reply #53 on: September 21, 2017, 12:24:54 PM »
+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: 7614
    • jinxtergames
Re: Playmaker is changing the name of a global variable
« Reply #54 on: September 21, 2017, 12:39:30 PM »
Hi,
Globals are stored in playmaker/Resources/PlayMakerGlobals.asset

The corrupted files will probably not be fixed on updating.

Dakk

  • Beta Group
  • Playmaker Newbie
  • *
  • Posts: 21
Re: Playmaker is changing the name of a global variable
« Reply #55 on: September 21, 2017, 01:07:07 PM »
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

  • Beta Group
  • Playmaker Newbie
  • *
  • Posts: 21
Re: Playmaker is changing the name of a global variable
« Reply #56 on: September 21, 2017, 05: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.

craigz

  • Beta Group
  • Full Member
  • *
  • Posts: 234
    • Haven Made
Re: Playmaker is changing the name of a global variable
« Reply #57 on: December 06, 2017, 10:15:40 PM »
Just wanted to put my findings here for anyone else who's had this issue!

I was able to fix it by editing the PlayMakerGlobals.asset file manually (though still had to manually reconnect the NEW global variable to where it was disconnecte).

Sauce: http://hutonggames.com/playmakerforum/index.php?topic=16254.msg75824#msg75824

-craigz

craigz

  • Beta Group
  • Full Member
  • *
  • Posts: 234
    • Haven Made
Re: Playmaker is changing the name of a global variable
« Reply #58 on: July 19, 2018, 09:56:29 PM »
Following back up on this thread.

Just had this happen again today. Specifically the renaming bug, not a duplicate global variable.

Getting ready to roll back and redo half a day of work  >:(

Playmaker 1.8.9
Unity 2017.3.1f1

Still not sure what made it happen, but one of my used Global variable gameobject's name just got changed to a general and vague local variable I use a lot (temp_go_1) so I've no idea where/when it happened.

Ugh.

-craigz

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 3985
  • Official Playmaker Support
    • LinkedIn
Re: Playmaker is changing the name of a global variable
« Reply #59 on: July 20, 2018, 10:41:12 AM »
Sorry to hear that :(
Have you tried updating to 1.9.0?