- Joined
- Mar 2, 2012
- Messages
- 41,867
- Reaction score
- 14,520
- First Language
- English
- Primarily Uses
- RMMV
Kill Counter
2016.02.15
by Shaz
Introduction
This plugin allows you to track, in a variable, the number of enemies of a specific kind killed. The counter can be turned on and off as desired.
How to use
Add to your plugins folder (file name does not matter, but I call mine KillCounter.js). There are no parameters to set.
Use the following plugin commands:
enemyId is the enemy's id as shown in the database - do not include leading zeros
variableId is the variable's id where the kill count is to be stored - do not include leading zeros
maximumRequired is the point at which the counter will stop accumulating. This argument is optional - if omitted or 0, the variable will keep incrementing until the kill counter is ended. Use this argument if you want to show the number of enemies killed in a text message via \v[...] and don't want it to go over the required amount (for example, if you will show \v[...] / 10 slimes, you would not want the variable to exceed 10).
Example:
will increment variable 15 for every bat (enemy 1 in the default database) killed after the plugin command is run. When the variable reaches 10, it will not be incremented further.
Remember, if you don't pass in a maximum, the variable will keep incrementing, so if you only need 10 slimes, your test will have to be "if variable >= 10" rather than "if variable = 10".
Plugin
Download from pastebin
Credit
- Shaz
Terms
- free for use in commercial games
Notes
- You MUST define the maximum variables in the database to be large enough to include the variable you're using in the plugin command. If your database only contains 50 variables and you use variable 100 for the plugin, it will not work. I suggest using a Control Variables to set it to 0 (and give it a name) at the same time as the Plugin Command is called to start the counter
2016.02.15
by Shaz
Introduction
This plugin allows you to track, in a variable, the number of enemies of a specific kind killed. The counter can be turned on and off as desired.
How to use
Add to your plugins folder (file name does not matter, but I call mine KillCounter.js). There are no parameters to set.
Use the following plugin commands:
Code:
StartKillCounter enemyId variableId maximumRequired
EndKillCounter enemyId
enemyId is the enemy's id as shown in the database - do not include leading zeros
variableId is the variable's id where the kill count is to be stored - do not include leading zeros
maximumRequired is the point at which the counter will stop accumulating. This argument is optional - if omitted or 0, the variable will keep incrementing until the kill counter is ended. Use this argument if you want to show the number of enemies killed in a text message via \v[...] and don't want it to go over the required amount (for example, if you will show \v[...] / 10 slimes, you would not want the variable to exceed 10).
Example:
Code:
StartKillCounter 1 15 10
will increment variable 15 for every bat (enemy 1 in the default database) killed after the plugin command is run. When the variable reaches 10, it will not be incremented further.
Remember, if you don't pass in a maximum, the variable will keep incrementing, so if you only need 10 slimes, your test will have to be "if variable >= 10" rather than "if variable = 10".
Plugin
Download from pastebin
Credit
- Shaz
Terms
- free for use in commercial games
Notes
- You MUST define the maximum variables in the database to be large enough to include the variable you're using in the plugin command. If your database only contains 50 variables and you use variable 100 for the plugin, it will not work. I suggest using a Control Variables to set it to 0 (and give it a name) at the same time as the Plugin Command is called to start the counter
Last edited by a moderator: