I'm making a game, but don't want players to worry about game overs. In it's place, I decided to use a checkpoint system, having players interact with specific objects to set a new respawn point to appear at when they die. I thought I would be able to achieve this using variables and a bit of help from Yanfly's "Death Common Event" script, but anything I try doesn't seem to be working. Any tips on how I can achieve my vision?
Checkpoint System?
RGSSx Script SupportMoved to: RGSSx Script Support
I'm not familiar with the script, but just in case it DOES work and you've just not used it properly, can you show how you implemented it? Any script changes, any setup in the database or in events.
I'm not familiar with the script, but just in case it DOES work and you've just not used it properly, can you show how you implemented it? Any script changes, any setup in the database or in events.
The script I mentioned (Death Common Event) allows common events to run in response to something dying. The script works perfectly, it is not what I had a problem with. Apologies if I made that unclear, it was very late when I made this post. I brought up the script simply to explain how my event starts, as I used the script to run a common event when the party is wiped out.
There is the event that I have set to play. When Interacting with a checkpoint, the respawn variable is set to change to that checkpoint's associated number. Upon death, however, nothing under the Conditional Branch activates, and the player simply appears where they were when the battle started. I'm pretty green to this, so I'm trying to ask, Is there something I'm missing? Or am I just misunderstanding how variables work?
Does the text show? If not, the common event is not being run at all, which means there's something wrong with how you've got the script set up.
If the text does show, it means the variable is set to something other than 1 or 2. You can hit F9 to debug at this point and see what is in the variable. If this is the issue, show us a screenshot of your two checkpoints so we can see what you're doing to set it, and if there's something wrong there.
Once you get it working, you might also find that it first transfers you back to where the player was when the battle began, and then takes you back to the checkpoint, which you might find annoying. You can update a couple of script variables before the Abort Battle command so that you will be taken instantly to the checkpoint when the battle begins. Let's worry about getting the event and conditional branches to trigger first though.
If the text does show, it means the variable is set to something other than 1 or 2. You can hit F9 to debug at this point and see what is in the variable. If this is the issue, show us a screenshot of your two checkpoints so we can see what you're doing to set it, and if there's something wrong there.
Once you get it working, you might also find that it first transfers you back to where the player was when the battle began, and then takes you back to the checkpoint, which you might find annoying. You can update a couple of script variables before the Abort Battle command so that you will be taken instantly to the checkpoint when the battle begins. Let's worry about getting the event and conditional branches to trigger first though.
Yes it does, but it shows in the battle and then exits the battle after the common event has completed.
Found the method to do what you want and has Shaz's issue mentioned.
In the common event show the text then set a switch on, recover the party and abort battle
In a second common event do your variable check and perform your transfer then turn switch off.
Just makes the second common event set to parallel and condition switch is set.
I was able to make it work by modifying some code, but text messages did not have a window frame, they were blank backgrounds.
i'm guessing the teleport did not happen because the common event executed when still at the Scene_Battle...
Thank you so much! It works... almost. I have one more little problem that needs to be fixed. First of all, the issue with the player appearing where the battle began before being transferred is there. Second, when being brought to a checkpoint on a different map than the one I died on, the game fades out and in an extra time before giving the player back control. Can you help me fix this?
Yes, that's the issue I mentioned.
You can do one of 2 things to solve it.
First is do a fadeout before the Abort Battle, then all your conditional branches / transfers, and then a fadein. It means you'll still return to the map you were on and then transfer to the new map, but the screen will be faded out while this happens so the player won't see it. However, it will take longer than usual to go from the battle scene back to the map (because it's doing 2 transitions), and the original map BGM may play first.
The second is to change the map while still in the battle screen. To do this, move all your conditional branches ABOVE the Abort Battle command (even to the top of the common event, before the show text). And replace all the Transfer Player commands with the following:
where id is the id of the map you want them to reappear on, and x and y are the coordinates on that map. Do not use any leading zeros for any of these numbers.
So for your original example, your common event would look like this:
You can do one of 2 things to solve it.
First is do a fadeout before the Abort Battle, then all your conditional branches / transfers, and then a fadein. It means you'll still return to the map you were on and then transfer to the new map, but the screen will be faded out while this happens so the player won't see it. However, it will take longer than usual to go from the battle scene back to the map (because it's doing 2 transitions), and the original map BGM may play first.
The second is to change the map while still in the battle screen. To do this, move all your conditional branches ABOVE the Abort Battle command (even to the top of the common event, before the show text). And replace all the Transfer Player commands with the following:
Code:
Script: $game_map.setup(id)
$game_player.moveto(x, y)
where id is the id of the map you want them to reappear on, and x and y are the coordinates on that map. Do not use any leading zeros for any of these numbers.
So for your original example, your common event would look like this:
Code:
Conditional Branch: Variable [0001:Respawn] = 1
Script: $game_map.setup(8)
: $game_player.moveto(9,4)
: $game_player.set_direction(2)
Else
Conditional Branch: Variable [0002:Respawn] = 2
Script: $game_map.setup(6)
: $game_player.moveto(8,5)
: $game_player.set_direction(2)
End
End
Text: The party is wiped out!
Abort Battle
Recover All: Entire Party
This works perfectly! Thank you so much for your help!
Original thread: https://forums.rpgmakerweb.com/threads/checkpoint-system.134666/