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

XSE Script Error

32
Posts
10
Years
    • Seen Aug 27, 2018
    So I needed to make a new script in Pkmn Emerald. I want to add a meteorite which will display a message and trigger a legendary pokemon battle with Jirachi. I keep getting an error. Any help would be awesome! Here is my script, not even sure if the 990F6Z space is a free space so if you could help me with that too, thanks.

    '---------------
    #dynamic 0x800000
    #org 0x290F6F
    lock
    faceplayer
    msgbox @990F6Z 0x6
    checksound
    cry 0x199 0x2
    waitcry
    wildbattle 0x199 0x3C 0x0
    fadescreen 0x1
    setflag 0x454
    hidesprite LASTTALKED
    fadescreen 0x0
    release
    end



    '---------
    ' Strings
    '---------
    #org 0x990F6Z
    = A meteorite is laying here.\nA POKéMON jumped out!
     
    476
    Posts
    6
    Years
    • Seen Feb 26, 2020
    @'s are not offsets, they are names of segments of a script. 0x(numbers) are offsets. That's the first mistake.

    Code:
    #dynamic 0x800000
    #org 0x290F6F

    Is also wrong because you've told XSE to make it dynamic, then use a specific offset. I'd honestly not be surprised if that crashed XSE when attempting to compile it (not a criticism against you, I just think that'd cause some crazy errors in the program. It's an easy mistake to make.)

    Also, it'd help greatly to know what error you're getting. Is XSE not compiling it? Does the script compile but not work when you try to activate it? Knowing what the error is and where/when it happens is very useful to know.

    Edit: I should add that I am in no way an expert and am not that knowledgeable on scripting, really at all, but I've tried making legendary encounter scripts before and I know what a headache it is and want to offer what I do know. I can even show you my own scripts (the working versions) as an example if you want. :)
     
    Last edited:
    32
    Posts
    10
    Years
    • Seen Aug 27, 2018
    @'s are not offsets, they are names of segments of a script. 0x(numbers) are offsets. That's the first mistake.

    Is also wrong because you've told XSE to make it dynamic, then use a specific offset. I'd honestly not be surprised if that crashed XSE when attempting to compile it (not a criticism against you, I just think that'd cause some crazy errors in the program. It's an easy mistake to make.)

    Also, it'd help greatly to know what error you're getting. Is XSE not compiling it? Does the script compile but not work when you try to activate it? Knowing what the error is and where/when it happens is very useful to know.

    Edit: I should add that I am in no way an expert and am not that knowledgeable on scripting, really at all, but I've tried making legendary encounter scripts before and I know what a headache it is and want to offer what I do know. I can even show you my own scripts (the working versions) as an example if you want. :)

    Hey thanks for replying. I got rid of the dynamics and the @ sign. I'm kinda frustrated bc this is the only script besides basic legendary pokemon stuff. I just like making a slightly modified rom for my friends hahaha. Id love to add more sprites but Im afraid that would be a tad too much.

    The error says type mismatch on line 5 which is the msgbox line.
     
    Last edited:
    476
    Posts
    6
    Years
    • Seen Feb 26, 2020
    Hey thanks for replying. I got rid of the dynamics and the @ sign. I'm kinda frustrated bc this is the only script besides basic legendary pokemon stuff. I just like making a slightly modified rom for my friends hahaha. Id love to add more sprites but Im afraid that would be a tad too much.

    The error says type mismatch on line 5 which is the msgbox line.

    You shouldn't remove the dynamic, because then you need to remember the exact number of bytes each part of the script uses.

    While I don't think this is guaranteed to work, I've taken your original script and made changes that should be a step in the right direction:

    Code:
    #dynamic 0x800000
    #org @start
    lock
    faceplayer
    msgbox @msg
    cry 0x199 0x0
    waitcry
    wildbattle 0x199 0x3C 0x0
    fadescreen 0x1
    setflag 0x1200
    hidesprite LASTTALKED
    fadescreen 0x0
    release
    end
    
    #org @msg
    = A meteorite is laying here.\nA POKéMON jumped out!

    I'm not guaranteeing that will work but it should at least be able to compile. Feel free to examine the differences as closely as you can, since I don't know how to explain some of it.
     
    32
    Posts
    10
    Years
    • Seen Aug 27, 2018
    You shouldn't remove the dynamic, because then you need to remember the exact number of bytes each part of the script uses.

    While I don't think this is guaranteed to work, I've taken your original script and made changes that should be a step in the right direction:

    Code:
    #dynamic 0x800000
    #org @start
    lock
    faceplayer
    msgbox @msg
    cry 0x199 0x0
    waitcry
    wildbattle 0x199 0x3C 0x0
    fadescreen 0x1
    setflag 0x1200
    hidesprite LASTTALKED
    fadescreen 0x0
    release
    end
    
    #org @msg
    = A meteorite is laying here.\nA POKéMON jumped out!

    I'm not guaranteeing that will work but it should at least be able to compile. Feel free to examine the differences as closely as you can, since I don't know how to explain some of it.


    I used your code and changed it a bit. Works like a charm! Thanks.
     
    Back
    Top