[LordV] Kill Quest Assistant

Kill Quest Assistant (v1.0)
LordValinar
​

Introduction
This plugin was designed to assist "kill quests" in mind. Basically you get a quest to kill 10 bandits, and you want a variable to increase for each bandit you kill, but doing so with vanilla RPG Maker is difficult since "if enemyHP % <= 0" condition in the troop page doesn't account for the last enemy killed! With this plugin, that issue is resolved! Each enemy with the proper tag that dies in combat will run the appropriately assigned common event (where you can design to your heart's content the conditions and features that happen when it happens).

Features
Runs a common event when an enemy with the <kqs: eventId> tag dies.

Screenshots
<< see attachments >>

How to Use
Place this plugin in your plugins folder, add it to your plugin manager within the RPG Maker MZ engine. Then create an (or select an already made) enemy in the database. Place the <kqs: eventId> tag within the note field. "eventId" will be the numerical value of the Common Event ID you wish to run when this enemy type dies. For example (like in the screenshots) if you want a variable to increase when a zombie dies, you would set that up in the common event.

Download(Github) - Kill Quest Assistant

Terms and Credits
* Free to use and modify for commercial and noncommercial games, with credit.
* Do NOT remove my name from the Author of this plugin
* Do NOT reupload this plugin (modified or otherwise) anywhere other than on these forums (RPGMakerWeb).
So I tried this plugin, followed the instructions but it was not working. Not sure why.
That isn't much to go on. Show us how you set up your enemy and your common event.
So, after playinng around with it, i'm having the same issue I had prior to installing the plugin. If I have 1 enemy in my troop, it does not count the death; however, if I have 2 or more it counts all others except the last one to die. But the point of the plugin was to count all deaths, including last/only.
its <kqs: x> NOT LEADING 000000 (zeroes) as zeroes will cause trouble.
I have the same issue without the leading zeros.
I had thought maybe if I had set the variable to 0 initially in the quest, with the +1 for the kills, it would solve the issue. But no such luck.
The variable I see in the event is #7 and in the enemies note tag common event #4. what if you both set to the same number like in the exampel?
The core BattleManager:
  1. Does not update events during the victory phase;
  2. Checks for victory before events;
  3. Clears the common event reservation queue when the battle ends.
I just quickly checked the plugin's code on Github and found no special handling for running events at the end of battle. So for the last enemy, the plugin will reserve its event, if any, but by default that event does not get a chance to run in battle (due to the victory phase) or on the map (due to getting cleared).

The usual, non-plugin workaround for this uses an "Immortal" state (Resist State: Death). You can use a troop event with condition Enemy HP <= 0%: that event does stuff (e.g. +1 to variable) and then removes the Immortal state.
The variable I see in the event is #7 and in the enemies note tag common event #4. what if you both set to the same number like in the exampel?
7 is the varible number. 4 is the common event. The plugin references common events, the common event then effects the varible. However, the varible only if effected if I have two or more enemies; and only changes after the first dies. Not affected by the last battle.
That
The core BattleManager:
  1. Does not update events during the victory phase;
  2. Checks for victory before events;
  3. Clears the common event reservation queue when the battle ends.
I just quickly checked the plugin's code on Github and found no special handling for running events at the end of battle. So for the last enemy, the plugin will reserve its event, if any, but by default that event does not get a chance to run in battle (due to the victory phase) or on the map (due to getting cleared).

The usual, non-plugin workaround for this uses an "Immortal" state (Resist State: Death). You can use a troop event with condition Enemy HP <= 0%: that event does stuff (e.g. +1 to variable) and then removes the Immortal state.
This defeats the purpose of the purposed plugin. As shown in the plugin setup, none of that was needed for the varible to change.
@boutterson - yes. I just checked the author's profile and it looks like they haven't logged in for a month, so you may want to find or request an alternative:
I have a couple of ideas, but I feel like it'd be impolite to post them in someone else's thread. 😅
can you target a clean common event without visustella plugin commands?
as I convert it to MV for a test and it does work on my end.
That

This defeats the purpose of the purposed plugin. As shown in the plugin setup, none of that was needed for the varible to change.
Okay sorry for the long hiatus; Tested the code again with some regex and the number (even with leading zeroes) comes out to be "4" (without quotes), so in theory it should run common event 4. The only things I can think of that's stopping it is:
Game_BattlerBase.prototype.die

Meaning if you have my plugin before any VisuStella plugins that modify the battle system, it won't work properly. Try moving the plugin AFTER VisuStella plugins?

Original thread: https://forums.rpgmakerweb.com/threads/lordv-kill-quest-assistant.136853/