Death Curse System

So I have been trying to implement a system which is a core concept of my game I'm working on, Shattered Realms: Mortal Tale. It is a Death Curse, which does a couple of things.

  1. Creates a timer which counts down to zero, upon reaching zero it is supposed to place a status called 'Dying'. This reduces player health and skill points to just 10 %, as well as applying slip damage, making the threat of the curse severe.
  2. Fighting monsters is the only way to alleviate the curse's effect. Upon slaying a monster in combat, it resets the curse timer, giving the player more time to explore again.
I've been having a massive amount of trouble with this system, and I really need some help figuring out what to do. I've been able to deduce that the game engine isn't liking parallel processes, so I've started trying to find a way around it, as when I use them, the system gets mad and kicks the player out of combat, or just doesn't make the timer trigger at zero. It also really doesn't like the timer.

The second half of the problem is the combat reward itself, which doesn't tend to work at all if the player is up against single enemies, there are points when the player is too strong and will oneshot singular enemies and will not get any time bonus, which has lead to some aggravating moments.

There was a point where this all *technically* worked, except the single monster issue and the timer counting down to zero. I'm at my wit's end trying to solve this, and I could really use assistance figuring out the best way to make the system work.
Edit: Just noticed it was in Maker XP, sorry.
Some say "Curse or Die".  I guess you're saying "Both!"  🤣

It's hard to diagnose your problem because your setup is not perfectly clear.  I don't know, for example, when/how the curse is applied, what your parallel process(es) look like or used to look like, whether this slip damage applies during battle, or what "time bonuses" are supposed to do.  I also don't know what your eventing does nor whether you are using scripts.

I can probably help you solve this if you provide screenshots (or text copy) of all relevant eventing and scripting, as well as an example scenario of what actually happens (and where this is different from what you want to happen).
DeathCurse System.jpgDeathCurse System2.jpgDeathCurse System3.jpg

The curse is initiated if you leave a safe zone, example, the major village, and begins a countdown. Normally it is set to 5 minutes and thirty seconds. When it reaches zero on the timer, it is supposed to apply the Dying state, thus the Death Curse has been completed. Slip damage continues on map and in combat, and will not stop until either the player reaches the village and restores his health at the Hero's Shrine, or until he dies. There are no items which undo this status. 

In my tests, I set it to just 30 seconds so I don't wait 5-6 minutes, so I'll use that as the example. I leave the village, and the curse instantly kicks into gear, using a darkness animation to signify it has turned on. I engage in battle with a monster to extend the time, and in normal circumstances, if I win, I get a time bonus, which will reset the timer to 6 minutes and 30 seconds. 

The death curse initiation works just fine, it's whenever the timer reaches 0:00 when problems start. On reaching 0:00, you are instantly removed from combat, and as monsters chase you, every time they attack, you are just as quickly pulled out, completely breaking the ability to fight. I've tried erase event, exit event processing, and turning off switches to make this stop, but it's almost as if it's just directly related to either parallel processes and or the timer hitting zero.

As for the second issue I've been trying to get it so that it always gives a time bonus for an enemy's death. What should happen is at 0% health is the combat curse event fires and refreshes your time. Exact opposite happens: nothing, and if you were already in a pinch, this is pretty much a death sentence, if you had plenty of time while fighting the enemy, this just serves as a source of aggravation. Groups of more than one monster usually works, provided I set the bonus to something like 30% health instead. I only use events.
Thanks for showing me your setup.  I can see why this is frustrating for you - RPG Maker's default timers are set up really poorly, especially in XP.  I don't think there's necessarily a way to do it using the approach you're taking - so I'm going to show you an alternate approach which involves a bit of script editing, and I think it will give you exactly the effect you desire.  If it doesn't, then feel free to let me know.

Your first event can be left alone; it looks fine.  But let's add a switch to make the next few steps easier: Turn a Switch called "Curse Timer Active" ON.

Let's work on changing your second event.  Make it a Parallel Process event with the Curse Timer Active switch as a requirement (this will improve performance over having no real requirement).  Set a 10-20 frame Wait, and then a Conditional Branch: Timer is at 0 or less.  Inside that Conditional Branch, have the following eventing: Apply "Dying" state to entire party, Turn Timer Off, Turn Curse Timer Active switch Off.  (Additionally, if you want to set a switch to indicate that the Dying state has been applied, you can do so here, but it's not strictly necessary.)  Now the "Dying" state will be applied whenever the Timer ends on the map, so that's a good start.

