• Just a reminder that providing specifics on, sharing links to, or naming websites where ROMs can be accessed is against the rules. If your post has any of this information it will be removed.
  • Ever thought it'd be cool to have your art, writing, or challenge runs featured on PokéCommunity? Click here for info - we'd love to spotlight your work!
  • Welcome to PokéCommunity! Register now and join one of the best fan communities on the 'net to talk Pokémon and more! We are not affiliated with The Pokémon Company or Nintendo.

[Error] Script error with battles

  • 20
    Posts
    4
    Years
    • Seen Oct 2, 2021
    I guess I posted this thread in the wrong section, before. Just to be sure I'll put here as well.
    I'm starting to think that the issue I'm facing was caused by a mistake made by me and not a simple bug in the scripts.
    I'm really, really desperate for help.

    I recently upgraded to Pokémon Essentials v18.1, and so far so good. Nothing out of the ordinary happens to events or game mechanics.

    The problem arises during battles against specific Pokémon, them being either wild or belonging to any trainer.
    When facing a Pokémon, specifically any Pokémon from generation VI to VIII (the game data of gen VI and VII were already in the PBS files, I manually added those of gen VIII), an error screen appears when the Pokémon is defeated.
    It reads like this:
    ---------------------------
    Pokemon Essentials
    ---------------------------
    [Pokémon Essentials version 18.1]

    Exception: TypeError

    Message: nil can't be coerced into Fixnum



    Backtrace:

    Audio_Utilities:1167:in `*'

    Audio_Utilities:1167:in `getPlayTime2'

    Audio_Utilities:1111:in `open'

    Audio_Utilities:1111:in `getPlayTime2'

    Audio_Utilities:1090:in `getPlayTime'

    PSystem_FileUtilities:445:in `pbCryFrameLength'

    PokeBattle_SceneAnimations:674:in `createProcesses'

    PokeBattle_Animation:9:in `initialize'

    PokeBattle_SceneAnimations:652:in `initialize'

    Scene_Animations:291:in `new'



    This exception was logged in

    C:\Users\USERNAME\Saved Games\Pokemon Essentials\errorlog.txt.

    Press Ctrl+C to copy this message to the clipboard.
    ---------------------------


    When it happens, the battle ends in case the Pokémon is a wild one. Experience points are not given and the game continues treating it as a win.
    When the same thing happens during a trainer battle, then the active ally Pokémon is forced to repeat the same move it used to K.O. the enemy, but with no target whatsoever. The enemy, with 0 HP, does not leave the battlefield until the enemy trainer replaces it.
    If it was the last Pokémon, then the battle ends and it is treated ad a win, the trainer appears and says their line, but the enemy Pokémon is still there.
    Experience points are not given, either.

    I really can't get myself to understand what the problem is, I don't think I am competent enough to fix this on my own.
    Does anyone have a solution? Did something like this happen to anyone else?
     
    But I do have them. In fact, when the battle starts, the Pokémon plays their cry correctly.
    Let's make an example: when a wild Bounsweet appears, its cry is loud and clear and even the sprite image.

    It's when I K.O. him that the text appears and the problem arises. It doesn't make any cry and the battle freezes.
    Could it be that I messed up something with the cries?

    In my "Audio" folder, "SE", "Cries" I have every Cry as a .wav or .ogg file named 001Cry, 002Cry and so on, and that for every Pokémon in my game.
    I still can't understand the issue.
     
    Last edited:
    I tried uploading the files linked by Golisopod, and it actually worked!
    It was probably as you said; the problem was quite possibly in the files themselves.

    It was a rather silly problem, but got me hanged for a long time. You are both life savers, thanks!
     
    Back
    Top