Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: Seiryu33 on December 10, 2017, 10:27:28 AM

Title: Constant info
Post by: Seiryu33 on December 10, 2017, 10:27:28 AM
I haven't found anything relevant to this topic, but how do I get information to carry over scene to scene? Like if I want a game object to remain active or even just coins and health. I thought about using global floats but I didn't work the way i planned. Any tips or advice would he greatly appreciated. Thanks.
Title: Re: Constant info
Post by: djaydino on December 10, 2017, 01:50:53 PM
Hi.
You can use an asset called easy save to save/load values
or
You can have a gameobject with data which you don't destroy when changing scenes
with the action "Don't Destroy On Load"
Title: Re: Constant info
Post by: Seiryu33 on December 10, 2017, 04:27:41 PM
I thought of that too but then I had problems with enemies not reacting to the player since they have to be able to recognize them. Any suggestion on how to fix the enemy A.I so they react accordingly after the scene changes?
Title: Re: Constant info
Post by: djaydino on December 11, 2017, 06:22:29 PM
Hi.
Maybe this is a possibility:
if you have a lot already going on in your project, i would make an empty object and place an fsm on that (called DataHolder for example)
Then just before changing scene, use 'set fsm' actions to set the data you need for the other scene.

then on the other scene you need to use 'get fsm' actions to get the data you need @ the start of your scene or when you need it.

To connect you need to use a global (DataHolderObj) and also you need to set the 'DataHolder' gameobject to the global by using "Set Game Object"

Then you also need to use "Send Active Scene Changed Event" and point it back to do the "Set Game Object" again

You could do something similar to the player instead of making the dataholder.

Make a backup!! and play around a bit to see what works best.
Title: Re: Constant info
Post by: Seiryu33 on January 24, 2018, 10:33:53 PM
Okay so what I did was make the player and player cam it's own scene then set player and status bar as a global game object. The scene loads fine when it's used Async. But i wanted to try loading the scenes as a Single so that there's better performance. I tried using the Don't destroy on load action, but the subsequent scene still loaded without the scene with the player loading with it. Do I put the action on the subsequent scene?