RMRK is retiring.
Registration is disabled. The site will remain online, but eventually become a read-only archive. More information.

RMRK.net has nothing to do with Blockchains, Cryptocurrency or NFTs. We have been around since the early 2000s, but there is a new group using the RMRK name that deals with those things. We have nothing to do with them.
NFTs are a scam, and if somebody is trying to persuade you to buy or invest in crypto/blockchain/NFT content, please turn them down and save your money. See this video for more information.
Equipment Constraints

0 Members and 2 Guests are viewing this topic.

****
Rep:
Level 83
You have alot of scripts that you want to rewrite, don't you? Geez...lol. I don't know how you do it

*
Rep: +0/-0Level 82
Ok, I don't know if i'm asking this at the right topic. But how can I copy the script and paste it in my game's script database? Don't answer me (Ctrl+C) then (Ctrl+V) ::)! When I paste the script code, it only paste it in one line, which makes the script unreadable and then makes the game crash. Can you please help me? :-[

***
Rep:
Level 81
it's time to poke
Stop using Internet Explorer.


**
Rep: +0/-0Level 87
I don't know if this has been answered or is in the script but how do you display what they need to equip it, because when I but it in it doesn't display the weapon until I'm that lvl.

**
Rep: +0/-0Level 75
RMRK Junior
Great script !! It could've been better if the item doesn't disappear on the equipment list instead once the weapon is equiped it'll produce a dialogue box stating that the requisites were not met. Just a thought though and I don't really know if its doable. :p

You rock ~! :D

**
Rep:
Level 84
I get an error. line 120 undefined 'level'

I have another script that checks user.level with no problems but this one has problems 0.o

If you rewrite this could you add in a forced remove equipment option. IE: ran out of required item and still have a weapon that uses it equipped to have it unequipped?
« Last Edit: September 14, 2010, 06:22:13 AM by wsensor »

*
Rep:
Level 97
2014 Most Unsung Member2014 Best RPG Maker User - Engine2013 Best RPG Maker User (Scripting)2012 Best Member2012 Best RPG Maker User (Scripting)2012 Favorite Staff Member2012 Most Mature MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Veteran2011 Favourite Staff Member2011 Most Mature Member2011 Best RPG Maker User (Scripting)2011 Best Use of Avatar and Signature Space2010 Most Mature Member2010 Favourite Staff Member
Well, item loss is the only condition in which it actually doesn't check to remove equipment, mostly because I didn't actually think anyone would ever require a certain item to be possessed to allow equipment. However, any other condition, stat requirements, level requirements, equip requirements, etc... will all remove the equipment upon losing those requirements.

As for your problem with checking level, it's probably an incompatibility with another script. Probably a Battle one. Can't really fix it without knowing which script is causing it.

**
Rep:
Level 84
probably => tankentai lol...
but I have a yerd/yanfly script that uses user.level with no problems 0.o (well actually it might have problems but I only use it to lower damage lol I ignore the other stuffs)

*
Rep:
Level 97
2014 Most Unsung Member2014 Best RPG Maker User - Engine2013 Best RPG Maker User (Scripting)2012 Best Member2012 Best RPG Maker User (Scripting)2012 Favorite Staff Member2012 Most Mature MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Veteran2011 Favourite Staff Member2011 Most Mature Member2011 Best RPG Maker User (Scripting)2011 Best Use of Avatar and Signature Space2010 Most Mature Member2010 Favourite Staff Member
Well, user is simply a name for a variable. It works if it holds a Game_Actor object. It won't if it doesn't. In this case, it doesn't because it is retrieving the active battler from Scene_Battle, which I am guessing Tankentai does not save in the same way and so it is nil once it passes to this method.

**
Rep:
Level 84
Tankentai does not seem to have a .level of any sort in its scripts so I am guessing it uses it from the regular battle scripts lol.

**
Rep: +0/-0Level 82
Hrmph.
Hey I was wondering if there was a way to combine this with Jets Alignment system? IE /Align[100]> so you have to have a good alignment to use that item, ect.

I figure it could be done easily if this script allowed for checking a variable.
IE. Set alignment to variable #10, then item requirement checks variable 10 for a certain range or value
Currently working on :: The Empire

And check the forums!

***
Rep:
Level 84
---> LOL <---
I apologize for the serious NecroPost how ever (see the screen shot) in battle using the: Tankentai Sideview Battle System  , if you go into the items menu and select to use an item you throw the error you see which is on line 120 and is:

Code: [Select]
actor_stats = [user.level, user.maxhp, user.maxmp, user.atk, user.def, user.spi, user.agi]


Is there a fix for this?




upon further testing this is only an issue with the battle system and not with general use of the items, that is if I use the items out side of battle nothing happens. its only using of items IN batttle.

a fix I tried was placing a level requirement on said item, how ever that did nothing.

Update

I found the true cause of the issue, no matter if the script is bellow or above it still throws this issue. I seems the script bellow is incompatible with this script. Can some one provide a fix for it please?

Code: [Select]

=begin ========================================================================
 * ziifee's Spin Command for RPG Tankentai Sideview Battle System with ATB
   <ATB Only>
   ?-This script is only for the Tankentai SBS with the ATB installed.
   <Image Required>
     Spin40 : Spin40.png is required in the Graphics/System folder.
=end # ========================================================================

module ZiiN7
 
  # ? Spin Command/Icon Index Number
  ATTACK = 95                                # Attack (Default)
  GUARD = 436                                # Guard
  SKILL = 277                               # Skill
  ITEM = 297                                # Item
  ESCAPE = 437                              # Escape
 
  # ? Spin Command/Direction of Rotation ( "normal" or "reverse" )
  #   Determines how Spin Command rotates according to left/right key press.
  TURN = "normal"
 
  # ? Spin Command/Switch Actor Command Button
  #   Define input button used to switch between actors with full ATB gauges.
  SWITCH_COMMAND_BUTTON = Input::X
 
  #--------------------------------------------------------------------------
  # ? ???? ??? (???????) Ignore this.
  #--------------------------------------------------------------------------
  def self.turn_normal?
    return false if TURN == "reverse"
    return true
  end
end

#==============================================================================
# ? module N02   for ATB Ver1.1
#==============================================================================
module N02
  # ATB Gauge Positions.  Overwrites ATB_PARTY_POSITION defined in ATB Config.
  ATB_PARTY_POSITION = [[45,390],[143,390],[239,390],[335,390]]
end


#******************************************************************************
# ? ???
#******************************************************************************
#==============================================================================
# ? Window_SpinCommand
#------------------------------------------------------------------------------
# ?????????????????????
#==============================================================================

class Window_SpinCommand < Window_Base
  #--------------------------------------------------------------------------
  # ? ??????????
  #--------------------------------------------------------------------------
  attr_reader   :index                    # ??????
  attr_reader   :help_window              # ????????
  #--------------------------------------------------------------------------
  # ? ?????????
  #     cx / cy  : ??? X?? / Y??
  #     commands : ?????? (?? ? [name, kind, pull, enabled?])
  #     setting  : ?????? ("R"=>?? "S"=>?? "G"=>?? "L"=>??)
  #--------------------------------------------------------------------------
  def initialize(cx, cy, commands, setting = {})
    @radius    = setting.has_key?("R") ? setting["R"] : 40  # ????
    @speed     = setting.has_key?("S") ? setting["S"] : 36  # ????
    @spin_back = setting.has_key?("G") ? setting["G"] : ""  # ????
    @spin_line = setting.has_key?("L") ? setting["L"] : nil # ????
    x, y = cx - @radius - 28, cy - @radius - 28
    width = height = @radius * 2 + 56
    super(x, y, width, height)
    self.opacity = 0
    @index = 0
    @commands = commands                                    # ????
    @spin_right = true
    @spin_count = 0
    update_cursor
  end
  #--------------------------------------------------------------------------
  # ? ?????????? (???? ???)
  #     i  : ??????
  #     cx : ?? ???? X??
  #     cy : ?? ???? Y??
  #--------------------------------------------------------------------------
  def draw_spin_graphic(i, cx, cy)
    case command_kind(i)
    when "icon"
      draw_icon(command_pull(i), cx - 12, cy - 12, command_enabled?(i))
    end
  end
  #--------------------------------------------------------------------------
  # ? ?????? ?????
  #--------------------------------------------------------------------------
  def refresh
    set_spin
  end
  #--------------------------------------------------------------------------
  # ? ????? ?????
  #--------------------------------------------------------------------------
  def draw_item(index, enabled = true)
    @commands[index][3] = enabled
    set_spin
  end
  #--------------------------------------------------------------------------
  # ? ?????????????
  #--------------------------------------------------------------------------
  def command_name(index = @index)
    return "" if index < 0
    name = @commands[index][0]
    return name != nil ? name : ""
  end
  #--------------------------------------------------------------------------
  # ? ??????????
  #--------------------------------------------------------------------------
  def command_kind(index)
    result = @commands[index][1]
    return result != nil ? result : ""
  end
  #--------------------------------------------------------------------------
  # ? ??????? ???
  #--------------------------------------------------------------------------
  def command_pull(index)
    result = @commands[index][2]
    return result != nil ? result : ""
  end
  #--------------------------------------------------------------------------
  # ? ?????????????
  #--------------------------------------------------------------------------
  def command_enabled?(index)
    result = @commands[index][3]
    return result != nil ? result : true
  end
  #--------------------------------------------------------------------------
  # ? ?????? index ?????
  #--------------------------------------------------------------------------
  def set_index(name)
    n = -1
    for i in 0...@commands.size
      n = i if @commands[i][0] == name
    end
    @index = n if n >= 0
    update_cursor
    call_update_help
    set_spin
  end
  #--------------------------------------------------------------------------
  # ? ?????????
  #     index : ?????????
  #--------------------------------------------------------------------------
  def index=(index)
    @index = index
    update_cursor
    call_update_help
    set_spin
  end
  #--------------------------------------------------------------------------
  # ? ???X?????
  #--------------------------------------------------------------------------
  def center_x
    return contents.width / 2
  end
  #--------------------------------------------------------------------------
  # ? ???Y?????
  #--------------------------------------------------------------------------
  def center_y
    return contents.height / 2
  end
  #--------------------------------------------------------------------------
  # ? ??????
  #--------------------------------------------------------------------------
  def item_max
    return @commands.size
  end
  #--------------------------------------------------------------------------
  # ? ????? (??? ??)
  #--------------------------------------------------------------------------
  def set_background
    return if @spin_back == ""
    bitmap = Cache.system(@spin_back)
    rect = Rect.new(0, 0, bitmap.width, bitmap.height)
    self.contents.blt(12, 12, bitmap, rect)
  end
  #--------------------------------------------------------------------------
  # ? ????? (??? ??)
  #--------------------------------------------------------------------------
  def set_text
    return if @spin_line == nil
    y = center_y - WLH / 2 + @spin_line
    self.contents.draw_text(center_x - 48, y, 96, WLH, command_name, 1)
  end
  #--------------------------------------------------------------------------
  # ? ?????????????????
  #--------------------------------------------------------------------------
  def angle_size
    return (Math::PI * 2 / item_max)
  end
  #--------------------------------------------------------------------------
  # ? ??????????????? ?????
  #--------------------------------------------------------------------------
  def set_spin_count
    @spin_count = angle_size * 360 / @speed
    set_spin(true)
  end
  #--------------------------------------------------------------------------
  # ? ????? ???
  #     spin : ????? (true ?????)
  #--------------------------------------------------------------------------
  def set_spin(spin = false)
    self.contents.clear
    set_background
    angle = spin ? @speed * @spin_count / 360 : 0
    angle = @spin_right ? angle : -angle
    for i in 0...item_max
      n = (i - @index) * angle_size + angle
      cx = @radius * Math.sin(n) + center_x
      cy = - @radius * Math.cos(n) + center_y
      draw_spin_graphic(i, cx, cy)
    end
    set_text
  end
  #--------------------------------------------------------------------------
  # ? ??????
  #--------------------------------------------------------------------------
  def update
    super
    update_cursor
    if @spin_count > 0
      @spin_count -= 1
      set_spin(@spin_count >= 1)
      return
    end
    update_command
  end
  #--------------------------------------------------------------------------
  # ? ???????????
  #--------------------------------------------------------------------------
  def command_movable?
    return false if @spin_count > 0
    return false if (not visible or not active)
    return false if (index < 0 or index > item_max or item_max == 0)
    return false if (@opening or @closing)
    return true
  end
  #--------------------------------------------------------------------------
  # ? ?????????
  #--------------------------------------------------------------------------
  def command_right
    @index = (@index + 1) % item_max
    @spin_right = true
    set_spin_count
  end
  #--------------------------------------------------------------------------
  # ? ?????????
  #--------------------------------------------------------------------------
  def command_left
    @index = (@index - 1 + item_max) % item_max
    @spin_right = false
    set_spin_count
  end
  #--------------------------------------------------------------------------
  # ? ?????????
  #--------------------------------------------------------------------------
  def update_command
    if command_movable?
      if Input.press?(Input::RIGHT)
        Sound.play_cursor
        ZiiN7.turn_normal? ? command_right : command_left
      end
      if Input.press?(Input::LEFT)
        Sound.play_cursor
        ZiiN7.turn_normal? ? command_left : command_right
      end
    end
    call_update_help
  end
  #--------------------------------------------------------------------------
  # ? ???????
  #--------------------------------------------------------------------------
  def update_cursor
    if @index < 0
      self.cursor_rect.empty
    else
      rect = Rect.new(0, 0, 24, 24)
      rect.x = center_x - rect.width / 2
      rect.y = center_y - rect.height / 2 - @radius
      self.cursor_rect = rect
    end
  end
  #--------------------------------------------------------------------------
  # ? ???????????
  #     help_window : ???????????
  #--------------------------------------------------------------------------
  def help_window=(help_window)
    @help_window = help_window
    call_update_help
  end
  #--------------------------------------------------------------------------
  # ? ???????????????????
  #--------------------------------------------------------------------------
  def call_update_help
    if self.active and @help_window != nil
       update_help
    end
  end
  #--------------------------------------------------------------------------
  # ? ??????????? (???????????)
  #--------------------------------------------------------------------------
  def update_help
  end
end

#******************************************************************************
# ? ???
#******************************************************************************

#==============================================================================
# ? Window_ActorCommand
#==============================================================================

class Window_ActorCommand < Window_SpinCommand
  #--------------------------------------------------------------------------
  # ? ?????????
  #--------------------------------------------------------------------------
  def initialize
    set = []
    set.push([Vocab::attack, "icon", ZiiN7::ATTACK, true])
    set.push([Vocab::skill,  "icon", ZiiN7::SKILL,  true])
    set.push([Vocab::guard,  "icon", ZiiN7::GUARD,  true])
    set.push([Vocab::item,   "icon", ZiiN7::ITEM,   true])
    super(64, 64, set, {"R"=>40, "S"=>52, "L"=>-12, "G"=>""})
    self.active = false
    set_spin
  end
  #--------------------------------------------------------------------------
  # ? ??????
  #     actor : ????
  #--------------------------------------------------------------------------
  def setup(actor)
    @commands[0][2] = ZiiN7::ATTACK
    @commands[1][0] = Vocab::skill
    if actor.weapons[0] != nil
      n = actor.weapons[0].icon_index
      @commands[0][2] = n if n > 0
    end
    @commands[1][0] = actor.class.skill_name if actor.class.skill_name_valid
    self.index = 0
    set_spin
  end
end

#==============================================================================
# ? Window_BattleStatus
#==============================================================================

class Window_BattleStatus
  #--------------------------------------------------------------------------
  # ? ????????? ?
  #--------------------------------------------------------------------------
  def initialize
    super(128, 0, 416, 128)
    @column_max = 4
    refresh
    self.active = false
    self.opacity = 0
  end
  #--------------------------------------------------------------------------
  # ? ????? ?
  #--------------------------------------------------------------------------
  def draw_item(index)
    x = index * 96
    rect = Rect.new(x, 0, 96, 96)
    self.contents.clear_rect(rect)
    self.contents.font.color = normal_color
    actor = $game_party.members[index]
    draw_actor_face(actor, x + 2, -10, 92)
    draw_actor_state(actor, x + 72, WLH * 3)
    self.contents.font.color = hp_color(actor)
    size = 14
    self.contents.font.size = size
    #self.contents.draw_text(x, WLH * 1 + 20 - size, 80, WLH, actor.name)
    self.contents.font.size = 20
    draw_actor_hp(actor, x+5, WLH * 1.7, 60)
    draw_actor_mp(actor, x+5, WLH * 2.2, 80)
  end
  #--------------------------------------------------------------------------
  # ? ???????
  #--------------------------------------------------------------------------
  def update_cursor
    self.cursor_rect.empty
  end
end

#******************************************************************************
# ? ???????????
#******************************************************************************

#==============================================================================
# ? Scene_Battle
#==============================================================================
class Scene_Battle
  #--------------------------------------------------------------------------
  # ? ??????  ????
  #--------------------------------------------------------------------------
  def update_actor_command_selection
    # ??????????????????????
    return reset_command unless commanding?
    if Input.trigger?(Input::B)
      Input.update
      Sound.play_decision
      start_party_command
    elsif Input.trigger?(Input::C)
      Input.update
      case @actor_command_window.index
      when 0  # ??
        Sound.play_decision
        @commander.action.set_attack
        start_target_enemy_selection
      when 1  # ???
        Sound.play_decision
        $in_select = true
        start_skill_selection
      when 2  # ??
        Sound.play_decision
        @commander.action.set_guard
        end_command
      when 3  # ????
        Sound.play_decision
        $in_select = true
        start_item_selection
      end
     
    # ??????????????? ************************************
    elsif Input.trigger?(ZiiN7::SWITCH_COMMAND_BUTTON)
      next_commander
    #********************************************************************
   
    end
  end
end


« Last Edit: December 22, 2011, 07:53:52 PM by Adrien. »

*****
my name is Timothy what's yours
Rep:
Level 79
Hello
2014 Most Missed Member2014 Zero to Hero2014 Best IRC Quote2012 Zero To HeroSecret Santa 2012 ParticipantContestant - GIAW 9For frequently finding and reporting spam and spam bots2011 Zero to Hero
I didn't test this, but it seemed like a pretty simple fix.
Code: [Select]
#==============================================================================
# ** Item/Equipment/Skill Conditions
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#  This script allows you to set stats and/or level requirements for weapons
#  and armor
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#  Instructions:
#    Place above Main and below Materials
#
#    To configure this script, you have to place codes in the Notes Field of
#   the respective items. These codes are:
#     
#     \LVLR[<level_requirement>]           *Actor must be at least this level
#     \HPR[<hp_requirement>]               *Actor must have this much HP
#     \MPR[<mp_requirement>]               *Actor must have this much MP
#     \ATKR[<attack_requirement>]          *Actor must have this much Attack
#     \DEFR[<defense_requirement>]         *Actor must have this much Defense
#     \SPIR[<spirit_requirement>]          *Actor must have this much Spirit
#     \AGIR[<agility_requirement>]         *Actor must have this much Agility
#     \WPNR[<weapon_id>]                   *Weapon must be equipped
#     \ARMR[<armor_id>]                    *Armor must be equipped
#     \ITMR[<item_id>, <n>]                *At least n of item_id in possession
#     \ITMR[<item_id>, <n>]C               *As above and consumed upon use.
#     \PWPNR[<possession_weapon_id>, <n>]  *At least n of weapon_id in possession
#     \PWPNR[<possession_weapon_id>, <n>]C *As above and consumed upon use.
#     \PARMR[<possession_armor_id>, <n>]   *At least n of armor_id in possession
#     \PARMR[<possession_armor_id>, <n>]C  *As above and consumed upon use.
#     \SKLR[<skill_id>]                    *Skill must be learned
#     \STER[<state_id>]                    *State must be added
#
#    After any of them that make sense, you can also add these restrictions:
#      >= - greater than or equal to - default
#      <= - less than or equal to
#      >  - strictly greater than
#      <  - strictly less than
#      =  - strictly equal to
#
#    You can leave out any or all or none of them and the script will only
#   restrict the attributes you set
#
#   EXAMPLE:
#     If Club has a Notes Field like this:
#
#       \LVLR[6]<
#       \ATKR[37]
#       \AGIR[27]>
#
#      then an actor could only use that club if he was less than level 6, had
#     an Attack of at least 37 and an Agility of at least 28.
#==============================================================================
# ** RPG::BaseItem
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#  Summary of Changes
#    new method - requirements_field
#==============================================================================

class RPG::BaseItem
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Requirement Field
  #--------------------------------------------------------------------------
  #  This method returns an array of restrictions on using each item
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def requirement_field
    r_field = []
    # Dissect Note
    text = self.note.dup
    text.sub! (/\\lvlr\[(\d+?)\](<*>*=*)/i) { '' }
    r_field.push ([$1.to_i, $2.to_s])
    # HP Requirement
    text.sub! (/\\hpr\[(\d+?)\](<*>*=*)/i) { '' }
    r_field.push ([$1.to_i, $2.to_s])
    # MP Requirement
    text.sub! (/\\mpr\[(\d+?)\](<*>*=*)/i) { '' }
    r_field.push ([$1.to_i, $2.to_s])
    # Attack Requirement
    text.sub! (/\\atkr\[(\d+?)\](<*>*=*)/i) { '' }
    r_field.push ([$1.to_i, $2.to_s])
    # Defense Requirement
    text.sub! (/\\defr\[(\d+?)\](<*>*=*)/i) { '' }
    r_field.push ([$1.to_i, $2.to_s])
    # Spirit Requirement
    text.sub! (/\\spir\[(\d+?)\](<*>*=*)/i) { '' }
    r_field.push ([$1.to_i, $2.to_s])
    # Agility Requirement
    text.sub! (/\\agir\[(\d+?)\](<*>*=*)/i) { '' }
    r_field.push ([$1.to_i, $2.to_s])
    r_field.push ([], [], [], [], [], [], [], [], [], [])
    # Weapon Requirement
    r_field[7].push ($1.to_i) while text.sub! (/\\wpnr\[(\d+?)\]/i) {''} != nil
    # Armor Requirement
    r_field[8].push ($1.to_i) while text.sub! (/\\armr\[(\d+?)\]/i) {''} != nil
    # Item Possession Requirement
    while text.sub! (/\\itmr\[(\d+),*\s*(\d*)\](C*)(<*>*=*)/i) { '' } != nil
      r_field[9].push ([$1.to_i, [$2.to_i, 1].max, $4.to_s])
      # Consumable items
      r_field[14].push ([$1.to_i, [$2.to_i, 1].max, $4.to_s]) if $3 != ""
    end
    # Weapon Possession Requirement
    while text.sub! (/pwpnr\[(\d+),*\s*(\d*)\](C*)(<*>*=*)/i) {''} != nil
      r_field[10].push ([$1.to_i, [$2.to_i, 1].max, $4.to_s])
      # Consumable weapons
      r_field[15].push ([$1.to_i, [$2.to_i, 1].max, $4.to_s]) if $3 != nil
    end
    # Armor Possession Requirement
    while text.sub! (/parmr\[(\d+),*\s*(\d*)\](C*)(<*>*=*)/i) {''} != nil
      r_field[11].push ([$1.to_i, [$2.to_i, 1].max, $4.to_s])
      # Consumable Armors\
      r_field[16].push ([$1.to_i, [$2.to_i, 1].max, $4.to_s]) if $3 != nil
    end
    # Skill Requirement
    r_field[12].push ($1.to_i) while text.sub! (/\\sklr\[(\d+?)\]/i) {''} != nil
    # State Requirement
    r_field[13].push ($1.to_i) while text.sub! (/\\ster\[(\d+?)\]/i) {''} != nil
    return r_field
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Check requirements
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def check_reqs (user)
    return if !user.is_a?(Game_Actor)
    actor_stats = [user.level, user.maxhp, user.maxmp, user.atk, user.def, user.spi, user.agi]
    reqs = self.requirement_field
    # Stats
    for i in 0...7
      case reqs[i][1]
      when "" # Assume Greater than or Equal to
        return false unless actor_stats[i] >= reqs[i][0]
      else # Other
        begin
          eval ("return false unless actor_stats[i] #{reqs[i][1]} reqs[i][0]")
        rescue
        end
      end
    end
    data = [$data_items, $data_weapons, $data_armors]
    # Weapons and Armor equips
    for i in 7...9
      reqs[i].each { |j|
        return false unless user.equips.include? (data[i-6][j])
      }
    end
    # Items, Weapons, Armors in possession
    for i in 9...12
      reqs[i].each { |j|
        case j[2]
        when ""
          return false unless $game_party.item_number (data[i-9][j[0]]) >= j[1]
        else
          begin
            eval ("return false unless $game_party.item_number (data[i-9][j[0]]) #{j[2]} j[1]")
          rescue
          end
        end
      }
    end
    # Skills learned
    self.requirement_field[12].each { |i| return false unless user.skill_learn? ($data_skills[i]) }
    # States
    self.requirement_field[13].each { |i| return false unless user.state? (i) }
    return true
  end
end
 
#==============================================================================
# ** Game_Actor
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#  Summary of Changes:
#    new method - check_reqs, consume_reagants
#    aliased_methods - equippable?, setup, level_down, maxhp=, maxmp=, atk=,
#                      def=, spi=, agi=
#    modified super - skill_effect, item_effect, skill_can_use?, item_effective?
#==============================================================================

class Game_Actor < Game_Battler
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Setup
  #     actor_id : actor ID
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  alias modalg_equip_required_actor_stp_7ht1 setup
  def setup (actor_id)
    # Run Original Method
    modalg_equip_required_actor_stp_7ht1 (actor_id)
    # Make sure all starting items are allowed to be on the hero
    check_equip_reqs
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Determine if Equippable
  #     item : item
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  alias modalg_eqp_reqs_actor_check_equip_5js9 equippable?
  def equippable?(item)
    return false if item == nil
    return modalg_eqp_reqs_actor_check_equip_5js9 (item) & item.check_reqs (self)
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Determine Usable Skills
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def skill_can_use? (skill)
    test = super (skill)
    return skill.check_reqs (self) if test
    return test
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Determine if an Item can be Used
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def item_effective?(user, item)
    return super (user, item) if user.is_a? (Game_Enemy)
    return super (user, item) & item.check_reqs (user)
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Apply Item Effects
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def item_effect(user, item)
    super (user, item)
    # Consume reagants if consumable
    consume_reagants (item)
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Apply Skill Effects
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def skill_effect(user, skill)
    super (user, skill)
    # Consume reagants if consumable
    consume_reagants (skill)
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Check Equipment Requirements
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def check_equip_reqs
    @checking_equipment = true
    equip_array = equips.dup
    for i in 0...5
      # Unequip everything
      change_equip (i, nil, true)
      test = equippable? (equip_array[i])
      change_equip (i, equip_array[i], true)
      # Unequip item for real if requirements not met
      change_equip (i, nil) unless test
    end
    @checking_equipment = false
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Consume Reagants
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def consume_reagants (item)
    unless @skipped || @missed || @evaded
      # Remove items, weapons, and armors
      item.requirement_field[14].each { |i| $game_party.lose_item ($data_items[i[0]], i[1]) }
      item.requirement_field[15].each { |i| $game_party.lose_item ($data_weapons[i[0]], i[1]) }
      item.requirement_field[16].each { |i| $game_party.lose_item ($data_armors[i[0]], i[1]) }
    end
  end
  #--------------------------------------------------------------------------
  # * Make sure requirements still met if stats decrease in any way
  #--------------------------------------------------------------------------
  alias modalg_eqpreqs_lvlup_check_9dn4 level_up
  def level_up
    modalg_eqpreqs_lvlup_check_9dn4
    check_equip_reqs
  end
 
  alias modalg_equip_reqs_changelvl_check_5hy2 level_down
  def level_down
    modalg_equip_reqs_changelvl_check_5hy2
    check_equip_reqs
  end
 
  alias modalg_equip_reqs_changemaxhp_check_h83d maxhp=
  def maxhp=(new_maxhp)
    modalg_equip_reqs_changemaxhp_check_h83d (new_maxhp)
    check_equip_reqs
  end
 
  alias modalg_equip_reqs_changemxmp_check_8fjq maxmp=
  def maxmp=(new_maxmp)
    modalg_equip_reqs_changemxmp_check_8fjq (new_maxmp)
    check_equip_reqs
  end
 
  alias modalg_equip_reqs_change_atk_94nd atk=
  def atk=(new_atk)
    modalg_equip_reqs_change_atk_94nd (new_atk)
    check_equip_reqs
  end
 
  alias modernalg_chck_reqs_def_73ij def=
  def def=(new_def)
    modernalg_chck_reqs_def_73ij (new_def)
    check_equip_reqs
  end
 
  alias modalgebra_reqs_chck_sprit_8dsn spi=
  def spi=(new_spi)
    modalgebra_reqs_chck_sprit_8dsn (new_spi)
    check_equip_reqs
  end
 
  alias modalgebra_requirements_equipment_agi_6hdt agi=
  def agi=(new_agi)
    modalgebra_requirements_equipment_agi_6hdt (new_agi)
    check_equip_reqs
  end
 
  alias ma_chck_eqp_reqs_chnge_equip_7fn change_equip
  def change_equip (equip_type, item, test = false)
    ma_chck_eqp_reqs_chnge_equip_7fn (equip_type, item, test)
    check_equip_reqs if @checking_equipment == nil || !@checking_equipment && !test
  end
 
  alias ma_frgt_skill_check_eqp_reqs_8her forget_skill
  def forget_skill (skill_id)
    ma_frgt_skill_check_eqp_reqs_8her (skill_id)
    check_equip_reqs if @checking_equipment == nil || !@checking_equipment
  end
end

#==============================================================================
# ** Game_Party
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#  Summary of Changes:
#    aliased methods - item_can_use?
#==============================================================================

class Game_Party
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Item Can Use?
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  alias modalg_req_itm_party_use_9m43 item_can_use?
  def item_can_use? (item)
    # Run Original Method
    test = modalg_req_itm_party_use_9m43 (item)
    return false unless test
    if $game_temp.in_battle
      return test & item.check_reqs ($scene.active_battler)
    else
      $game_party.members.each { |i| return test if item.check_reqs (i) }
      return false
    end
  end
end

#==============================================================================
# ** Scene_Battle
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#  Summary of Changes:
#    makes public - active_battler
#==============================================================================

class Scene_Battle < Scene_Base
  attr_reader :active_battler
end

#==============================================================================
# ** Scene_Item
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#  Summary of Changes:
#    aliased method - use_item_nontarget
#==============================================================================

class Scene_Item < Scene_Base
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Use Item (apply effects to non-ally targets)
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  alias modalg_eqp_reqs_consume_regnts_refresh_rn4 use_item_nontarget
  def use_item_nontarget
    # Run Original Method
    modalg_eqp_reqs_consume_regnts_refresh_rn4
    # Refresh Item Window
    @item_window.refresh
  end
end
it's like a metaphor or something i don't know

***
Rep:
Level 84
---> LOL <---
So I made a test project and ripped out all the scripts but that which you see here. (see image bellow)

With out your fix I got:



So I was wrong all along, either one of these scripts is the issue or this core script is "broken."

So I implemented your fix and look it works.....except...I cant use items in battle, there greyed out. So I thought - I must be dumb and forgot to set the scope. Nope, I can use items out side of battle but cannot use them in battle....

I am gracious for your help in this issue. I know we are so close to fixing this bug.

***
Rep:
Level 84
---> LOL <---
Update

I am so dumb sometimes.....I never tried this: complete vanilla game with just this script - the Original works fine. I am thinking its incompatible with the Tankentai Sideview Battle System.

---Continues Testing

So I downloaded the:

RPG Tankentai Sideview Battle System Version 3.4e & Active Time Battle v1.2c - ATB version and plugged in the original script and it threw the error.

I plugged in your version of the fix and got: - it works, except all items are greyed out and I cant use them in battle.

This is my final test. can you fix this small bug? - Your fix works its just the items are greyed out.

What would be really beneficial is if we could just take out the items section of the script and just do the level compare for weapons and armor.

Its official its a Tankentai issue. is there any patch for this?

also as I am testing your script is incompatible with one of my other scripts in such that items do NOT show up in battle - they did inmy test game where I ripped out everything but the battle system, and even then they show up as greyed out.
« Last Edit: December 23, 2011, 02:51:32 AM by Adrien. »