Tutorial Bb3 : How To Set And Load Checkpoint Without Reset Score.

Discussion in 'Buildbox General Discussion' started by mohamed awad, Feb 25, 2020.

  1. mohamed awad

    mohamed awad Avid Boxer

    Joined:
    Mar 10, 2019
    Messages:
    314
    Likes Received:
    158
    Hello Boxers,
    without reset score.
    This issue cost me two days searching for a solution, youtube, Buildbox Tutorials, Buildbox Forums and i contact with Buildbox support and they have not responded yet,
    but thank god, i .... maybe can say that I discovered the solution to this issue,
    anyway, let's get started

    First of all, let's build a Checkpoint,
    1-Open BB3
    2- I will use SpaceBuggy Template on this tutorial

    When the project open,
    Open asset library to build new object as Checkpoint

    1.png

    Choose and build Cube shape, this is best shape for checkpoint ( you can choose anther shape )
    Back to 3D World and Select this Cube
    double click to open Edit Nodes

    1- add If Collide Node and edit affected asset to your Character
    2- add Set CheckPoint Node
    3-Connect nodes as shown...

    3.png

    Now we set this Cube as Checkpoint let's add it to game scenes
    Back to 3D World

    1-Chose Cube again
    2-remove the Cube shape to make it invisible
    3-select collision shape mode ( idk real name ):
    4-Change Cube collision shape as you like
    best position for Checkpoint is before start[] scene ..

    Close collision shape mode and make sure the Cube position for path axis ( y axis on this project )
    is the same value for character position
    Why ??????
    When Checkpoint is loaded the character position reset to the Cube position values.

    Now you copy this Cube and paste it on any scene you want

    4.png

    We need to set a Checkpoint loader Button
    Open the Mind Map
    Open GameOver UI
    1- Add Control Button
    2-Choose image for it
    3-Open Asset library and choose Default ( Only one Object you will find )

    Back to GameOver UI and Choose this Default Object

    5.png

    This will open Edit Nodes
    1-Add UI Button
    Choose the Control Button you have already build it above
    2- Add Load CheckPoint Node
    3- ADD Event Observer Node
    Connect Nodes as shown

    Back to GameOver UI and add this default Object to your GameOver UI menu
    7.png

    Back to Mind Map
    Now you can see Event that You added ( Event Observer ) on GameOver UI Node
    1- Connect it to your World
    2-Choose your 3D World and Choose Edit Components
    add CheckPoint Loader Node

    8.png

    Now We build a Full CheckPoint
    But here the problems appear
    When we test this check point and we record the score and current point
    on every load checkpoint the current score is reset back to 0
    What is the matter of Checkpoint now ??

    For solving this issue...
    We need to add the current Score Point (the best scoreon the current scene on current gameplay) to new score record for every Loading new Checkpoint
    it's very complicated and I am not good at english, but anyway

    Open Mind Map >> 3D World and Choose Edit Components
    1-This is a CheckPoint Loader we added above
    2-Add Script node
    Choose it and add this script on this method function start() { }

    this.scene().addScorePoint(this.scene().bestPoints());


    9.png

    Now on every Start 3D World the Current Score will increase to last Score Point
    BUT we need to do this Only if CheckPoint Loaded
    So When we Restart the game or back to home or main menu screen we need restart the current score to 0
    SO
    back to GameOver UI

    1-Add new Control Button ( Restart game button )
    2- Open Asset Library and add new Object ( Change Object name to differentiate it )

    10.png
    Double Click on this new Object to Edit Nodes
    1-Add UI Button Node
    Choose restart game Button that you created above
    2-Add Two Reset Nodes
    one with this settings
    Choose Local
    Your score
    Current
    --and the other one
    Choose Local
    Your score
    Total and best
    3- Add Event Observer Node ( must Change node Name )

    Connect Nodes as shown

    11.png


    Back to GAME OVER UI
    1-Add the new object
    2-Set the restart button

    Back to Mind Map >> Game Over UI Node you will find the new connection ( restart game ) event you added
    Connect it to 3D World Node If restart the game
    or Main Menu or anywhere you wish...
    12.png
    We Done
    You can test Your CheckPoint now....
    Here is the Project file
    Buildbox v3.1.4

    https://drive.google.com/file/d/1-GjoarRWCLl8-Xr94iviNAAKA7e1q3qU/view?usp=sharing

    I hope this become useful and sorry for bad english..
    Like and post thank you for this Tutorial :)
     
    Last edited: Feb 25, 2020
  2. shahar.m192

    shahar.m192 Avid Boxer

    Joined:
    Oct 7, 2018
    Messages:
    204
    Likes Received:
    44
    thank you
     
    mohamed awad likes this.
  3. mohamed awad

    mohamed awad Avid Boxer

    Joined:
    Mar 10, 2019
    Messages:
    314
    Likes Received:
    158
    your welcome
     
  4. Regie Arines

    Regie Arines Boxer

    Joined:
    Mar 2, 2020
    Messages:
    6
    Likes Received:
    0
    Hi, your guide helps me a lot and it's working very big thanks to you..
    But the---this.scene().addScorePoint(this.scene().bestPoints())
    Added in the script node is not working in my project, I even tried to put it in the checkpoint loader node but no luck for me..points resets to zero when checkpoint was loaded, and another issue is sometimes the loaded checkpoint scene was the next checkpoint not the last checkpoint touched by the character..
     
  5. mohamed awad

    mohamed awad Avid Boxer

    Joined:
    Mar 10, 2019
    Messages:
    314
    Likes Received:
    158
    Regie Arines are you sure you add this script on Script Node - Start function? + this script works only with score recorded as current and best score point
    and what is button you used to load checkpoint ?
    Download bbdoc file
    it's explain evrything
     
  6. Regie Arines

    Regie Arines Boxer

    Joined:
    Mar 2, 2020
    Messages:
    6
    Likes Received:
    0
    Yup, exact place you mentioned, and same as the screen shot. I copied and pasted the script to avoid wrong script,

    I didn't do the last part about the reset button, coz I think that's a different issue to the checkpoint loading score points. And other reason is I already had a reset button. But feel free to correct me if I'm wrong ☺️
     
  7. mohamed awad

    mohamed awad Avid Boxer

    Joined:
    Mar 10, 2019
    Messages:
    314
    Likes Received:
    158
  8. Regie Arines

    Regie Arines Boxer

    Joined:
    Mar 2, 2020
    Messages:
    6
    Likes Received:
    0
    The checkpoint is just for the scene and not for another world, like I'm putting a checkpoint in scene 10, 15 etc...
     
  9. Karamer

    Karamer Boxer

    Joined:
    Feb 10, 2020
    Messages:
    8
    Likes Received:
    1
    it works fine. Thank you.but when every game is over, the checkpoint option appears again. I want the checkpoint option to appear once, and if the game ends again, it should return to the main menu.
     
  10. Karamer

    Karamer Boxer

    Joined:
    Feb 10, 2020
    Messages:
    8
    Likes Received:
    1
    Also I want to use the checkpoint system as a reward video. how can I do that.
     
  11. mohamed awad

    mohamed awad Avid Boxer

    Joined:
    Mar 10, 2019
    Messages:
    314
    Likes Received:
    158
    if it dosn't work until now please drag bbdoc temp here to check it out
     
    Last edited: Mar 19, 2020
  12. mohamed awad

    mohamed awad Avid Boxer

    Joined:
    Mar 10, 2019
    Messages:
    314
    Likes Received:
    158
    on check point loader button add reward video..

    about button appears again i have tried to do this but there is no way i think...
    maybe in app purchase method can solve this issue but it is available only with pro subscription
     
    Last edited: Mar 19, 2020
  13. Karamer

    Karamer Boxer

    Joined:
    Feb 10, 2020
    Messages:
    8
    Likes Received:
    1
    I have pro subscription if you know solution can you tell me ?
     
  14. mohamed awad

    mohamed awad Avid Boxer

    Joined:
    Mar 10, 2019
    Messages:
    314
    Likes Received:
    158
  15. Rameo

    Rameo Boxer

    Joined:
    Mar 22, 2020
    Messages:
    21
    Likes Received:
    1
    After collide with an checkpoint and over enemy. When continue the play with load checkpoint.... but it play like invert direction.

    Give the right resolution for this guys. Screenshot-1334x750-2020-03-28-10.42.05AM.png
     
  16. mohamed awad

    mohamed awad Avid Boxer

    Joined:
    Mar 10, 2019
    Messages:
    314
    Likes Received:
    158
    Rameo Make sure you are set character rotations to 0 and path direction axis for character and checkpoint the same value,
    if you want to rotate character shapes, do it from 3D moduls node
     
  17. Rameo

    Rameo Boxer

    Joined:
    Mar 22, 2020
    Messages:
    21
    Likes Received:
    1
    I changed as you said for rotation option. But there is any change in that, same.
     
  18. Rameo

    Rameo Boxer

    Joined:
    Mar 22, 2020
    Messages:
    21
    Likes Received:
    1
    Not effective at all Mohamed awad. restart will work smoothly. But while return from load checkpoint there is an issue like this? 4 projects are done for this in both 3D & 2D as well.
     

    Attached Files:

  19. mohamed awad

    mohamed awad Avid Boxer

    Joined:
    Mar 10, 2019
    Messages:
    314
    Likes Received:
    158
    in fact, i see nothing from this image,
    more explaining please
     
    aminee and Rameo like this.
  20. Karamer

    Karamer Boxer

    Joined:
    Feb 10, 2020
    Messages:
    8
    Likes Received:
    1
    can you upload bbdoc file ?
     
    Rameo likes this.

Share This Page