Automatic Equipment Optimization for Guilaume777's Multislot
#1
can somone make this compatible with 777's multislot equip pls ?!
Reply }
#2
bump !

pls DerVVulfman help me out it cant be much work !

i got it bymyself so that it equip extra slots but only if theyre unique, that means if you have 2x Ring
it doesnt work for the second one ...
also the weapon slot 2 isnt get equiped...

so pls pls pls help me out !!!
Reply }
#3
sry for bumping again ...
i need this so much !
Reply }
#4
Split from RPG Advocate's thread as this is a request for a patch or merger between two separate scripts.

Just tried. DAMN hard. Not the only one to try though. I asked Guillaume about it years ago when he was developing his system.
Up is down, left is right and sideways is straight ahead. - Cord "Circle of Iron", 1978 (written by Bruce Lee and James Coburn... really...)

[Image: QrnbKlx.jpg]
[Image: sGz1ErF.png]    [Image: liM4ikn.png]    [Image: fdzKgZA.png]    [Image: sj0H81z.png]
[Image: QL7oRau.png]    [Image: uSqjY09.png]    [Image: GAA3qE9.png]    [Image: 2Hmnx1G.png]    [Image: BwtNdKw.png%5B]
  Above are clickable links
Reply }
#5
so its even for you to hard ?!

damn !
Reply }
#6
I didn't say it was impossible, did I? However, Guillaume777 said it would have been difficult to integrate it into his system. He did most all the other RPG Advocate equip menu scripts though. I was the one to remind him about cursed items. Winking

However, I crafted this. Mind you, it assumes no removal of slots... kept at a basic level:
Code:
# Automatic Equipment Optimization
# by RPG Advocate


#==============================================================================
# ** Scene_Equip
#------------------------------------------------------------------------------
#  This class performs equipment screen processing.
#==============================================================================

