• 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.
  • Dawn, Gloria, Juliana, or Summer - which Pokémon protagonist is your favorite? Let us know by voting in our poll!
  • Our friends from the Johto Times are hosting a favorite Pokémon poll - and we'd love for you to participate! Click here for information on how to vote for your favorites!
  • 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.

[Other✓] Error 9 XSE

  • 36
    Posts
    15
    Years
    Hey, I'm having a problem with XSE.
    Its been working well for a while now, but for this one code its giving me an error: "Error 9: "Subscript out of range" on line 59."
    Its not the update problem which other problem people have had, given that I check settings.ini, and the update thing is set to 0.
    here's the actual code:
    Spoiler:


    Any assistance would be incredible!
     
    Hey, I'm having a problem with XSE.
    Its been working well for a while now, but for this one code its giving me an error: "Error 9: "Subscript out of range" on line 59."
    Its not the update problem which other problem people have had, given that I check settings.ini, and the update thing is set to 0.
    here's the actual code:
    Spoiler:


    Any assistance would be incredible!


    The problem is that line 59 isn't the one pointed out, but rather this one:
    Spoiler:


    I copied your script into xse, and that was line 59
    Your problem is that the commands to change line are wrong
    You use /n to change line
    /l to change line after /n has been used

    And the first three line changes are /n, only the first one should be /n, and all the rest should be /l

    I'm assuming you already know this, since you usually come here with scripting questions and you seem to know scripting rather well
    This was probably just a distraction
    If this is not the case, check diegoisawesome's MEGA HUGE XSE tutorial to find all the other commands to switch line, new box, etc.
     
    Your problem is that the commands to change line are wrong
    You use /n to change line
    /l to change line after /n has been used

    And the first three line changes are /n, only the first one should be /n, and all the rest should be \l

    Actually, that's not correct. XSE doesn't care whether you have the new lines entered correctly or not (the compiler doesn't check for that).

    The real issue here is not your use of /n, rather your overly excessive use of \l in the Diego sentence.
    Code:
    Diego: To many, success seems\nto come[COLOR="Red"]\n[/COLOR]suddenly. When you[COLOR="red"]\l[/COLOR]observe others[COLOR="red"]\l[/COLOR]and what they[COLOR="red"]\l[/COLOR]have achieved you[COLOR="red"]\l[/COLOR]usually don't[COLOR="red"]\l[/COLOR]appreciate what it[COLOR="red"]\l[/COLOR]has taken for[COLOR="red"]\l[/COLOR]them to get where[COLOR="red"]\l[/COLOR]they are.[COLOR="red"]\l[/COLOR]Ultimately, in failing[COLOR="red"]\l[/COLOR]to do[COLOR="red"]\l[/COLOR]this you also fail to learn[COLOR="red"]\l[/COLOR]what[COLOR="red"]\l[/COLOR]it would take for you to[COLOR="red"]\l[/COLOR]attain[COLOR="red"]\l[/COLOR]the same level of[COLOR="red"]\l[/COLOR]achievement[COLOR="red"]\l[/COLOR]and success.
    You need to divide your sentance up with multiple /p's as well as /n's and /l's. Having that many /l's created an irritation for the compiler (it seems) and it refused to compile the line of text.
    Not only is this sentence wacked out, but all of your text is like this. You'll have to go back and organize it a bit.

    I remade your script with organized text, but it appears that you still have another problem:
    Code:
    msgbox @3 0x6
    This line isn't being used anywhere in the script, so you have a type mis-match there. Delete that line of code (as well as the other things I told you) and your script will compile just fine.

    This isn't a problem with compilation, but your script won't run if you don't add on to the end of your script:
    Code:
    #dynamic 0x327EDA
    #org @start
    checkflag 0x200
    if 0x1 goto @done
    applymovement 0xFF @move1
    waitmovement 0x0
    msgbox @1 0x6
    applymovement 0x06 @move2
    waitmovement 0x0
    msgbox @2 0x6
    applymovement 0x06 @move3
    waitmovement 0x0
    msgbox @3 0x6
    trainerbattle 0x1 0x001 0x0 @before @after @later
    [COLOR="Red"]---ORIGINALLY END OF SCRIPT---[/COLOR]
    You will have to add the command 'end' to the end. Not sure if this one is required, but it's good practice to do so.

    Also, I noticed that the NPC you talk to that initiates this script doesn't disappear afterwards. I'm going to assume that you don't want the player to be able to talk to the NPC and get the same speech with no battle afterwards (because once the battle is finished, its flag will be set and the battle will no longer happen).
    To avoid this, you will want to change:
    Code:
    [COLOR="Red"]checkflag 0x200[/COLOR]
    if 0x1 goto @done
    Instead of checking a manual flag of 0x200 to stop the script from running again (which you didn't set anywhere), change this to a 'checktrainerflag' command so once the player defeats the NPC, the script will go straight to '@done' instead of waiting for some future event that sets flag 0x200.
     
    Hey, I'm having a problem with XSE.
    Its been working well for a while now, but for this one code its giving me an error: "Error 9: "Subscript out of range" on line 59."
    Its not the update problem which other problem people have had, given that I check settings.ini, and the update thing is set to 0.
    here's the actual code:
    Spoiler:


    Any assistance would be incredible!

    Where's #org @3 ?

    Also, your script crashes on me. I tried removing your texts and simply replacing them with Test and it compiled no problem.
    So I guess I'm going to agree with Renegade here, that the XSE compiler "got annoyed" because you have placed FAR to many \l's and \n's in there. >.>


    Also, I noticed that the NPC you talk to that initiates this script doesn't disappear afterwards. I'm going to assume that you don't want the player to be able to talk to the NPC and get the same speech with no battle afterwards (because once the battle is finished, its flag will be set and the battle will no longer happen).
    To avoid this, you will want to change:
    Code:
    [COLOR="Red"]checkflag 0x200[/COLOR]
    if 0x1 goto @done
    Instead of checking a manual flag of 0x200 to stop the script from running again (which you didn't set anywhere), change this to a 'checktrainerflag' command so once the player defeats the NPC, the script will go straight to '@done' instead of waiting for some future event that sets flag 0x200.

    I believe this script is placed on a green 'S' tile, since the very start of the event, the player moves, probably towards an NPC.
     
    I believe this script is placed on a green 'S' tile, since the very start of the event, the player moves, probably towards an NPC.
    Ah yeah, you're probably right.
    Although it still wouldn't change the @done issue (unless flag 0x200 is set just after this script ends.)
     
    Ah yeah, you're probably right.
    Although it still wouldn't change the @done issue (unless flag 0x200 is set just after this script ends.)

    The script will end. As seen in this code.
    Code:
    trainerbattle [COLOR="Red"]0x1[/COLOR] 0x001 0x0 @before @after @later

    He used trainerbattle 0x1, meaning that after the battle, the script will continue to @later, where the setflag is located.

    However, I predict that when the player steps on it again, the player will be stuck.
    I suggest that the #org @done should have the release code in there as well.
     
    He used trainerbattle 0x1, meaning that after the battle, the script will continue to @later, where the setflag is located.
    Oh dear, how did I miss the 0x1... -_-

    But yeah, you're right.
    And...
    However, I predict that when the player steps on it again, the player will be stuck.
    I suggest that the #org @done should have the release code in there as well.
    Spoiler:
     
    Thanks guys!

    That worked, my friend (whose working on the hack with me) added in all the suggested changes and here's what we got:

    Spoiler:


    Now we have a problem. As soon as the script starts, the game freezes. It was intended to be a script which occurs when you enter a map, and the screen turned black. When I made it a normal script on a normal map to test it, it froze the game. Please advise.

    Thanks!

    edit: I'd guess there's something wrong with he first 5 lines of code, given that I don't move at all...
     
    It was intended to be a script which occurs when you enter a map, and the screen turned black. When I made it a normal script on a normal map to test it, it froze the game.
    So this is a level script? Make sure you have decompiled your script into XSE and fixed its 0xFFFF line with 0x0. Here a tutorial that might help you with that:
    https://www.pokecommunity.com/threads/191500
    added in all the suggested changes and here's what we got:
    The text still isn't fixed. \n \l \p
     
    Back
    Top