playMaker

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

charming_fox

  • Playmaker Newbie
  • *
  • Posts: 47
    • View Profile
Re: Playmaker is changing the name of a global variable
« Reply #30 on: March 17, 2016, 08:37:18 AM »
Hi all,

I'm getting this error every now and then and it is an absolute mother******, basically unless I have a very recent backup then I have to hunt out hundreds of broken references to two global variables in particular (player and ui_canvas). Is anyone else still getting this?

Thanks

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 3207
  • Official Playmaker Support
    • View Profile
    • LinkedIn
Re: Playmaker is changing the name of a global variable
« Reply #31 on: March 17, 2016, 08:49:29 AM »
What version of Playmaker are you using? We don't have reports of this bug happening in 1.8.

charming_fox

  • Playmaker Newbie
  • *
  • Posts: 47
    • View Profile
Re: Playmaker is changing the name of a global variable
« Reply #32 on: March 18, 2016, 02:18:40 AM »
PM is 1.8.0f43 and Unity is 5.3.2f1. I'm about 80% convinced it happened when I applied changes to a child within a prefab in a scene by accident, normally I apply changes to the root object. The result is that any reference to the global game object 'player' is now a reference to the global game object 'canvas'.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 12351
  • Official Playmaker Support
    • View Profile
Re: Playmaker is changing the name of a global variable
« Reply #33 on: March 24, 2016, 12:36:32 AM »
Hi,

 I am trying to repro this, but I am having a hard time.

Where was the global used, was it inside this prefab? what did you edited in the prefab instance child, an Fsm or something else?

Bye,

 Jean

hannesdelbeke

  • Playmaker Newbie
  • *
  • Posts: 2
    • View Profile
Re: Playmaker is changing the name of a global variable
« Reply #34 on: April 12, 2016, 08:58:33 AM »
I also have this happen to me several times in the past weeks
just happened today on a very big FSM
lucky enough i could roll back and redo my changes

I have a prefab called "manager", with several chilren
made a new gameobject variable inside of the FSM attached to it
then dragged it in the scene so it becomes a instance
the FSM has 3 nodes with action "set gameobject action"
i dragged some children from the "manager" in the slots for "set gameobject action"
then clicked apply on the "manager" instance
now going back to the prefab a lot of gameobject variables are shuffled

playmaker version is 1.8.0f43 unity 5.2.3.f1 (not 5.3!)

i think in the past when it got corrupted it was similar.
my current workaround is
dragging gameobjects directly in actions isntead of making a variable, exposing it in the editor, and dragging it in the variable slot of the fsm
and lots of backups

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 12351
  • Official Playmaker Support
    • View Profile
Re: Playmaker is changing the name of a global variable
« Reply #35 on: April 19, 2016, 11:41:23 PM »
Hi,

 You should report this using the bug report.

It's never a good idea to work on the instance in general. I only do the very strict minium that Unity impose, like modifying deep hierarchy and all, everything Fsm wise, I only work on the prefab itself.

Bye,

 Jean

hannesdelbeke

  • Playmaker Newbie
  • *
  • Posts: 2
    • View Profile
Re: Playmaker is changing the name of a global variable
« Reply #36 on: April 20, 2016, 07:21:47 AM »
i only work in the instance to drag deep hierarchy stuff in the variables instead of using find

terri

  • Sr. Member
  • ****
  • Posts: 349
    • View Profile
    • terrivellmann.tumblr.com
Re: Playmaker is changing the name of a global variable
« Reply #37 on: November 28, 2016, 12:41:29 PM »
I've had this happen too, today it was pretty bad :/
I changed an action which was referencing a global variable, and it made the same change on other FSMs on the prefab, breaking a bunch of stuff

I've had it happen before but I was always not 100% sure what happened, but this time it was just too obvious. I'm guessing it does have to do with applying changes on prefabs, but since you only have access to the first level of children on the hierarchy, you kinda have to do it sometimes, it really shouldn't break everything

terri

  • Sr. Member
  • ****
  • Posts: 349
    • View Profile
    • terrivellmann.tumblr.com