class Scene_Equip
  #--------------------------------------------------------------------------
  # * Constants
  #--------------------------------------------------------------------------  
  WEAPON_ATK_WEIGHT = 1.0
  WEAPON_PDF_WEIGHT = 0.0
  WEAPON_MDF_WEIGHT = 0.0
  WEAPON_STR_WEIGHT = 0.0
  WEAPON_DEX_WEIGHT = 0.0
  WEAPON_AGI_WEIGHT = 0.0
  WEAPON_INT_WEIGHT = 0.0
  ARMOR_EVA_WEIGHT  = 0.0
  ARMOR_PDF_WEIGHT  = 0.75
  ARMOR_MDF_WEIGHT  = 0.25
  ARMOR_STR_WEIGHT  = 0.0
  ARMOR_DEX_WEIGHT  = 0.0
  ARMOR_AGI_WEIGHT  = 0.0
  ARMOR_INT_WEIGHT  = 0.0
  NO_ACCESSORY_OPTIMIZATION = false  
  #--------------------------------------------------------------------------
  # * Frame Update (when right window is active)
  #--------------------------------------------------------------------------  
  alias aeo_update_right update_right
  def update_right
    # Perform the original call
    aeo_update_right
    # If X button was pressed
    if Input.trigger?(Input::X)
      # Play decision SE
      $game_system.se_play($data_system.decision_se)
      # optimize
      optimize(@right_window.index)
      # Refresh windows
      @left_window.refresh
      @right_window.refresh
      for i in 0..@actor.armor_slots.max+1
        @item_windows[i].refresh
      end
      return
    end
    # If Y button was pressed
    if Input.trigger?(Input::Y)
      # Play decision SE
      $game_system.se_play($data_system.decision_se)
      for i in 0..@actor.armor_slots.max+1
        optimize(i)
      end
      @left_window.refresh
      @right_window.refresh
      for i in 0..@actor.armor_slots.max+1
        @item_windows[i].refresh
      end
      return
    end
  end  
  #--------------------------------------------------------------------------
  # * Optimize Equipment
  #     slot : equipment slot
  #--------------------------------------------------------------------------  
  def optimize(slot)
    old_slot = slot
    slot = index_to_equip_kind(old_slot)
    if slot == 0
      
      return if @actor.cursed?(slot)
      object = $data_weapons[@actor.weapon_id]
      optimal = object.id
      current = 0.00
      if @actor.weapon_id != 0
        current += object.atk  * WEAPON_ATK_WEIGHT
        current += object.pdef * WEAPON_PDF_WEIGHT
        current += object.mdef * WEAPON_MDF_WEIGHT
        current += object.str_plus * WEAPON_STR_WEIGHT
        current += object.dex_plus * WEAPON_DEX_WEIGHT
        current += object.agi_plus * WEAPON_AGI_WEIGHT
        current += object.int_plus * WEAPON_INT_WEIGHT
      else
        optimal = 0
      end
      max_eval = current
      @actor.equip(0, 0)
      flag = false
      zero_flag = true
      for weapon in $data_weapons
        if !flag
          flag = true
          next
        end
        evaluation = 0.00
        evaluation += weapon.atk  * WEAPON_ATK_WEIGHT
        evaluation += weapon.pdef * WEAPON_PDF_WEIGHT
        evaluation += weapon.mdef * WEAPON_MDF_WEIGHT
        evaluation += weapon.str_plus * WEAPON_STR_WEIGHT
        evaluation += weapon.dex_plus * WEAPON_DEX_WEIGHT
        evaluation += weapon.agi_plus * WEAPON_AGI_WEIGHT
        evaluation += weapon.int_plus * WEAPON_INT_WEIGHT
        if evaluation > 0
          zero_flag = false
        end
        if @actor.equippable?(weapon) &&
          $game_party.weapon_number(weapon.id) > 0 && evaluation > max_eval
          max_eval = evaluation
          optimal = weapon.id
        end
      end
      optimal = 0 if zero_flag
      @actor.equip(0, optimal)
      # If two-handed weapon
      @actor.equip(1, 0) if object.nb_hands > 1
      
      
      
    end
    # if armor slots.....
    if slot >= 1
      not_equipped = false
      case slot
      when 1
        # Skip Shield slot if two-handed...
        object = $data_weapons[@actor.weapon_id]
        return if object.nb_hands > 1
        if @actor.armor1_id == 0
          not_equipped = true
        else
        object = $data_armors[@actor.armor1_id]
        end
      when 2
        if @actor.armor2_id == 0
          not_equipped = true
        else
        object = $data_armors[@actor.armor2_id]
        end
      when 3
        if @actor.armor3_id == 0
          not_equipped = true
        else
        object = $data_armors[@actor.armor3_id]
        end
      when 4
        if NO_ACCESSORY_OPTIMIZATION
          return
        end
        if @actor.armor4_id == 0
          not_equipped = true
        else
        object = $data_armors[@actor.armor4_id]
        end
      end
      optimal = object.id
      # Skip if cursed and unremovable
      return if @actor.cursed?(optimal)
      # Calculate
      current = 0.00
      if not_equipped = false
        current += object.eva  * ARMOR_EVA_WEIGHT
        current += object.pdef * ARMOR_PDF_WEIGHT
        current += object.mdef * ARMOR_MDF_WEIGHT
        current += object.str_plus * ARMOR_STR_WEIGHT
        current += object.dex_plus * ARMOR_DEX_WEIGHT
        current += object.agi_plus * ARMOR_AGI_WEIGHT
        current += object.int_plus * ARMOR_INT_WEIGHT
      else
        optimal = 0
      end
      max_eval = current
      @actor.equip(slot, 0)
      flag = false
      zero_flag = true
      for armor in $data_armors
        if !flag
          flag = true
          next
        end
        next if armor.kind != slot-1
        # Calculate
        evaluation = 0.00
        evaluation += armor.eva  * ARMOR_EVA_WEIGHT
        evaluation += armor.pdef * ARMOR_PDF_WEIGHT
        evaluation += armor.mdef * ARMOR_MDF_WEIGHT
        evaluation += armor.str_plus * ARMOR_STR_WEIGHT
        evaluation += armor.dex_plus * ARMOR_DEX_WEIGHT
        evaluation += armor.agi_plus * ARMOR_AGI_WEIGHT
        evaluation += armor.int_plus * ARMOR_INT_WEIGHT
        #
        zero_flag = false if evaluation > 0
        #
        if @actor.equippable?(armor) &&
          $game_party.armor_number(armor.id) > 0 && evaluation > max_eval
          max_eval = evaluation
          optimal = armor.id
        end
      end
      #
      optimal = 0 if zero_flag
      @actor.equip(slot, optimal)
    end  
  end
end


Even though I use my own system nowadays.
Up is down, left is right and sideways is straight ahead. - Cord "Circle of Iron", 1978 (written by Bruce Lee and James Coburn... really...)

[Image: QrnbKlx.jpg]
[Image: sGz1ErF.png]    [Image: liM4ikn.png]    [Image: fdzKgZA.png]    [Image: sj0H81z.png]
[Image: QL7oRau.png]    [Image: uSqjY09.png]    [Image: GAA3qE9.png]    [Image: 2Hmnx1G.png]    [Image: BwtNdKw.png%5B]
  Above are clickable links
Reply }
#7
thx alot !
but what means " it assumes no removal of slots" ??
can i not change slots during class change like [0,0,2,3,4,5,6,6,7,7,8] to [0,2,3,4,5,6,6,7,7,8] ?!
Reply }
#8
Well, I don't know anything about that. After your response, I turned on Guillaume777's system and did a class change call and didn't get the message. Oh... a new version of the above in the works. That's a prelim job. The 2nd will deal with multiple weapon slots and variations on the armor such as having two helmet slots, removed shields and the like.

Mind you, I haven't messed with his system in over a year.
Up is down, left is right and sideways is straight ahead. - Cord "Circle of Iron", 1978 (written by Bruce Lee and James Coburn... really...)

[Image: QrnbKlx.jpg]
[Image: sGz1ErF.png]    [Image: liM4ikn.png]    [Image: fdzKgZA.png]    [Image: sj0H81z.png]
[Image: QL7oRau.png]    [Image: uSqjY09.png]    [Image: GAA3qE9.png]    [Image: 2Hmnx1G.png]    [Image: BwtNdKw.png%5B]
  Above are clickable links
Reply }
#9
woah cool !
thats exactly that what i meant ^^
i call at class change a method which sets the slots for every class new.
like warriors has 2 hands and all armor slots, mages have only one weapon slot and all armor slots and knights have 1 hand, the shield slot and all armor slots.
also i have multiple slot types like earrings and rings, you can equip 2 of each kind...
thats why i need this and you really do this ?!
awsome, really awsome ! Winking

edit: if its not to much work, can you maybe add a switch to enable desable the key methods,
and use only a script call for optimizing.
this method must check the actors weapons/armor slots and optimize only those which the actor at the moment have.
this would be a nice addition, maybe not only for me...
Reply }
#10
Thankies! I just posted a separate thread for the Guillaume version of the system. Probably the closest you're gonna get.

I don't mess with changing slots by classes. Didn't know you could do that. I deal with them by actors. Less headache I guess. That and I don't get that error.

Now about disabling it and making automated script calls, the optimization is run straight from the Equipment Menu. So there's no 'calling' the optimzation method.

But... at least it handles the multiple weapons and even the dumb things like two HEAD slots. Cursed thingies too.
Up is down, left is right and sideways is straight ahead. - Cord "Circle of Iron", 1978 (written by Bruce Lee and James Coburn... really...)

[Image: QrnbKlx.jpg]
[Image: sGz1ErF.png]    [Image: liM4ikn.png]    [Image: fdzKgZA.png]    [Image: sj0H81z.png]
[Image: QL7oRau.png]    [Image: uSqjY09.png]    [Image: GAA3qE9.png]    [Image: 2Hmnx1G.png]    [Image: BwtNdKw.png%5B]
  Above are clickable links
Reply }


Possibly Related Threads…
Thread Author Replies Views Last Post
   Atoa ACBS, Equipment Set Add-on Error Solitaire 10 871 10-13-2024, 11:41 PM
Last Post: Solitaire
   Visual PaperDoll Equipment Script JayRay 0 4,258 02-16-2016, 03:44 AM
Last Post: JayRay
   G777 Multislot Error with CF Equipment Upgrade XP Kobold 5 8,860 08-07-2011, 05:03 PM
Last Post: XP Kobold
   Syvakal's Conditional Skills And Equipment Crashes Samven 0 3,957 08-02-2011, 01:58 PM
Last Post: Samven
   YEM Equipment Error Message Samven 3 7,000 06-12-2011, 06:30 AM
Last Post: Samven
   Multislot error!? Brutanos 7 10,604 05-03-2010, 01:46 PM
Last Post: Brutanos
   [Resolved] Equipment Scene Problem Yin 4 7,283 08-29-2009, 11:01 PM
Last Post: Yin



Users browsing this thread: 2 Guest(s)