Chaos Project

RPG Maker => RPG Maker Scripts => RMXP Script Database => Topic started by: G_G on May 10, 2009, 02:20:29 am

Title: [XP] Kill Count BABS Add On
Post by: G_G on May 10, 2009, 02:20:29 am
Kill Count BABS Add On
Authors: game_guy
Version: 1.0
Type: Blizz ABS Add On
Key Term: Blizz-ABS Plugin



Introduction

This keeps track of how many enemies you kill in blizz abs. This includes the ones party members kill and people on your team.


Features




Screenshots

None


Demo

None


Script


Spoiler: ShowHide
if BlizzABS::VERSION < 2.51
 raise "Blizz ABS Version isnt high enough. Now Closing."
end

class BlizzABS::Processor
 
 KillCountVariable = 1

 alias exp_result_kill_count_later exp_result
 def exp_result(enemy)
   $game_variables[KillCountVariable] += 1  
   return exp_result_kill_count_later(enemy)
 end
 
end

$BlizzABS = BlizzABS::Processor.new



Instructions

Just set the variable id to the one you want to use


Compatibility

None yet found. Not tested with SDK.


Credits and Thanks




Author's Notes

Enjoy
Title: Re: [XP] Kill Count BABS Add On
Post by: Blizzard on May 10, 2009, 07:19:16 am
You should alias the method instead. Your code will become shorter and more compatible. :)
You should also add the checking if Blizz-ABS is there like I described in the manual.
Title: Re: [XP] Kill Count BABS Add On
Post by: G_G on May 10, 2009, 08:06:41 am
Spoiler: ShowHide
module BlizzABS

  KillCountVariable = 1 # Variable ID to store amount of enemies killed in
 
  class Processor
    if BlizzABS::VERSION < 2.51
      print "Blizz ABS Version isnt high enough. Now Closing."
      $scene = nil
    else
    alias kill_count_later exp_result
    def exp_result(enemy)
      $game_variables[BlizzABS::KillCountVariable] += 1 
      kill_count_later
    end
    end
  end
end


Would that work?
Title: Re: [XP] Kill Count BABS Add On
Post by: Blizzard on May 10, 2009, 11:03:07 am
Like this and that should do it.
Spoiler: ShowHide
if BlizzABS::VERSION < 2.51
  raise "Blizz ABS Version isnt high enough. Now Closing."
end

class BlizzABS::Processor
 
  KillCountVariable = 1

  alias exp_result_kill_count_later exp_result
  def exp_result(enemy)
    $game_variables[KillCountVariable] += 1 
    return exp_result_kill_count_later(enemy)
  end
 
end

$BlizzABS = BlizzABS::Processor.new


I changed it slightly so it looks cleaner. And the last line is necessary so the changes to the class actually apply.
Title: Re: [XP] Kill Count BABS Add On
Post by: G_G on May 10, 2009, 10:16:31 pm
Updated first post with your script Blizzard. Thanks for the help.
Title: Re: [XP] Kill Count BABS Add On
Post by: tSwitch on May 11, 2009, 11:53:05 am
Quote from: Rival Blizzard on May 10, 2009, 11:03:07 am
if BlizzABS::VERSION < 2.51
  raise "Blizz ABS Version isnt high enough. Now Closing."
end



what is this, the SDK? D:
Title: Re: [XP] Kill Count BABS Add On
Post by: Blizzard on May 11, 2009, 03:20:40 pm
No, it just prevents you from using an add-on when you don't have Blizz-ABS installed. Imagine somebody with an IQ of room temperature installs "Kill Count BABS Add On" without putting Blizz-ABS above it. In fact the person doesn't even use Blizz-ABS. And suddenly it all crashes. And the person is like "WTF" and wastes our time by posting about a problem caused by his/her own stupidity. This way the person will at least get a slat into his/her face saying "YOU NEED BLIZZ-ABS TO USE THIS SCRIPT, DUMBASS!".

And in fact it should be:

if !$BlizzABS || BlizzABS::VERSION < 2.51
  raise 'Blizz-ABS v2.51 or higher not found! RMXP will now close.'
end


The SDK is not a bad concept, it was just terribly realized. If I had made the SDK, it would be compatible and people wouldn't hate it. :/
Title: Re: [XP] Kill Count BABS Add On
Post by: King Munkey on May 11, 2009, 03:25:13 pm
Quote from: Rival Blizzard on May 11, 2009, 03:20:40 pm
The SDK is not a bad concept, it was just terribly realized. If I had made the SDK, it would be compatible and people wouldn't hate it. :/


Arrogant much? XD. Although you may have a point there.

