Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: Krileon on April 01, 2013, 06:56:19 PM

Title: Global variables completely lost from prefab on Play [SOLVED]
Post by: Krileon on April 01, 2013, 06:56:19 PM
For some reason for one of my prefabs the global variables are completely lost on Play. During editor they work fine and I can select them fine. As far as I am aware my other prefabs using globals are still working fine. Please see the attached sceenshots. Does anyone have any idea what's going on?

Edit: Just checked my other prefabs and they're losing their globals too on play. This is a massive massive issue as it basically has broken my game.
Title: Re: Global variables completely lost from prefab on Play
Post by: Alex Chouls on April 01, 2013, 07:37:45 PM
What version of Playmaker and Unity are you using?
Title: Re: Global variables completely lost from prefab on Play
Post by: Krileon on April 01, 2013, 07:40:19 PM
Unity 4.1.2f1 and PlayMaker 1.5.4.f3.
Title: Re: Global variables completely lost from prefab on Play
Post by: Krileon on April 01, 2013, 08:52:22 PM
Ok, did some more testing and the globals are working for 1 frame then lost (changed to None as shown in my screenshots). My project is basically completely on hold until this can be fixed as it depends on some globals. Should I be using some other way to handle the globals instead of using globals? Maybe a single FSM that holds the variables instead?
Title: Re: Global variables completely lost from prefab on Play
Post by: Alex Chouls on April 02, 2013, 12:04:50 AM
Was it working in Unity 4.1?

4.1.1 broke a lot of asset store tools. Maybe some stuff remains broken in 4.1.2.

I haven't updated to 4.1.2 yet, but will do so ASAP to test...

BTW, is it a display bug, or is the FSM actually broken?
Also, if you run the project without the playmaker editor open, does it run as expected?
Title: Re: Global variables completely lost from prefab on Play
Post by: Lobohotpants on April 02, 2013, 12:52:00 AM
I think I had a similar problem and it was because I filled the global variable with a prefab from my assets and not my scene.  To fix it I use a "get owner" on each of the prefabs that are supposed to be in the global variable and fill the variable at run time. 
Title: Re: Global variables completely lost from prefab on Play
Post by: PolyMad on April 02, 2013, 01:21:27 AM
Sorry for this OT, but... I see in the picutres that there are FSM with more starting points.

How is that possible?
Title: Re: Global variables completely lost from prefab on Play
Post by: jeanfabre on April 02, 2013, 02:36:26 AM
@megmaltese: what do you mean by starting point?

 fsm have only one "START", but then you can reroute transitions back to it the way you want. is that what you mean?

bye,

 Jean
Title: Re: Global variables completely lost from prefab on Play
Post by: PolyMad on April 02, 2013, 02:48:38 AM
No.

There is START, Escape and Kill.
For the little I know, I can only have START.
I didn't read or see anywhere else those other starting points (or whatever they are  :o )
Title: Re: Global variables completely lost from prefab on Play
Post by: jeanfabre on April 02, 2013, 02:53:20 AM
Hi,

 That's "Global transitions" for you. Right click on a state and select "Add Global Transition", then it will appear so, and it means that if you call that event somehow, it will enter that state.

It's a critical feature of playmaker, it's very important that you master this concept. Have you watched the various screencasts and tutorial videos on Playmaker?

bye,

 Jean
Title: Re: Global variables completely lost from prefab on Play
Post by: Krileon on April 02, 2013, 08:10:51 AM
Was it working in Unity 4.1?
Yes, it was working fine in 4.1. After the upgrade I believe is when it broke, but I do not recall exactly when as I just now noticed it while working on my new UI.

BTW, is it a display bug, or is the FSM actually broken?
It's broken. The globals are lost and PlayMaker, if debugging is on, will throw an error stating the required variables are missing. The states that use those globals also will not function unless they use the global on the first frame as any frames after that the globals are lost.

Also, if you run the project without the playmaker editor open, does it run as expected?
No it does not run fine with the PlayMaker editor open or not. However, if you have the editor open and press play it will LOOK fine, but it won't be as once you close and re-open it does as seen in my screenshots.
Title: Re: Global variables completely lost from prefab on Play
Post by: PolyMad on April 02, 2013, 02:11:52 PM
Hi,

 That's "Global transitions" for you. Right click on a state and select "Add Global Transition", then it will appear so, and it means that if you call that event somehow, it will enter that state.

It's a critical feature of playmaker, it's very important that you master this concept. Have you watched the various screencasts and tutorial videos on Playmaker?

bye,

 Jean

