设为首页收藏本站同能贴吧 切换语言 繁体中文
开启辅助访问 切换到窄版
扫描二维码关注官方公众号
返回列表
+ 发新帖
查看: 124|回复: 0

[转载发布] (Auto) Equip Slots (Beginner friendly)

[复制链接]
累计送礼:
0 个
累计收礼:
1 个
  • TA的每日心情
    开心
    2026-7-12 04:10
  • 签到天数: 209 天

    连续签到: 2 天

    [LV.7]常住居民III

    9071

    主题

    864

    回帖

    6万

    积分

    管理员

    Rank: 9Rank: 9Rank: 9

    VIP
    7
    卡币
    58883
    OK点
    16
    推广点
    0
    同能卷
    50
    积分
    68848

    灌水之王

    发表于 2026-8-1 15:55:32 | 显示全部楼层 |阅读模式
    Made for a request here.

    This script allows equip slots to be add/remove automatically simply by adding/removing armour type in the database editor.

    Since it's using armour type instead of equip type for slots, you can add as many slot types as you like to your game simply by creating more armour types in database=>terms. The slots will automatically be available to the actor as long as he/she can use that weapon/armour type. So actors with their own slots, job change with their own slots, states that effect slots, weapon/armour that add/delete slots, cursed armour/weapon etc etc can be done easily right inside the database editor without any scripting knowledge.



    Features:

    [1] Automatic add/remove equip slots based on database editor's setting (actor/class/weapon/armour/state)

    [2] Able to add as many equip slot types as you like

    [3] Automatic name the slots to be the same as weapon/armour types in database=>terms

    [4] Automatic name the weapon slot type and stack when more than one weapon is allowed (separated by /)

    [5] Able to seal/fix weapons/armours using note tags

    [6] Able to seal off dual wield when using two handed weapon

    [7] Able to set starting gears using note tags

    [8] Sealed weapon/armour slots are automatically removed from the equip slot list

    How to Use:

    [1] The script itself is pretty much plug & play. Simply paste this script below Material and above Main in your script editor

    [2] To add an equipment slot to the actor, all you need is to add weapon & armour types to either Actor/Class/Weapons/Armors/States under Features in the Database editor. As long as the weapon/armour type is available to the actor, the slot will automatically show up in the equip list.

    (as shown in picture below)

    This is all you need to add the equip slots to the class/actor/weapon/armour/state



    NOTE: You can create as many armour types as you like in Database=>Terms=>Armour type, they can then later be added to actor/class/weapon/armor/state in their features(as shown in picture above).

     

    [3] To have more than 1 same type equipment slots(armour only), just add another of the same armour type in features in the database editor. eg, if you want 3 accessories slot, just add accessories armour type 3 times in features.

     



     

    NOTE: When using more than 1 types of weapon, the type name will stack, separated by /

    eg. Sword/Claw/Whip

    To disable showing weapon types, go to settings area in the script and change true to false

     

    [4] To Seal/Fixed an equip slot type, add the following to the Actor/Class/Weapon/Armor/State note box

       <seal: 1, 3, 4> or <SEAL: 1, 3, 4>

       <fix: 2, 5, 6> or <FIX: 2, 5, 6>

        0 = weapon, 1~=armor type id (same as those under Database=>Terms tab=>Armour types)

     

    NOTE: Sealed gear slots are automatically hidden from equip scene

     

    [5] To seal off dual wield when using a 2 handed weapon, add below to weapon's note box

        <twohand>

     

    [6] To add starting gears(armours only), add below to actor's note box

        <gear: 21, 15, 61> or <GEAR: 21, 15, 61>

        please use armour's id here (refer to Database=>Armors tab)

     

     [!!_IMPORTANT NOTE_!!]

      * Equip types no longer work and are replaced by Armour types

      * Only use the note tag to do seal/fix, the editor's default seal/fix no longer works correctly because they are meant for the old

         equip type not the new armour type this script is using.

      * Add starting gears using the note tag is for armours only, you are still require to add starting weapons using the default

         database editor's way.

    Compatibility:

    This script modifies the way equip slots works, but is kept at the minimum to avoid conflicts.

    If you find it conflicting with another script. Try move this script above/below that other script.

    Terms of Use:

    Free for both commercial and non-commercial.

    Script:

    Spoiler                Code:       
    1. #==============================================================================# ■ Meow Face (Auto) Equip Slots#------------------------------------------------------------------------------# Automatically Add/Remove equip slots based on database editor weapon/armor types# Automatically name slots to be the same as weapon/armor types#==============================================================================## [How to Use]## [1] Place this script below Material and above Main## [2] Add weapon & armor types to actor/class/weapon/armor/state under features## [3] To have more than 1 same equip slots(armor only), just add more in features.## NOTE: When using more than 1 types of weapon, the type name will stack, separated by /# eg. Sword/Claw/Whip#  To disable showing weapon types, goto settings area below and change true to false## [4] To Seal/Fixed a gear slot, add the following to the actor/class/weapon/armor/state notebox#    <seal: 1, 3, 4> or <SEAL: 1, 3, 4>#    <fix: 2, 5, 6> or <FIX: 2, 5, 6>#     0 = weapon, 1~=armor type id (same as those under terms tab)## NOTE: Sealed gear slots are automatically removed from equip scene## [5] To seal off dual wield when using a 2 handed weapon, add below to weapon's notebox#    <twohand>## [6] To add starting gears(armors only, use editor for weapon), add below to actor's notebox#    <gear: 21, 15, 61> or <GEAR: 21, 15, 61>#    use armor's id here## [!!_IMPORTANT NOTE_!!]#  * Equip types no longer work and are replaced by Armor types#  * Only use the script's seal/fix, the editor's default seal/fix no longer works#  * Add starting gears using the script's method for armor only, weapons still require editor#==============================================================================module MEOWFACE_EQUIP_SLOTS #DO NOT REMOVE!!#==============================================================================# Settings Area#==============================================================================  SHOW_WEAPON_TYPE = true #Show weapon's individual type(true)/default(false)#==============================================================================# End of Settings Area# Edit anything past this line at your own risk!#==============================================================================endmodule Vocab  def self.mfwtype(wtype_id)    $data_system.weapon_types[wtype_id]  end  def self.mfatype(atype_id)    $data_system.armor_types[atype_id]  endendclass RPG::BaseItem  def meow_start_gear    return @meowgear if @meowgear != nil    @meowgear = []    stmemo = @note.scan(/<(?:GEAR|gear):[ ](\d+(?:\s*,\s*\d+)*)>/i).flatten    stmemo.each do |m|      m.to_s.split(/\s*,\s*/).each {|d| @meowgear.push(d.to_i)} if stmemo != nil && !stmemo.empty?    end    @meowgear  end  def meow_fix_gear    return @meowfixeq if @meowfixeq != nil    @meowfixeq = []    fmemo = @note.scan(/<(?:FIX|fix):[ ](\d+(?:\s*,\s*\d+)*)>/i).flatten    fmemo.each do |m|      m.to_s.split(/\s*,\s*/).each {|d| @meowfixeq.push(d.to_i)} if fmemo != nil && !fmemo.empty?    end    @meowfixeq  end  def meow_seal_gear    return @meowsealeq if @meowsealeq != nil    @meowsealeq = []    smemo = @note.scan(/<(?:SEAL|seal):[ ](\d+(?:\s*,\s*\d+)*)>/i).flatten    smemo.each do |m|     m.to_s.split(/\s*,\s*/).each {|d| @meowsealeq.push(d.to_i)} if smemo != nil && !smemo.empty?    end    @meowsealeq  endendclass RPG::Armor < RPG::EquipItem  def etype_id #overwrite method    return self.atype_id  endendclass RPG::Weapon < RPG::EquipItem  def two_hand?    @note.include?("<twohand>")  endendclass Game_BattlerBase  def equip_type_fixed?(etype_id) #overwrite method    meow_fixed_sum.include?(etype_id)  end  def equip_type_sealed?(etype_id) #overwrite method    meow_sealed_sum.include?(etype_id)  end  def equip_features(code)    features(code).inject([]) {|r, ft| r += [ft.data_id] }  end  def eq_wtype    return [] if meow_sealed_sum.include?(0)    features_set(FEATURE_EQUIP_WTYPE)  end  def eq_atype    equip_features(FEATURE_EQUIP_ATYPE) - meow_sealed_sum  endendclass Game_Actor < Game_Battler  alias meow_init_equips init_equips  def init_equips(equips)    meow_init_equips(equips)    meow_start_equip  end  def meow_start_equip    for id in actor.meow_start_gear      meowarmor = $data_armors[id]      next if meowarmor.nil?      etype_id = meowarmor.etype_id      next unless equip_slots.include?(etype_id)      slot_id = empty_slot(etype_id)      @equips[slot_id].set_equip(etype_id == 0, meowarmor.id)    end    optimize_equipments    refresh  end  def meow_fixed_sum    @meow_fixed_math = []    @meow_fixed_math += self.class.meow_fix_gear    @meow_fixed_math += actor.meow_fix_gear    for equip in equips      next if equip.nil?      @meow_fixed_math += equip.meow_fix_gear    end    for state in states      next if state.nil?      @meow_fixed_math += state.meow_fix_gear    end    @meow_fixed_math  end  def meow_sealed_sum    @meow_sealed_math = []    @meow_sealed_math += self.class.meow_seal_gear    @meow_sealed_math += actor.meow_seal_gear    for equip in equips      next if equip.nil?      @meow_sealed_math += equip.meow_seal_gear    end    for state in states      next if state.nil?      @meow_sealed_math += state.meow_seal_gear    end    @meow_sealed_math  end  def two_handed?    weapons.any? do |weapon|       return weapon.two_hand? if weapon != nil    end  end  def equip_slots #overwrite method    if eq_wtype == []      return eq_atype    else      return [0]+eq_atype if two_handed?      return [0,0]+eq_atype if dual_wield?      return [0]+eq_atype    end  endendclass Window_EquipSlot < Window_Selectable  def slot_name(index) #overwrite method    if @actor.equip_slots[index] == 0      if !MEOWFACE_EQUIP_SLOTS::SHOW_WEAPON_TYPE        return @actor ? Vocab::etype(@actor.equip_slots[index]) : ""      end      mfwtype_name = ""      last_id = @actor.eq_wtype[-1]      @actor.eq_wtype.each do |id|        mfwtype_name += Vocab::mfwtype(id)        if id != last_id          mfwtype_name += "/"        end      end      @actor ? mfwtype_name : ""    else      @actor ? Vocab::mfatype(@actor.equip_slots[index]) : ""    end  endendclass Scene_Equip < Scene_MenuBase  alias meow_csw create_slot_window  def create_slot_window    meow_csw    @slot_window.create_contents    @slot_window.draw_all_items  end  alias meow_oac on_actor_change  def on_actor_change    meow_oac    @slot_window.create_contents    @slot_window.draw_all_items  endend
    复制代码








    本贴来自国际rpgmaker官方论坛作者:MeowFace处,因国际论坛即将永久关站,为了存档多年珍贵资料,署名转载到本论坛存档,由于官方帖子为英文原帖,需要中文翻译请点击论坛顶部切换语言为中文就可以将帖子翻译成中文浏览,方便大家随时查看,原文地址:https://forums.rpgmakerweb.com/threads/auto-equip-slots-beginner-friendly.50873/

    本帖子中包含更多资源

    您需要 登录 才可以下载或查看,没有账号?立即注册

    x
    天天去同能,天天有童年!
    回复 送礼论坛版权

    使用道具 举报

    文明发言,和谐互动
    文明发言,和谐互动
    高级模式
    您需要登录后才可以回帖 登录 | 立即注册

    本版积分规则

    简体中文
    繁體中文
    English(英语)
    日本語(日语)
    Deutsch(德语)
    Русский язык(俄语)
    بالعربية(阿拉伯语)
    Türkçe(土耳其语)
    Português(葡萄牙语)
    ภาษาไทย(泰国语)
    한어(朝鲜语/韩语)
    Français(法语)
    关闭

    幸运抽奖

    社区每日抽奖来袭,快来试试你是欧皇还是非酋~

    立即查看

    聊天机器人
    Loading...

    QQ|Archiver|手机版|小黑屋|同能RPG制作大师 ( 沪ICP备12027754号-3 )

    GMT+8, 2026-8-18 00:25 , Processed in 0.143240 second(s), 53 queries .

    Powered by Discuz! X3.4

    Copyright © 2001-2020, Tencent Cloud.

    快速回复 返回顶部 返回列表