RPG Maker VX Ace中的RGSS

编程入门 行业动态 更新时间:2024-10-26 06:28:37
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)} end

I 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)}

更多推荐

本文发布于:2023-08-04 12:18:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1416466.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:Maker   RPG   VX   RGSS   Ace

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!