Added LoopRandomLevels option on completion of all Levels (World). Google Drive: Updated BBDOC V4 https://drive.google.com/open?id=1mA3Adc_F-yIb6qOToYB1PAIzqHffbI2H
Thanks @particles I got the Random levels to work in a different way. But it seems like this SKLevelSelectorAsset works only IF COLLIDE (Character) with Finish Line. What if the level ends with Points / Coins? Is there a way around? After certain amount of points, triggers Event Observer on UI to Complete a Level, tried a solution with your SKLevelSelectror, but it does not increment levels. Best, Itzo
Mission impossible. Each level completes when a different session points are reached and that is configured in the World UI event observer (the eye-looking icon), not with a node Event Observer. So how to link SKLevel up to an Event Observer that’s placed on UI when reached the required points? There is no node map there.
In game jam game, I used script, which saves current level id into Settings.ID. So, when you start game, level ID gets saved and when you restart, it starts from last saved level. I didn't use levelselector node.
For doing that, make new asset without mesh and drag it into each scene. In that asset's node map, add script node, add new number attribute from right side, and into function int(){ add something like this: let level = this.attribute('Levels'); Setting.ID = level; And pin that level attribute. And on 3d world scene, click on that invisible object and set your current level there. I can't guarantee that code is 100% correct, typed it as remembered.
Connect the output from Event Observer to a (new UI) LevelUpUI and add SKLevelUp node there. Wait a delay of say .5 seconds and then redirect to the Complete UI. Everything will work as per requirement.
I did it in a different way @particles - thanks to Hanomax and I was able to randomize the worlds as well
@particles do you know how to save levels progress if game crash? It appears that it saves level progress when the game quits, but when it crash, it looses all data and I start from level 1 even with Sklevelselector. As we are introduced with beta versions of BB3, crashes are imminent Like adding a small code in AppDelegate somewhere on ScreenOnEnter or applicationWillTerminate? Itzo
Yes. It is possible. You can do a change that in level selector asset. I am busy with my Artificial Intelligence project, will check on my free time.
Actually we can do that by adding a code in ScreenOnEnter but that code is broken in the latest BB3 build. //Make sure you include this line below 1. #include "screens/PTPScoreController.h" // in top of AppDelegate.mm 2.//below - (void)screenOnEnterconst char *)name { PTPSettingsController obj; obj.save(); @Sean Buildbox Hi Sean, calling obj.save(); makes the game to begin malfunctioning. Please help to fix.
@particles @itzonator @Hanomax Hi,i came across a bug.I have a game with 70+ levels as of now.So each level loads in random order as per the nodes shared above.But out of random the UI and the world that has world name UI which points LevelSelectorUI pops up.Could you tell me how to fix it?
I am not sure I follow here. I was able to add random levels without issues with @particles Level Selector v.3 The way I did that, you duplicate the worlds you have created and link them to the Level Selector. They will load and make sure you are using just one World UI for all random Worlds. When the level is complete, goes back to that Random node.
Hi,thanks for the response ☺. Yeah I have duplicated the world and linked them to level selector and it works fine.However after playing few levels the first screen in level selector with that big white cube pops up.I didn't had trouble with this for my previous game.I don't know why it appears now.Here is what I did... Added level numbers within the node.Changed the total level number.Connected menu jumps and finally in mindmap have linked all corresponding worlds to the master level. But the very first world screen in master level which has been linked to dummy UI screen pops up in between levels
The white cube appears, because you ran out of levels. If you set it to 70 levels, on level 71 will show the white cube. That’s why. Even if you set it to random, you have to make sure you have enough worlds duplicated that support the level count.