Checkpoint System

● ARCHIVED · READ-ONLY
Started by Bravo2Kilo 13 posts View original ↗
  1. Checkpoint System




    By: Bravo2Kilo


    Introduction

    This script adds a checkpoint system to the game. If the player dies, instead of a game over you will respawn at a checkpoint. This script also has a lives feature, when you die you will lose a life, if you have no lives you will get a game over.

    Screenshot

    none

    Script

    You can get the script from my blog here

    Credit

    - Bravo2Kilo

    Terms of Use

    Terms of use can be found at my blog
  2. Isnt this is what saves are for? Oh well Nice script :)
  3. Mudgrunt said:
    Isnt this is what saves are for? Oh well Nice script :)
    True enough, but I can imagine plenty of game styles, especiall horror-themed ones, that might use this system.

    I was planning on looking into a possible "remove save feature" after I get used to the program myself, as I wanted to have a "save point" in my games, rather than saving at-will, if that were even possible.

    This script works great for hinting at that possibility already! :D
  4. Oh ya I never really though of that...hmmm I might just make a horror game...
  5. I just updated the script fixing a bug.
  6. I just cant make the script work. If I die I get no respawn or anything else. Please some help here? 
  7. mariomshinu said:
    I just cant make the script work. If I die I get no respawn or anything else. Please some help here? 
    The script is configured by switches as defined in the beginning of the script.

    Which switches have you choosen to control the script's function, and have you added the neccessary events with control switch commands to activate the scripts function?

    Is it possible that you forgot to reserve those switches and have used them for other functions in the game, resulting in random disabling of the script?
  8. Thanks for response. I think I cannot make ir work because I  have problems with the language but I will try. I have just made 5 new events to check the script. This is my example:

    Event 1. Parallel process. Switch that actives CHECKPOINT_SWITCH = 1

    Event 2. Parallel process. Switch that actives the life system LIFE_SWITCH = 2

    Event 3. Active by touching the event. Script call, calling: set_checkpoint

    Event 4. Active by touching the event. Script call, calling: add_life (1)

    Event 5. Active by touching the event. Game over.

    In that order. Am I doing everything wrong? Can anyone put an example that works please? Thanks in advance.
  9. How did you activate the switches? Please provide screenshots of the events.

    That said - a parallel process repeats itself until deactivated, which means that your events one and two will be run 60 times per second, activating those switches with every frame again and again. Depending on what they're doing exactly this could cause a lot of problems, and it will increase lag.

    another problem might be if you have other events using the same switches - you should always name any switch you're using to prevent them from being used for two different things, and in the case of script-used switches, that's even more important.

    Or one of your events 3 to 5 might not have been activated correctly due to wrong conditions - that would also cause problems.

    And no, no one can put on an example that works because there are to many specific problems to see, and we would need to make a game with those scripts (while you have everything already setup and we would only need to check for the error in your events).

    Only with screenshots of your events we can check the details of what might have gone wrong.
  10. 01.png This is how my scene like

    02.png Here we have the checkpoint switch turning on by touching event.

    03.png Here we have the life system switch turning on by touching event.

    04.png Here we have the event that calls the add_life (1) script

    05.png Here we have the event that calls the set_checkpoint script

    06.png And finally here we have the game over event

    To make the example easier all the buttons, events or wharever are actives by touch event and below the character. 

    Thanks again.
  11. The script does exactly what it is intended to do - the problem is in your logic.

    I assumed that you would be able to use event 3 several times to add more than one life, but your coding (with the self-switch) enforces that the player can only get one life once.

    And if the life-counter in that script is activated, then it's game over when you loose the last life (see it's description)

    Player has 1 life - dies - gameover

    The script works exactly as intended, try it with more than one live ;-)

    And if you force a gameover by a gameover command, then that goes directly to the gameover screen - that is not the same as loosing a live in combat.

    I don't see any combat event on the map - are you going around until you die by random encounter or how do you test that script's behaviour of returning the player to the checkpoint if he dies?
  12. I didn't know that the game over command didn't work with this type of things. I just changed the add_life (1) to add_life (5) and got killed in a battle and it's done, script working for me. Thank you so much for your help.

    Edit: I just try it again with the script add_life (1) and works, so I imagine the big problem was I was calling the Game Over event. anyway thanks for the help.

    Edit: So... another question. Is there any way I could see a counter of remaining lifes and / or a message when you respawn at the checkpoint? 
  13. This is an old thread so I wonder if anyone can still help.

    I can't seem to get this script working. I call set_checkpoint even script through one event, and then when I die it just does a game over.

    Is there anything else I need to do?

    (Additionally, is there a way to add a text box once the player respawns?)