• Do not use Discord to host any images you post, these links expire quickly! You can learn how to add images to your posts here.
  • The results of the game jam are out!
    See the Judge's Spotlight choices and vote for your favorites to win Community Choice Spotlight by the 28th! 🫙
  • Reminder: AI-generated content is not allowed on the forums per the Rules and Regulations. Please contact us if you have any questions!

What is this and how do I fix it?

Demgor

Professionally Bad
Member
Joined
Nov 13, 2022
Posts
28
I keep getting this error message when I start a battle. The back trainer sprite is missing.

[Pokémon Essentials version 21.1]
[v21.1 Hotfixes 1.0.9]

Exception: NoMethodError
Message: undefined method `width' for nil:NilClass

Backtrace:
Battle_Scene_BaseAnimation:105:in `ballTracksHand'
Battle_Scene_Animations:427:in `createProcesses'
Battle_Scene_BaseAnimation:12:in `initialize'
Battle_Scene_Animations:397:in `initialize'
Scene_PlayAnimations:122:in `new'
Scene_PlayAnimations:122:in `block in pbSendOutBattlers'
Scene_PlayAnimations:112:in `each'
Scene_PlayAnimations:112:in `each_with_index'
Scene_PlayAnimations:112:in `pbSendOutBattlers'
Battle_ActionSwitching:291:in `pbSendOut'

Is anyone able to help? I added new trainer sprites but I'm pretty sure they worked fine at first. I re-added the base sprites and that didn't help anything.
 
Sorry for the late reply, but yeah, it seems like you got the trainer sprites messed up somehow. The relevant function gets the trainer sprite passed to it, and can't find a width to the sprite, which I'm guessing is due to there not being a sprite declared (assumedly, your trainer sprite names don't align with the name of the trainer in the code). This is used for both the player trainer and for the opponent trainer.

Did you change the player's trainer class, by chance? This could result in there not being a back sprite for that trainer class and would explain the issue persisting, even when adding the original files. Or, if you've formatted the name of the back sprite differently for the trainer than the other ones. A typo in the name of the sprite in the Trainers folder or of the trainer name in the trainer_types PBS document might also have caused it. Also, if you haven't declared a new player trainer class in the trainer_types PBS file (they're in the brackets in all caps), this could also do it. Another potential error is- are you sure it's the player class's back? I could be mistaken, but I think it starts off-screen (the opponent trainer does this I believe). However, if it's occurring all the time, it's probably definitely the player trainer.

Anyhow, those are my stabs at it, with limited info.
 
Back
Top