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

Teh Blazer

Divider of Zero
776
Posts
15
Years
  • I am attempting to make a script that makes Oak give you the national dex after you fight your rival before you leave his lab. I have the movement working that brings you front and center to Oak but nothing continues after that. Thanks for any help.
    Spoiler:

    I'm not well versed in pksv (at least, I think that is) but where you compare the variable 4002, is the jumpcommand after that the one that allows you to return to your previous script? Like in xse, there is "call" and "goto". "Goto" means to go to the next part while "call" means to to the next part but you can return back to the original script at the spot you called it. Did you use the correct command that lets you use return with it?

    When editing a very long script in a game, would it be viable to add any stuff that you want to implement and leave the rest as is? For example, I would like to have Wallace's dialogue and team change in Emerald after the first Hall of Fame; (similar to the newer games) however, it turns out that the script for the champ battle is over 300 lines long and would take ages to replicate, unlike the E4 scripts. Here's the dump from the ROM
    Spoiler:

    My plan is to insert a check for 0x87F (the HoF flag), redirect to the new "before battle" msgbox and team, then go back to the regular script events. Everything else will be kept untouched. Of course, dynamic and freespace will be put on top to prevent overwriting or corrupting anything. And as usual, help is greatly appreciated!

    If you repoint the part of the script that you wanted to change to a free space and left everything else untouched, I'd imagine there'd be no problem.
     
    Last edited:
    27
    Posts
    9
    Years
    • Seen May 8, 2024
    Thank you, Teh Blazer. Just tried out what you suggested and it work! Thanks again.
     
    16
    Posts
    9
    Years
    • Seen Nov 28, 2015
    I would give a ton of cookies to whoever can help me with this issue. The script goes perfectly fine until the @later part of the script. During this part of the script it duplicates the antagonist and also makes the camera follow around the professor when it should be following around the player. I have some gifs to display some examples of my problems.

    https://gyazo.com/418ebd5e3ca170c9a298e6c53bd76ec8 (Duplicate of antagonist)

    https://gyazo.com/eb2538779844e0b8ddd25715baafa5b1 (Control switched to professor)

    Here is the script.

    Spoiler:
     

    Squeetz

    ROM Hacker
    191
    Posts
    10
    Years
  • I would give a ton of cookies to whoever can help me with this issue. The script goes perfectly fine until the @later part of the script. During this part of the script it duplicates the antagonist and also makes the camera follow around the professor when it should be following around the player. I have some gifs to display some examples of my problems.


    One possibility why some of this happening is that one or more of the NPCs on that map uses the bugged 'look down' movement, aka this (in red Arrow):
    Script Help Thread
     
    27
    Posts
    9
    Years
    • Seen May 8, 2024
    I am attempting to add another rival battle script when you enter pewter city. The battle works but the sprite does not move nor disappear at the end. Do I need to have a variable set to make the sprite disappear and stay gone?
    Spoiler:
     

    machomuu

    Stuck in Hot Girl Summer
    10,507
    Posts
    16
    Years
  • I am attempting to add another rival battle script when you enter pewter city. The battle works but the sprite does not move nor disappear at the end. Do I need to have a variable set to make the sprite disappear and stay gone?
    Spoiler:
    A few things.

    First, you don't have to set put #dyn 0x740000 every line. You can just put it once at the top.

    Second, what are you using to write this script?
     
    16
    Posts
    9
    Years
    • Seen Nov 28, 2015
    One possibility why some of this happening is that one or more of the NPCs on that map uses the bugged 'look down' movement, aka this (in red Arrow):
    Script Help Thread

    You have no idea how grateful I am man, this issue has been eating me up for the past few days! Thanks a ton Squeetz! Your shipment of cookies will be coming in soon.
     
    5,256
    Posts
    16
    Years
  • In addition keep in mind that the numbers in advance map for person ID and such are in decimal, not hex. Your person ID being 12 means you should applymovement 0xC. That could be the issue.

    Just to clarify, it's the "Person event number" which controls movement, the "Person ID" controls visibility. It might also be worth checking if other events don't share the same Person event number, too, as sometimes A-Map does that if you delete a person event, as the Person event numbers don't auto-adjust.
     
    27
    Posts
    9
    Years
    • Seen May 8, 2024
    Just to clarify, it's the "Person event number" which controls movement, the "Person ID" controls visibility. It might also be worth checking if other events don't share the same Person event number, too, as sometimes A-Map does that if you delete a person event, as the Person event numbers don't auto-adjust.

    Thank you Spherical Ice and FBI. I changed to 0xc and made a person ID then added a reappear 0xc and it work perfectly!!! Thanks again.
     
    5
    Posts
    10
    Years
    • Seen Oct 19, 2015
    I'm trying to script a battle encounter with your rival in route one of a firered ROM. The start of the script works fine, then you battle the rival and instead of continuing the script just stops. If you walk away and step back on the tile it activates the lines before the battle again, he makes the same movements as he did for movement list 1 instead of movement list 3 like he should and then continues with the end of what he's supposed to say and then still doesn't do the third movements but does dissapear like he's supposed to. I'm working in xse and have literally spent two hours trying to figure out where the bug in.the script Is but can't figure it out.

    Spoiler:
     
    325
    Posts
    10
    Years
  • I'm trying to script a battle encounter with your rival in route one of a firered ROM. The start of the script works fine, then you battle the rival and instead of continuing the script just stops. If you walk away and step back on the tile it activates the lines before the battle again, he makes the same movements as he did for movement list 1 instead of movement list 3 like he should and then continues with the end of what he's supposed to say and then still doesn't do the third movements but does dissapear like he's supposed to. I'm working in xse and have literally spent two hours trying to figure out where the bug in.the script Is but can't figure it out.

    Spoiler:
    Ok so there's multiple things wrong with this script. First; why are you using such a low offset to assemble your script in? Second, your flag is unsafe. Check this document on flags to get a safe flag. If you read through that whole thing you'll also see why the script keeps on happening if you step on that tile again. As for the script continuing after you've battled, you need to use trainerbattle 0x1, which has three text pointers rather than two. The final one is the text for after. Now, your final movements in that script are out of order. You need to apply the movement first, then waitmovement so he finishes walking, THEN hide the sprite. Otherwise he'll just vanish as soon as you're done talking.
     
    959
    Posts
    11
    Years
  • I've been experimenting with daily encounters in Emerald, trying to script a Lapras overworld that re-spawns daily. According to Phenom2122's flag document, the unused flags from 0x900 onward are probably dailyflags. The problem is that I can't figure out how to make the Lapras re-spawn after the day has passed.
    Spoiler:
    As you can see, it sets 0x9C0 after the battle. (which, based on the flags around it, might be a dailyflag) I don't know what approach to take after checkdailyflags. Does a showsprite command have to be incorporated into the script or something?
     

    Blah

    Free supporter
    1,924
    Posts
    11
    Years
  • I've been experimenting with daily encounters in Emerald, trying to script a Lapras overworld that re-spawns daily. According to Phenom2122's flag document, the unused flags from 0x900 onward are probably dailyflags. The problem is that I can't figure out how to make the Lapras re-spawn after the day has passed.
    Spoiler:
    As you can see, it sets 0x9C0 after the battle. (which, based on the flags around it, might be a dailyflag) I don't know what approach to take after checkdailyflags. Does a showsprite command have to be incorporated into the script or something?

    Lapras should respawn after the day is out if 0x9C0 truely is reset after the day. Since the invisible flag is also 0x9C0, when it is cleared after the day, it won't be keeping Lapras invisible.
     

    BadEgg~

    Pokémon: Volant Version Developer
    112
    Posts
    8
    Years
  • I'm trying to give the player the running shoes once they step on a tile. The tile has a script event placed on it in advanced map, and the offsets are definitely correct. However, when I step on any of the tiles, the player is locked in place. Help?

    Spoiler:
     

    destinedjagold

    You can contact me in PC's discord server...
    8,593
    Posts
    16
    Years
    • Seen Dec 23, 2023
    I'm trying to give the player the running shoes once they step on a tile. The tile has a script event placed on it in advanced map, and the offsets are definitely correct. However, when I step on any of the tiles, the player is locked in place. Help?

    Spoiler:

    Apply these values on your script tile.
    Script Help Thread
     
    58
    Posts
    8
    Years
    • Seen Jan 7, 2017
    Can I post battle script here? I can't understand the battle script which deals with the pokeball throwing scene:
    Code:
    #org 0x1D9A14
    jumpifword 0x4 0x2022B4C 0x200 0x81D9A34
    jumpifword 0x4 0x2022B4C 0x10000 0x81D9A38
    printstring 0x101
    pokemoncatchfunction
    
    #org 0x1D9A34
    printstring 0x102
    pokemoncatchfunction
    
    #org 0x1D9A38
    printstring 0x173
    pokemoncatchfunction
    printstring 0x101
    cmd98 0x1
    pokemoncatchfunction
    jumpifhalfword 0x0 0x2023D68 0x5 0x81D9A50
    cmd60 0xB
    
    #org 0x1D9A50
    printstring 0x10B
    cmdf1 0x81D9A63
    printstring 0x10F
    waitstate
    setbyte 0x2023E82 0x0
    cmdf2
    printstring 0x10D
    waitstate
    setbyte 0x2023E82 0x0
    cmdf3 0x81D9A80
    cmdf0
    printfromtable 0x83FE654
    waitmessage 0x40
    goto 0x81D9A81
    
    #org 0x1D9A81
    setbyte 0x2023E8A 0x7
    cmdf7
    printstring 0x10C
    setbyte 0x2023E8A 0x7
    cmd57
    cmdf7
    printfromtable 0x83FE5F2
    waitmessage 0x40
    jumpifword 0x5 0x2022B4C 0x80 0x81D9AC0
    jumpifbyte 0x1 0x2039994 0x0 0x81D9AC0
    printstring 0x122
    waitmessage 0x40
    setbyte 0x2023E8A 0x8
    
    #org 0x1D9AC0
    cmdf6
    waitmessage 0x40
    printstring 0x103
    waitmessage 0x40
    printstring 0x104
    waitmessage 0x40
    cmdf6
    waitmessage 0x40
    printstring 0x105
    waitmessage 0x40
    cmdf6
    setbyte 0x2023FD8 0xF
    cmd49 0x1 0x0
    end
    
    
    // Used Strings
    // String 0x101
    // = [buffer 0xFD:0x23] used\n[buffer 0xFD:0x16]!
    
    // String 0x102
    // = The old man used\n[buffer 0xFD:0x16]!
    
    // String 0x173
    // = The POKé DUDE used\n[buffer 0xFD:0x16]!
    
    // String 0x10B
    // = Gotcha!\n[buffer 0xFD:0x6] was caught![buffer 0xFC:0xA][buffer 0xFC:0xB]À\l
    
    // String 0x10F
    // = [buffer 0xFD:0x6]'s data was\nadded to the POKéDEX.\l
    
    // String 0x10D
    // = Give a nickname to the\ncaptured [buffer 0xFD:0x6]?
    
    // String 0x10C
    // = Gotcha!\n[buffer 0xFD:0x6] was caught![buffer 0xFC:0xA][buffer 0xFC:0xB]À[buffer 0xFC:0x8]
    
    // String 0x122
    // = [buffer 0xFC:0x10] ANNOUNCER: You're out of\nSAFARI BALLS! Game over!\l
    
    // String 0x103
    // = The TRAINER blocked the BALL!
    
    // String 0x104
    // = Don't be a thief!
    
    // String 0x105
    // = It dodged the thrown BALL!\nThis POKéMON can't be caught!

    anyone can help? I'm a starter in BS.
    I can imagine that it uses a command 0xf6 to do some important things, but I don't know what does it do.
     
    1,344
    Posts
    14
    Years
    • Seen Dec 10, 2021
    Thank you very much ^ -^) If you don't mind explaining to me, why did changing the "Unknown" and Var numbers fix the freezing issue?

    The unknown number actually does nothing, you can just leave it as 0000 if you wish, but the script tile needs a var to function. Usually you'd put the var you're using there to stop the script from repeating but it isn't necessary when you're using a flag, so instead you can just use an unused var.
     
    Status
    Not open for further replies.
    Back
    Top