RPG Maker VX Ace中的RGSS-(RGSS in RPG Maker VX Ace-)
我一直在为RPG Maker VX Ace使用一组脚本,纹理和音频,称为Ace的神奇宝贝。 我一直在成功解决一些错误,但是这个我无法修复。 我在控制台中收到此错误:
Item Effects:216:in `block in extra_evs': private method `extra_evs' called for nil:NilClass (NoMethodError) from Item Effects:216:in `each' from Item Effects:216:in `inject' from Item Effects:216:in `extra_evs' from Pokémon Battle System:4403:in `block (3 levels) in process_action_end' from Pokémon Battle System:4392:in `each' from Pokémon Battle System:4392:in `block (2 levels) in process_action_end' from Pokémon Battle System:4379:in `each' from Pokémon Battle System:4379:in `block in process_action_end' from Pokémon Battle System:4373:in `each' from Pokémon Battle System:4373:in `process_action_end' from Mega Evolution:453:in `process_action' from Scene_Battle:48:in `update' from Pokedex:1746:in `update' from Party Dying Battle BGM:130:in `update' from Scene_Base:14:in `main' from MOG_Weather_EX:694:in `main' from Graphical Object Global Reference:201:in `main' from Video Player:153:in `run' from Map Screenshot:971:in `run' from Screenshot taker:215:in `run' from Main:12:in `block in <main>'这是给出错误的部分的代码:
class Game_Battler < Game_BattlerBase attr_accessor :attacking_item attr_accessor :captured def extra_evs(stat) equips.inject(0) {|r, equip| r += equip.extra_evs(stat)} endI have been using a pack of scripts, textures and audio for RPG Maker VX Ace called Pokémon for Ace. I have been succeeding to fix some errors, but this one I could not fix. I get this error in the console:
Item Effects:216:in `block in extra_evs': private method `extra_evs' called for nil:NilClass (NoMethodError) from Item Effects:216:in `each' from Item Effects:216:in `inject' from Item Effects:216:in `extra_evs' from Pokémon Battle System:4403:in `block (3 levels) in process_action_end' from Pokémon Battle System:4392:in `each' from Pokémon Battle System:4392:in `block (2 levels) in process_action_end' from Pokémon Battle System:4379:in `each' from Pokémon Battle System:4379:in `block in process_action_end' from Pokémon Battle System:4373:in `each' from Pokémon Battle System:4373:in `process_action_end' from Mega Evolution:453:in `process_action' from Scene_Battle:48:in `update' from Pokedex:1746:in `update' from Party Dying Battle BGM:130:in `update' from Scene_Base:14:in `main' from MOG_Weather_EX:694:in `main' from Graphical Object Global Reference:201:in `main' from Video Player:153:in `run' from Map Screenshot:971:in `run' from Screenshot taker:215:in `run' from Main:12:in `block in <main>'Here' s the code of the part that gives errors:
class Game_Battler < Game_BattlerBase attr_accessor :attacking_item attr_accessor :captured def extra_evs(stat) equips.inject(0) {|r, equip| r += equip.extra_evs(stat)} end最满意答案
你的equips数组包含一个零值。 检查它被分配的位置。
对于脏修复,请尝试equips.compact.inject(0) {|r, equip| r += equip.extra_evs(stat)} equips.compact.inject(0) {|r, equip| r += equip.extra_evs(stat)}
Your equips array contains a nil value. Check where it is being assigned.
For dirty fix, try equips.compact.inject(0) {|r, equip| r += equip.extra_evs(stat)}
更多推荐
发布评论