RPG Maker Forums

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:

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

Latest Threads

Latest Profile Posts

Day 9 of giveaways! 8 prizes today :D
He mad, but he cute :kaopride:

Our latest feature is an interview with... me?!

People4_2 (Capelet off and on) added!

Just beat the last of us 2 last night and starting jedi: fallen order right now, both use unreal engine & when I say i knew 80% of jedi's buttons right away because they were the same buttons as TLOU2 its ridiculous, even the same narrow hallway crawl and barely-made-it jump they do. Unreal Engine is just big budget RPG Maker the way they make games nearly identical at its core lol.

Forum statistics

Threads
106,037
Messages
1,018,464
Members
137,821
Latest member
Capterson
Top