Individual Enemy Kill Counter for Blizz ABS
Authors: Nathmatt
Version: 2.0
Type: Enemy Counter
Key Term: Blizz-ABS Plugin
Introductionkeeps individual counters for each enemy
Features
- Can create more than 1 counter for the same enemy
- Keeps as many counts as you want
- Keeps track of all enemies killed
Screenshotsno screen shot
DemoNo Demo
Script#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
# Individual Enemy Kill Counter for Blizz ABS by Nathmatt
# Version: 2.0
# Type: Enemy Counter
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
#
# This work is protected by the following license:
# #----------------------------------------------------------------------------
# #
# # Creative Commons - Attribution-NonCommercial-ShareAlike 3.0 Unported
# # ( http://creativecommons.org/licenses/by-nc-sa/3.0/ )
# #
# # You are free:
# #
# # to Share - to copy, distribute and transmit the work
# # to Remix - to adapt the work
# #
# # Under the following conditions:
# #
# # Attribution. You must attribute the work in the manner specified by the
# # author or licensor (but not in any way that suggests that they endorse you
# # or your use of the work).
# #
# # Noncommercial. You may not use this work for commercial purposes.
# #
# # Share alike. If you alter, transform, or build upon this work, you may
# # distribute the resulting work only under the same or similar license to
# # this one.
# #
# # - For any reuse or distribution, you must make clear to others the license
# # terms of this work. The best way to do this is with a link to this web
# # page.
# #
# # - Any of the above conditions can be waived if you get permission from the
# # copyright holder.
# #
# # - Nothing in this license impairs or restricts the author's moral rights.
# #
# #----------------------------------------------------------------------------
#
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
#
# Script Calls:
#
# $game_player.start_counter(id,enemy_id) creates a new counter for enemy_id
#
# $game_player.get_counter(id) gets the ammount on that counter
#
# $game_player.stop_counter(id) clears and stops id's counts
#
# $game_player.total_killed returns the total amount of enemies
# killed
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
class Game_Player < Map_Actor
attr_accessor :counters,:total_killed
alias counter_initialize initialize
def initialize
counter_initialize
@counters = {}
@total_killed = 0
end
def start_counter(id,enemy_id)
@counters[id] = Enemy_Counter.new(enemy_id)
end
def get_counter(id)
return if !@counters[id].is_a?(Enemy_Counter)
return @counters[id].count
end
def stop_counter(id)
@counters[id] = nil
end
end
class Enemy_Counter
attr_accessor :count
attr_reader :enemy
def initialize(enemy)
@enemy = enemy
@count = 0
end
end
class BlizzABS::Processor
alias counter_remove_enemy remove_enemy
def remove_enemy(enemy)
counter_remove_enemy(enemy)
return if enemy.execute || enemy.erased || enemy.body != nil
check_counter(enemy.real_enemy.id)
$game_player.total_killed += 1
end
def check_counter(enemy_id)
$game_player.counters.each_value{|counter|
counter.count += 1 if counter.enemy == enemy_id}
end
end
class Map_Enemy < Map_Battler
def real_enemy
return @enemy
end
end
RMX-OS Pluginif !defined?(RMXOS) || RMXOS::VERSION < 1.09
raise 'ERROR: The "Blizz-ABS Controller" requires RMX-OS 1.09 or higher.'
end
module RMXOS
module Options
SAVE_DATA[Game_Player].push('@counters')
SAVE_DATA[Game_Player].push('@total_killed')
end
end
Instructionsin the script
Compatibilityno compatibility issues known
Credits and Thanks
Author's Notesif you have any issues or suggestions post here
Quick question, as I'm still learning basic scripting. What code should I use to activate a switch when a certain monster ID reaches a desired number?
$game_player.enemy[id] should be used somewhere I'm assuming. I apologize for my noobishness, but I'm more of a designer and artist than scripter. :/
Do a conditional branch
if $game_player.enemy[id] == X
Turn on switch.
first you want to turn the enemies counter on using this
$game_player.enemy_trigger[id] = true
then in a condition branch you could turn on a switch or just use a condition script as
$game_player.enemy[id] >= x
x being the amount needed to kill after so you will want to use
$game_player.enemy_reset(id)
to reset it back to 0 and
$game_player.enemy_trigger[id] = false
to turn it off so that it will be ready for the next quest that needs you to kill it
Would this script work with RMX-OS btw?
i don't see y it wouldn't but it would need the save data configured
edit: just use the newly added plug-in place it below this script
I was looking to a script like this one. Using now and working fine. Thanks nathmatt (lvl up)
why the hell was this never moved? *moved to database after adding the [XP] tag to the title*
The xp tag was probably the reason it didn't get moved
nathmatt got it right. ;)
pssh, it's not like it take more than ten seconds to add the tag, lazy other mods.
Nathmatt's been doing that a couple of times so I just decided not to fix his post this one time as a lesson. :P
i have to admit i didn't even notice it wasn't in the database until you mentioned it
Quote from: Ryex on December 02, 2010, 04:34:21 am
pssh, it's not like it take more than ten seconds to add the tag, lazy other mods.
I plead innocent; I'm not a mod over this section.
I plead innocent as well, because I can. :=
I´m having a problem using this script on my game. After killing an enemy if I use a Custom Event Triggers the $game_player.enemy[id] variable count +14 enemies killed instead +1. (I tested too on a new Blizz-ABS game with only Individual Enemy Kill Counter for Blizz ABS script and got the same error)
send me a quick demo so i can see it
Demo explaining the problem:
http://www.sendspace.com/file/95nlto
update 1.10 fixed above error
updated my game to 1.10 and no errors, ty.
update 2.0 reworked this script you can now create as many counters as you want even for that same enemy