Next, we need to fix the battle behavior.  There are probably ways to do it with eventing, but they are so extremely clumsy that they're not worth mentioning.  Go to Scene_Battle 1 in your script editor and you'll see the following code about three-quarters of the way down the script:

# If timer has reached 0 if $game_system.timer_working and $game_system.timer == 0 # Abort battle $game_temp.battle_abort = true endI can see why they did this, but it's a really dumb decision to not give the designer some control over what happens.  So we'll need to change up the code to suit your purposes.  Change this code to:

# If timer has reached 0 if $game_system.timer_working and $game_system.timer == 0 # Apply the Dying state and turn the Timer Off if the Curse is active if $game_switches[5] == true for member in $game_party.actors member.add_state(10) end $game_system.timer_working = false $game_switches[5] = false end endObviously, replace 5 with the Curse Active switch and 10 with the ID of the Dying state (and, again, you can set a Switch to indicate that Dying has been applied, but it's not necessary).  With that, the Dying state will be applied if the Timer reaches 0 during battle and the battle will no longer be aborted.

There's one more thing we need to get working properly, I guess - resetting the Timer upon scoring a kill on a monster.  It sounds like your battle events are actually working almost properly in terms of resetting the timer - the problem is that troop events won't run after all the enemies are dead.  We'll fix this in a second, but I'm a bit confused as to why your third event looks the way it does.  I don't know what your troop events look like and "Combat Switch" seems like a weird thing to be turning on and off.  Additionally, I find it strange that you're removing the Dying state from the party when they kill a monster.  The way I understand the desired behavior is that while the timer is running, you can delay Dying by resetting the timer (by killing a monster), but once the Dying state sets in, you can't delay or remove it by killing a monster (you can only remove it by returning to a shrine, etc.).

Assuming that my understanding is correct, what I'd advise you to do is delete that third event entirely.  We won't need it.  Instead, create Troop Events for each monster in each troop, with a "Battle" span and the condition that the monster's HP is 0% or below.  Inside that, have a conditional branch: If the Curse Timer Active switch is ON.  And inside that (if the Switch IS On), have it simply reset the Timer.  This should give you the behavior you're looking for, as I understand it.  (By the way, with a super-easy script call, I think we could have it add X seconds to the Timer for each kill instead of simply resetting it.  If you want to do this, let me know.)

You can fix the lack of Timer Reset upon killing the final enemy by going to Scene_Battle 2 and finding the method start_phase5 (which handles Victory processing - it's a little over halfway down the page).  Add the line $game_switches[6] = true where 6 is replaced by a new Switch.  Then, create a new Parallel Process (or Autorun) Common Event which requires this Switch to be set On - the event should reset the Timer (as if you had just killed an enemy), and then turn Switch 6 (or whatever number you chose) Off.  Alternatively, there are probably scripts out there to run troop events right before battle ends - I know Hime has a similar script for VX Ace but I couldn't link you to one for XP.

OK, I think this covers everything.  Was a lot more complicated than expected, because of some of RPG Maker's idiosyncracies.  But I think everything should work the way you want it, and it's a pretty cool system.  Hope you show it to us in some gameplay footage sometime! 🙂
I got the following error, can you explain it real quick? I'm not a coder so I'm not sure what's up 

Script 'Scene_Battle 1' line 247: NameError occured.

uninitalized constant Scene_Battle::Timer
I have a feeling that one of your lines broke incorrectly.

Please show me a screenshot of your script editor at and around (above and below) line 247.  The more you can show me, the better.
screen..jpg
Use the number of the switch, not the name 🙂
Ok thanks. The battle is no longer exited as of right now, but does not actually apply the curse, not sure why. It just has: 0:00 now.
Most likely that's because the switch is currently off.  Make sure it's On before entering battle.  You can check this using F9 during Playtest mode.
Thank you, it's finally working! Thank you so very much for helping me get this fixed! You have no idea how frustrating this was until you came along, thanks for the help man! I will definitely have to put you in an honorable mentions section of the credits when I get this game done. I really appreciate it.

If you want to try the game out by the way, I'll be more than happy to send you a link in private message if you'd like. I've still got some stuff to check into before I update the private playtest version of the game though, I don't want any more surprises in the game :/ But I can definitely send a link your way if you're interested once everything's been looked into.
You're welcome!  Glad we could get it working for you - from all the times I've gone through similar stuff myself, I definitely do have an idea how frustrating it is. 🙂
This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

Original thread: https://forums.rpgmakerweb.com/threads/death-curse-system.41821/