Re: Playmaker is changing the name of a global variable
« Reply #38 on: November 29, 2016, 04:51:38 AM »
To extend on this, it changes the global variable not just on the local prefab's other fsms, but also on other completely unrelated prefabs.

I also just had a problem where it changed the name of the global variable??? I used to have globals/BRAIN and globals/UI, and after switching one from the other in a FSM, my globals now list UI two times and no BRAIN

I'm going to attempt to replicate this on a blank project

terri

  • Sr. Member
  • ****
  • Posts: 349
    • View Profile
    • terrivellmann.tumblr.com
Re: Playmaker is changing the name of a global variable
« Reply #39 on: July 19, 2017, 10:08:38 AM »
So, this is still happening.

I can't figure out exactly what triggers it, but it has to do with editing actions on a scene and hitting apply.

I set up an action today referencing a child and when I hit play, I got a bunch of errors and turns out my prefab lost all the references to a global variable.

I've seen cases where if you changed a reference from one global variable to another, it will change every other reference, as if you had rename the variable instead of just picking another one.

This really sucks, I already don't rename global variables since I know that will likely break everything, but I almost feel like I shouldn't use global variables at all since they break out of the blue and its a ton of work to track them down and fix everything.

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 2288
    • View Profile
    • jinxtergames
Re: Playmaker is changing the name of a global variable
« Reply #40 on: July 19, 2017, 07:06:36 PM »
Hi,
It has been a long time ago that i had this issue too.
What unity and Playmaker version are you on?

How are you backing up your project?

If you use something like sourcetree you could revert the global file to reduce the damage, if it happens.
It is not a solution, but it reduces the damage.

terri

  • Sr. Member
  • ****
  • Posts: 349
    • View Profile
    • terrivellmann.tumblr.com
Re: Playmaker is changing the name of a global variable
« Reply #41 on: July 20, 2017, 05:08:18 AM »
Unity is 5.6.1f1, Playmaker is 1.8.4

I backup often but manually. (zip the project + dropbox). The tricky bit is I've had instances where I'd work on something for a few hours after a backup, and this will mess everything up. OK, couple hours lost but I revert to the backup. So I work on things again and the exact same thing happens...

Another thing that sucks is that since it doesn't always throw errors (switching a variable doesn't), you only catch this once you run through the FSM by chance while playtesting and things don't work as they should

also sometimes I'll catch the error, fix it and run the game and the FSM will seem to revert back to the wrong variable? it so weird

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 2288
    • View Profile
    • jinxtergames
Re: Playmaker is changing the name of a global variable
« Reply #42 on: July 20, 2017, 08:28:12 AM »
Hi,
It is indeed weird, but maybe you should look into using sourcetree and github so You can for example view a change log for a single file (pointing to playmaker/Resources/PlayMakerGlobals.Asset ) so you can see if something has changed on the file (this includes Global Variables and Global Events.)

If you don't want to get into sourcetree, you could use import/export globals.
When you click on the file playmaker/Resources/PlayMakerGlobals.Asset
you can see import/export Globals and also what is on your global file.
Export it and when something went wrong,
import the file
But you will need to export every time you add/remove globals.
Also i think the 'renamed' globals will still be there after import.

I have not tested this but i think it should work.

Have you also send i bug report inside unity?
You can find it under Playmaker/Tools/

terri

  • Sr. Member
  • ****
  • Posts: 349
    • View Profile
    • terrivellmann.tumblr.com
Re: Playmaker is changing the name of a global variable
« Reply #43 on: July 21, 2017, 02:13:21 PM »
ah, cool thanks, will check that out - though that is for when the globals get messed up right? I mostly have the issue where the action inside prefabs that are using a global variable will break

I should totally send a proper bug report I have not

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 2288
    • View Profile
    • jinxtergames
Re: Playmaker is changing the name of a global variable
« Reply #44 on: July 21, 2017, 10:17:55 PM »
Hi,
Quote
I should totally send a proper bug report I have not

Please do :)
and give as much give as much detail as you can.
If you do, also ad a link to this Post :)