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

[Archive] Script help thread

Status
Not open for further replies.

destinedjagold

I do not exist.
  • 8,593
    Posts
    17
    Years
    • Seen May 26, 2024
    I have a script that works perfectly, until I reach the end of it. It's a movement script where someone comes and gives you three Pokemon, after that they go away, then when they reach their final spot the player warps into the middle of nowhere, I know they warp because I looked at the script to try and fix it with the 'Open Script' in AM, using XSE. I didn't add the warp, but everytime I remove it and fix the end it comes back up in the game and then the script.

    I don't know whats causing the problem or have any idea about it, but it would be good if someone can help me here. I don't think anythings wrong with the script but if you need it I can post it.

    maybe post your script in this thread?
     
  • 224
    Posts
    16
    Years
    • Seen Mar 8, 2016
    Hey all. I have 2 more questions.
    1. How do I continue a script after a warp? I heard it's called a level script or something.. How would I go about making a level script?

    2. In the beginning of Firered, Professor oak is hidden until you try to go into the grass. (meaning his sprite was hidden, it was visible in Advancemap but not in the game itself). I know you are supposed to use the command hidesprite or something like that.. but how on earth was the sprite hidden without there being a script to hide him in the first place?
     

    destinedjagold

    I do not exist.
  • 8,593
    Posts
    17
    Years
    • Seen May 26, 2024
    Hey all. I have 2 more questions.
    1. How do I continue a script after a warp? I heard it's called a level script or something.. How would I go about making a level script??

    look at the Documents and Tutorials section...
    there's a lot of useful and knowledgeable tutorials there like how to apply Level Scripts...
     

    Ninja Caterpie

    AAAAAAAAAAAAA
  • 5,979
    Posts
    16
    Years
    I have a script that works perfectly, until I reach the end of it. It's a movement script where someone comes and gives you three Pokemon, after that they go away, then when they reach their final spot the player warps into the middle of nowhere, I know they warp because I looked at the script to try and fix it with the 'Open Script' in AM, using XSE. I didn't add the warp, but everytime I remove it and fix the end it comes back up in the game and then the script.

    I don't know whats causing the problem or have any idea about it, but it would be good if someone can help me here. I don't think anythings wrong with the script but if you need it I can post it.
    Go to a hex editor and manually change it into whatever you want. The commands have their hex command counterparts in the XSE help thing.
     

    Hiche..

     
  • 979
    Posts
    16
    Years
    • Seen Dec 27, 2014
    I have a script that works perfectly, until I reach the end of it. It's a movement script where someone comes and gives you three Pokemon, after that they go away, then when they reach their final spot the player warps into the middle of nowhere, I know they warp because I looked at the script to try and fix it with the 'Open Script' in AM, using XSE. I didn't add the warp, but everytime I remove it and fix the end it comes back up in the game and then the script.

    I don't know whats causing the problem or have any idea about it, but it would be good if someone can help me here. I don't think anythings wrong with the script but if you need it I can post it.

    Your script may have compiled wrong.
    Can you show us the script please?
     

    Dratii

    Working on something new...
  • 195
    Posts
    15
    Years
    • Seen Oct 24, 2023
    Is it possible to use the same script twice even if one of the times you have set something so you can't get it again there. Like:

    First 'A' press: Player found a pokeball
    Second 'A' press: There is nothing but books here now

    and have that script on different things?
     

    Hiche..

     
  • 979
    Posts
    16
    Years
    • Seen Dec 27, 2014
    Is it possible to use the same script twice even if one of the times you have set something so you can't get it again there. Like:

    First 'A' press: Player found a pokeball
    Second 'A' press: There is nothing but books here now

    and have that script on different things?

    Yes, it's simple flag command.
    Example:
    Spoiler:


    Hope that helps.
     

    /Circa

    a face in the clouds.
  • 881
    Posts
    16
    Years
    This is the script:

    Code:
    #org 0x26D458
    checkflag 0x201
    if 0x1 goto 0x86D54A
    lock
    faceplayer
    setflag 0x828
    applymovement 0x1 0x826D53D
    waitmovement 0x0
    msgbox 0x826D4C9 '"Wait [player]!"
    callstd 0x6
    applymovement 0x1 0x826D541
    waitmovement 0x0
    msgbox 0x826D4D7 '"I have your Pokemon from your\nJoht..."
    callstd 0x6
    givepokemon 0x5 0x17 0x0 0x0 0x0 0x0
    givepokemon 0xBE 0x15 0x0 0x0 0x0 0x0
    givepokemon 0x62 0x16 0x0 0x0 0x0 0x0
    msgbox 0x826D51D '"[player] recieved three Pokemon."
    callstd 0x6
    applymovement 0x1 0x826D546
    waitmovement 0x0
    warpteleport2 0xD5 0xDD 0xE8 0xFD00 0xAB01
    
    '-----------------------
    #org 0x26D54A
    release
    
    '-----------
    ' Movements
    '-----------
    #org 0x26D53D
    #raw 62 'Exclamation Mark (!)
    #raw 1 'Face Up
    #raw FE 'End of Movements
    
    #org 0x26D541
    #raw B 'Step Right (Very Slow)
    #raw B 'Step Right (Very Slow)
    #raw 1 'Face Up
    #raw FE 'End of Movements
    
    #org 0x26D546
    #raw A 'Step Left (Very Slow)
    #raw A 'Step Left (Very Slow)
    #raw FE 'End of Movements
    
    
    '---------
    ' Strings
    '---------
    #org 0x26D4C9
    = Wait [player]!
    
    #org 0x26D4D7
    = I have your Pokemon from your\nJohto journey.\pYou'll need them now.
    
    #org 0x26D51D
    = [player] recieved three Pokemon.

    This is what it's supposed to be:

    Code:
    #org 0x26D458
    checkflag 0x201
    if 0x1 goto 0x86D54A
    lock
    faceplayer
    setflag 0x828
    applymovement 0x1 0x826D53D
    waitmovement 0x0
    msgbox 0x826D4C9 '"Wait [player]!"
    callstd 0x6
    applymovement 0x1 0x826D541
    waitmovement 0x0
    msgbox 0x826D4D7 '"I have your Pokemon from your\nJoht..."
    callstd 0x6
    givepokemon 0x5 0x17 0x0 0x0 0x0 0x0
    givepokemon 0xBE 0x15 0x0 0x0 0x0 0x0
    givepokemon 0x62 0x16 0x0 0x0 0x0 0x0
    msgbox 0x826D51D '"[player] recieved three Pokemon."
    callstd 0x6
    applymovement 0x1 0x826D546
    waitmovement 0x0
    [B]setflag 0x201
    release
    end[/B]
    
    '-----------------------
    #org 0x26D54A
    release
    
    '-----------
    ' Movements
    '-----------
    #org 0x26D53D
    #raw 62 'Exclamation Mark (!)
    #raw 1 'Face Up
    #raw FE 'End of Movements
    
    #org 0x26D541
    #raw B 'Step Right (Very Slow)
    #raw B 'Step Right (Very Slow)
    #raw 1 'Face Up
    #raw FE 'End of Movements
    
    #org 0x26D546
    #raw A 'Step Left (Very Slow)
    #raw A 'Step Left (Very Slow)
    #raw FE 'End of Movements
    
    
    '---------
    ' Strings
    '---------
    #org 0x26D4C9
    = Wait [player]!
    
    #org 0x26D4D7
    = I have your Pokemon from your\nJohto journey.\pYou'll need them now.
    
    #org 0x26D51D
    = [player] recieved three Pokemon.
     

    Hiche..

     
  • 979
    Posts
    16
    Years
    • Seen Dec 27, 2014
    This is the script:

    Code:
    #org 0x26D458
    checkflag 0x201
    if 0x1 goto 0x86D54A
    lock
    faceplayer
    setflag 0x828
    applymovement 0x1 0x826D53D
    waitmovement 0x0
    msgbox 0x826D4C9 '"Wait [player]!"
    callstd 0x6
    applymovement 0x1 0x826D541
    waitmovement 0x0
    msgbox 0x826D4D7 '"I have your Pokemon from your\nJoht..."
    callstd 0x6
    givepokemon 0x5 0x17 0x0 0x0 0x0 0x0
    givepokemon 0xBE 0x15 0x0 0x0 0x0 0x0
    givepokemon 0x62 0x16 0x0 0x0 0x0 0x0
    msgbox 0x826D51D '"[player] recieved three Pokemon."
    callstd 0x6
    applymovement 0x1 0x826D546
    waitmovement 0x0
    warpteleport2 0xD5 0xDD 0xE8 0xFD00 0xAB01
    
    '-----------------------
    #org 0x26D54A
    release
    
    '-----------
    ' Movements
    '-----------
    #org 0x26D53D
    #raw 62 'Exclamation Mark (!)
    #raw 1 'Face Up
    #raw FE 'End of Movements
    
    #org 0x26D541
    #raw B 'Step Right (Very Slow)
    #raw B 'Step Right (Very Slow)
    #raw 1 'Face Up
    #raw FE 'End of Movements
    
    #org 0x26D546
    #raw A 'Step Left (Very Slow)
    #raw A 'Step Left (Very Slow)
    #raw FE 'End of Movements
    
    
    '---------
    ' Strings
    '---------
    #org 0x26D4C9
    = Wait [player]!
    
    #org 0x26D4D7
    = I have your Pokemon from your\nJohto journey.\pYou'll need them now.
    
    #org 0x26D51D
    = [player] recieved three Pokemon.
    This is what it's supposed to be:

    Code:
    #org 0x26D458
    checkflag 0x201
    if 0x1 goto 0x86D54A
    lock
    faceplayer
    setflag 0x828
    applymovement 0x1 0x826D53D
    waitmovement 0x0
    msgbox 0x826D4C9 '"Wait [player]!"
    callstd 0x6
    applymovement 0x1 0x826D541
    waitmovement 0x0
    msgbox 0x826D4D7 '"I have your Pokemon from your\nJoht..."
    callstd 0x6
    givepokemon 0x5 0x17 0x0 0x0 0x0 0x0
    givepokemon 0xBE 0x15 0x0 0x0 0x0 0x0
    givepokemon 0x62 0x16 0x0 0x0 0x0 0x0
    msgbox 0x826D51D '"[player] recieved three Pokemon."
    callstd 0x6
    applymovement 0x1 0x826D546
    waitmovement 0x0
    [B]setflag 0x201
    release
    end[/B]
    
    '-----------------------
    #org 0x26D54A
    release
    
    '-----------
    ' Movements
    '-----------
    #org 0x26D53D
    #raw 62 'Exclamation Mark (!)
    #raw 1 'Face Up
    #raw FE 'End of Movements
    
    #org 0x26D541
    #raw B 'Step Right (Very Slow)
    #raw B 'Step Right (Very Slow)
    #raw 1 'Face Up
    #raw FE 'End of Movements
    
    #org 0x26D546
    #raw A 'Step Left (Very Slow)
    #raw A 'Step Left (Very Slow)
    #raw FE 'End of Movements
    
    
    '---------
    ' Strings
    '---------
    #org 0x26D4C9
    = Wait [player]!
    
    #org 0x26D4D7
    = I have your Pokemon from your\nJohto journey.\pYou'll need them now.
    
    #org 0x26D51D
    = [player] received three Pokemon.

    What script compiler do you use? Try recompiling the script again.
    I don't see anything wrong with it :\ Do you have the un-compiled script? The original?

    Spoiler:


    Try this, it's XSE.
     
    Last edited:

    /Circa

    a face in the clouds.
  • 881
    Posts
    16
    Years
    What script compiler do you use? Try recompiling the script again.
    I don't see anything wrong with it :\ Do you have the un-compiled script? The original?

    Spoiler:


    Try this, it's XSE.

    I used XSE for the script, and unfortunately I don't have the original, but it looks about the same as yours.
     

    Dratii

    Working on something new...
  • 195
    Posts
    15
    Years
    • Seen Oct 24, 2023
    Yes, it's simple flag command.
    Example:

    #dynamic 0xoffset

    #org @1
    lock
    checkflag 0x200
    if 0x1 goto @next
    giveitem 0x4 0x1
    hidesprite 0x<people eventnumber>
    setflag 0x200
    release
    end

    #org @next
    message @2
    boxset 0x6
    release
    end

    #org @2
    = There is nothing but books here now.

    Hope that helps.

    But when I put that same script on another thing, it would check the flag and go straight to 2. I want to know if you could make a script which would work on all of the thing
     
  • 185
    Posts
    16
    Years
    But when I put that same script on another thing, it would check the flag and go straight to 2. I want to know if you could make a script which would work on all of the thing

    Ofcourse, you need to use a diffirent flag. If you used 0x200 before, use something like 0x201 next time, and so on
     

    HackMew

    Mewtwo Strikes Back
  • 1,314
    Posts
    17
    Years
    • Seen Oct 26, 2011
    Ofcourse, you need to use a diffirent flag. If you used 0x200 before, use something like 0x201 next time, and so on

    To avoid any problems, it's better to use flags like 0x1000, 0x1001... 0x1009, 0x100A, 0x100B ...and so on.
     

    myfavouriteax

    Pop Bop's Boppin' Beats
  • 338
    Posts
    15
    Years
    So. Does anyone have any ideas on how to force the seagallop to go wherever you want it to with "special 0x17B"? I'd like it to NOT go to Vermillion or those seven islands.
    I read the romhacking newsletter issue two, and it still confused the dickens out of me, so if anyone could help me out, I would be quite grateful.
     

    Dratii

    Working on something new...
  • 195
    Posts
    15
    Years
    • Seen Oct 24, 2023
    Ofcourse, you need to use a diffirent flag. If you used 0x200 before, use something like 0x201 next time, and so on
    I know how to do that, I just wanted to know if you could re-use the same script to save space, which now I know you can't
     
  • 224
    Posts
    16
    Years
    • Seen Mar 8, 2016
    I just learned how to make level scripts, and everything is working fine except for one problem I'm running into. You see I set a flag in the beginning of the game to hide a sprite in one of the houses in pallet town. That flag was 112. So the sprite was hidden. Then I went and made a script that when I talk to a man he leads him to his house, and in his house I put a level script where he gives me a Pokemon (celebi). It all works fine, and I get the Celebi and everything. I made it so that the flag I set in the beginning of the game is cleared when I talk to the man, because I want the sprite in the house that he's leading me to to be visible again. So, the sprite is visible again and all works fine. HOWEVER, my problem is that when I go into the house without talking to the old man, as soon as I enter the house, the game freezes... Or at least the character freezes.

    Here are my 2 scripts:

    The first one, when the old man leads me to his house (this one works fine)

    Spoiler:


    Here is the LEVEL script:

    Spoiler:
     
  • 185
    Posts
    16
    Years
    I just learned how to make level scripts, and everything is working fine except for one problem I'm running into. You see I set a flag in the beginning of the game to hide a sprite in one of the houses in pallet town. That flag was 112. So the sprite was hidden. Then I went and made a script that when I talk to a man he leads him to his house, and in his house I put a level script where he gives me a Pokemon (celebi). It all works fine, and I get the Celebi and everything. I made it so that the flag I set in the beginning of the game is cleared when I talk to the man, because I want the sprite in the house that he's leading me to to be visible again. So, the sprite is visible again and all works fine. HOWEVER, my problem is that when I go into the house without talking to the old man, as soon as I enter the house, the game freezes... Or at least the character freezes.

    Here are my 2 scripts:

    The first one, when the old man leads me to his house (this one works fine)

    Spoiler:


    Here is the LEVEL script:

    Spoiler:

    Looks like you don't know but... It's kinda unsafe to use flags below 0x200, alot of them are used by the game itself..... Change the flag to 0x200 or 0x1000 or whatever (but don't use flags from 0x800, those are special flags as well.)
     

    0m3GA ARS3NAL

    Im comin' home...
  • 1,816
    Posts
    16
    Years
    Oooohohohohhohhoooo! You people are going to cry for joy when you get the new XSE...
    Anyways... (snicker)... is there a way to have the script check to see if 2 variables are the same, and if soo, continue the script from a different pointer? Like a checkflag, only for 2 pointers?
    if so, can I get an example? If it is comparevars, please tell me how exactly to use it
     

    Gyaridos1992

    Banned
  • 15
    Posts
    15
    Years
    • Seen Nov 14, 2008
    For some reason, this script wont compile. It keeps saying,Run time error 9. Subscript out of range. Heres my script
     
    Last edited:

    Hiche..

     
  • 979
    Posts
    16
    Years
    • Seen Dec 27, 2014
    For some reason, this script wont compile. It keeps saying,Run time error 9. Subscript out of range. Heres my script

    Well, there is nothing wrong in it, Only this:
    setflag 0x230
    setflag 0x231
    warp 0x6 0x0 0xFF
    #raw 0x07 0x00 0x0E 0x00
    end

    You should add an end.

    How do you compile it?
    Do you: Right click on the script( saved as.rbc), and press compile. You click Assign and search for your rom. Then you press Look(flashlight looking), and copy an offset, and press Assign.
    Then File>Burn.

    Is that what you do?
     
    Status
    Not open for further replies.
    Back
    Top