Sklevelselector - Levels By Worlds In Bb3 For Non-coders

Discussion in 'BBNodes' started by particles, Nov 7, 2019.

  1. particles

    particles Avid Boxer

    Joined:
    Aug 31, 2018
    Messages:
    337
    Likes Received:
    242
    Added LoopRandomLevels option on completion of all Levels (World).

    Google Drive: Updated BBDOC V4
    https://drive.google.com/open?id=1mA3Adc_F-yIb6qOToYB1PAIzqHffbI2H


    [​IMG]
     

    Attached Files:

    itzonator likes this.
  2. itzonator

    itzonator Serious Boxer

    Joined:
    Dec 18, 2017
    Messages:
    595
    Likes Received:
    230
    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
     
    particles likes this.
  3. particles

    particles Avid Boxer

    Joined:
    Aug 31, 2018
    Messages:
    337
    Likes Received:
    242
    Instead of If Collide(Character), connect SKLevelUp node after player reached required points/coins.
     
  4. itzonator

    itzonator Serious Boxer

    Joined:
    Dec 18, 2017
    Messages:
    595
    Likes Received:
    230
    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.
     
  5. Hanomax

    Hanomax Avid Boxer

    Joined:
    Aug 24, 2018
    Messages:
    157
    Likes Received:
    85
    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.
     
    itzonator likes this.
  6. itzonator

    itzonator Serious Boxer

    Joined:
    Dec 18, 2017
    Messages:
    595
    Likes Received:
    230
    Interesting, do you have a tutorial on that? :)
     
  7. Hanomax

    Hanomax Avid Boxer

    Joined:
    Aug 24, 2018
    Messages:
    157
    Likes Received:
    85
    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.
     
  8. particles

    particles Avid Boxer

    Joined:
    Aug 31, 2018
    Messages:
    337
    Likes Received:
    242
    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.
     
  9. particles

    particles Avid Boxer

    Joined:
    Aug 31, 2018
    Messages:
    337
    Likes Received:
    242
    If you can't able to then PM me.
    [​IMG]
     
    itzonator likes this.
  10. itzonator

    itzonator Serious Boxer

    Joined:
    Dec 18, 2017
    Messages:
    595
    Likes Received:
    230
    I did it in a different way @particles - thanks to Hanomax and I was able to randomize the worlds as well :)
     
  11. Colin MH

    Colin MH Boxer

    Joined:
    Nov 15, 2018
    Messages:
    26
    Likes Received:
    17
    Hi Hanomax, this solution only works for One World, right? Not multiple worlds.

     
  12. Hanomax

    Hanomax Avid Boxer

    Joined:
    Aug 24, 2018
    Messages:
    157
    Likes Received:
    85
    This method is for multiple worlds (each level is new world).
     
  13. whitedogapp

    whitedogapp Avid Boxer

    Joined:
    Oct 8, 2015
    Messages:
    295
    Likes Received:
    72
  14. itzonator

    itzonator Serious Boxer

    Joined:
    Dec 18, 2017
    Messages:
    595
    Likes Received:
    230
    @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
     
  15. particles

    particles Avid Boxer

    Joined:
    Aug 31, 2018
    Messages:
    337
    Likes Received:
    242
    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.
     
  16. particles

    particles Avid Boxer

    Joined:
    Aug 31, 2018
    Messages:
    337
    Likes Received:
    242
    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)screenOnEnter:(const char *)name {
    PTPSettingsController obj;
    obj.save();

    @Sean Buildbox Hi Sean, calling obj.save(); makes the game to begin malfunctioning. Please help to fix.
     
    itzonator likes this.
  17. TheGameAppStudio

    TheGameAppStudio Serious Boxer

    Joined:
    Nov 2, 2016
    Messages:
    927
    Likes Received:
    318
    @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?
     
    Jaro likes this.
  18. itzonator

    itzonator Serious Boxer

    Joined:
    Dec 18, 2017
    Messages:
    595
    Likes Received:
    230
    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.
     
  19. TheGameAppStudio

    TheGameAppStudio Serious Boxer

    Joined:
    Nov 2, 2016
    Messages:
    927
    Likes Received:
    318
    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
     
  20. itzonator

    itzonator Serious Boxer

    Joined:
    Dec 18, 2017
    Messages:
    595
    Likes Received:
    230
    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.
     

Share This Page