Hello modern algebra,
I have taken a long time to respond, sorry.
The 864 line error: undefined method `empty? 'for nil: NilClass, it's weird, because it happens sometimes.
I've been trying to do that I mentioned in the post above and I have questions about your code.
When the game is running, load all composite weapons and armors in cache? I guess this is where reading the notebox of weapons and armors:
def self.interpret_composite_graphic_string(string, cg = MA_Composite_Graphic.new("", 0, 0, 255, 0, 0))
if cg.is_a?(Hash)
string.sub!(/["'](.+)["']/) { cg[:filename] = $1; "" } # Filename: ""
string.sub!(/[Zz](-?\d+)/) { cg[:z] = $1.to_i; "" } # Z: 0
string.sub!(/[Hh](\d+)/) { cg[:hue] = $1.to_i; "" } # Hue: 0
string.sub!(/[Oo](\d+)/) { cg[:opacity] = $1.to_i; "" } # Opacity: 255
string.sub!(/[Rr](\d+)/) { cg[:rcode] = $1.to_i; "" } # R-Code: 0
string.sub!(/[Ii]?(\d+)/) { cg[:index] = $1.to_i; "" } # Index: 0
elsif cg.is_a?(MA_Composite_Graphic)
string.sub!(/["'](.+)["']/) { cg.filename = $1; "" } # Filename: ""
string.sub!(/[Zz](-?\d+)/) { cg.z = $1.to_i; "" } # Z: 0
string.sub!(/[Hh](\d+)/) { cg.hue = $1.to_i; "" } # Hue: 0
string.sub!(/[Oo](\d+)/) { cg.opacity = $1.to_i; "" } # Opacity: 255
string.sub!(/[Rr](\d+)/) { cg.rcode = $1.to_i; "" } # R-Code: 0
string.sub!(/[Ii]?(\d+)/) { cg.index = $1.to_i; "" } # Index: 0
end
cg
end
If when running the game reads the notebox and is cached, it will be very difficult to modify the code to change equipped items when you change the sprite of the character or event.
Another question. I added several msgbox_p in the code to try understand how it works and also know where I could read the character_name the actor or event. (To do what I said in the post above).
I thought that could do it here:
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Add Composite Character/Face
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
def macgve_add_cg(type, arg = {})
case arg
when String then cg = RPG::MACGVE_Data_CompositeGraphic.interpret_composite_graphic_string(arg)
when Hash
cg = MA_Composite_Graphic.new("", 0, 0, 255, 0, 0)
arg.each_pair(key, value) { cg.send(:"#{key}=", value) }
when MA_Composite_Graphic then cg = arg
else
return
end
send(:"base_composite_#{type}") << cg
$game_player.refresh
end
Here you call the function that reads the notebox, and as you are in Game_Actor, you can pass as an argument the character_name the actor or event and then use it when you read the filename of weapon or armor notebox. To know what must load.
I do not know if I have explained well.
Thanks for your help.