Problem with the Earthbound Battle system

So, in a game I'm making, I put in the Earthbound battle system by cozziekuns
but, when I try to do battles, I get this error message
upload_2017-6-19_11-24-18.png

So, I decided to check it out, and it was this line of code that was messing up

rect = Rect.new(icon_index % 16 * 24, icon_index / 16 * 24, 24, 24)

I honestly have no clue what to do, I'll take any and all help, cause I'm confused.
Most likely that line has nothing to do with the error directly - the error just says that on this line the computer detected that you're missing data that is needed to process this line (undefined for nilclass means data doesn't exist)

So either you forgot to configure the script correctly, or you didn't start a new game after installing the script.

If that is not enough to find the error yourself, we need a link to the script and a screenshot of the backtrace output with the full error message (instead of the abbreviated default message you made a screenshot of).
If you don't know of the backtracer, please follow the link "how to use a script" in my signature.
...huh
I fixed the problem by changing the sprites of the battle options.
weird.
Well, its fixed, that's all that matters, I suppose.

Original thread: https://forums.rpgmakerweb.com/threads/problem-with-the-earthbound-battle-system.80122/