NoMethodError In a script I use.

soraroxasxion

Villager
Member
Joined
Jun 6, 2016
Messages
6
Reaction score
0
First Language
English
Primarily Uses
Hello, I've been trying for quite a few days, to get this script to work, it tells me "Script 'Item Effects' Line 213: NoMethodError occurred
 Error occurred, check the debug console for more information.


here is the debug console Crash occurs at 231


https://gist.github.com/anonymous/4f29b1b51013721cb08ec2c35ee103c9


Here is the Script in question


https://gist.github.com/anonymous/2bbc1a792bf3baef2f80dabb3a5f6828


If anybody could point me in the right direction to fix this, it would help greatly.
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,434
Reaction score
7,713
First Language
German
Primarily Uses
RMMV
Did you start a new game after installing that script or did you load an old savefile?


In 95% of all cases such errors are caused by savefiles that have become incompatible due to the added script, you NEED to start a new game for those scripts.


If you started a new game, then that is an incompatibility with one of your other scripts and you need to disable them one after another until you find the conflicting script, then try to find a compatibility patch.
 

soraroxasxion

Villager
Member
Joined
Jun 6, 2016
Messages
6
Reaction score
0
First Language
English
Primarily Uses
Did you start a new game after installing that script or did you load an old savefile?


In 95% of all cases such errors are caused by savefiles that have become incompatible due to the added script, you NEED to start a new game for those scripts.


If you started a new game, then that is an incompatibility with one of your other scripts and you need to disable them one after another until you find the conflicting script, then try to find a compatibility patch.
New file, but it's strange because the script's i'm using were set up and ordered by the script dev. guess I can try that.
 

soraroxasxion

Villager
Member
Joined
Jun 6, 2016
Messages
6
Reaction score
0
First Language
English
Primarily Uses
Did you start a new game after installing that script or did you load an old savefile?


In 95% of all cases such errors are caused by savefiles that have become incompatible due to the added script, you NEED to start a new game for those scripts.


If you started a new game, then that is an incompatibility with one of your other scripts and you need to disable them one after another until you find the conflicting script, then try to find a compatibility patch.
I have now gone through and when I disabled them they either crashed almost immediately, or when I reached that same point.
 

Sixth

Veteran
Veteran
Joined
Jul 4, 2014
Messages
2,162
Reaction score
823
First Language
Hungarian
Primarily Uses
RMVXA
You can see this method in Game_Battler:


def extra_evs(stat)
equips.inject(0) {|r, equip| r += equip.extra_evs(stat)}
end


It's right at the start in that script you linked.


If an actor got an empty equip slot, you will get that error, because that code above will try to call that extra_evs method on a non-existent equip item (which is actually nil).


To fix it, just replace that method with this one:


def extra_evs(stat)
equips.inject(0) {|r, equip| next if equip.nil?; r += equip.extra_evs(stat)}
end


And the error should disappear.
 

soraroxasxion

Villager
Member
Joined
Jun 6, 2016
Messages
6
Reaction score
0
First Language
English
Primarily Uses
You can see this method in Game_Battler:



def extra_evs(stat)
equips.inject(0) {|r, equip| r += equip.extra_evs(stat)}
end


It's right at the start in that script you linked.


If an actor got an empty equip slot, you will get that error, because that code above will try to call that extra_evs method on a non-existent equip item (which is actually nil).


To fix it, just replace that method with this one:



def extra_evs(stat)
equips.inject(0) {|r, equip| next if equip.nil?; r += equip.extra_evs(stat)}
end


And the error should disappear.
This solved it, Thank you so much.
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Profile Posts

Don't forget, aspiring writers: Personality isn't what your characters do, it is WHY they do it.
Hello! I would like to know if there are any pluggings or any way to customize how battles look?
I was thinking that when you start the battle for it to appear the eyes of your characters and opponents sorta like Ace Attorney.
Sadly I don't know how that would be possible so I would be needing help! If you can help me in any way I would really apreciate it!
The biggest debate we need to complete on which is better, Waffles or Pancakes?
rux
How is it going? :D
Day 9 of giveaways! 8 prizes today :D

Forum statistics

Threads
106,050
Messages
1,018,548
Members
137,835
Latest member
yetisteven
Top