{VXAce}Monster Capture System

Hi, I was hoping I could do this without scripts but it seems not. I would like a script that allows the player to select a command (in this case "Capture") that gives a 25% chance of success if the enemy is below 50% HP. If it succeeds, the enemy is "captured" and an item is added into your inventory like "Live Behemoth". If not, the monster you failed to capture flees, leaving you no reward. Seems like I could do it with events and stuff, right?

The only problem is knowing what monster has been captured. I have over 30 monsters and even more troops. I need something that can tell that a "Red Slime" {in slot 003} has been captured and that would add a "Live Red Slime" to your inventory, and finally remove the enemy from the battle. In my game there are two monster items, Live, and Dead. Dead items are less valuable, but allow you to unlock pets. Live items are much more valuable and give you the option to fight that enemy again and again.

{Also if I could get pointed in the direction of a shop that has to have items unlocked from it (for my pet system) that would be awesome.}

Can't wait too hear from scripters! Thank you to anyone who can help. Credit will be given, obviously.
dinner has been served...

Spoiler
if true # << Make true to use this script, false to disable.#===============================================================================## ☆ Script requested by onewingedangel on http://forums.rpgmakerweb.com# -- Author   : Dekita# -- Version  : 1.0# -- Level    : Easy# -- Requires : N/A# -- Engine   : RPG Maker VX Ace##===============================================================================module OneWing_Thing#===============================================================================   # // notetag for skill to deseignate capture skill  Skill_Note = /<capture skill>/i  # // notentag for enemies to determine item dropped when caught.  Enemy_Note = /<item gain🙁.*)>/i  # // Capture Percentage  Capt_Perc = 25  # // HP must be below max hp * 0.25 to be sucessful  HP_Perc   = 0.25end#===============================================================================class RPG::Skill < RPG::UsableItem#===============================================================================  #-----------------------------------------------------------------------------  #  #-----------------------------------------------------------------------------  def onewing_note    if self.note =~ OneWing_Thing::Skill_Note      return $1.to_i    else      return nil    end  endend#===============================================================================class RPG::Enemy < RPG::BaseItem#===============================================================================  #-----------------------------------------------------------------------------  #  #-----------------------------------------------------------------------------  def onewing_note    if self.note =~ OneWing_Thing::Enemy_Note      return $1.to_i    else      return nil    end  endend#===============================================================================module BattleManager#===============================================================================  #-----------------------------------------------------------------------------  #  #-----------------------------------------------------------------------------  class << self    alias 😛rovict_onewingthing 😛rocess_victory  end  #-----------------------------------------------------------------------------  #  #-----------------------------------------------------------------------------  def self.process_victory    $game_temp.captured_enemy.each do |i|      next unless i.is_a?(Integer)      $game_party.gain_item($data_items, 1)    end    $game_temp.reset_capt_ene    provict_onewingthing  endend#===============================================================================class Game_Temp#===============================================================================  #-----------------------------------------------------------------------------  #  #-----------------------------------------------------------------------------  attr_accessor :captured_enemy  #-----------------------------------------------------------------------------  #  #-----------------------------------------------------------------------------  alias :init_onwing_thing :initialize  #-----------------------------------------------------------------------------  #  #-----------------------------------------------------------------------------  def initialize    init_onwing_thing    @captured_enemy = []  end  #-----------------------------------------------------------------------------  #  #-----------------------------------------------------------------------------  def reset_capt_ene    @captured_enemy = []  endend#===============================================================================class Game_Battler < Game_BattlerBase#===============================================================================  #-----------------------------------------------------------------------------  #  #-----------------------------------------------------------------------------  alias :mdv_onewing_thing :make_damage_value  #-----------------------------------------------------------------------------  #  #-----------------------------------------------------------------------------  def make_damage_value(user, item)    @onewingcaptene = false    if self.is_a?(Game_Enemy) && user.is_a?(Game_Actor) && item.onewing_note      if self.hp <= (self.mhp*OneWing_Thing::HP_Perc).to_i        if rand(101) < OneWing_Thing::Capt_Perc          $game_temp.captured_enemy << self.enemy.onewing_note          @onewingcaptene = true          self.hide        end      end    end    mdv_onewing_thing(user, item)  endend#==============================================================================##                      http://dekitarpg.wordpress.com/                         ##==============================================================================#end  # if true # << Make true to use this script, false to disable.

