Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: Sjones on July 12, 2018, 12:39:11 PM

Title: Global Variable Issues
Post by: Sjones on July 12, 2018, 12:39:11 PM
Hi all, i have came across a little bit of an issue with PM global variables, it seems like it happened through an existing bug (https://hutonggames.com/playmakerforum/index.php?topic=3861.30) however this may because I was using an older version of PM up till recently - not sure if its now fixed.

So the issue is I forgot to make a backup... it means a lot of work to figure out exactly whats changed and to get everything back up and running using the method of re-creating variables and re-assigning them. - problem is I am not sure where every instance is so finding them and re-linking all of them will mean a complete overhaul of the project with 100's of Fsm's and 1000's of variables

So I am looking into other solutions at the moment, my first is the global export and import setting, using the latest backup as the main source (copied the global.asset file to a new project) and then tried to export the globals from the latest project version and import into this test scene, when I do this (and the other way around) all I get when I import the exported asset package is the error "no global to import"

Second option I am looking into is manually editing the globalvariable file itself, notepad++ finds the variable name but gives lots of errors (mostly null but other errors) throughout the file.

My question is is there something I am doing wrong to import the globals to a new project
1.copy global asset file from backup to new project (works fine)
2. playmaker->tools->export globals in the latest version
3. playmaker->tools->import globals in the test scene
4. error with no globals to import

and second is there a way to manually edit them? so they get assigned the same ID's or whatever PM uses to track the variables? is it encoded in a certain format that can be used to view it all properly?

this has caused more than a headache or two so I am hoping that someone here may have a solution thats efficient to get the job done.

I am currently using the latest version of playmaker and unity5.6.1f1

Title: Re: Global Variable Issues
Post by: ToxicFrog on July 12, 2018, 02:34:13 PM
You're in luck - I just dealt with this today :)

This video worked for me. NOTE: It did not appear to work at first, but after restarting Unity, all my globals were in the project as expected. So, restart after you do this:

https://www.youtube.com/watch?v=NJrZdlqeAx8 (https://www.youtube.com/watch?v=NJrZdlqeAx8)
Title: Re: Global Variable Issues
Post by: Sjones on July 12, 2018, 03:29:57 PM
you sir may just be a life saver, an initial test shows importing working, im hoping they now just match up with the FSM's and the initial issue I had is still somewhat present, there is a duplicate of a variable (even though PM doesn't allow you to name them the same) so still a bit more testing to go

Thanks!