this code was built in a custom window inheriting from window-base
it breaks on itemidweight = $data_items.weight and says that no method [] is found.
the .weight has been defined in another script.
Can anyone also explain why it says [] as a method?
Code:
#--------------------------------------------------------------------------
# Calculations
#--------------------------------------------------------------------------
i = 0
itemweight = 0
loop do
i += 1
itemidweight = $data_items[i].weight
itemidcount = $game_party.item_number($data_items[i])
if itemidweight == 0
next
end
itemtotalweight = itemidweight * itemidcount
itemweight += itemtotalweight
if i == 250
break
end
end
it breaks on itemidweight = $data_items.weight and says that no method [] is found.
the .weight has been defined in another script.
Can anyone also explain why it says [] as a method?