じ☆ve冰风 发表于 2026-7-28 09:38:53

Kill Counter

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


本贴来自国际rpgmaker官方论坛作者:Shaz处,因国际论坛即将永久关站,为了存档多年珍贵资料,署名转载到本论坛存档,由于官方帖子为英文原帖,需要中文翻译请点击论坛顶部切换语言为中文就可以将帖子翻译成中文浏览,方便大家随时查看,原文地址:https://forums.rpgmakerweb.com/threads/kill-counter.56923/
页: [1]
查看完整版本: Kill Counter