[XP] Kill Count BABS Add On

Started by G_G, May 10, 2009, 02:20:29 am

Previous topic - Next topic

G_G

May 10, 2009, 02:20:29 am Last Edit: December 28, 2010, 07:14:12 pm by game_guy
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


  • Keeps track of enemies killed in Blizz ABS



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


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



Author's Notes

Enjoy

Blizzard

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.
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

G_G

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?

Blizzard

May 10, 2009, 11:03:07 am #3 Last Edit: May 10, 2009, 11:07:32 am by Blizzard
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.
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

G_G

Updated first post with your script Blizzard. Thanks for the help.

tSwitch

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:


FCF3a A+ C- D H- M P+ R T W- Z- Sf RLCT a cmn+++ d++ e++ f h+++ iw+++ j+ p sf+
Follow my project: MBlok | Find me on: tSwitch.us | Twitter | Tumblr

Blizzard

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. :/
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

King Munkey

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

G_G Is my hero!
Munkey != monkey
Munkey > monkey

Blizzard

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.
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

fugibo

I always thought that you should expose Tons as more of a DevKit and allow better integration (with gradients and such, for example)

RoseSkye

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*

G_G

I am really sorry Rose xD I was thinking someone else wanted me to do this but I forgot :^_^': there added you ;)

RoseSkye

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.

G_G

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

Holyrapid

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...

G_G

If you could event it it'd be fine. All enemies killed are stored in a variable.

The Niche

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.
Level me down, I'm trying to become the anti-blizz!
Quote from: winkio on June 15, 2011, 07:30:23 pm
Ah, excellent.  You liked my amusing sideshow, yes?  I'm just a simple fool, my wit entertains the wise, and my wisdom fools the fools.



I'm like the bible, widely hated and beautifully quotable.

Dropbox is this way, not any other way!

G_G

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.

winkio

May 15, 2010, 03:47:42 pm #18 Last Edit: May 15, 2010, 03:51:14 pm by winkio
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


The Niche

THanks wink. Is it missing a bit at the start?
Level me down, I'm trying to become the anti-blizz!
Quote from: winkio on June 15, 2011, 07:30:23 pm
Ah, excellent.  You liked my amusing sideshow, yes?  I'm just a simple fool, my wit entertains the wise, and my wisdom fools the fools.



I'm like the bible, widely hated and beautifully quotable.

Dropbox is this way, not any other way!