v21.1 Exception `NoMethodError' at Section395:397 - undefined method `[]' for nil:NilClass

This thread pertains to v21.1 of Pokémon Essentials.

Neyomn

Rookie
Member
Joined
Apr 10, 2022
Posts
3
Age
23
So, I'm having an issue where the error; "Exception NoMethodError' at Section395:397 - undefined method []' for nil:NilClass" (as the title says) has been plaguing my game recently.

It occurred after I fiddled around with the Pokemon.txt folder of my game, removing certain Pokemon from the .txt file as I don't want them in the game, and editing some spelling errors I made on some moves. Before that, it was working fine until I tried to playtest and then the following error occurred.

I'm a complete novice at this scripting stuff, and have watched numerous videos and the like but this one, in particular, I cannot seem to solve on my own, even after doing things such as uninstalling plugins (the plugins I have are Customizable Level Caps, Voltseon's Pause Menu, and PokeSearch), readding the Pokemon I removed from the game, and even completely replacing the Pokemon.txt file (which is where the compiling stops and has the error) with a fresh, new file from another separate and fresh download of Pokemon Essentials v21.1. But still, nothing seems to be working.

I've also included a screenshot of what is hopefully the correct area where I think the error is located, considering it says "section 395:397" and the compiling can't get beyond the "Pokemon.txt" portion. If not, hopefully, I don't look stupid and have been looking in the wrong place this entire time lol

Thank you for any help!

1694555612908.png



1694555785537.png
 

Vendily

Elite Trainer
Member
Your issue isn't with that line necessarily. If you don't remember what you changed recently, we need to make a small modification to def validate_compiled_pokemon(hash). under that line, put echoln hash[:id]. that will show every mon name in the console as it's compiled and the one after the last one to appear is misformed, and not using the proper format.
 

Neyomn

Rookie
Member
Joined
Apr 10, 2022
Posts
3
Age
23
Your issue isn't with that line necessarily. If you don't remember what you changed recently, we need to make a small modification to def validate_compiled_pokemon(hash). under that line, put echoln hash[:id]. that will show every mon name in the console as it's compiled and the one after the last one to appear is misformed, and not using the proper format.
Ah, that modification pretty much helped me spot my issue.

It turns out I didn't give an EV gain number in the EVs section in the Pokemon.txt PBS when you define the Pokemon, so I had a custom Pokemon as follows; EVs = SPECIAL_ATTACK, and no number after the fact. As soon as I put the number there, it resolved the issue. Would never have figured that out without your input, so thanks my friend, appreciated!
 
Top