Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: PET on July 13, 2016, 05:57:40 AM

Title: Async Load Level but don't trigger the level change
Post by: PET on July 13, 2016, 05:57:40 AM
Hey there,

I'm loading a leve async... however as soon as the loading finishes the level automatically changes. Is there a way to only trigger the loading change when I tell it to?

Thanks
Title: Re: Async Load Level but don't trigger the level change
Post by: ARK1391 on July 13, 2016, 03:48:48 PM
I would also like an answer to this question as I am having the same issue.
Title: Re: Async Load Level but don't trigger the level change
Post by: PET on July 15, 2016, 04:53:51 AM
 :-[ :'( :'(
Title: Re: Async Load Level but don't trigger the level change
Post by: PET on July 17, 2016, 03:25:08 PM
Is this really not possible?
Title: Re: Async Load Level but don't trigger the level change
Post by: elusiven on July 18, 2016, 08:39:32 AM
Have you had a look on google first?

http://answers.unity3d.com/questions/137261/loading-level-async-without-switching-the-level-im.html

there is plenty of info on this
Title: Re: Async Load Level but don't trigger the level change
Post by: jeanfabre on July 18, 2016, 09:17:08 AM
hi,

 Yes, this is going to be a problem right now. The best solution is to have an fsm inside each sublevel you are loading and have then send a custom global event "ON SUB LEVEL LOADED" and you can even pass some data to it with the name of the scene just loaded. That would be how I would do this personally.

To make sure this is efficient, have this on a dedicated dummy GameObject, and once you have broacasted that event, destroy it, so that if you load it again, you won't have possible duplicates and similar issue.


Bye,

 Jean
Title: Re: Async Load Level but don't trigger the level change
Post by: PET on July 19, 2016, 04:58:45 AM
Hey Jean,

So let me see if I understand.
I have 3 scenes that I'm loading async ... each scene after another.

01 -> 02 -> 03

On the 2nd scene when loading the 3rd one I want to wait until the level change. I want to immediately load the 3rd scene, but I don't want it to automatically change when the 3rd scene is loaded. I want to press a button in Scene 2, and when I press that button go to scene 3.

You are suggesting to make a GameObject with a FSM on scene 3, create a custom global event called "ON SUB LEVEL LOADED" ... and when the scene 3 will load, it will send that custom global event. I can use "Broadcast All" I guess?

But... how do I stop Scene 2 FSM to not change the scene when the Scene 3 loads? Also, how do I change to Scene 3 when I want it? With what event?

I could use Loaded Event from the "Load Event" action, go to a state where I wait for the ENTER key, and when that key is pressed go to a state that changes the levels, but what action do I use there?

I hope I made myself clear.

Thanks Jean.
Title: Re: Async Load Level but don't trigger the level change
Post by: jeanfabre on July 19, 2016, 08:32:44 AM
Hi,

 that's already down to y custom implementation.

 If scene two is listening to sub level loading, it can then disable some features when it detect that level 3 is loaded. that would work very well.

 I would organize your levels by number but also by depth, level 3 is depth 3, so from level 2, if you want to load another level that would be like level 3 but a variant, I would suggest that you also set n int data on the global event for sub leve loaded to keep track of the depth.

 so when you load 01, the even has a string "01" and an int '0', when it loads "02", the event will have string "02" and an int set to '1', etc etc

so now you have two different information from your level loading system, one is the name, one if the depth, and with this, I am positive that within level2 you can then listen to all new sub level loaded an act accordingly.

Bye,

 Jean
Title: Re: Async Load Level but don't trigger the level change
Post by: PET on July 19, 2016, 08:54:09 AM
Damn. This is a bit to complicated. Isn't there a way to do it easier?

http://docs.unity3d.com/540/Documentation/ScriptReference/AsyncOperation-allowSceneActivation.html

There have to be some stuff that could be added in PlayMaker... like a checkbox or something :D
Title: Re: Async Load Level but don't trigger the level change
Post by: jeanfabre on July 21, 2016, 02:51:30 AM
Hi,

 Actually, my solution would be actually easier then implement asynch operations, even with proper wrappers so you don't have to code anything. Because you'll end up having to build a game manager for your level loading and this general means lots of extra work to cover every case in a generic way.

But, you have a good point actually, I meant to tackle the new SceneManager scope of functionnalities, it's something that I indeed think we should support fully.

I created a Task on Trello (https://trello.com/c/LichVuvn/164-unity-5-multi-scene-support), please up vote, but for sure I'll tackle it no matter what.

Bye,

 Jean

Title: Re: Async Load Level but don't trigger the level change
Post by: PET on July 21, 2016, 05:55:21 AM
I voted on trello :)

Hopefully you can implement this. My scene manangement is pretty straight forward, Scene 1 -> Scene 2 -> Scene 3 and that's it ... but even like this I don't know how to do it without code :(

Title: Re: Async Load Level but don't trigger the level change
Post by: jeanfabre on July 22, 2016, 03:18:30 AM
Hi,

 Does the solution I mentionned above not working ( while I'll work on this) ?

 Bye,

 Jean
Title: Re: Async Load Level but don't trigger the level change
Post by: PET on July 22, 2016, 04:32:19 AM
I didn't really understood the above solution. I don't know what "sub level loading" is.

Like I got the idea of a FSM in Scene 3 that activates when the Scene 3 has loaded... but I don't know how to make Scene 2 to stop changing the level.

But this is not 100% urgent. I can wait like 1 month.
Title: Re: Async Load Level but don't trigger the level change
Post by: dudebxl on July 22, 2016, 10:48:35 AM
Hey guys,
 Fyi there is whole bunch of scene manager actions on the ecosystem
Title: Re: Async Load Level but don't trigger the level change
Post by: PET on November 16, 2016, 03:00:26 AM
Hey Jean. I saw Trello ... is it done? :D
Title: Re: Async Load Level but don't trigger the level change
Post by: jeanfabre on November 16, 2016, 03:29:38 AM
Hi,

 It's pending release, it should be on the next PlayMaker Update :)

 Bye,

 Jean
Title: Re: Async Load Level but don't trigger the level change
Post by: PET on November 16, 2016, 09:02:45 AM
Hell yea! Thanks Jean for doing this! <3  :-* :-* :-* :-* :-* :-* :-* :-*
Title: Re: Async Load Level but don't trigger the level change
Post by: PET on March 14, 2017, 05:53:04 AM
Hello Jean!

Is there a way to get my hands on the new Scene actions? I'm looking on the EcoSystem but not sure how they are called.
Title: Re: Async Load Level but don't trigger the level change
Post by: jeanfabre on March 15, 2017, 03:59:47 AM
Hi,

 There are currently in beta, PlayMaker update will likely be out very soonn, but if you want you can apply for the beta and you'll get access to the the scenes actions. Pm me to apply to the beta.

 Bye,

 Jean
Title: Re: Async Load Level but don't trigger the level change
Post by: BlanketsWilson on July 18, 2018, 10:50:50 PM
I know I'm late to this, but what is this action called? I've been using the load level action but I don't want the transition to happen immediately.

This action seemed great but where can I find it in the ecosystem?


Hi,

 There are currently in beta, PlayMaker update will likely be out very soonn, but if you want you can apply for the beta and you'll get access to the the scenes actions. Pm me to apply to the beta.

 Bye,

 Jean
Title: Re: Async Load Level but don't trigger the level change
Post by: djaydino on July 19, 2018, 06:21:29 AM
Hi.
@BlanketsWilson :

Search for 'Scene'  ;)
Title: Re: Async Load Level but don't trigger the level change
Post by: BlanketsWilson on July 19, 2018, 10:08:15 AM
@djaydino - Is it "Scene preload" in the ecosystem?

If so, I downloaded it and tried running the demo scenes and I'm getting this error

"Could Not Create Action: Load Manager: FSM: Unload: UnloadSceneAsynch (Maybe the script was removed?)"

https://flic.kr/p/27UKBxZ (https://flic.kr/p/27UKBxZ) - picture of error.
Title: Re: Async Load Level but don't trigger the level change
Post by: djaydino on July 19, 2018, 04:31:27 PM
Hi.
They should be in the official action list :) (i think PM 1.8.7+)
Title: Re: Async Load Level but don't trigger the level change
Post by: jeanfabre on August 01, 2018, 03:29:29 AM
Hi,

 the action is named "LoadLevel" and you have a checkbox async to check if you want that level to be loaded asynchonously.

 Bye,

 Jean