Cool script though G_G
Title: Re: [XP] Kill Count BABS Add On
Post by: Blizzard on May 11, 2009, 03:33:12 pm
Look at Blizz-ABS and Tons. Don't you think they are some sort of development kits? And yet they are compatible with loads of other stuff. :/ I would love to make some sort of SDK for RMXP, but I lack the time and people will probably not go for it anyway as there already is an SDK.
Title: Re: [XP] Kill Count BABS Add On
Post by: fugibo on May 11, 2009, 04:42:28 pm
I always thought that you should expose Tons as more of a DevKit and allow better integration (with gradients and such, for example)
Title: Re: [XP] Kill Count BABS Add On
Post by: RoseSkye on July 07, 2009, 04:37:06 am
Quote from: game_guy on May 10, 2009, 02:20:29 am

Credits and Thanks


  • game_guy ~ making it
  • Blizzard ~ Death Toll add on in ToA for inspiring me to make this







Oh... well.

Quote from: RoseSkye on April 30, 2009, 08:28:10 pm
Quote from: Youngster Gi Gi on April 30, 2009, 08:24:55 pm
Its still coming along. I'll try to squeeze statistics in there but its hard to do that with 8 men in one menu

OFFTOPIC
Its still coming along. I'll try to squeeze statistics in there but its hard to do that with 8 men in one menu  :naughty:


You know what'll be cool? If you removed Step count, G, and playtime and added something like an HUD for a character

or ..

"Monsters killed"
"Damage Dealt"
or something like that. . maybe both.


Quote from: game_guy on April 30, 2009, 08:29:51 pm
Quote from: RoseSkye on April 30, 2009, 08:28:10 pm
Quote from: Youngster Gi Gi on April 30, 2009, 08:24:55 pm
Its still coming along. I'll try to squeeze statistics in there but its hard to do that with 8 men in one menu

OFFTOPIC
Its still coming along. I'll try to squeeze statistics in there but its hard to do that with 8 men in one menu  :naughty:


You know what'll be cool? If you removed Step count, G, and playtime and added something like an HUD for a character

or ..

"Monsters killed"
"Damage Dealt"
or something like that. . maybe both.


*gets great idea for BABS plugin :naughty:*
Thnx RoseSkye! *powers up*
Title: Re: [XP] Kill Count BABS Add On
Post by: G_G on July 07, 2009, 12:40:29 pm
I am really sorry Rose xD I was thinking someone else wanted me to do this but I forgot :^_^': there added you ;)
Title: Re: [XP] Kill Count BABS Add On
Post by: RoseSkye on July 07, 2009, 02:43:27 pm
Quote from: game_guy on July 07, 2009, 12:40:29 pm
I am really sorry Rose xD I was thinking someone else wanted me to do this but I forgot :^_^': there added you ;)


*Ego stroked* *Flexes muscles* Oh yeaaaaah baby..

G_G you have a msn? I want you talk to one of my scripters helping with my project about your kill count thing. Your view could help me incorporate it into an HUD.
Title: Re: [XP] Kill Count BABS Add On
Post by: G_G on July 07, 2009, 02:57:53 pm
I have msn but I cant get on right now I'm about to head out to go to my grandma's house -_-
she needs help moving stuff out into the shed and I ahve to help
Title: Re: [XP] Kill Count BABS Add On
Post by: Holyrapid on April 29, 2010, 03:49:43 am
G_G, is it possble to use a variable or something (i dont know what else) so that when enough of certain enemy is killed, you get better items as drops or something like that. Think FF12
If possible, could it be customisised so that diffrent enemies do diffrent things... if i´m not clear just ask for more details ok...
Title: Re: [XP] Kill Count BABS Add On
Post by: G_G on April 29, 2010, 08:43:12 am
If you could event it it'd be fine. All enemies killed are stored in a variable.
Title: Re: [XP] Kill Count BABS Add On
Post by: The Niche on May 15, 2010, 03:31:44 pm
Almost a necropost, errrr, you didn't see anything, ok?
G_G, can you use this script to have a kill count for each of the actors? I'd kinda like a few of my main characters competing.
Title: Re: [XP] Kill Count BABS Add On
Post by: G_G on May 15, 2010, 03:45:31 pm
I might be able to. Not sure if Blizz-Abs detects who actually killed the enemy. I'll mess around with it later.

And the necropost is okay seeing you had a question.
Title: Re: [XP] Kill Count BABS Add On
Post by: winkio on May 15, 2010, 03:47:42 pm
I remember doing this for RoseSkye.  I'll dig around for the script.

EDIT:  It's not quite the same thing, but it has it for skills and weapons.  g_g could use this as a reference to figure out items as well (excuse my hasty/sloppy coding, it was kinda created last minute and tacked on to the HUD I made for him).

Spoiler: ShowHide
# so, this will give kills for attacks and skills to actors.  It won't for items,
# or slip damage, because that would be a much longer script.  Right now, it
# stores the kill counts in variables 11-14 for easy reference but if you want
# to change, just change the +10 to and different number.

#==============================================================================
# Map_Enemy
#------------------------------------------------------------------------------
#  This class handles a map enemy character. It supports pixel movement,
#  complete AI handling, advanced sprite handling and battle handling.
#==============================================================================

