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:
- You can create a new Bloodstain that spawns in the room before the boss room.
- 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.
本贴来自国际rpgmaker官方论坛作者:BeanCanDev处,因国际论坛即将永久关站,为了存档多年珍贵资料,署名转载到本论坛存档,由于官方帖子为英文原帖,需要中文翻译请点击论坛顶部切换语言为中文就可以将帖子翻译成中文浏览,方便大家随时查看,原文地址:
https://forums.rpgmakerweb.com/threads/dark-souls-bonfire-death-bloodstain-system.163148/