Resisting Death

Reddit user Dynamex had the most standard of RPG quests in his game – kill 10 rats. He had troops with 2 rats, and would slay them with gusto, but whenever he fought them, the quest would only register one kill. He was script-phobic, and was looking for a fail-proof way to count that second rat. And one that did not involve changing his game design.

There’s a solution, but it’s tedious. Fortunately, it can be used for so much more than rats.

Dynamex’s problem was something inherent in RPG Maker VX Ace. The very second the last enemy in a troop dies, RPG Maker will start running its end-of-battle code. Anything that’s supposed to trigger when an enemy dies will be forgotten with respect to that enemy. So how do we solve this problem?

  • If your enemies are events on the screen that trigger when you run into them, this can be handled in the battle processing event branch. But what if they aren’t?
  • If you’re willing to use a script, Hime has a script for you. But what if you aren’t?
  • If you change this to a “turn in 10 rat tails” quests, and have the rat drop a rat tail 100% of the time, your problem is solved. But who wants to clutter their inventory like that?

Well then, we’ll just need our monsters to cheat death long enough to run our events.

Avoid Death State

The first “state” in the database – regardless of what you call it – is the Death state. It will be applied to an enemy the second it reaches 0 HP. We need to prevent this from happening for a little bit, and the trick is another state that we’ll make ourselves. Make a state called “Avoid Death”, clear most of the fluff from it, but under Features add “State Resist: Death.”

No need to have a message appear - we don't want the player to know what goes on behind the curtain.

No need to have a message appear – we don’t want the player to know what goes on behind the curtain.


Now let’s set up our troops. For our purposes, troops of 1 rat, 2 rats, and 3 rats should do it. If rats traveled in packs larger than 3, my guess is that whoever gave us the quest would be asking us to kill way more than 10.

Troops, like events, have pages. Here you can have events trigger during the battle. Let’s set up one which applies our new Avoid Death state to every enemy as soon as the battle starts.

Happily, there's a copy event page and paste event page. Make sure this goes in any troop where it matters.

Happily, there’s a copy event page and paste event page. Make sure this goes in any troop where it matters.

For condition, we’ve added Turn No. 0 to make sure it happens right at the start. “Span” really refers to frequency – can the event happen once per battle, once per turn, or repeatedly? We only want this happening once per battle, so we’ve set it to battle.

Now, if any rat’s health drops below 0 HP, nothing happens. Battle will continue, and we’ve got a serious undead rat problem on our hands. So let’s take care of that. Make a new event page, which triggers as soon as the enemy’s HP is down to 0. We’ll do three things:

  1. Increment our rat killer counter
  2. Remove Avoid Death
  3. Add Death

Like so!

Can't we just find a troop of 10 rats so I can get this over with?

Can’t we just find a troop of 10 rats so I can get this over with?

Unlike the first event page, which applies to the entire troop, we’ll need a separate event for each rat in the troop. Change the event page accordingly – so when enemy 2’s HP is 0% or below, enemy 2’s states should change, etc.

Beginner Challenge

I noted this has more utility than you’d think. Create a battle against a Chocobird (I’m not about to get sued for trademark/copyright infringement). Set it up so that when a Chocobird dies, there’s a 10% chance that an over-powered Devourer shows up  to fight you.

Advanced Challenge

There are plenty of scripts out there to handle things like “magic points” or “action points.” But without scripts, use this system to assign a new type of point/experience at the end of battle, where the amount of points you receive is assigned in each troop.

Check back in two weeks for some solutions!


One thought on “Resisting Death

  1. Pingback: Revisiting Death – Challenge Solutions | The Iron Shoe

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s