- 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.
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:


