Getting the weapon/armor params?

● ARCHIVED · READ-ONLY
Started by Meguido 7 posts View original ↗
  1. Hello everyone,

    I feel really bad with this being my first post in this community... It's not the best way to start :(

    Well to the point, I've run into a "trouble" I mean, i don't know how or when the weapon/armor' stats are applied when equipping it.

    I searched in the base script for reference and looked at Scene_Equip. There I found the method 'on_item_ok' which i suposse it's the one executed when you equip anything in a character.

    Then from this method i get

    @actor.change_equip(@slot_window.index, @item_window.item)so i searched 'change_equip' in Game_Actor. In that method i just found two 'return' and this

    @equips[slot_id].object = itemrefreshThe i assume that the actual updating in param values you can see in 'real time' while equiping a piece of weapon/armor should be in the refresh am i right? because the other line is just setting 'item' as the 'object' in that 'slot_id' of the '@equips' so it's not updating in real time atleast in that method.

    But then again the refresh method is get from the main class Game_BattlerBase

    def refresh state_resist_set.each {|state_id| erase_state(state_id) } @hp = [[@hp, mhp].min, 0].max @mp = [[@mp, mmp].min, 0].max @hp == 0 ? add_state(death_state_id) : remove_state(death_state_id)endAnd as far as i can see in there only the states and hp/mp are updated...

    I'm probably getting all the thing wrong :S but i have more experience with RGSS1 than with RGSS3 and it's hard for me to get used to it tbh

    Hope someone can help me with this. All i want to know is where are the newly added stats applied to be able to set some conditions on when to add some of them and when to add some others but not all of the  at the same time.

    Thank you very much in advance!
  2. In the class "Window_EquipStatus" you have two methods:

    "draw_current_param" and "draw_new_param".

    The first method draws the current params of the actor and the second method draws the param of the actor when he would equip the armor or weapon.
  3. Thanks for your reply!

    I looked at those methods and i found it create a copy of the actor as a temp_actor and then force_change_equip the selected equipment and then compare it to the actual actor.

    But then i look at the force_change_equip to see if it applies the new params in any way that updates right away...

    def force_change_equip(slot_id, item) @equips[slot_id].object = item release_unequippable_items(false) refreshendthen only thing that could immediately update the params would be the refresh i see in there but the refresh have nothing but only updates for HP/MP and states...

    So i still don't know how can i apply only some params based on the slot you use to equip an item.
  4. Can you give an example of what you want to do?
  5. Yeah.

    I have my character with 2 shield slots. Shield L and Shield Rand i have an item called Silver Shield

    This item in the database gives +10 ATK and +150MHP and also gives the fire skill. What i want is:

    - If you equip Silver Shield in Shield L slot:

         - You get +10 ATK and the Fire skill BUT not the +150MHP

    - if you equip Silver Shield to Shield R slot instead:

         - You only get +150MHP

    I hope this is understandable ^^
  6. I can think of a makeshift fix.  Clone the weapon, then replace the stat as its equipped to the equipment slot with 0 bonus on the stat, or if possible the stat bonus entirely, ONLY if a note tag is attached to the item designating the stat to only apply to a different slot number.  Clone it, alter stats, equip it.  Removing it shouldn't have any issues.

    Hope this helps.
  7. Thanks!

    That was the way i was doing it before asking in here. I wanted to know if there was an easier way to achieve this :p