• 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.

[Scripting Question] Syntax Error on line 9471 that makes no sense

  • 60
    Posts
    5
    Years
    I am learning to code for my game and in the process, had added a bit of code to my script, but on removing it, due to it not working and my deciding to work on adding new Pokemon to the game, it has begun to tell me that it is finding a syntax error on the move effects script.

    ################################################################################
    # Fails unless user has consumed a berry at some point. (Belch)
    ################################################################################
    class PokeBattle_Move_158 < PokeBattle_Move
    def pbMoveFailed(attacker,opponent)
    return !attacker.pokemon || !attacker.pokemon.belch
    end
    end



    ################################################################################
    #Note:
    ################################################################################

    Ignore the note thing, I accidentally deleted it and just put it there as a stand in.

    now if I remove the last comment, the syntax error just appears on the final line.

    I have not got the skill to fix it and have yet to find any article that has addressed a problem like this. Could anyone help me fix this?
     
  • 172
    Posts
    7
    Years
    • Seen Sep 6, 2022
    I am learning to code for my game and in the process, had added a bit of code to my script, but on removing it, due to it not working and my deciding to work on adding new Pokemon to the game, it has begun to tell me that it is finding a syntax error on the move effects script.

    ################################################################################
    # Fails unless user has consumed a berry at some point. (Belch)
    ################################################################################
    class PokeBattle_Move_158 < PokeBattle_Move
    def pbMoveFailed(attacker,opponent)
    return !attacker.pokemon || !attacker.pokemon.belch
    end
    end



    ################################################################################
    #Note:
    ################################################################################

    Ignore the note thing, I accidentally deleted it and just put it there as a stand in.

    now if I remove the last comment, the syntax error just appears on the final line.

    I have not got the skill to fix it and have yet to find any article that has addressed a problem like this. Could anyone help me fix this?
    a syntax error on the final line means you're missing an "end" somewhere. So from you what said I can guess that when you deleted your script you may have deleted an end to a block of code that still exists in the rest of your code. You may want to look back at where you deleted from and make sure you have all your ends still
     
  • 44
    Posts
    8
    Years
    • Seen Apr 14, 2019
    Or a bracket or something could be missing

    It just means something that was started was not finished. AKA, there's not enough ending points (like end, brackets, etc) for the stuff that was started

    It's at the end because it finished the script still expecting one

    This can be a bad issue if you don't know where it might be missing, since it could start combining and using a lot of code that is not intended to be used together
     
    Last edited:
  • 60
    Posts
    5
    Years
    thank you, i will try reading through and try to identify the missing ending

    Could someone maybe help me find a copy of the original move effects script so I can scan through and put any accidentally deleted code?
     
    Last edited:
  • 44
    Posts
    8
    Years
    • Seen Apr 14, 2019
    thank you, i will try reading through and try to identify the missing ending

    Could someone maybe help me find a copy of the original move effects script so I can scan through and put any accidentally deleted code?

    You can download a fresh copy of Essentials

    I'd recommend always having an untouched version you can reference back to or use to undo stuff
     
  • 172
    Posts
    7
    Years
    • Seen Sep 6, 2022
    thank you, i will try reading through and try to identify the missing ending

    Could someone maybe help me find a copy of the original move effects script so I can scan through and put any accidentally deleted code?

    I doubt reading through the entire thing will get you anywhere. There's so much to keep track of and you don't even know what you're looking for. You're better off just going to where you made your edits last and checking there.
     
  • 60
    Posts
    5
    Years
    Thanks guys! After a while spent checking the code, a few reads on how it works, and a bit of editing I fixed it!! Also I have taken the advice and made a copy of the Pokemon essentials file script and all, to keep in the case that this happens again

    P.S. I thought you might find this funny, but while trying to fix it, I accidentally made Explosion,self destruct, momento etc NOT feint the user, but it is all fixed up and solved now!

    Thanks for your suggestions everyone!
     
    Back
    Top