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

Help Thread: Script Help Thread

Status
Not open for further replies.
10,078
Posts
15
Years
    • UK
    • Seen Oct 17, 2023
    All your msgboxs are the wrong way around.

    msgbox @pointer 0xWHATEVER

    Silly me for not spotting that the first time.
     
    154
    Posts
    9
    Years
    • Seen Jun 23, 2018
    All your msgboxs are the wrong way around.

    msgbox @pointer 0xWHATEVER

    Silly me for not spotting that the first time.
    Thanks a lot I am new i n scripting that my this happen some time and its my third script
     
    26
    Posts
    8
    Years
    • Seen Nov 25, 2017
    I'm making a script for choosing a pokemon from a ball, but this script does not remove the ball sprite:
    Spoiler:

    I am choosing the correct person event number in advance map and setting the person id to the flag name. Any ideas how to fix?
     
    Last edited:

    Le pug

    Creator of Pokémon: Discovery / Fat Kid
    870
    Posts
    10
    Years
  • I'm making a script for choosing a pokemon from a ball, but this script does not remove the ball sprite:
    Spoiler:

    I am choosing the correct person event number in advance map and setting the person id to the flag name. Any ideas how to fix?

    Have you tried using a different flag or different event number? Also, check to make sure your Pokeball OW doesn't SHARE the same event number with any other OWs. Also, make sure you don't have duplicate OWs on top of each other. 1.95 allows the user to duplicate OWs so there could be a chance you did this by accident and there is an OW hidden beneath the OW you have. (I've done it before)
    If that doesn't work try using an applymovement command (or whatever it's called in your script editor) and use the hidesprite movement for FR on that OW. Also is removesprite the same as hidesprite for XSE? Are you sure it's intention is to hide the sprite (I wouldn't know lol)


    ~~~~~~~~~~~~~~~~~~~~

    Whenever I compile this script
    Spoiler:


    and then decompile it, it comes out as this:
    Spoiler:

    It cuts off the rest of the script. Is there a reason it does this? Is it something I'm doing or is it a bug? It's happened to me before but now I can't fix it. Any help would be appreciated


    Could be overwritten by other data. Is this a fresh problem right after you compile or did you compile other stuff or do other work and then see that it wasn't working? Did you try compiling to a new offset and seeing if that worked? Also if I may use a recommendation:

    I know MSG_YESNO may seem easy to remember but 0x5 is sooo much quicker to type and also

    "msgbox @1 MSG_YESNO
    compare LASTRESULT 0x0
    if 0x1 call @no
    compare LASTRESULT 0x1
    if 0x1 call @yes"

    can be shortened to
    "msgbox @1 0x5
    compare LASTRESULT 0x1
    if 0x1 goto @yes
    XXXXXX
    XXXXX <---- put your @no stuff here.
    XXXXX
    release
    end"

    It checks if you pressed yes ... if you didn't press yes then obviously you pressed no. so it'll keep going into the script rather than going to the any other pointers.
    Also, I see you like to use the decimal shortcut. Decimal works with the other commands too i.e.
    compare LASTRESULT 1
    if 1 goto @yes

    and msgbox @2 5
     
    Last edited:
    26
    Posts
    8
    Years
    • Seen Nov 25, 2017
    I tried a different flag with no luck, and I tried different event numbers as well. This may seem a bit nooby, but what's an OW and what do you mean by a duplicate OW? If you mean whether or not I have another event on the same tile, the answer is no. Also, I have been compiling this script many times while testing and the problem persisted in all attempts.
    As for the decimal shortcut, I've been grabbing script from a few different sources since I've just started, so that's why there's some inconsistencies with which I use xD
    EDIT: After reading how the game normally treats the starter pokeballs, using disappear LASTTALKED worked instead of removesprite.
     
    Last edited:
    154
    Posts
    9
    Years
    • Seen Jun 23, 2018
    hey guys in editing level script we put script 2nd offset but from where the 2nd offset of script come?
     
    Last edited:

    Le pug

    Creator of Pokémon: Discovery / Fat Kid
    870
    Posts
    10
    Years
  • I tried a different flag with no luck, and I tried different event numbers as well. This may seem a bit nooby, but what's an OW and what do you mean by a duplicate OW? If you mean whether or not I have another event on the same tile, the answer is no. Also, I have been compiling this script many times while testing and the problem persisted in all attempts.
    As for the decimal shortcut, I've been grabbing script from a few different sources since I've just started, so that's why there's some inconsistencies with which I use xD
    EDIT: After reading how the game normally treats the starter pokeballs, using disappear LASTTALKED worked instead of removesprite.

    IDK what it could be, I took your script and edited it to be XSE and then I inserted it and this happened:
    Script Help Thread


    Here's the modified XSE script:
    Spoiler:


    Take out the applymovement and our scripts are exactly the same in terms of commands ... I always include applymovement to hide the sprite that way also just to make sure the bugger is really hidden xD Can you take a picture of the OW (which means Overworld ... shortened for Overworld Sprite aka those person events are sprites in the overworld of the game). Yeah just take a picture of the OW being selected in Advancemap so I can see what you have inputted into the OW. If you wouldn't mind, you could also just PM me an IPS patch of your ROM and I'll fix it and tell you what the problem was.

    hey guys in editing level script we put script 2nd offset but from where the 2nd offset of script come?

    all your base are belong to us?
    I don't understand what you're asking, your English is fragmented on top of you not providing that many details as to what you're looking for. Since your Engrish is bad, try taking screenshots of the problem and uploading to https://snag.gy and share the image here in LINK FORM or through a spoiler. Don't paste the image in
    Script Help Thread
     
    154
    Posts
    9
    Years
    • Seen Jun 23, 2018
    IDK what it could be, I took your script and edited it to be XSE and then I inserted it and this happened:
    Script Help Thread


    Here's the modified XSE script:
    Spoiler:


    Take out the applymovement and our scripts are exactly the same in terms of commands ... I always include applymovement to hide the sprite that way also just to make sure the bugger is really hidden xD Can you take a picture of the OW (which means Overworld ... shortened for Overworld Sprite aka those person events are sprites in the overworld of the game). Yeah just take a picture of the OW being selected in Advancemap so I can see what you have inputted into the OW. If you wouldn't mind, you could also just PM me an IPS patch of your ROM and I'll fix it and tell you what the problem was.



    all your base are belong to us?
    I don't understand what you're asking, your English is fragmented on top of you not providing that many details as to what you're looking for. Since your Engrish is bad, try taking screenshots of the problem and uploading to https://snag.gy and share the image here in LINK FORM or through a spoiler. Don't paste the image in tags without a spoiler.[/QUOTE]
    I just want to ask that to add level script in advance map we need to add the 2nd offset .and I don't know which is second offset of script and what I put there
     

    Le pug

    Creator of Pokémon: Discovery / Fat Kid
    870
    Posts
    10
    Years
  • I just want to ask that to add level script in advance map we need to add the 2nd offset .and I don't know which is second offset of script and what I put there

    What second offset? You talking about the map script offset? Just follow this guide (tajaros XSE) and go all the way down to the end of the first post and that's where he explains how to add level scripts. click me!

    Also, for future reference: stop quoting big posts. It is unnecessary and makes the page longer and really grinds my gears : P
     

    ExitWound

    Boggle
    79
    Posts
    16
    Years
    • Seen Sep 22, 2016
    So, I've been hacking Emerald recently just to add stuff into the game (Unobtainable legendaries, rebattle-able trainers, etc.)
    I've added The Old Sea Map and Mystic Ticket but neither of them work! Upon further research, I found out you need to set flags. So of course, I made a script to set these flags:
    Code:
    #dynamic 0x6C4340
    
    #org @start
    checkflag 0x8d5
    if 0x1 goto @nevermind
    setflag 0x8e0
    setflag 0x8d6
    setflag 0x8d5
    release
    end
    
    #org @nevermind
    release
    end
    Unfortunately, they still don't work. I only have the options to go to the other ferry city and the Battle Frontier. What else do I need to do to make this possible?
     

    PurpleOrange

    still don't know what I'm doing
    367
    Posts
    10
    Years
  • So, I've been hacking Emerald recently just to add stuff into the game (Unobtainable legendaries, rebattle-able trainers, etc.)
    I've added The Old Sea Map and Mystic Ticket but neither of them work! Upon further research, I found out you need to set flags. So of course, I made a script to set these flags:
    Code:
    #dynamic 0x6C4340
    
    #org @start
    checkflag 0x8d5
    if 0x1 goto @nevermind
    setflag 0x8e0
    setflag 0x8d6
    setflag 0x8d5
    release
    end
    
    #org @nevermind
    release
    end
    Unfortunately, they still don't work. I only have the options to go to the other ferry city and the Battle Frontier. What else do I need to do to make this possible?

    you have to give the item as well as set the flag :)
     

    ExitWound

    Boggle
    79
    Posts
    16
    Years
    • Seen Sep 22, 2016
    So, I've been hacking Emerald recently just to add stuff into the game (Unobtainable legendaries, rebattle-able trainers, etc.)
    I've added The Old Sea Map and Mystic Ticket but neither of them work! Upon further research, I found out you need to set flags. So of course, I made a script to set these flags:
    Code:
    #dynamic 0x6C4340
    
    #org @start
    checkflag 0x8d5
    if 0x1 goto @nevermind
    setflag 0x8e0
    setflag 0x8d6
    setflag 0x8d5
    release
    end
    
    #org @nevermind
    release
    end
    Unfortunately, they still don't work. I only have the options to go to the other ferry city and the Battle Frontier. What else do I need to do to make this possible?

    Any help here? If I have the item and the flag is set, shouldn't it work? :/
     
    80
    Posts
    15
    Years
  • I'm trying to make it so that Oak, from his lab, goes up to you on the final tile of Pallet Town, and upgrade your Pokedex to the National Pokedex. I know I'm missing at least one or two things, but I haven't found an appropriate tutorial (though PokemonXSE101 helped for the majority of it).

    Code:
    #dynamic 0x800000
    
    #org @NationalDex
    msgbox @talk1 0x6
    applymovement 1 @walk1
    waitmovement 10
    applymovement 0xFF @surprise
    waitmovement 0xFF
    msgbox @talk2 0x6
    special 0x16F
    fanfare 0x13E
    msgbox @talk3 0x6
    waitfanfare
    msgbox @talk4 0x6
    applymovement 10 @walk2
    waitmovement 10
    hidesprite 10
    setvar 0x2000 0x1
    setflag 0x1206
    release
    end
    
    #org @talk1
    = Wait!
    
    #org @talk2
    = I forgot to upgrade your\nPokedex...
    
    #org @talk3
    = \v\h01's Pokedex was upgraded to the\nNational Pokedex!
    
    #org @talk4
    = There ya go!\nGood luck on your journey!
    
    #org @walk1
    #raw 0x12
    #raw 0x12
    #raw 0x12
    #raw 0x12
    #raw 0x11
    #raw 0x11
    #raw 0x11
    #raw 0x11
    #raw 0x11
    #raw 0x11
    #raw 0x11
    #raw 0x11
    #raw 0x11
    #raw 0x11
    #raw 0x11
    #raw 0x11
    #raw 0xFE
    
    #org @surprise
    #raw 0x62
    #raw 0x0
    #raw 0xFE
    
    #org @walk2
    #raw 0x10
    #raw 0x10
    #raw 0x10
    #raw 0x10
    #raw 0x10
    #raw 0x10
    #raw 0x10
    #raw 0x10
    #raw 0x10
    #raw 0x10
    #raw 0x10
    #raw 0x10
    #raw 0x13
    #raw 0x13
    #raw 0x13
    #raw 0x13
    #raw 0xFE
     

    ExitWound

    Boggle
    79
    Posts
    16
    Years
    • Seen Sep 22, 2016
    I'm trying to make it so that Oak, from his lab, goes up to you on the final tile of Pallet Town, and upgrade your Pokedex to the National Pokedex. I know I'm missing at least one or two things, but I haven't found an appropriate tutorial (though PokemonXSE101 helped for the majority of it).

    Code:
    #dynamic 0x800000
    
    #org @NationalDex
    msgbox @talk1 0x6
    applymovement 1 @walk1
    waitmovement 10
    applymovement 0xFF @surprise
    waitmovement 0xFF
    msgbox @talk2 0x6
    special 0x16F
    fanfare 0x13E
    msgbox @talk3 0x6
    waitfanfare
    msgbox @talk4 0x6
    applymovement 10 @walk2
    waitmovement 10
    hidesprite 10
    setvar 0x2000 0x1
    setflag 0x1206
    release
    end
    
    #org @talk1
    = Wait!
    
    #org @talk2
    = I forgot to upgrade your\nPokedex...
    
    #org @talk3
    = \v\h01's Pokedex was upgraded to the\nNational Pokedex!
    
    #org @talk4
    = There ya go!\nGood luck on your journey!
    
    #org @walk1
    #raw 0x12
    #raw 0x12
    #raw 0x12
    #raw 0x12
    #raw 0x11
    #raw 0x11
    #raw 0x11
    #raw 0x11
    #raw 0x11
    #raw 0x11
    #raw 0x11
    #raw 0x11
    #raw 0x11
    #raw 0x11
    #raw 0x11
    #raw 0x11
    #raw 0xFE
    
    #org @surprise
    #raw 0x62
    #raw 0x0
    #raw 0xFE
    
    #org @walk2
    #raw 0x10
    #raw 0x10
    #raw 0x10
    #raw 0x10
    #raw 0x10
    #raw 0x10
    #raw 0x10
    #raw 0x10
    #raw 0x10
    #raw 0x10
    #raw 0x10
    #raw 0x10
    #raw 0x13
    #raw 0x13
    #raw 0x13
    #raw 0x13
    #raw 0xFE

    applymovement 0x1 <---- Don't forget 0x

    Change all waitmovements to waitmovement 0x0

    Use 0x2 for your msgbox instead of 0x6. Read XSE guide as to why.
     
    80
    Posts
    15
    Years
  • applymovement 0x1 <---- Don't forget 0x

    Change all waitmovements to waitmovement 0x0

    Use 0x2 for your msgbox instead of 0x6. Read XSE guide as to why.

    Alright. It should be fixed, but still waiting on the "activated if I have the Pokedex" command for FRLG.

    Code:
    #dynamic 0x800000
    
    #org @NationalDex
    msgbox @talk1 0x2
    applymovement 0x1 @walk1
    waitmovement 0x0
    applymovement 0x1 @surprise
    waitmovement 0x0
    msgbox @talk2 0x2
    special 0x16F
    fanfare 0x13E
    msgbox @talk3 0x2
    waitfanfare
    applymovement 0x1 @walk2
    waitmovement 0x0
    hidesprite 10
    setvar 0x2000 0x1
    setflag 0x1206
    release
    end
    
    #org @talk1
    = Wait!
    
    #org @talk2
    = Allow me to quickly upgrade your\nPokedex...
    
    #org @talk3
    = Good luck on your journey!
    
    #org @walk1
    #raw 0x12
    #raw 0x12
    #raw 0x12
    #raw 0x12
    #raw 0x11
    #raw 0x11
    #raw 0x11
    #raw 0x11
    #raw 0x11
    #raw 0x11
    #raw 0x11
    #raw 0x11
    #raw 0x11
    #raw 0x11
    #raw 0x11
    #raw 0x11
    #raw 0xFE
    
    #org @surprise
    #raw 0x62
    #raw 0x0
    #raw 0xFE
    
    #org @walk2
    #raw 0x10
    #raw 0x10
    #raw 0x10
    #raw 0x10
    #raw 0x10
    #raw 0x10
    #raw 0x10
    #raw 0x10
    #raw 0x10
    #raw 0x10
    #raw 0x10
    #raw 0x10
    #raw 0x13
    #raw 0x13
    #raw 0x13
    #raw 0x13
    #raw 0xFE
     

    ExitWound

    Boggle
    79
    Posts
    16
    Years
    • Seen Sep 22, 2016
    Alright. It should be fixed, but still waiting on the "activated if I have the Pokedex" command for FRLG.

    Code:
    #dynamic 0x800000
    
    #org @NationalDex
    msgbox @talk1 0x2
    applymovement 0x1 @walk1
    waitmovement 0x0
    applymovement 0x1 @surprise
    waitmovement 0x0
    msgbox @talk2 0x2
    special 0x16F
    fanfare 0x13E
    msgbox @talk3 0x2
    waitfanfare
    applymovement 0x1 @walk2
    waitmovement 0x0
    hidesprite 10
    setvar 0x2000 0x1
    setflag 0x1206
    release
    end
    
    #org @talk1
    = Wait!
    
    #org @talk2
    = Allow me to quickly upgrade your\nPokedex...
    
    #org @talk3
    = Good luck on your journey!
    
    #org @walk1
    #raw 0x12
    #raw 0x12
    #raw 0x12
    #raw 0x12
    #raw 0x11
    #raw 0x11
    #raw 0x11
    #raw 0x11
    #raw 0x11
    #raw 0x11
    #raw 0x11
    #raw 0x11
    #raw 0x11
    #raw 0x11
    #raw 0x11
    #raw 0x11
    #raw 0xFE
    
    #org @surprise
    #raw 0x62
    #raw 0x0
    #raw 0xFE
    
    #org @walk2
    #raw 0x10
    #raw 0x10
    #raw 0x10
    #raw 0x10
    #raw 0x10
    #raw 0x10
    #raw 0x10
    #raw 0x10
    #raw 0x10
    #raw 0x10
    #raw 0x10
    #raw 0x10
    #raw 0x13
    #raw 0x13
    #raw 0x13
    #raw 0x13
    #raw 0xFE

    Ok, so you're saying you want this script to run ONLY if you have the Pokedex?

    If that's the case, the flag for the Pokedex (I'm assuming you're hacking Fire Red) is 0x829. So you want to check for that flag

    Code:
    checkflag 0x829

    Next, tell it what to do when that flag is set or not set.

    This will tell it to go run your script if you DO have a Pokedex already:
    Code:
    if 0x1 goto @getnational

    Then, it's as simple as special 0x16f

    This 'special' code will activate National dex:
    Code:
    special 0x16f

    Put it all together:

    Code:
    #org @start
    lock
    checkflag 0x829              <----- Check to see if you have Pokedex.
    if 0x1 goto @getnational     <----- If you have a Pokedex, it will start your script.
    release                      <------ If you don't have a pokedex, it will
    end                          <------ just ignore your script and end.
    
    #org @getnational
    special 0x16f                <-----Unlock national dex
    release
    end

    See if you can combine it with your code.
     
    80
    Posts
    15
    Years
  • Ok, so you're saying you want this script to run ONLY if you have the Pokedex?

    If that's the case, the flag for the Pokedex (I'm assuming you're hacking Fire Red) is 0x829. So you want to check for that flag

    Code:
    checkflag 0x829

    Next, tell it what to do when that flag is set or not set.

    This will tell it to go run your script if you DO have a Pokedex already:
    Code:
    if 0x1 goto @getnational

    Then, it's as simple as special 0x16f

    This 'special' code will activate National dex:
    Code:
    special 0x16f

    Put it all together:

    Code:
    #org @start
    lock
    checkflag 0x829              <----- Check to see if you have Pokedex.
    if 0x1 goto @getnational     <----- If you have a Pokedex, it will start your script.
    release                      <------ If you don't have a pokedex, it will
    end                          <------ just ignore your script and end.
    
    #org @getnational
    special 0x16f                <-----Unlock national dex
    release
    end

    See if you can combine it with your code.
    This should work.
    Code:
    #dynamic 0x800000
    
    #org @check
    checkflag 0x829
    if 0x1 goto @NationalDex
    release
    end
    #org @NationalDex
    lock
    msgbox @talk1 0x2
    applymovement 0x1 @walk1
    waitmovement 0x0
    applymovement 0x1 @surprise
    waitmovement 0x0
    msgbox @talk2 0x2
    special 0x16F
    fanfare 0x13E
    msgbox @talk3 0x2
    waitfanfare
    applymovement 0x1 @walk2
    waitmovement 0x0
    hidesprite 10
    setvar 0x2000 0x1
    setflag 0x1206
    release
    end
    
    #org @talk1
    = Wait!
    
    #org @talk2
    = Allow me to quickly upgrade your\nPokedex...
    
    #org @talk3
    = Good luck on your journey!
    
    #org @walk1
    #raw 0x12
    #raw 0x12
    #raw 0x12
    #raw 0x12
    #raw 0x11
    #raw 0x11
    #raw 0x11
    #raw 0x11
    #raw 0x11
    #raw 0x11
    #raw 0x11
    #raw 0x11
    #raw 0x11
    #raw 0x11
    #raw 0x11
    #raw 0x11
    #raw 0xFE
    
    #org @surprise
    #raw 0x62
    #raw 0x0
    #raw 0xFE
    
    #org @walk2
    #raw 0x10
    #raw 0x10
    #raw 0x10
    #raw 0x10
    #raw 0x10
    #raw 0x10
    #raw 0x10
    #raw 0x10
    #raw 0x10
    #raw 0x10
    #raw 0x10
    #raw 0x10
    #raw 0x13
    #raw 0x13
    #raw 0x13
    #raw 0x13
    #raw 0xFE
    Now all I have to do is encode the alternative route and it should be good (at least I'm pretty sure I can figure out how to do that).

    I've now got it to go through it with no problem.. except that this happens:
    Spoiler:

    And the event doesn't occur.
     
    Last edited:

    Alexander Nicholi

    what do you know about computing?
    5,500
    Posts
    14
    Years
  • hey guys in editing level script we put script 2nd offset but from where the 2nd offset of script come?
    The map headers generated by Advance Map create stub scripts that call your main script via the "second pointer." I don't particularly see the reason why you find this information relevant, but you asked so I answered.
     
    26
    Posts
    8
    Years
    • Seen Nov 25, 2017
    Spoiler:

    Whenever I try this script and the trainer sees me, it starts a battle with a glitch trainer instead of the trainer I labelled as 001. When I talk to him by walking up to him, it works normally. Also, when he sees me, the \v\h06 rival name appears with an A with an accent over it. Any ideas how to fix?
    Also, is there a way that I can make it so the game goes back to the overworld after losing the battle and continuing the script instead of putting me back at the parent's house?
     
    Status
    Not open for further replies.
    Back
    Top