- Joined
- Jan 5, 2016
- Messages
- 149
- Reaction score
- 88
- First Language
- English
- Primarily Uses
- RMVXA
After a few days trying to work this out, I've pretty much run out of ideas. First, here's the title script I'm referencing:
https://github.com/Archeia/Kread-Ex...Scripts/Gameplay Scripts/Runic_Enchantment.rb
Anyways, there's a snippet that Kread-Ex adds which aliases "feature_objects," a method in Game_Actor that gathers all of the traits from their equipment ("equips"). The snippet can be found at line 198:
What the script does essentially is allowing your characters to equip "Runes" (notetagged armors) to their weapons. Then, the traits on those runes are applied to the actor using the above method. What it doesn't do is add the parameters from those armors onto the character. That makes sense because this isn't what "feature_objects" does; it only stores the actor's "traits" in an array. The method for adding equipment parameters is found in Game_Actor, on line 377:
This is where things get confusing. I'm trying to make it so that equipped runes have their parameters added to their respective actor via the above method. But this is proving extremely complicated for me because I'm not very keen on method values, which is what "equips" and "param_plus" return basically. I don't know how to access or edit the equips hash. I also don't understand what inject(super) means... Is that just injecting the following hash into the superclass method "param_plus"?
Any and all help is much appreciated. I'm trying to solve as many things on my own as I can, but this problem in particular is very difficult and an explanation on how to achieve what I want would be great.
https://github.com/Archeia/Kread-Ex...Scripts/Gameplay Scripts/Runic_Enchantment.rb
Anyways, there's a snippet that Kread-Ex adds which aliases "feature_objects," a method in Game_Actor that gathers all of the traits from their equipment ("equips"). The snippet can be found at line 198:
Code:
class Game_Actor < Game_Battler
#--------------------------------------------------------------------------
# ● Returns the list of traits
#--------------------------------------------------------------------------
alias_method(:krx_sandal_ga_fo, :feature_objects)
def feature_objects
runes = []
equips.compact.each do |equip|
container = equip.is_a?(RPG::Weapon) ? $game_party.enchants_w :
$game_party.enchants_a
next if container[equip.id].nil?
ids = container[equip.id]
ids.each do |id|
next if id.nil?
runes.push($data_armors[id])
end
end
krx_sandal_ga_fo + runes.compact
end
end
Code:
#--------------------------------------------------------------------------
# * Get Added Value of Parameter
#--------------------------------------------------------------------------
def param_plus(param_id)
equips.compact.inject(super) {|r, item| r += item.params[param_id] }
end
Any and all help is much appreciated. I'm trying to solve as many things on my own as I can, but this problem in particular is very difficult and an explanation on how to achieve what I want would be great.