I took the first 8 tutorials from basics but didn't see this feature (or forgot about it lol).
Very cool.
Anyway, I'm quite in my project atm and I managed to not use global FSM, but surely they can come very useful in some situations.
Title: Re: Global variables completely lost from prefab on Play
Post by: Krileon on April 02, 2013, 09:30:40 PM
Has anything been found in regards to this? It has my project completely on hold. This seams like a pretty massive massive bug.
Title: Re: Global variables completely lost from prefab on Play
Post by: Krileon on April 04, 2013, 09:16:05 AM
Tried deleting and re-importing PlayMaker as well as my globals with no luck. Issue still present. Please can there be some movement on this? My project is at a complete stand still as it depends on some globals. The globals are lost after the first frame as shown in my screenshots.
Title: Re: Global variables completely lost from prefab on Play
Post by: Lane on April 04, 2013, 09:21:42 AM
I would revert to an older Unity version, if it broke after a Unity patch then it seems like the problem is fairly clear... Especially so after considering the huge volume of issues they've had with the last 2 patches.
Title: Re: Global variables completely lost from prefab on Play
Post by: Krileon on April 04, 2013, 09:28:50 AM
I don't know for sure if updating Unity broke it is the problem. I don't want to risk breaking more by downgrading either.
Title: Re: Global variables completely lost from prefab on Play
Post by: Lane on April 04, 2013, 09:55:13 AM
So backup your project folder and give it a try?
Title: Re: Global variables completely lost from prefab on Play
Post by: Krileon on April 04, 2013, 10:56:45 AM
Downgraded to Unity 4.1 and issue still present. Will try Unity 4.0 now.
Title: Re: Global variables completely lost from prefab on Play
Post by: Krileon on April 04, 2013, 11:08:04 AM
Downgraded to Unity 4.0 and issue still present. Upgrading back to 4.1.2. It must be due to the latest PlayMaker release is all I can guess. Can the developers please look into why the globals would be lost after the first frame please?
Title: Re: Global variables completely lost from prefab on Play
Post by: Alex Chouls on April 04, 2013, 01:47:30 PM
Can you send me your project?

Have you moved Playmaker from its default location?
Is PlayMakerGlobals in the PlayMaker/Resources directory?
Could there be another PlayMakerGlobals in the project somewhere? E.g., if you imported globals from another project...
Title: Re: Global variables completely lost from prefab on Play
Post by: Krileon on April 04, 2013, 04:14:46 PM
Quote
Can you send me your project?
Yes, please provide where you'd like me to send it.

Quote
Have you moved Playmaker from its default location?
No.

Quote
Is PlayMakerGlobals in the PlayMaker/Resources directory?
Yes.

Quote
Could there be another PlayMakerGlobals in the project somewhere?
No, have done a full search of my project multiple times.

The last asset I imported was CoherentUI, but I don't see how it could conflict nor seen any errors regarding it.

The global variables work, but only for 1 frame then are lost. Global events appear to be unaffected.
Title: Re: Global variables completely lost from prefab on Play
Post by: markfrancombe on April 04, 2013, 05:02:31 PM
I don't have anything to add, other than to ask you to please consider going back to 4.0 (or I think 4.1 is ok).
I have had similar issues with 4.1.2 not PlayMaker specific, but Unity specific, so I would advise waiting...

Im staying at 4.0 for a while...

M
Title: Re: Global variables completely lost from prefab on Play
Post by: Krileon on April 04, 2013, 10:59:11 PM
I don't have anything to add, other than to ask you to please consider going back to 4.0 (or I think 4.1 is ok).
I have had similar issues with 4.1.2 not PlayMaker specific, but Unity specific, so I would advise waiting...

Im staying at 4.0 for a while...

M
Please see my above replies as I have already done this. I've tested 4.1.2, 4.1, and 4.0 all with same issue. I believe it was the update to latest PlayMaker release that maybe doing it or my project is already messed up from already upgrading to 4.1.2 and won't reverse.

Edit: Thought it could've been CoherentUI, but completely deleted it and did not solve the issue. The only 3 recent things that I have done is Unity 4.1.2 update, PlayMaker update, and CoherentUI import. I've ruled out Unity and CoherentUI now.
Title: Re: Global variables completely lost from prefab on Play
Post by: Krileon on April 04, 2013, 11:40:48 PM
Ok, took my tests another step forward. New project and all it has is PlayMaker imported. The only objects in the scene is the camera and an empty game object with PlayMaker on it that adds +1 to a Global Float. Issue is still present. This clearly is a bug in PlayMaker. I am begging someone at PlayMaker to please prioritize and resolve this as my project is completely stalled and globals are completely useless now or at least send me earlier versions of PlayMaker to test as asset store won't give me older releases.
Title: Re: Global variables completely lost from prefab on Play
Post by: Lane on April 05, 2013, 12:52:09 AM
I can't figure out how you're having this problem and others aren't if it's a problem in the latest PM patch then it would be widespread.
Title: Re: Global variables completely lost from prefab on Play
Post by: Krileon on April 05, 2013, 08:58:18 AM
I can't figure out how you're having this problem and others aren't if it's a problem in the latest PM patch then it would be widespread.
I don't know, I'd be able to explore this more if it all wasn't crammed into a DLL. Beyond what I've provided I don't know what further to add. I've confirmed it still happens even in a new project so it's nothing in my project causing it. If the code where globals is established isn't in the DLL then I'd like to know where so I can take a look. I just want this fixed...
Title: Re: Global variables completely lost from prefab on Play
Post by: Krileon on April 06, 2013, 10:34:56 AM
Globals issue is now fixed with 1.5.5, but now there's over 500 FPS loss; as don't want a duplicate topic regarding performance will just link the below.