Also, http://yanflychannel.wordpress.com/rmvxa/menu-scripts/common-event-shop/ allows for you to make common events be sold in shop.

Edit:

As you did not specify the conditions for gaining 'dead monsters' i assume these are gained when an enemy is killed. This script simply removes the enemy from battle completely if captured. no exp, gold or anything like that, just the item..
Thank you muches! Can I just copy this from the top to bottom? Or are there any kind of instructions?
On those note tags do you need the i's at  the end?

-EDIT sorry for the double post 'twas an accident. please merge if needed.
nope... those are for parsing... the actual tag is the one inside the <>


@Dekita - why not just opt to put a configurable percent penalty when HP is not below the threshold? also why add the items only at Win?
I actually like the Items being gained after the party wins. And for the enemy note tag do I put the Item ID where the * is?
items only added when win because if you die there is no need for items, if you escape you are leaving the items. it doesnt make sense to always add them imo..

Also, it was just a quick draft.. if you wanted to always allow capture but simply make it 'lower hp = more chance) change this method..

#===============================================================================class Game_Battler < Game_BattlerBase#===============================================================================  #-----------------------------------------------------------------------------  #  #-----------------------------------------------------------------------------  alias :mdv_onewing_thing :make_damage_value  def make_damage_value(user, item)    @onewingcaptene = false    if self.is_a?(Game_Enemy) && user.is_a?(Game_Actor) && item.onewing_note      if rand(101) < (OneWing_Thing::Capt_Perc * (1.0-self.hp_rate))        $game_temp.capture_enemy = self.enemy.onewing_note        @onewingcaptene = true        self.hide      end    end    mdv_onewing_thing(user, item)  endendThe notetags you use are simply <capture skill> and <item gain: ITEM_ID>

replace ITEM_Id with the item id from the database.

^_^
You my friend are awesome. Can I cedit you as Dekita?
I accept credit in the form of 'Dekita', 'Dekita-RPG' and 'That totally mindblowingly awsome dude', preferably 'Dekita' though yes 🙂
I'll use a combo BD
also, just looking over that code.. you could change the line

class RPG::Skill < RPG::UsableItemfor this line...

class RPG::UsableItem < RPG::BaseItem
and then you could create an item, maybe call it 'a cage' and then use that for capturing monsters 🙂
Hey I actually tested this out today and I couldn't get it to work. Sorry that it's in a Word file... I can't paste on this site. (it's Really Dumb ha ha) All I changed was .25 to .5 for the HP percentage. and the Capture percentage to 100 (I just wanted to make sure everything was in order, I was planning on changing it back.)

Thanks for looking at it.
Sorry I don't think the file got uploaded.
i tested it and it seems to work  fine for me..

what was the error message you got saying ? or did it not display any error ?
The Move just doesn't work. I probably should have said I was using battle symphony. I have the tag (on capture) above the tags for the animation and stuff.

capture fail.png

capture fail.png
what kind of skill are you using ? I tested using a hp damage skill that dealt 0 damage... dunno if that has anything to do with it.
OK I made the damage output 0 and it worked.... sort of. I didn't get the item.

On the "Red Slimes" Note I have the stuff for a bestiary entry, then <item gain🙁13)> Item 13 is Live red slime.
<item gain: 13> should work, dont use the brackets. I dont know why that would make a difference but it seems to :/
Awesome. Thanks a lot.

you don mind I' going to look at some of your other scripts 🙂 Any you would recommend?
Depends on what your looking for I guess. My Best / Newest / Most advanced scripts can be found HERE

Be careful though, alot of my cripts are really complex in terms of customization options and its very easy to become 'lost' quite quickly.

Original thread: https://forums.rpgmakerweb.com/threads/vxace-monster-capture-system.24118/