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:
    315
    Likes Received:
    158
    Edit*
    How to remove checkpoint button after using it - and of course reset it
    Let's say that is your game over UI
    1- Main menu button
    2- revive button (reward)
    3- restart button
    sd.png

    What we need is...
    When we pressed revive button it's disappears on next game over
    and when pressed restart or main menu revive button back again on next game over UI
    It's very simple
    We will define a variable -- when press revive this var will equal true and remove revive button
    and when press main menu or restart or any other button on game over UI forcing you to restart your game
    even if this button on main menu UI like start button
    just to avoid issues like if the player close the app without reset this variable or on first time opinning it ....
    any way...
    1- we will use a revive button as object
    on tutorial i used it as control button so remove this control button and replace it with revive object
    it's very similar - but here is
    sd1.png

    to do what we said above-
    variable name is "removech"
    We will add script node for restart and main menu
    1- add script node
    2- add input signal connectet with UI button or touch button or whatever is activate it
    3- add this script inside signal function

    function signal(name, value, sender){
    if(name == 'en' && value){
    Settings.removech = false;
    }

    }

    4- on revive object we will do the same but it will be true
    function signal(name, value, sender){
    if(name == 'en' && value){
    Settings.removech = true;
    }
    }
    5- + this script on revive object too - inside Start function
    function start(){
    if(Settings.removech == true){
    this.emitSignal('x' , true);
    }
    }


    and connect the output with remove node


    sd34.png

    now we done
    i hope this is helpful....
    Thanks.
     

    Attached Files:

    Last edited: May 12, 2020
    aminee likes this.
  2. Serdar

    Serdar Boxer

    Joined:
    Apr 5, 2020
    Messages:
    27
    Likes Received:
    2
    How can you create revive object ? is it control button or navigation button ? I don't understand ?
     
  3. mohamed awad

    mohamed awad Avid Boxer

    Joined:
    Mar 10, 2019
    Messages:
    315
    Likes Received:
    158
    3-Open Asset library and choose Default ( Only one Object you will find ) "Arrow-3"
    Back to GameOver UI and you will find it under Objects

    [​IMG]
     
    aminee likes this.
  4. Serdar

    Serdar Boxer

    Joined:
    Apr 5, 2020
    Messages:
    27
    Likes Received:
    2
    thanks @mohamed awad . can you share bbdoc file ?

    I don't understand this line, where do we paste these lines.

    4- on revive object we will do the same but it will be true
    function signal(name, value, sender){
    if(name == 'en' && value){
    Settings.removech = true;
    }
    }
     
  5. mohamed awad

    mohamed awad Avid Boxer

    Joined:
    Mar 10, 2019
    Messages:
    315
    Likes Received:
    158
    inside new script node
    this is revive object with 2 script nodes
    [​IMG]

    first one connected with touch node
    add this line
    function signal(name, value, sender){
    if(name == 'en' && value){
    Settings.removech = true;
    }
    }
     
    aminee likes this.
  6. Serdar

    Serdar Boxer

    Joined:
    Apr 5, 2020
    Messages:
    27
    Likes Received:
    2
    no! you said put this line first script node,
    ** Settings.removech = false;

    in this map only two script nodes.
    You said,

    3- add this script inside signal function - THIS IS CLEAR

    function signal(name, value, sender){
    if(name == 'en' && value){
    Settings.removech = false;
    }
    }

    4- on revive object we will do the same but it will be true - THIS IS NOT CLEAR , Which node
    function signal(name, value, sender){
    if(name == 'en' && value){
    Settings.removech = true;
    }
    }
    5- + this script on revive object too - inside Start function - THIS IS CLEAR
    function start(){
    if(Settings.removech == true || Settings.removech == null){
    this.emitSignal('x' , true);
    }
    }
     
  7. mohamed awad

    mohamed awad Avid Boxer

    Joined:
    Mar 10, 2019
    Messages:
    315
    Likes Received:
    158
    no no no!
    man, i said above 3- that inside restart and main menu we will add this script
    function signal(name, value, sender){
    if(name == 'en' && value){
    Settings.removech = false;
    }
    }
    after that 4- i'm start talking about revive object...
    anyway
    i will upload bbdoc file
    give me 2 sec...
     
  8. mohamed awad

    mohamed awad Avid Boxer

    Joined:
    Mar 10, 2019
    Messages:
    315
    Likes Received:
    158
  9. Serdar

    Serdar Boxer

    Joined:
    Apr 5, 2020
    Messages:
    27
    Likes Received:
    2
    thanks. but When I add rewarded node in revive object (your bbdoc file) , your revive object doesn't work.
     

    Attached Files:

  10. mohamed awad

    mohamed awad Avid Boxer

    Joined:
    Mar 10, 2019
    Messages:
    315
    Likes Received:
    158
    reward node only work with unique network id and should uploaded to play store if admob network
    other networks might work if you just export project to android studio
    and of course it doesn't work anyway inside buildbox preview
     
    aminee likes this.
  11. Samkhan

    Samkhan Boxer

    Joined:
    May 12, 2020
    Messages:
    11
    Likes Received:
    0
    When i try this method its work properly but after 2-3 games try it make character big please help
     

    Attached Files:

  12. mohamed awad

    mohamed awad Avid Boxer

    Joined:
    Mar 10, 2019
    Messages:
    315
    Likes Received:
    158
    when restart checkpoint the character scales will reset to 1.1.1
    on game world set character scales to 1.1.1
    and edit your scale values inside character nodes editor-3DModel
     
    aminee likes this.
  13. Samkhan

    Samkhan Boxer

    Joined:
    May 12, 2020
    Messages:
    11
    Likes Received:
    0
    why this pop up is showing.
    please help i have upload beta version of my game on play store i want this option to automatic accept or not show this pop.
     

    Attached Files:

  14. Codifie

    Codifie Avid Boxer

    Joined:
    Apr 17, 2018
    Messages:
    364
    Likes Received:
    190
    If you are using ads in your game this consent screen is a requirement and only shows once. You can not automatically have it accept, if you do you will not be adhering to the privacy policy rules set forth by Apple and Google. You need to just leave this alone.
     
    mohamed awad likes this.
  15. JSeeger6

    JSeeger6 Avid Boxer

    Joined:
    Aug 29, 2018
    Messages:
    100
    Likes Received:
    12
    I think an easier way to do this is simply to define a new settings lets say "Settings.lastPoints" and "Settings.revive = false" or something. Then say if the character is defeated and revive is false, then don't do anything and score will reset, etc. Otherwise if the user presses the revive (aka Settings.revive == true), then set "Settings.lastPoints" equal to your this.scene().currentPoints() and set Settings.revive = false again afterwards. Something along those lines! You get the point haha
     
  16. mohamed awad

    mohamed awad Avid Boxer

    Joined:
    Mar 10, 2019
    Messages:
    315
    Likes Received:
    158
    yeah, that's a better way
     
  17. Abdul-Rahman

    Abdul-Rahman Boxer

    Joined:
    Jun 9, 2020
    Messages:
    9
    Likes Received:
    0
    You can make a video on youtube ?
     
  18. mohamed awad

    mohamed awad Avid Boxer

    Joined:
    Mar 10, 2019
    Messages:
    315
    Likes Received:
    158
    @Smart Penguins already publish a video explaining a revive button with a better way
     
  19. bercii

    bercii Boxer

    Joined:
    Jun 26, 2020
    Messages:
    1
    Likes Received:
    0
    is this works in 2d too?
     
  20. Dmytro

    Dmytro Boxer

    Joined:
    May 9, 2020
    Messages:
    27
    Likes Received:
    5
    @mohamed awad Hello! Cool way, but I had a problem, when I press the "revive" button, my character really is reborn, but his clone also appears in a horizontal position, how can this be fixed?
     

Share This Page