Playmaker Forum

PlayMaker News => General Discussion => Topic started by: joduffy on May 07, 2013, 01:48:21 AM

Title: Global Variables and packages
Post by: joduffy on May 07, 2013, 01:48:21 AM
Hi Guys,

I am working with different groups and I created a scene were I use playmaker global variables. I then made a unity3d package of the scene and sent it to the other people (who each own playmaker) and it doesnt work.

The scene and the FSM's are all there but the Global Variables are missing. It seems that when you create a package, Global Variables are not include which means you have to remake all the Global Variables and edit all the FSM's to get them to work properly.

Is there anyway to make sure the Global Variables are included in the unity3d package.
Title: Re: Global Variables and packages
Post by: jeanfabre on May 07, 2013, 01:51:11 AM
Hi,

 you have to export the global vars using the "export globals" from the tools menu of playmaker and include the newly created asset:

Assets/PlayMaker/Resources/PlayMakerGlobals.asset

when you import the package, then you have to user "import globals" from the tool menu of playmaker.

bye,

 Jean
Title: Re: Global Variables and packages
Post by: joduffy on May 07, 2013, 01:57:13 AM
Is there anyway to include this file in the unity package

PlaymakerGlobals.asset

....

Sorry, my web browser didnt display the reply. I will try it now. Thank you jean
Title: Re: Global Variables and packages
Post by: jeanfabre on May 07, 2013, 01:58:29 AM
Hi,

Yes, you have to select it as part of the assets you want to package, it's not going to get selected automatically,

bye,

 Jean
Title: Re: Global Variables and packages
Post by: joduffy on May 07, 2013, 02:52:33 AM
Sorry to annoy you Jean.

I am trying to select both the scene file and also the PlaymakerGlobals.asset file. When I export the package it shows all the files that I want. But when I import the package into a different project it only display the PlaymakerGlobals.asset file.

I tried re-making the package several times and I only get either the scene or the PlaymakerGlobals.asset file but not both in the same package.

Again sorry to annoy you over something that seems trivial.
Title: Re: Global Variables and packages
Post by: joduffy on May 07, 2013, 03:09:15 AM
Here is screen shots showing what is happening
Title: Re: Global Variables and packages
Post by: jeanfabre on May 07, 2013, 03:26:19 AM
Hi,

 Existing assets are not listed when you import a package, that's why you may not see all the content of your package if you have already some there.

If you see the global asset in the assets, then what happens when you "import globals" from playmaker?

bye,

 Jean
Title: Re: Global Variables and packages
Post by: joduffy on May 07, 2013, 04:41:59 AM
Sometimes it works and sometimes it doesnt.

But I keep getting the same message saying no "globals to import". Is there a step I am missing

Title: Re: Global Variables and packages
Post by: joduffy on May 07, 2013, 06:16:35 AM
It turns out that I did things right.

Ignore the message that says "no globals to import".
It seems to be a bug.

Your globals may or may not be displayed when you import the globals as shown in the previous post.

If your globals are not displayed you need to quit unity and re-load your project. Your global variables will then be displayed in your playmaker scene.
Title: Re: Global Variables and packages
Post by: jeanfabre on May 07, 2013, 06:32:56 AM
Hi,

 uhm, can you fill out a bug report on this? thanks,

bye,

 Jean
Title: Re: Global Variables and packages
Post by: t4d on January 07, 2015, 01:49:43 AM
same problem where is the solution to import Globals ??  this is a project killer !!
Title: Re: Global Variables and packages
Post by: Alex Chouls on January 07, 2015, 07:36:02 AM
The PlayMakerGlobals.asset contains the global variables and events used by a project.

If you want to move these to a new project, overwriting all globals, just include the asset in the exported unitypackage - you do not need to use export/import globals.

Use export/import globals if you want to merge (not replace) globals in the target project.

When you export globals, include the PlayMakerGlobals_EXPORTED.asset in the unitypackage (NOT PlayMakerGlobals.asset). Then import the package into the target project and use Import Globals. Import Globals merges the globals from the PlayMakerGlobals_EXPORTED.asset with the existing PlayMakerGlobals.asset. The PlayMakerGlobals.asset should now include all globals from both projects.

Does that help? If you're seeing different behavior please submit a bug report so we can figure out the problem...