Making checkpoints/respawn points

Henlo I'm completely new to using RPG Maker engines or making games in general so I'm really unfamiliar with this kind of thing

I wanna know how to make a system where you are respawned to the last checkpoint you interacted with (similar to Toro's Black Souls Dark Souls bonfire system) instead of sending you to the game over screen and put you to the title screen, but I have found almost nothing regarding this topic around the internet. Either they're old threads with missing resources or they are used for MV

With how very inexperienced I am at scripting or anything sort, I am completely lost and I have nowhere to start.
Assistance is really appreciated!
have 3 variables reserved for map ID, X and Y.
on interaction with the event, save those values to those variables.
on death, use a common event to send the player there.
You know, I had published my script Kyonides' Respawn Point long time ago. Perhaps you might wanna google it. I could say it's just another way to do what the previous poster mentioned before.
I have to say Bings Ai Assistant helped me search for a Solution i would have never found alone.

1. On the Top Bar - Open Script Editor - Scroll down and insert new empty Page in the Materials Section.
Copy paste this Script:
Edit: It just works a few Times and than stops working. Sorry iam no scripter and have no clue why this is happening. Its not the old safe files, just deleted them and retested.

Edit:
Sadly i was not able to make it work to just safe and load the last safe file, it always stops working.
But Ai helped me to create smal script to allow safing and loading a specific Savefile with event script command.
It seems to work just fine. Maybe this helps getting started with this Mechanic.
Script:
Code:
class Game_Interpreter
  def load_game(index)
    DataManager.load_game(index)
    SceneManager.goto(Scene_Map)
  end
end
class Game_Interpreter
  def save_game(index)
    DataManager.save_game(index)
    SceneManager.goto(Scene_Map)
  end
end

Scriptcall to Safe Load the first Safe Slot.
Code:
save_game(0)
Code:
load_game(0)
have 3 variables reserved for map ID, X and Y.
on interaction with the event, save those values to those variables.
on death, use a common event to send the player there.
I'm uhh lost in the sauce
I get the idea, but I have no idea how to execute it.
I tried to match it like the game I was referring to, but I have no clue on how to even start it, let alone know how variables work (I'm sorry)
If you like, I can show you how it works exactly in the game I was referring to for reference--
You know, I had published my script Kyonides' Respawn Point long time ago. Perhaps you might wanna google it. I could say it's just another way to do what the previous poster mentioned before.
Perhaps you might wanna send the link instead cuz I see nothing at all, even going through the effort of digging through your profile and find nothing

I have to say Bings Ai Assistant helped me search for a Solution i would have never found alone.

1. On the Top Bar - Open Script Editor - Scroll down and insert new empty Page in the Materials Section.
Copy paste this Script:
Edit: It just works a few Times and than stops working. Sorry iam no scripter and have no clue why this is happening. Its not the old safe files, just deleted them and retested.

Edit:
Sadly i was not able to make it work to just safe and load the last safe file, it always stops working.
But Ai helped me to create smal script to allow safing and loading a specific Savefile with event script command.
It seems to work just fine. Maybe this helps getting started with this Mechanic.
Script:
Code:
class Game_Interpreter
  def load_game(index)
    DataManager.load_game(index)
    SceneManager.goto(Scene_Map)
  end
end
class Game_Interpreter
  def save_game(index)
    DataManager.save_game(index)
    SceneManager.goto(Scene_Map)
  end
end

Scriptcall to Safe Load the first Safe Slot.
Code:
save_game(0)
Code:
load_game(0)
I appreciate the work, but it's not quite what I'm looking for.
I want the deaths to be accounted for, not load to the previous save file as if the death never happened (I dunno if that makes sense)
In that case you can still find it here, @Nanotial_D .
respawned to the last checkpoint you interacted with
Do you need to turn a switch on when the party dies?
Spoiler: Return to checkpoint
Ruby:
# ╔═════════════════════════════════════╦════════════════════╗
# ║ Title: Checkpoint save              ║  Version: 1.01     ║
# ║ Author: Roninator2                  ║                    ║
# ╠═════════════════════════════════════╬════════════════════╣
# ║ Function:                           ║   Date Created     ║
# ║                                     ╠════════════════════╣
# ║ Return actor to checkpoint          ║    23 May 2023     ║
# ╚═════════════════════════════════════╩════════════════════╝
# ╔══════════════════════════════════════════════════════════╗
# ║ Instructions:                                            ║
# ║                                                          ║
# ║   Specify the default data                               ║
# ║    X = map x position to return                          ║
# ║    Y = map y position to return                          ║
# ║    Map = Map id for the map to return                    ║
# ║    Direction = directional facing for the actor (2,4,6,8)║
# ║                                                          ║
# ║   Use script command to change checkpoint                ║
# ║     set_new_checkpoint(map,x,y,d)                        ║
# ║       for example                                        ║
# ║     set_new_checkpoint(5,7,2,4)                          ║
# ║                                                          ║
# ╚══════════════════════════════════════════════════════════╝
# ╔══════════════════════════════════════════════════════════╗
# ║ Terms of use:                                            ║
# ║ Free for all uses in RPG Maker - Except Nudity           ║
# ╚══════════════════════════════════════════════════════════╝

#==============================================================================
# ** CheckPoint Save Variable
#==============================================================================
module R2_Checkpoint_Save
  # set default save checkpoint
  Default = [5, 5, 5, 2] # map id, x, y, direction (2, 4, 6, 8)
end

#==============================================================================
# ** Game_Interpreter
#==============================================================================
class Game_Interpreter
  def set_new_checkpoint(map, x, y, d)
    $game_party.save_new_checkpoint(map,x,y,d)
  end
end

#==============================================================================
# ** Game_Party
#==============================================================================
class Game_Party
  attr_accessor :scp
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  alias r2_init_checkpoint_save initialize
  def initialize
    r2_init_checkpoint_save
    @scp = R2_Checkpoint_Save::Default
  end
  #--------------------------------------------------------------------------
  # * Defeat Processing
  #--------------------------------------------------------------------------
  def save_new_checkpoint(map, x, y, d)
    @scp = [map, x, y, d]
  end
end

#==============================================================================
# ** BattleManager
#==============================================================================
module BattleManager
  #--------------------------------------------------------------------------
  # * Defeat Processing
  #--------------------------------------------------------------------------
  def self.process_defeat
    $game_message.add(sprintf(Vocab::Defeat, $game_party.name))
    wait_for_message
    revive_battle_members
    SceneManager.return
    battle_end(2)
    $game_player.reserve_transfer(*$game_party.scp)
    $game_player.perform_transfer
    replay_bgm_and_bgs
    return true
  end
end
@Nanotial_D
make a common event containing three "control variable" entries:
-Var1, SET, to "Game Data", "mapID"
-Var2, SET, to "Game Data", "Player X"
-Var3, SET, to "Game Data," "Player Y"

at the point where you're supposed to have the save point, drop an event.
set the event to action button, and call that common event.

make a new common event with a "transfer player" entry, set the designation to variables, and use those variables to set the map and point.
if your player isn't supposed to die unless in battle, set the battle entry to "continue when losing", and at the "if lose" branch, call the transfer event.
if you don't call the transfer after losing, it'll send you to the game over screen.
if your player can die at events other than battle, you'll have to call that event at every instance.
Many thanks
I gave it a try but it gave me this error and tbh I'm not smart enough to know how to fix this
1685159694327.png


Do you need to turn a switch on when the party dies?
Spoiler: Return to checkpoint
Ruby:
# ╔═════════════════════════════════════╦════════════════════╗
# ║ Title: Checkpoint save              ║  Version: 1.01     ║
# ║ Author: Roninator2                  ║                    ║
# ╠═════════════════════════════════════╬════════════════════╣
# ║ Function:                           ║   Date Created     ║
# ║                                     ╠════════════════════╣
# ║ Return actor to checkpoint          ║    23 May 2023     ║
# ╚═════════════════════════════════════╩════════════════════╝
# ╔══════════════════════════════════════════════════════════╗
# ║ Instructions:                                            ║
# ║                                                          ║
# ║   Specify the default data                               ║
# ║    X = map x position to return                          ║
# ║    Y = map y position to return                          ║
# ║    Map = Map id for the map to return                    ║
# ║    Direction = directional facing for the actor (2,4,6,8)║
# ║                                                          ║
# ║   Use script command to change checkpoint                ║
# ║     set_new_checkpoint(map,x,y,d)                        ║
# ║       for example                                        ║
# ║     set_new_checkpoint(5,7,2,4)                          ║
# ║                                                          ║
# ╚══════════════════════════════════════════════════════════╝
# ╔══════════════════════════════════════════════════════════╗
# ║ Terms of use:                                            ║
# ║ Free for all uses in RPG Maker - Except Nudity           ║
# ╚══════════════════════════════════════════════════════════╝

#==============================================================================
# ** CheckPoint Save Variable
#==============================================================================
module R2_Checkpoint_Save
  # set default save checkpoint
  Default = [5, 5, 5, 2] # map id, x, y, direction (2, 4, 6, 8)
end

#==============================================================================
# ** Game_Interpreter
#==============================================================================
class Game_Interpreter
  def set_new_checkpoint(map, x, y, d)
    $game_party.save_new_checkpoint(map,x,y,d)
  end
end

#==============================================================================
# ** Game_Party
#==============================================================================
class Game_Party
  attr_accessor :scp
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  alias r2_init_checkpoint_save initialize
  def initialize
    r2_init_checkpoint_save
    @scp = R2_Checkpoint_Save::Default
  end
  #--------------------------------------------------------------------------
  # * Defeat Processing
  #--------------------------------------------------------------------------
  def save_new_checkpoint(map, x, y, d)
    @scp = [map, x, y, d]
  end
end

#==============================================================================
# ** BattleManager
#==============================================================================
module BattleManager
  #--------------------------------------------------------------------------
  # * Defeat Processing
  #--------------------------------------------------------------------------
  def self.process_defeat
    $game_message.add(sprintf(Vocab::Defeat, $game_party.name))
    wait_for_message
    revive_battle_members
    SceneManager.return
    battle_end(2)
    $game_player.reserve_transfer(*$game_party.scp)
    $game_player.perform_transfer
    replay_bgm_and_bgs
    return true
  end
end
Switch on as in the respawn or the battle itself? (I don't really understand)
I put it in the scripts editor page but uhhh tbh I really don't get anything.

@Nanotial_D
make a common event containing three "control variable" entries:
-Var1, SET, to "Game Data", "mapID"
-Var2, SET, to "Game Data", "Player X"
-Var3, SET, to "Game Data," "Player Y"

at the point where you're supposed to have the save point, drop an event.
set the event to action button, and call that common event.

make a new common event with a "transfer player" entry, set the designation to variables, and use those variables to set the map and point.
if your player isn't supposed to die unless in battle, set the battle entry to "continue when losing", and at the "if lose" branch, call the transfer event.
if you don't call the transfer after losing, it'll send you to the game over screen.
if your player can die at events other than battle, you'll have to call that event at every instance.
This one right here might be the one I'm looking for. In all honesty, this one worked quite pretty well for my tiny pea brain, haha.. It's really simple but it's the most effective one. Thank you for coming back and explain it more thoroughly step by step.

For the others that helped out, I really appreciate your time just to help a total newb like me
If I get advanced enough, I might come back and try everyone's method again. Again, thank you!!
Switch on as in the respawn or the battle itself? (I don't really understand)
I put it in the scripts editor page but uhhh tbh I really don't get anything.
I was asking if you needed to turn a switch on. Depends on whatever it is you are doing or what your goals are. Adding in a switch is not hard.

You don't get anything? When your party dies it does nothing? Then you have a script conflict.
Or are you referring to calling the game over screen from a command in an event.
I build this script for dying in battle.
Moved to: RGSSx Script Support
It's really simple but it's the most effective one.
wouldn't have it any other way 😀

do note that this method warps you back to a previous location... it doesn't *restore* the state of gameplay at that moment of interaction.
if you took a quest after that point, and you die while at it, you'll be warped back to it with that quest already started.
since you mention Dark Souls's bonfire, you might want to use a save point, not a warp point.... but that requires file management, and that needs scripting, and it's messier.
if you're not using quests or checkpoints that need to be restored to a previous state, this will do just fine.
I was asking if you needed to turn a switch on. Depends on whatever it is you are doing or what your goals are. Adding in a switch is not hard.

You don't get anything? When your party dies it does nothing? Then you have a script conflict.
Or are you referring to calling the game over screen from a command in an event.
I build this script for dying in battle.
Ideally when the party dies, the party's max HP decreases and loses their currency unless picked up from the death point and use an item to restore those max HP, but that comes in another time.

There's no game over screen, it'll just sends you back to your last assigned checkpoint. I think I should've explained it better orz
Ideally when the party dies, the party's max HP decreases and loses their currency unless picked up from the death point and use an item to restore those max HP, but that comes in another time.

There's no game over screen, it'll just sends you back to your last assigned checkpoint. I think I should've explained it better orz
So ...
1. Map HP gets reduced by a specific amount or percentage? And you mean Max HP not HP?
2. Currency is all removed and recovered by an item. The item is then found at the checkpoint? Do all of there items and equipment get removed?
3. Needs to go to a game over screen
4. Returns to specified checkpoint.

Does that cover the requirements?
So ...
1. Map HP gets reduced by a specific amount or percentage? And you mean Max HP not HP?
2. Currency is all removed and recovered by an item. The item is then found at the checkpoint? Do all of there items and equipment get removed?
3. Needs to go to a game over screen
4. Returns to specified checkpoint.

Does that cover the requirements?
1. Yep, like Dark Souls in reference, when the player dies, the player's Max HP decreases until he uses a certain item to regain his original health back (example 1000 max hp drops to 750 max hp on death, then restores back to 1000 max hp after item usage)
2. Just the currency all removed yes and recovered once you pick up the item that was left on the death spot, not really at the checkpoint
3. Game over screen is more like it was bypassed(?) therefore no game over screen
4. Yes the player will return to the specified checkpoint

The problem is already solved tbh but if anything I'm glad to learn different more methods-
I did this exact thing all through just events, including dropping your items at a corpse that appears where you died. I also added a save-scumming feature so that the game saves every few seconds, and if you enter a battle, leave the battle and then attempt to do it again, it just automatically makes you lose the battle and drops your stuff there. You can check it out here for some ideas on how I evented it

Original thread: https://forums.rpgmakerweb.com/threads/making-checkpoints-respawn-points.157705/