Dark Souls Bonfire, Death & Bloodstain System

I was making this for my own project, but after I realized that this is shockingly easier than I expected, so I've decided to share this!

Requirements
  • A plugin that changes how Game Overs are handled (Any will probably work)
  • Visustella Events & Movement Core
Yes, that is it. I'm kind of shocked to be honest that's all it takes.

What your going to do next is create 5-ish variables:
  • One to save the bonfire's MapID
  • Two to set the X and Y coordinates you want the player to respawn at.
  • One to save the MapID where the player dies
  • One per value you want to be lost after death (such as Gold and EXP)
If you want the party to lose EXP, your going to need to set up a variable for each party slot.

Once you got these variables, we're going to need a common event that runs whenever the player dies:

Spoiler: Death Common Event
◆Control Variables:#0002 DeathMapID = Map ID
◆Control Variables:#0003 Death Gold = Gold
◆Change Gold:- {Death Gold}
◆Recover All:Entire Party
◆Transfer Player:{SaveMapID} ({SaveX},{SaveY})

What this does is save the Map the player died on, as well as how much Gold they had. It then removes all of that gold, before healing the party to full before sending them to the bonfire they last interacted with. (We'll set that up next) It also will not save the values of previous deaths, so the player will lose all that stuff. (Just like Dark Souls)

Your likely going to need to add some other event commands depending on what plugin you use, I'm using the NoGameover plugin found in MZ's dlc folder, witch detects when the player has game over's with a switch, so I added a command to set the switch off after everything else is done, but what your going to need to add might be different.

Next, we're going to need to set up an event for the bonfires that triggers on player interaction. This is just a very basic version, you can add more to it if you want, all that's important for this to work is the first 3 lines:

Spoiler: Bonfire Event
◆Control Variables:#0001 SaveMapID = Map ID
◆Control Variables:#0005 SaveX = X value of where you want the player to respawn
◆Control Variables:#0006 SaveY = Y value of where you want the player to respawn
◆Recover All:Entire Party
◆Text:None, None, Dim, Bottom
: :This is a save point.\.\.
: :What do you want to do?
◆Show Choices:Save, Nothing (Dim, Middle, #1, #2)
:When Save
◆Open Save Screen
◆
:When Nothing
◆
:End

This is setup so the player doesn't need to save to respawn at the bonfire, though you can easily change this if you want. After this you just need to copy and paste this event on every map you want a bonfire, changing the X and Y values when needed.

Next we're going to set up the bloodstain event, I've set these up in a way that they spawn in the same place no matter where you died on the map, but I did this for a good reason, as I will explain later. Do note this event has 2 pages, but it's not that complicated, so don't worry. The event is set up like this:

Spoiler: Bloodstain Code Page 1 [Autorun]
◆If:DeathMapID = MapID of current map
◆Control Self Switch:A = ON
◆
:Else
◆Erase Event
:End
Spoiler: Bloodstain Code Page 2 [Action Button]
Make sure this runs when Self Switch A is on
◆Play SE:Absorb1 (90, 100, 0)
◆Wait:60 frames
◆Play SE:Absorb2 (90, 100, 0)
◆Flash Screen:(255,204,204,170), 20 frames (Wait)
◆Control Variables:#0002 DeathMapID = 0
◆Change Gold:+ {Death Gold}
◆Control Variables:#0003 Death Gold = 0
◆Erase Event

Make sure the Bloodstain only has a graphic on page 2, otherwise it won't appear as intended. Also the Bloodstain event has the <Exit Reset Self Data> notetag from Visu Events Move Core, otherwise it won't show up ever.

What this does is detect when the Player is on the same map as the last death location, causing it to appear. Otherwise it won't show up. When the player interacts with the Bloodstain, it will play some effects and then give the player all their gold back, before it sets the Death MapID variable to 0 (To prevent it from showing up over and over), as well as the Lost Gold variable. (Just to be safe) After this your going to need to copy and paste the Bloodstain to each map where combat can take place, and then setting the MapID to the correct value.

"But what if I have a cutscene in the boss room? Won't that prevent this from working?" I hear you ask. I've already thought of this and have 2 fixes:
  1. You can create a new Bloodstain that spawns in the room before the boss room.
  2. Or you can do something like this with one of your previously made Bloodstains:
Spoiler: Alt Bloodstain Page 1
◆If:DeathMapID = MapID where the Bloodstain is
◆Control Self Switch:A = ON
◆
:Else
◆If:DeathMapID = MapID of the Boss Room
◆Control Self Switch:A = ON
◆
:Else
◆Control Self Switch:B = ON
◆
:End
◆
:End

Now the Bloodstain will show up if you died on either map, handy!

And that's about it! The whole system should work now! I will update this tutorial if I find any bugs or any are brought to my attention, but that's all I have for now. Feel free to ask questions if you don't fully under stand something, and thank you for checking this out!

Other Questions You Might Have
  • What if I want this to work with the normal game over screen?: Not sure, it probably depends on the plugin. I might update this tutorial to replicate the classic Dark Souls "YOU DIED" screen, but that will be later.
  • Could you maybe provide an example project?: Unlikely, don't really want to make one.
I'm also working on a turn-based Soulslike. This is very helpful! I'll give it a shot! Thanks!
Well, this is very old but I needed to implement a bloodstain mechanic and I found this very useful.
Nevertheless a few things weren't working for me so I modified this idea to work in different situations:

This whole thing has been tested successfully within one map but I don't see any reason for it not too be working across maps, since there's always that "If DeathMapID = this map".

Anyways, here the details:

Spoiler: Death Common Event


In addition to what was firstly proposed, I have added the X and Y coordinates of were the player was killed. As with the DEAD switch, it allows for the other events not to run in case you haven't died yet, or get in and out of the game, which caused me some unintended behaviours :

Spoiler: Bloodstain Pg.1


This is the same but instead of Erasing the Event if MAP ID is not the same (you are somewhere else)
I just put the switch DEAD as a condition for the event to run.

Spoiler: Bloodstain Pg.2


This, again, is pretty much the same but I also reset the switches DEAD and Self Switch A, to allow the bloodstain to spawn multiple times in the same map, without having to refresh map (getting in and out).

Finally, this I just modified to be more efficient. It's the event the moves the bloodstain. I had it in parallel before, which it worked, but it would technically unnecessarely keep placing the stain on the same spot over and over. Instead, I went about this by placing it on the SaveX-SaveY coordinates of the Map, so when the player spawns on it, it triggers the event (which works only if switch DEAD is on) to move the stain.

Spoiler: MoveBloodstain
Set Event Location : Bloodstain31, ({DeathX} , {DeathY})

This is necessary so if you quit the game and reload it replaces the bloodstain, because the bloodstain event can't do it once it selfcheck is already on.

edit: The only problem with being Player Touch is that if the player saves from a different spot and gets out of the game, it won't trigger the Event.
A solution would be having duplicates of the event surrounding the "bonfire" or just run one in Parallel (although very unefficient).

Anybody can figure out a way to polish all of this?
Okay, this is quite old, but after some finagling I did manage to improve on this! Now it works across maps!

Here's what you'll need:
- A No game over plugin. Like CannedBeans, I'm using the one that came with the DLC too.
- A plugin that lets you create template events. TemplateEvents from the DLC works perfectly, though you can also use VS' Events and Movements Core.
- Variables!

So first step, is create your Game Over event. Set it to Autorun, and make sure that the last thing the event does is Transfer the Player back to your respawn point and Fade the Screen In. Things will get weird if you change maps before all the Switches and Variables are established. If you're using the DLC NoGameOver plugin, make sure to put somewhere that you want the Menu Access enabled since the plugin automatically disables it as part of its functionality.
Spoiler: Death
◆Control Variables:#0001 DeathMapID = Map ID
◆Control Variables:#0002 DeathX = Map X of Player
◆Control Variables:#0003 DeathY = Map Y of Player
◆Control Variables:#0004 DeathXP = EXP of Player
◆Change EXP:- {DeathXP}
◆Recover All:Entire Party
◆Change Menu Access:Enable
◆Control Switches: #0002 Death = ON
◆Control Switches: #0003 GameOver = OFF
◆Transfer Player:{SaveMapID} ({SaveX},{SaveY})
◆Fadein Screen
1766695778436.png

Now, for our Bloodstain events! First you're gonna want to make a template map where you'll store all the events that you want to call across maps. In order to make things more efficient, you can use the following script call to check whether you're in the correct map or not. Just replace the (ID) with the value of the variable that stores the map you died in.

Code:
$gameMap.mapId() === $gameVariables.value(ID)

On the second page, make sure to set all Death variables back to 0. Not doing that leads to all amounts of weirdness!
Spoiler: Bloodstain
◆If : Script : $gameMap.mapId() === $gameVariables.value(3);
◆Set Event Location : This Event, ({DeathX}, {DeathY})
◆Transfer Player:{SaveMapID} ({SaveX},{SaveY})
◆Control Self Switch: A = ON
1766696238015.png

◆Play SE: (Whatever you choose)
◆Wait: 30 Frames
◆Flash Screen : (Whatever you choose)
◆Control Variables:#0001 DeathMapID = 0
◆Control Variables:#0002 DeathX = 0
◆Control Variables:#0003 DeathY = 0
◆Change EXP: Player, + {DeathXP}
◆Control Variables:#0004 DeathXP = 0
◆Control Switches: #0002 Death = Off
◆Control Self Switch: A = Off
1766697029359.png
And now, the star of this show! You're gonna place an empty event in all maps where you want your bloodstains to appear. If you're using the TemplateEvent plugin from the DLC, all you need to do is place the notetag <TE: (Name of your Bloodstain Event) in the empty event's note field and that's it! That blank event will transform into the bloodstain event, and because the first page of the event is responsible for moving it into the death coordinates, it will automatically appear right where you need it, even if you quit the game.

Spoiler: Mover
1766697152667.png

And that's it! No need to place extra events or anything!
1766697676124.png

1766698089945.png

Merry Christmas to y'all and hope this helps everyone out! If you feel like you can improve on this, feel free to pitch in!
Okay, this is quite old, but after some finagling I did manage to improve on this! Now it works across maps!

Here's what you'll need:
- A No game over plugin. Like CannedBeans, I'm using the one that came with the DLC too.
- A plugin that lets you create template events. TemplateEvents from the DLC works perfectly, though you can also use VS' Events and Movements Core.
- Variables!

So first step, is create your Game Over event. Set it to Autorun, and make sure that the last thing the event does is Transfer the Player back to your respawn point and Fade the Screen In. Things will get weird if you change maps before all the Switches and Variables are established. If you're using the DLC plugin, make sure to put somewhere that you want the Menu Access enabled since the plugin automatically disables it as part of its functionality.
Spoiler: Death

Now, for our Bloodstain events! First you're gonna want to make a template map where you'll store all the events that you want to call across maps. In order to make things more efficient, you can use the following script call to check whether you're in the correct map or not. Just replace the (ID) with the value of the variable that stores the map you died in.

Code:
$gameMap.mapId() === $gameVariables.value(ID)

On the second page, make sure to set all Death variables back to 0. Not doing that leads to all amounts of weirdness!
And now, the star of this show! You're gonna place an empty event in all maps where you want your bloodstains to appear. If you're using the TemplateEvent plugin from the DLC, all you need to do is place that notetag and that's it! That blank event will transform into the bloodstain event, and because the first page of the event is responsible for moving it into the death coordinates, it will automatically appear right where you need it, even if you quit the game.

Spoiler: Mover

And that's it! No need to place extra events or anything!
View attachment 356018
View attachment 356020
Merry Christmas to y'all and hope this helps everyone out! If you feel like you can improve on this, feel free to pitch in!
I know it's been a few months but I've had an issue with this and I hope somebody can help me.
For some reason the events won't go to the death coordinates, they just stay in the corner where I
placed them. I'm not sure if I did something wrong or if I need to add anything to make them
move to the right place properly.
Hiya! That's really weird, it should work right. The only things I could imagine are going on are:

That your placements are wrong (If we're doing Templated Events, you need to put the Base Event in a separate map (ideally one whose only purpose is to store the templates) and you'll put the Templated Events on the actual game maps.

Or that, you're not engaging with the event properly. If you die before resting at a bonfire, it could mess up the process.
Hiya! That's really weird, it should work right. The only things I could imagine are going on are:

That your placements are wrong (If we're doing Templated Events, you need to put the Base Event in a separate map (ideally one whose only purpose is to store the templates) and you'll put the Templated Events on the actual game maps.

Or that, you're not engaging with the event properly. If you die before resting at a bonfire, it could mess up the process.
I made sure to put the base event on its own map and there's a bonfire at the start of the game and I've made sure to use it every time I do a test run, though the common event that's trigger to transfer the player already accounts for the possibility of you not visiting one yet.
I made sure to put the base event on its own map and there's a bonfire at the start of the game and I've made sure to use it every time I do a test run, though the common event that's trigger to transfer the player already accounts for the possibility of you not visiting one yet.
Mmmm, this is really something. The only other thing I could think of is that maybe a plugin is interfering with the set-up?

I see that you're using NoGameOver2. That particular plugin can trigger two different switches.
1774670732116.png


ID is for when you die on field. And ID2 is for when you die on battle. There's a distinction there. So maybe check if you're using the correct switch.
Mmmm, this is really something. The only other thing I could think of is that maybe a plugin is interfering with the set-up?

I see that you're using NoGameOver2. That particular plugin can trigger two different switches.View attachment 363652

ID is for when you die on field. And ID2 is for when you die on battle. There's a distinction there. So maybe check if you're using the correct switch.
tested it out and seems like it didn't make a difference which one I used, even switched to NoGameOver and tried that. Still same issue, the dropped karma event (the empty one with the notetag) still doesn't budge from the corner.
Edit: did some testing by turning off plugins. disabled most of the other plugins and it still isn't working.
Well, I came up with this workaround, so maybe I can try to magic it to work? If you'd like, you can send me a sample project where you have the issue so I can compare with my version!
I made another project to try and replicate the issue on a fresh game and I was successful in doing so. It works perfectly if you die on map 1 but if you die on other map then the event just sits in the corner.
Edit: added a second zip containing the plugin .js files
@Matthew_Hews Rejoice! I found your problem! You won't believe what was happening.
1774726416958.png

There was no switch on the Karma Dropped event! For the Mover to work, it needs to have your "You Are Dead" switch on, since that's what's supposed to trigger this page!

We do that...

1774726518935.png


And voila!
I must have forgotten to do that on the sample project! But on my main project that was already there, you can see it in the screenshot of
event_with_switch.png
the base event I sent earlier.
Welp, that's weird. I got it to work just fine in the sample project! Across both maps even!
Okay @Matthew_Hews ! I finally found the issue! It took me quite a while to figure it out lol But I finally did it! Your common event for returning to the bonfires was messing up with your Death Event. I was fiddling about with it, and noticed that when I put the Common Event *after* the FadeIn command, the Karma would appear in the correct position before the Common Event triggered and teleported you away, and by the time you return to the spot, the karma would be in their default position.

I removed it entirely and replaced it with a simple Player Transfer and now the event works as intended.
1774754300038.png


Keep your variable system for the warp common event, but for the "return to last" function, you're better off sticking to BeanCanDev's bonfire example. Just set some Variables to the coordinates and map ID at the time of interacting with the bonfire. It would be best to have this as a Template Event, so you don't have to go adding that feature to every individual bonfire (which is in part why it took me so long to reply lmao).
1774754422036.png
can confirm this fixes it on my end too! Thank you so much for bearing with me and helping me with this! You have my eternal gratitude. Also yeah now that I've been working with template events I should implement them more I've mostly been spaghetti coding my way through this project lol.
Happy to help! Good luck on your game!

Original thread: https://forums.rpgmakerweb.com/threads/dark-souls-bonfire-death-bloodstain-system.163148/