class Map_Enemy < Map_Battler
 
  # setting all accessible variables
  attr_accessor :last_attacker
  #----------------------------------------------------------------------------
  # attack_effect
  #  character - the character that holds attack data (can be projectile)
  #  _battler  - the attacking battler
  #  This method executes attack upon a map character.
  #----------------------------------------------------------------------------
  alias attack_effect_killcount_later attack_effect
  def attack_effect(character, _battler)
    result = attack_effect_killcount_later(character,_battler)
    if @battler.dead? && _battler.is_a?(Game_Actor)
      _battler.kill_count += 1
    end
    return result
  end
  #----------------------------------------------------------------------------
  # skill_effect
  #  character - the character that holds skill use (can be projectile)
  #  _battler  - the skill using battler
  #  skill     - the skill
  #  This method executes skill use upon a map character.
  #----------------------------------------------------------------------------
  alias skill_effect_killcount_later skill_effect
  def skill_effect(character, _battler, skill)
    result = skill_effect_killcount_later(character, _battler, skill)
    if @battler.dead? && _battler.is_a?(Game_Actor)
      _battler.kill_count += 1
    end
    return result
  end
end

#==============================================================================
# ** Game_Actor
#------------------------------------------------------------------------------
#  This class handles the actor. It's used within the Game_Actors class
#  ($game_actors) and refers to the Game_Party class ($game_party).
#==============================================================================

class Game_Actor < Game_Battler
  attr_accessor   :kill_count
  attr_accessor   :kill_timer
  attr_accessor   :kill_rank
  alias initialize_kill_count_later initialize
  def initialize(actor_id)
    @kill_count, @kill_timer, @kill_rank = 0, 0, 0
    initialize_kill_count_later(actor_id)
  end
end

Title: Re: [XP] Kill Count BABS Add On
Post by: The Niche on May 15, 2010, 04:04:55 pm
THanks wink. Is it missing a bit at the start?
Title: Re: [XP] Kill Count BABS Add On
Post by: winkio on May 15, 2010, 04:07:19 pm
Hehe no.  As I said, I was rushed, so I just typed up a quick little explanation of what the script did so that a different scripter could finish it for him.  As it says, it doesn't keep track of kills by items or slip damage, so you will need to ask g_g or somebody to add those in (and take out the stuff about rank and time, because its not needed).
Title: Re: [XP] Kill Count BABS Add On
Post by: G_G on May 15, 2010, 04:23:37 pm
Thanks winkio. I'll go off that and add it.
Title: Re: [XP] Kill Count BABS Add On
Post by: keyonne on August 20, 2010, 12:03:49 pm
This is a nice basic script, but I was looking for something that would let me keep track of enemies killed by type for quests. So, I can send the player off to kill x amount of zombies or such. Has anyone seen anything like this that would be usable with Blizz-ABS?
Title: Re: [XP] Kill Count BABS Add On
Post by: Wizered67 on August 20, 2010, 06:46:00 pm
That could easily be evented by increasing a variable when each one is killed (you will need to set the trigger to death)
Title: Re: [XP] Kill Count BABS Add On
Post by: Holyrapid on August 26, 2010, 04:01:21 am
Hey, i have few things i'd like to ask...

One: i'm not sure how to event the 'better item drop' thing, and besides, i'm not sure g_g undestood it right, no offense ment. I'll try to explain it better.
If you kill a certain number of the same (type) enemies, they will begin to drop better items.
Say, we kill five sahagin which have, say ten% of dropping a potion when dead. but, after weäve killed six, there's say 20% they drop potion, or 5% they frop ether. Get it?
But, if we kill say a ghost in between, the chain goes back to one, and counts ghosts now, instead of sahagins... I have a video that should explain things a bit better than me.
The chaining part starts around 1.30 to 2.00 of the vids time: http://www.youtube.com/watch?v=OxDNcGvQLrw&p=977479D95F542BBF&playnext=1&index=7 (http://www.youtube.com/watch?v=OxDNcGvQLrw&p=977479D95F542BBF&playnext=1&index=7)

Two: Could be made so that the chain number would be displayed briefly on the screen after killing an enemy (unless it's the first of that type)
Title: Re: [XP] Kill Count BABS Add On
Post by: The Niche on October 04, 2010, 08:54:40 am
Quote from: game_guy on May 15, 2010, 04:23:37 pm
Thanks winkio. I'll go off that and add it.

Did you add it?
Title: Re: [XP] Kill Count BABS Add On
Post by: keyonne on November 05, 2010, 05:34:12 pm
I'm not quite sure how one would go about tracking numbers of monster kills in my game. If you mean within the monster group event box, I don't think that's possible for me, as I am using Blizz ABS, which bypasses the monster groups entirely.
Title: Re: [XP] Kill Count BABS Add On
Post by: nathmatt on November 05, 2010, 07:04:01 pm
I made a blizzabs counter for each type of monster with quest in mind i believe I called it individual enemy counter just look in the scripts section
Title: Re: [XP] Kill Count BABS Add On
Post by: Noob on January 07, 2011, 10:00:57 pm
Can it keep track of players u killed?