http://hutonggames.com/playmakerforum/index.php?topic=3581.0

Can we get a way to register our purchase here at PlayMakers site and you provide a way for us to download previous versions? Once updated through Asset Store you're pretty much screwed and I believe 1.5.3 worked perfectly fine for me. I don't want these updates unless they're going to actually work...
Title: Re: Global variables completely lost from prefab on Play
Post by: Alex Chouls on April 06, 2013, 11:48:02 AM
If you contact info@hutongames.com and provide your order info, we can email you a previous version.

Sorry about the performance problems! In the beta, 1.5.5 massively improved editor performance in our stress tests and real world projects. There must be some edge case that's not handled we'll and missing from our tests. Can you email me a project that shows the problem?
Title: Re: Global variables completely lost from prefab on Play [SOLVED]
Post by: jayhfd on May 17, 2013, 04:24:07 AM
I'm pretty sure I also managed to lose a global gameobject var just now by trying to set a gameobject variable on a prefab to be a scene object. This NGUI scene object was using Get Owner on itself, stored as a Global Gameobject var. Yes I know this is a dumb way of doing things, but I couldn't get something working and was 'just trying stuff' :)

Anyway the global gameobject var just disappeared from my scene/project, and I had to recreate it.

Just FYI...
Title: Re: Global variables completely lost from prefab on Play [SOLVED]
Post by: Satrio on June 11, 2013, 08:43:33 AM
Had problems with NGUI and Playmaker after trying to update through Asset Store. Had to delete both and reinstall to get stuff to work, although all my global vars were deleted and the whole game broke. No I can´t get the global vars back... really bad...

Shit like this really makes me mad...well, well..

Seems like global vars are associated with the project and not with "levels"?
Anyone else has a solution to this?
Title: Re: Global variables completely lost from prefab on Play [SOLVED]
Post by: Lane on June 11, 2013, 08:52:19 AM
Had problems with NGUI and Playmaker after trying to update through Asset Store. Had to delete both and reinstall to get stuff to work, although all my global vars were deleted and the whole game broke. No I can´t get the global vars back... really bad...

Shit like this really makes me mad...well, well..

Seems like global vars are associated with the project and not with "levels"?
Anyone else has a solution to this?

That sucks! The global variables are stored in a file which may not be the ideal solution since I've seen a lot of people accidentally delete them when they want to remove and reimport PlayMaker, including myself. You'll notice the alert dialog box telling you about the file when you first create a global variable, I think.

Not having a backup is terrible, always backup regularly, once a week at a minimum.
Title: Re: Global variables completely lost from prefab on Play [SOLVED]
Post by: Satrio on June 11, 2013, 09:14:45 AM
backups, yeah... backup 7 GB each week to keep some hidden file that is less than 1kb.. Would be nice to be informed about this "feature" somewhere. Most of the global events are still there though. Just the vars are gone.
Title: Re: Global variables completely lost from prefab on Play [SOLVED]
Post by: jeanfabre on June 14, 2013, 02:09:23 AM
hi,

 yes global vars apply to a project level. For scene based "global vars", use user prefs or actual fsm with local variables that you access from other places using "get fsm xxx", that's how I do it.

bye,

 Jean
Title: Re: Global variables completely lost from prefab on Play [SOLVED]
Post by: Alex Chouls on June 14, 2013, 01:20:35 PM
I've added a Help Box to the Global Variables Window for the next release:
NOTE: Globals are stored in PlayMaker/Resources/PlayMakerGlobals.asset

Currently globals have to be an asset so they can be referenced by any scene.

But we are playing with the idea of different global scopes. E.g., scene globals.
Title: Re: Global variables completely lost from prefab on Play [SOLVED]
Post by: Satrio on June 16, 2013, 03:29:19 AM
That would be good, Alex!
Sometimes a project contains more "subprojects", as when you import stuff from the asset store to try out if it fits the game you are building.

Being able to try a new technique or idea with PM and not messing up the global vars list with clutter could be nice! Other than that, naming conventions could prolly fix that (example "subproj_GL_Int_Score").