Actor and Enemy Death Common Events v2.0.1

Zevia

Veteran
Veteran
Joined
Aug 4, 2012
Messages
640
Reaction score
353
First Language
English
Primarily Uses
RMMV
Created from this thread.

Version 2.0.1: Github Link

Description
This plugin allows the user to run common events after any Actor or Enemy dies.

Installation
Either right click the Github link above and save as "DeathCommonEvent.js", or create a new text file called "DeathCommonEvent.js" and copy-paste the text from the link into it.
Move the file into your project's js/plugins folder.

Instructions
The plugin includes some logic to assign values to game variables that may be useful when writing common events, such as the Id and index of the last battler to act, the Id and index of the battler that just died, and the Id and type of the last skill or item used. By default:

- The Id of the Actor or Enemy that died is variable 1
- The index in either battleMembers or gameTroop of the Actor or Enemy that just died is variable 2
- The array of states the Actor or Enemy that died had before dying is variable 3
- The Id of the last Actor or Enemy to act is variable 4
- The index in either battleMembers or gameTroop of the Actor or Enemy that last acted is variable 5
- The Id of the last skill or item used is variable 6
- The type of the last action ("skill" or "item") is variable 7.

A quirk of common events is that their execution is queued up instead of immediately executed. By default, if you kill the last Enemy or the last Actor dies, then the common event is queued up, but not actually executed until after the battle is over.

There are two parameters you can change to affect this behavior - Run At Battle End will force your common event to be called just before the victory logic runs. Run After Battle will let your common event get called with the default behavior. If you turn both of them off, then the common event will not be called if the Actor or Enemy who dies would trigger the battle to be over.

Example

Terms of Use
This Plugin is available for commercial and non-commercial use, as long as credit is given to the author listed in the @ author section of the Plugin. Credit must be listed in-game, as well as in any additional credits documentation provided with the game.
This Plugin may be modified in any way by any author, most notably for compatibility fixes with specific projects or other Plugins, as long as credit is provided to the original author and to whichever author made said modifications, according to the above-stated rules.
 
Last edited:

VeryXInh

Veteran
Veteran
Joined
Jan 7, 2019
Messages
90
Reaction score
115
First Language
Japanese
Primarily Uses
RMXP
Seem to be an useful plugin, i was looking for one like this on RVXACE - _ -
 

Zevia

Veteran
Veteran
Joined
Aug 4, 2012
Messages
640
Reaction score
353
First Language
English
Primarily Uses
RMMV
@Finnuval Per your request, I've updated this Plugin to be capable of calling common events before the victory logic is processed. You'll need to replace your old version, then open up the Parameters and ensure that "Run At Battle End" is ON. If it is, then death common events will be called just before victory logic is processed.
 

Finnuval

World (his)story builder and barrel of ideas
Veteran
Joined
Aug 1, 2018
Messages
1,941
Reaction score
6,590
First Language
Dutch
Primarily Uses
RMMV
Thanks! :D
This is a great help.
 
Last edited:

Zevia

Veteran
Veteran
Joined
Aug 4, 2012
Messages
640
Reaction score
353
First Language
English
Primarily Uses
RMMV
Made a small change to the configurable parameters to use a type of variable instead of number for the 7 variables you can set. Now, when you configure them in the Plugin settings, it'll pull open your variable editor instead of requiring you to enter in a number.
 

snakehong

A cat with lots of questions
Veteran
Joined
May 1, 2019
Messages
44
Reaction score
5
First Language
korea
Primarily Uses
RMMV
Made a small change to the configurable parameters to use a type of variable instead of number for the 7 variables you can set. Now, when you configure them in the Plugin settings, it'll pull open your variable editor instead of requiring you to enter in a number.
Hello. I want to know if this works properly on QABS. I added a plug-in to this post, but it wasn't affected.
 

Zevia

Veteran
Veteran
Joined
Aug 4, 2012
Messages
640
Reaction score
353
First Language
English
Primarily Uses
RMMV
I want to know if this works properly on QABS.
I have not tested the Plugin with any ABS battle systems, so I don't know the answer for sure - however, it's very possible that an ABS system might overwrite the death functions, so there could be compatibility issues.

If you're specifically referring to the ability to reference variables in the Plugin's settings instead of entering numbers, that shouldn't be affected by other Plugins (except for them potentially using the same variables).
 

snakehong

A cat with lots of questions
Veteran
Joined
May 1, 2019
Messages
44
Reaction score
5
First Language
korea
Primarily Uses
RMMV
I have not tested the Plugin with any ABS battle systems, so I don't know the answer for sure - however, it's very possible that an ABS system might overwrite the death functions, so there could be compatibility issues.

If you're specifically referring to the ability to reference variables in the Plugin's settings instead of entering numbers, that shouldn't be affected by other Plugins (except for them potentially using the same variables).
Thank you for your reply! It was helpful for me.
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

Are we allowed to post about non-RPG Maker games?
I should realize that error was produced by a outdated version of MZ so that's why it pop up like that
Ami
i can't wait to drink some ice after struggling with my illness in 9 days. 9 days is really bad for me,i can't focus with my shop and even can't do something with my project
How many hours have you got in mz so far?

A bit of a "sparkle" update to the lower portion of the world map. :LZSexcite:

Forum statistics

Threads
105,883
Messages
1,017,236
Members
137,608
Latest member
Arm9
Top