• Our software update is now concluded. You will need to reset your password to log in. In order to do this, you will have to click "Log in" in the top right corner and then "Forgot your password?".
  • 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.

Syntax Error in pokemon.txt?

Rayziken 2

Beginning ROM Hacker
232
Posts
13
Years
    • Seen Sep 9, 2016
    I was editing movesets in the PBS files, and when I went to playtest, this error message came up:

    ---------------------------
    Pokemon Essentials
    ---------------------------
    Exception: RuntimeError

    Message: Bad line syntax (expected syntax like XXX=YYY)

    File PBS/pokemon.txt, section 181, key WildItemRare





    Compiler:1712:in `pbEachFileSectionEx'

    Compiler:1695:in `each_line'

    Compiler:1695:in `pbEachFileSectionEx'

    Compiler:1733:in `pbEachFileSection'

    Compiler:2337:in `pbCompilePokemonData'

    Compiler:2335:in `open'

    Compiler:2335:in `pbCompilePokemonData'

    Compiler:4040:in `pbCompileAllData'

    Compiler:4164



    This exception was logged in

    C:\Users\NAME\Saved Games/Pokemon Essentials/errorlog.txt.

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

    This confuses me though, because I think the message is telling me there's a problem with Ampharos' held item in the wild (correct me if I'm wrong), but I don't believe Ampharos actually holds an item if in the wild (again, correct me if I'm wrong. Does anyone know what this could be about?

    Also, whilst I've got a thread, I want to upgrade to the latest version of Pokémon Essentials, but I don't know every part of the code that I've modified. Is there any way I'd be able to upgrade without knowing, or am I effectively stuck until I find which parts of the code I've edited?
     
    296
    Posts
    9
    Years
  • I really don't know why the game is giving you this problem (WildItemRare are okay). There could be two causes:
    - An edit to compile script that messed up data files;
    - An error in "RegionalNumbers" values;

    I'll wait for an update.
     

    Rayziken 2

    Beginning ROM Hacker
    232
    Posts
    13
    Years
    • Seen Sep 9, 2016
    I was meant to post this hours ago, but I must have forgot to send it, so sorry about that. :(

    It's interesting that you'd mention "RegionalNumbers", because I have tinkered with them fairly recently, although I didn't touch Ampharos' information, which adds to the confusion. I definitely haven't touched the compiler, as I don't even know where to begin looking for it.
     
    296
    Posts
    9
    Years
  • Don't worry. I suggest You to read the Wiki more carefully, by using its example values and comparing them with yours.
     

    Rayziken 2

    Beginning ROM Hacker
    232
    Posts
    13
    Years
    • Seen Sep 9, 2016
    Don't worry. I suggest You to read the Wiki more carefully, by using its example values and comparing them with yours.
    That's a good idea. I'll have look and then let you know what I find out. :)

    EDIT: I didn't find anything out of the ordinary, so I'm getting really confused now.
     
    Last edited:

    Rayziken 2

    Beginning ROM Hacker
    232
    Posts
    13
    Years
    • Seen Sep 9, 2016
    A follow-up to this; the issue is cropping up again, with Staryu. I edited Staryu's moveset today, so that may be the reason it's happening. However, nothing seems out of the ordinary again. I'm becoming increasingly confused by this.
     

    Maruno

    Lead Dev of Pokémon Essentials
    5,286
    Posts
    16
    Years
    • Seen May 3, 2024
    Code:
    [182]
    Name=Bellossom
    InternalName=BELLOSSOM
    Type1=GRASS
    Type2=FAIRY
    BaseStats=75,80,85,50,90,100
    GenderRate=Female50Percent
    GrowthRate=Parabolic
    BaseEXP=216
    EffortPoints=0,0,0,0,0,3
    Rareness=45
    Happiness=70
    Abilities=CHLOROPHYLL
    HiddenAbility=HEALER
    Moves=1,LEAFBLADE,1,MEGADRAIN,1,SWEETSCENT,1,STUNSPORE,1,SUNNYDAY,23,MAGICALLEAF,53,LEAFSTORM
    1,PRANKBARRAGE,1,DOLLEYES,1,GALAXYBEAM,1,PLANETARYPULSE,5,SWEETSCENT,9,ACID,13,FAIRYWIND,15,POISONPOWDER,15,STUNSPORE,15,SLEEPPOWDER,21,MEGADRAIN,27,DRAININGKISS,33,LUCKYCHANT,39,BERRYSALVO,43,DAZZLINGGLEAM,49,MOONLIGHT,55,GIGADRAIN,61,HEALINGWISH,67,PETALDANCE,73,CUPIDSARROW,79,MOONBLAST
    Compatibility=Grass
    StepsToHatch=5355
    Height=0.4
    Weight=5.8
    Color=Green
    Habitat=Grassland
    RegionalNumbers=49,43,0,0,0,0,0,182
    Kind=Flower
    Pokedex=Its flower petals deepen in color through exposure to sunlight. When cloudy weather persists, it does a dance that is thought to be a ritual for summoning the sun.
    BattlerPlayerY=0
    BattlerEnemyY=25
    BattlerAltitude=0
    Evolutions=
    Check the line break halfway through the list of moves. This is making a line begin with 1,PRANKBARRAGE, which is not of the format XXX=YYY as required. Odds are your Starmie (the one after Staryu) is written the same.

    Error messages regarding pokemon.txt are rarely accurate, but they're at least close. This was nearly the correct section. The WildItemRare bit was only mentioned because that's the last of the possible data defined for a species - the compiler had gone through the list of possible data types, hit the last one and decided that nothing matched the line it was looking at. It's actually irrelevant here.

    I've improved the error messages for Essentials v16.2, to now point at the correct section and to quote the offending line in these cases, while removing the unnecessary mention of a key.
     

    Rayziken 2

    Beginning ROM Hacker
    232
    Posts
    13
    Years
    • Seen Sep 9, 2016
    Code:
    [182]
    Name=Bellossom
    InternalName=BELLOSSOM
    Type1=GRASS
    Type2=FAIRY
    BaseStats=75,80,85,50,90,100
    GenderRate=Female50Percent
    GrowthRate=Parabolic
    BaseEXP=216
    EffortPoints=0,0,0,0,0,3
    Rareness=45
    Happiness=70
    Abilities=CHLOROPHYLL
    HiddenAbility=HEALER
    Moves=1,LEAFBLADE,1,MEGADRAIN,1,SWEETSCENT,1,STUNSPORE,1,SUNNYDAY,23,MAGICALLEAF,53,LEAFSTORM
    1,PRANKBARRAGE,1,DOLLEYES,1,GALAXYBEAM,1,PLANETARYPULSE,5,SWEETSCENT,9,ACID,13,FAIRYWIND,15,POISONPOWDER,15,STUNSPORE,15,SLEEPPOWDER,21,MEGADRAIN,27,DRAININGKISS,33,LUCKYCHANT,39,BERRYSALVO,43,DAZZLINGGLEAM,49,MOONLIGHT,55,GIGADRAIN,61,HEALINGWISH,67,PETALDANCE,73,CUPIDSARROW,79,MOONBLAST
    Compatibility=Grass
    StepsToHatch=5355
    Height=0.4
    Weight=5.8
    Color=Green
    Habitat=Grassland
    RegionalNumbers=49,43,0,0,0,0,0,182
    Kind=Flower
    Pokedex=Its flower petals deepen in color through exposure to sunlight. When cloudy weather persists, it does a dance that is thought to be a ritual for summoning the sun.
    BattlerPlayerY=0
    BattlerEnemyY=25
    BattlerAltitude=0
    Evolutions=
    Check the line break halfway through the list of moves. This is making a line begin with 1,PRANKBARRAGE, which is not of the format XXX=YYY as required. Odds are your Starmie (the one after Staryu) is written the same.

    Error messages regarding pokemon.txt are rarely accurate, but they're at least close. This was nearly the correct section. The WildItemRare bit was only mentioned because that's the last of the possible data defined for a species - the compiler had gone through the list of possible data types, hit the last one and decided that nothing matched the line it was looking at. It's actually irrelevant here.

    I've improved the error messages for Essentials v16.2, to now point at the correct section and to quote the offending line in these cases, while removing the unnecessary mention of a key.
    Thank you so much! I understand exactly why that's happening now; I copied the movies of pre-evolutions and put them at a line below so I could use them as a basis for the new moveset without altering the original until I was happy with it. I must have forgotten to clear those up after I'd created the new moveset, which would explain why the error popped up.

    I'd upgrade, but I face a significant problem; I don't know exactly which parts I've edited, and the Wiki said I need to remember those so I can change them again after I've upgraded. I'll try and look into that, because I know which sections I've edited (although there would probably be a few sections I've forgotten), just not the exact parts. But is it possible to upgrade without knowing those things, or do I definitely need to know them all?

    Thank you so much for your help, though! I really appreciate it. :D
     
    Last edited:
    824
    Posts
    8
    Years
  • Well, the error messages here are all likely in the Compiler script section, so if you copy the Compiler section from 16.2 into your game it should be fine. I'm assuming your game is based in 16.0 or 16.1, so you don't need to worry about drastic differences in how the compiler works.
     

    Rayziken 2

    Beginning ROM Hacker
    232
    Posts
    13
    Years
    • Seen Sep 9, 2016
    Well, the error messages here are all likely in the Compiler script section, so if you copy the Compiler section from 16.2 into your game it should be fine. I'm assuming your game is based in 16.0 or 16.1, so you don't need to worry about drastic differences in how the compiler works.
    It turns out it was exactly how Maruno said; it was just an error regarding the extra lines I'd forgotten to erase. I got it working now, so that's good! :D

    My game's version is actually either 15.something or maybe even 14.something (unlikely, but entirely possible), so the whole prospect of updating if I would have to start over again is slightly jarring. I don't remember everything I've edited, you see, and without knowing the version I can't check which one I've modified.
     

    Rayziken 2

    Beginning ROM Hacker
    232
    Posts
    13
    Years
    • Seen Sep 9, 2016
    Oh, if you have v14.0-15.1, then absolutely DON'T replace the Compiler scripts with those from v16.2 unless you know what you're doing.
    That's definitely a huge no then, considering I haven't got a clue with stuff like this. What I want to do is update all of Essentials to the latest version, but I won't know which parts of the code to edit again after I get the upgraded version.
     
    824
    Posts
    8
    Years
  • That's definitely a huge no then, considering I haven't got a clue with stuff like this. What I want to do is update all of Essentials to the latest version, but I won't know which parts of the code to edit again after I get the upgraded version.

    Mostly the same here. I started with v15.1, and have made so many changes that I don't want to try again with v16+. On the other hand, I'm a very hands-on learner, so I know a lot about what is going when I look at a chunk of code, so I have been replacing chunks of my game with the equivalent bits in v16.0 or v16.1 to include some of the newer features of the engine. Of the top of my head I have:
    - type-based default move animations
    - more than 255 ability slots
    - item slots have grey text if the Pokemon has no item.
     

    Maruno

    Lead Dev of Pokémon Essentials
    5,286
    Posts
    16
    Years
    • Seen May 3, 2024
    I have been replacing chunks of my game with the equivalent bits in v16.0 or v16.1 to include some of the newer features of the engine.
    This is, of course, the opposite of the recommended way to update to a newer version of Essentials. I will not support anyone who does this. If you do it, you're on your own.
     

    Rayziken 2

    Beginning ROM Hacker
    232
    Posts
    13
    Years
    • Seen Sep 9, 2016
    This is, of course, the opposite of the recommended way to update to a newer version of Essentials. I will not support anyone who does this. If you do it, you're on your own.
    Would it be possible if effectively do the reverse of this and download the latest version and then add in my edits in 'chunks'? Assuming I can find them, of course. :3
     

    Rayziken 2

    Beginning ROM Hacker
    232
    Posts
    13
    Years
    • Seen Sep 9, 2016
    That is...exactly what Maruno wants you to do. The issue is going to be finding all your edits.
    Sorry, that was just a case of me being tired and asking stupid questions. :3

    I updated and I'm slowly editing the scripts again; my mian problem is that the tileset I used for some maps hasn't actually updated, despite me importing the tileset data that was in the Essentials 15 version of my game, so I'm having to do all that again, in addition to all of the map's names reverting back to 'MAPXXX'. Is there a way to fix that quickly, or will I have to deal with it during every update?
     
    Back
    Top