• 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.
25
Posts
7
Years
    • Seen Feb 19, 2018
    Ok I need help with a script.. I have my script Semi working I basically want the npc to walk towards me before battle talk to me then after battle the npc walks off screen. But after battle nothing happens until you step off the script tile and then back on then the npc just says the frist text again then walks off. is there anyway of making it so the npc walks off after you win the battle thanks in advance -jazzy (this is in fire red with XSE)

    Code:
    #dynamic 0x800F45
    
    #org @start
    playsong 0x013B 0x0
    applymovement 8 @move1 
    waitmovement 8 
    msgbox @talk1 0x6
    trainerbattle 0x0 0x002 0x0 @first @after
    applymovement 8 @move2
    waitmovement 8
    hidesprite 8
    setvar 0x6009 0x1
    setflag 0x1209
    fadesong 0x0126
    release
    end
    
    #org @move1
    #raw 0x13
    #raw 0x10
    #raw 0xFE
    
    #org @talk1
    = Hello my names Erin.. Can you help\nme train??
    
    #org @first
    = Lets do this..
    
    #org @after
    = Oh you win.. Thanks for your help\nthough. We should do this again\lsometime
    
    #org @move2
    #raw 0x11
    #raw 0x11
    #raw 0x11
    #raw 0x11
    #raw 0x13
    #raw 0x13
    #raw 0x13
    #raw 0x13
    #raw 0x13
    #raw 0x13
    #raw 0x13
    #raw 0x11
    #raw 0x11
    #raw 0xFE
     

    Bulbadon

    Might or might not come back
    106
    Posts
    9
    Years
    • Seen Aug 26, 2016
    I need help with an applymovement script. Here's the code:

    Code:
    [URL="https://www.youtube.com/results?q=%23dynamic"]#dynamic[/URL] 0x8008FE
    
    [URL="https://www.youtube.com/results?q=%23org"]#org[/URL] @start
    msgbox @talk1 0x6
    playsong 0x011A 0x0
    applymovement 10 @walk1
    waitmovement 10
    applymovement 0xFF @walk2
    waitmovement 0xFF
    msgbox @talk2 0x6
    giveitem 0x103 1 0x0
    msgbox @talk3 0x6
    applymovement 10 @walk3
    waitmovement 10
    hidesprite 10
    setvar 0x6000 0x1
    setflag 0x1206
    fadesong 0x012C
    release
    end
    
    [URL="https://www.youtube.com/results?q=%23org"]#org[/URL] @talk1
    = HEY WAIT! DONT GO YET!
    
    [URL="https://www.youtube.com/results?q=%23org"]#org[/URL] @talk2
    = I fixed your bike finally and it\nruns better than ever!\pHere you go!
    
    [URL="https://www.youtube.com/results?q=%23org"]#org[/URL] @talk3
    = That's all I needed to give you.\nI'll catch you later!\pBye!
    
    [URL="https://www.youtube.com/results?q=%23org"]#org[/URL] @walk1
    [URL="https://www.youtube.com/results?q=%23raw"]#raw[/URL] 0x10
    [URL="https://www.youtube.com/results?q=%23raw"]#raw[/URL] 0x10
    [URL="https://www.youtube.com/results?q=%23raw"]#raw[/URL] 0x10
    [URL="https://www.youtube.com/results?q=%23raw"]#raw[/URL] 0x10
    [URL="https://www.youtube.com/results?q=%23raw"]#raw[/URL] 0x10
    [URL="https://www.youtube.com/results?q=%23raw"]#raw[/URL] 0x10
    #raw 0x12
    [URL="https://www.youtube.com/results?q=%23raw"]#raw[/URL] 0x12
    [URL="https://www.youtube.com/results?q=%23raw"]#raw[/URL] 0x12
    [URL="https://www.youtube.com/results?q=%23raw"]#raw[/URL] 0x12
    [URL="https://www.youtube.com/results?q=%23raw"]#raw[/URL] 0x12
    [URL="https://www.youtube.com/results?q=%23raw"]#raw[/URL] 0x4A
    [URL="https://www.youtube.com/results?q=%23raw"]#raw[/URL] 0xFE
    
    [URL="https://www.youtube.com/results?q=%23org"]#org[/URL] @walk2
    [URL="https://www.youtube.com/results?q=%23raw"]#raw[/URL] 0x63
    [URL="https://www.youtube.com/results?q=%23raw"]#raw[/URL] 0x55
    [URL="https://www.youtube.com/results?q=%23raw"]#raw[/URL] 0xFE
    
    [URL="https://www.youtube.com/results?q=%23org"]#org[/URL] @walk3
    [URL="https://www.youtube.com/results?q=%23raw"]#raw[/URL] 0x13
    [URL="https://www.youtube.com/results?q=%23raw"]#raw[/URL] 0x13
    [URL="https://www.youtube.com/results?q=%23raw"]#raw[/URL] 0x13
    [URL="https://www.youtube.com/results?q=%23raw"]#raw[/URL] 0x13
    #raw 0x13
    [URL="https://www.youtube.com/results?q=%23raw"]#raw[/URL] 0x11
    [URL="https://www.youtube.com/results?q=%23raw"]#raw[/URL] 0x11
    [URL="https://www.youtube.com/results?q=%23raw"]#raw[/URL] 0x11
    [URL="https://www.youtube.com/results?q=%23raw"]#raw[/URL] 0x11
    [URL="https://www.youtube.com/results?q=%23raw"]#raw[/URL] 0x11
    [URL="https://www.youtube.com/results?q=%23raw"]#raw[/URL] 0x11
    [URL="https://www.youtube.com/results?q=%23raw"]#raw[/URL] 0xFE

    So I set the var to the green script tile and placed the OW at the right place BUT the problem with this script is the OW always shows no matter what it shows at the place where I put it on A Map and the script works right the OW walks up to you and gives you an item and walks away but when I go back to the place where I placed the OW he's still there.

    Am I doing something wrong? Do I need to set something so that the OW doesn't appear in game all the time, only during the script.
     
    348
    Posts
    8
    Years
  • I need help with an applymovement script. Here's the code:

    Code:
    [URL="https://www.youtube.com/results?q=%23dynamic"]#dynamic[/URL] 0x8008FE
    
    [URL="https://www.youtube.com/results?q=%23org"]#org[/URL] @start
    msgbox @talk1 0x6
    playsong 0x011A 0x0
    applymovement 10 @walk1
    waitmovement 10
    applymovement 0xFF @walk2
    waitmovement 0xFF
    msgbox @talk2 0x6
    giveitem 0x103 1 0x0
    msgbox @talk3 0x6
    applymovement 10 @walk3
    waitmovement 10
    hidesprite 10
    setvar 0x6000 0x1
    setflag 0x1206
    fadesong 0x012C
    release
    end
    
    [URL="https://www.youtube.com/results?q=%23org"]#org[/URL] @talk1
    = HEY WAIT! DONT GO YET!
    
    [URL="https://www.youtube.com/results?q=%23org"]#org[/URL] @talk2
    = I fixed your bike finally and it\nruns better than ever!\pHere you go!
    
    [URL="https://www.youtube.com/results?q=%23org"]#org[/URL] @talk3
    = That's all I needed to give you.\nI'll catch you later!\pBye!
    
    [URL="https://www.youtube.com/results?q=%23org"]#org[/URL] @walk1
    [URL="https://www.youtube.com/results?q=%23raw"]#raw[/URL] 0x10
    [URL="https://www.youtube.com/results?q=%23raw"]#raw[/URL] 0x10
    [URL="https://www.youtube.com/results?q=%23raw"]#raw[/URL] 0x10
    [URL="https://www.youtube.com/results?q=%23raw"]#raw[/URL] 0x10
    [URL="https://www.youtube.com/results?q=%23raw"]#raw[/URL] 0x10
    [URL="https://www.youtube.com/results?q=%23raw"]#raw[/URL] 0x10
    #raw 0x12
    [URL="https://www.youtube.com/results?q=%23raw"]#raw[/URL] 0x12
    [URL="https://www.youtube.com/results?q=%23raw"]#raw[/URL] 0x12
    [URL="https://www.youtube.com/results?q=%23raw"]#raw[/URL] 0x12
    [URL="https://www.youtube.com/results?q=%23raw"]#raw[/URL] 0x12
    [URL="https://www.youtube.com/results?q=%23raw"]#raw[/URL] 0x4A
    [URL="https://www.youtube.com/results?q=%23raw"]#raw[/URL] 0xFE
    
    [URL="https://www.youtube.com/results?q=%23org"]#org[/URL] @walk2
    [URL="https://www.youtube.com/results?q=%23raw"]#raw[/URL] 0x63
    [URL="https://www.youtube.com/results?q=%23raw"]#raw[/URL] 0x55
    [URL="https://www.youtube.com/results?q=%23raw"]#raw[/URL] 0xFE
    
    [URL="https://www.youtube.com/results?q=%23org"]#org[/URL] @walk3
    [URL="https://www.youtube.com/results?q=%23raw"]#raw[/URL] 0x13
    [URL="https://www.youtube.com/results?q=%23raw"]#raw[/URL] 0x13
    [URL="https://www.youtube.com/results?q=%23raw"]#raw[/URL] 0x13
    [URL="https://www.youtube.com/results?q=%23raw"]#raw[/URL] 0x13
    #raw 0x13
    [URL="https://www.youtube.com/results?q=%23raw"]#raw[/URL] 0x11
    [URL="https://www.youtube.com/results?q=%23raw"]#raw[/URL] 0x11
    [URL="https://www.youtube.com/results?q=%23raw"]#raw[/URL] 0x11
    [URL="https://www.youtube.com/results?q=%23raw"]#raw[/URL] 0x11
    [URL="https://www.youtube.com/results?q=%23raw"]#raw[/URL] 0x11
    [URL="https://www.youtube.com/results?q=%23raw"]#raw[/URL] 0x11
    [URL="https://www.youtube.com/results?q=%23raw"]#raw[/URL] 0xFE

    So I set the var to the green script tile and placed the OW at the right place BUT the problem with this script is the OW always shows no matter what it shows at the place where I put it on A Map and the script works right the OW walks up to you and gives you an item and walks away but when I go back to the place where I placed the OW he's still there.

    Am I doing something wrong? Do I need to set something so that the OW doesn't appear in game all the time, only during the script.

    you need to put the flag 1206 (used in this script) in the PERSON ID box in order to hide the Sprite permanently. Make sure you put it in PERSON ID not PERSON EVENT.
     

    Bulbadon

    Might or might not come back
    106
    Posts
    9
    Years
    • Seen Aug 26, 2016
    you need to put the flag 1206 (used in this script) in the PERSON ID box in order to hide the Sprite permanently. Make sure you put it in PERSON ID not PERSON EVENT.

    I see so that was the problem. Thank you for the help.
     
    348
    Posts
    8
    Years
  • Skipping Oak's Intro in Fire Red

    So, I am trying to skip Oak's Intro in FR using this Post:
    https://www.pokecommunity.com/showpost.php?p=8521318&postcount=155
    it skips the intro properly, but the problem arrives after that.
    The hero is holding the Vs Seeker, & moves left to right without actually facing left or right. None of the Person Events works anymore. The Default name i set doesn't works (It shows just white spaces in the Menu & when clicked on that, turns the screen Black).
    Any solution for this? I may post screenshots if you didn't understand my problem (no electricity atm).
     
    82
    Posts
    10
    Years
    • Seen Oct 25, 2017
    Ok I need help with a script.. I have my script Semi working I basically want the npc to walk towards me before battle talk to me then after battle the npc walks off screen. But after battle nothing happens until you step off the script tile and then back on then the npc just says the frist text again then walks off. is there anyway of making it so the npc walks off after you win the battle thanks in advance -jazzy (this is in fire red with XSE)

    Code:
    #dynamic 0x800F45
    
    #org @start
    playsong 0x013B 0x0
    applymovement 8 @move1 
    waitmovement 8 
    msgbox @talk1 0x6
    trainerbattle 0x0 0x002 0x0 @first @after
    applymovement 8 @move2
    waitmovement 8
    hidesprite 8
    setvar 0x6009 0x1
    setflag 0x1209
    fadesong 0x0126
    release
    end
    
    #org @move1
    #raw 0x13
    #raw 0x10
    #raw 0xFE
    
    #org @talk1
    = Hello my names Erin.. Can you help\nme train??
    
    #org @first
    = Lets do this..
    
    #org @after
    = Oh you win.. Thanks for your help\nthough. We should do this again\lsometime
    
    #org @move2
    #raw 0x11
    #raw 0x11
    #raw 0x11
    #raw 0x11
    #raw 0x13
    #raw 0x13
    #raw 0x13
    #raw 0x13
    #raw 0x13
    #raw 0x13
    #raw 0x13
    #raw 0x11
    #raw 0x11
    #raw 0xFE
    Try this, it should work:
    Code:
    #dynamic 0x800F45
    
    #org @start
    playsong 0x013B 0x0
    applymovement 8 @move1 
    waitmovement 0
    msgbox @talk1 0x6
    trainerbattle 0x3 0x002 0x0 @after
    applymovement 8 @move2
    waitmovement 0
    hidesprite 8
    setflag 0x1209
    setvar 0x6009 0x1
    release
    end
    
    #org @move1
    #raw 0x13
    #raw 0x10
    #raw 0xFE
    
    #org @talk1
    = Hello my names Erin.. Can you help\nme train??\pLets do this..
    
    #org @after
    = Oh you win.. Thanks for your help\nthough. We should do this again\lsometime
    
    #org @move2
    #raw 0x11
    #raw 0x11
    #raw 0x11
    #raw 0x11
    #raw 0x13
    #raw 0x13
    #raw 0x13
    #raw 0x13
    #raw 0x13
    #raw 0x13
    #raw 0x13
    #raw 0x11
    #raw 0x11
    #raw 0xFE
    Okay, so let's see.

    The waitmovement command is followed by 0x0, and not the person event no of the sprite.

    As you can see, I changed the value after trainerbattle from 0x0 to 0x3. The reason for this is that the 0x0 trainerbattle type is to be used for regular trainers (the kind that when you walk into their line of vision will get an exclamation mark above their head before walking up to you to initiate a battle).

    If you're going for a script like this one here (which triggers upon walking onto a script tile), you'll want to go with a different trainerbattle type. Most commonly used for this type of script, is the 0x3 type. It makes for a smoother transition from the playsong command and the pre-battle dialogue into the battle, too, as you will notice.

    Also, the 0x3 trainerbattle type can only have 1 message pointer at the end, which is why I removed @first (the text of which I moved to @talk1), leaving only @after

    I also removed fadesong 0x0126, as it was serving no purpose here.

    Hope this helps! Try it, and report back the results!

    It might be worth it to read up on trainer battles scripts and its different types. There should be some tutorials around here.
     
    Last edited:
    76
    Posts
    8
    Years
    • Seen Dec 9, 2022
    What have you got so far?

    Nevermind I got it working :)
    I just made a new script form the scratch and it worked
    Spoiler:
     
    107
    Posts
    7
    Years
    • Seen Sep 22, 2022
    Since I'm pretty new to scripting, I'd like some help on my script, because I'm pretty sure I don't have this right. I also have a question, "multichoice 0xE 0x0 0x3E 0x0" means that the player can choose to exit, but since this is gonna be where you get your pokemon, I clearly don't want the player to be able to exit the chat. if I chance the second 0x0 to 0x1 does that mean that the player can't exit the chat? And, since I've never made a flag script before either I want to make sure I have this right. If I don't please help me out, and let me know what to fix. :)

    Script:
    Spoiler:
     
    25
    Posts
    7
    Years
    • Seen Feb 19, 2018
    I am trying to finish my script it all works but on the second text the player sprite starts running on the spot I don't know why and I don't know how to fix it so thats why Im here


    Code:
    #dynamic 0x802697
    
    #org 0x802697
    lock
    showsprite 0x6
    setvar 0x6040 0x1
    playsong 0x14C 0x1
    applymovement MOVE_PLAYER 0x88027CC
    waitmovement 0xFF
    applymovement 0x6 0x88027EB
    waitmovement 0x6
    msgbox @talk1 0x6
    msgbox @talk2 0x6
    applymovement 0x6 0x88027E2
    applymovement MOVE_PLAYER 0x88027D0
    waitmovement 0xFF
    msgbox 0x8802716 MSG_NORMAL
    applymovement 0x6 0x88027DD
    waitmovement 0x6
    hidesprite 0x6
    applymovement MOVE_PLAYER 0x88027D8
    waitmovement 0xFF
    setflag 0x4D8
    release
    end
    
    
    '---------
    ' Strings
    '---------
    #org @talk1
    = no text
    
    #org @talk2
    = no text
    
    #org 0x802716
    = no text
    
    
    '-----------
    ' Movements
    '-----------
    #org 0x8027CC
    #raw 0x4 'Face Down (Faster)
    #raw 0x63 'Question Mark (?)
    #raw 0xFE 'End of Movements
    
    #org 0x8027EB
    #raw 0x11 'Step Up (Normal)
    #raw 0x11 'Step Up (Normal)
    #raw 0x1F 'Step Left (Fast)
    #raw 0x1F 'Step Left (Fast)
    #raw 0x12 'Step Left (Normal)
    #raw 0x12 'Step Left (Normal)
    #raw 0x12 'Step Left (Normal)
    #raw 0x12 'Step Left (Normal)
    #raw 0x12 'Step Left (Normal)
    #raw 0x12 'Step Left (Normal)
    #raw 0x12 'Step Left (Normal)
    #raw 0x11 'Step Up (Normal)
    #raw 0x11 'Step Up (Normal)
    #raw 0x66 'Happy (^_^)
    #raw 0xFE 'End of Movements
    
    #org 0x8027E2
    #raw 0x13 'Step Right (Normal)
    #raw 0x13 'Step Right (Normal)
    #raw 0x13 'Step Right (Normal)
    #raw 0x13 'Step Right (Normal)
    #raw 0x13 'Step Right (Normal)
    #raw 0x13 'Step Right (Normal)
    #raw 0x2 'Face Left
    #raw 0xFE 'End of Movements
    
    #org 0x8027D0
    #raw 0x10 'Step Down (Normal)
    #raw 0x13 'Step Right (Normal)
    #raw 0x13 'Step Right (Normal)
    #raw 0x13 'Step Right (Normal)
    #raw 0x13 'Step Right (Normal)
    #raw 0x13 'Step Right (Normal)
    #raw 0xFE 'End of Movements
    
    #org 0x8027DD
    #raw 0x13 'Step Right (Normal)
    #raw 0x13 'Step Right (Normal)
    #raw 0x13 'Step Right (Normal)
    #raw 0xFE 'End of Movements
    
    #org 0x8027D8
    #raw 0x13 'Step Right (Normal)
    #raw 0x13 'Step Right (Normal)
    #raw 0x13 'Step Right (Normal)
    #raw 0xFE 'End of Movements
     

    PatJamma

    From the ashes
    477
    Posts
    16
    Years
    • Age 29
    • Seen Jan 8, 2022
    Can anybody point me in the direction of an item table for Emerald? Specifically, I'm looking to change up locations of TMs and which ones the Gym Leaders give to the player. I'm having trouble because the items don't match up with their index. For example, Flannery gives TM50, in the unmodified script it says give item 152, however TM50 is item 338 in the index, so I'm kinda lost here...

    Also, again in Emerald, how would I go about changing the script with the old woman who gives the player an egg with a Wynaut to an egg containing an Eevee instead?
     
    21
    Posts
    7
    Years
  • Hello there!
    I´m having troubles with this starter choosing script. I took the original script from a tutorial on the forum and modified it a bit to let the player choose into two more starters.
    The thing is that after saying "no" to the first pokémon, the script (if it worked well) it´s supposed to ask the player if they want x pokémon (in this case is an eevee) but after denying all i get is some weird text and the third opption doesent even appear and the dialog ends.
    This is the script:
    Spoiler:


    the error may be very basic since I´m really new at scripting.
    Also, sorry if any grammar mistake is found. English is not my mother language.
    Thanks for helping me!
     
    348
    Posts
    8
    Years
  • Can anybody point me in the direction of an item table for Emerald? Specifically, I'm looking to change up locations of TMs and which ones the Gym Leaders give to the player. I'm having trouble because the items don't match up with their index. For example, Flannery gives TM50, in the unmodified script it says give item 152, however TM50 is item 338 in the index, so I'm kinda lost here...

    Also, again in Emerald, how would I go about changing the script with the old woman who gives the player an egg with a Wynaut to an egg containing an Eevee instead?

    you have to convert the index no. of item into Hex.
    for example, the index no. of TM50 is 338, converting it into hex gives the value 152 (that's what Flannery gives).
    Same goes for the egg.
    You can convert this by Windows calculator. just Switch the mode to 'Programmers Mode' & you are way to go.
     
    82
    Posts
    10
    Years
    • Seen Oct 25, 2017
    Hello there!
    I´m having troubles with this starter choosing script. I took the original script from a tutorial on the forum and modified it a bit to let the player choose into two more starters.
    The thing is that after saying "no" to the first pokémon, the script (if it worked well) it´s supposed to ask the player if they want x pokémon (in this case is an eevee) but after denying all i get is some weird text and the third opption doesent even appear and the dialog ends.
    This is the script:
    Spoiler:


    the error may be very basic since I´m really new at scripting.
    Also, sorry if any grammar mistake is found. English is not my mother language.
    Thanks for helping me!

    Hey there!

    First of all, nice try! The script is a little bit of a mess, but definitely not bad for a beginner. I'll try to explain the biggest flaws with it.

    At various points in the script, after YES/NO questions, you put:
    compare 0x800D 0x1
    if 0x1 goto @something
    compare 0x800D 0x0
    if 0x1 goto @something

    The second compare and if are redundant, because when you click NO to the question, the script will automatically execute what is specified below the first compare and if(which is the compare for YES) anyway. This is probably why the script stops working at that point, because there shouldn't be a compare & if for when you click NO, at least not in this situation.

    Your script is also a bit too long. For some things, you jump through various unnecessary hoops to get to a certain result. The script can be shortened a bit, while still yielding the desired result.

    Those are the main flaws.

    I have tweaked your script to a shorter and more streamlined form, and I believe it works the way you intended it to. Please test it out in the game and report back the results!

    Spoiler:
     
    Last edited:
    21
    Posts
    7
    Years
  • Hey there!

    First of all, nice try! The script is a little bit of a mess, but definitely not bad for a beginner. I'll try to explain the biggest flaws with it.

    At various points in the script, after YES/NO questions, you put:
    compare 0x800D 0x1
    if 0x1 goto @something
    compare 0x800D 0x0
    if 0x1 goto @something

    The second compare and if are redundant, because when you click NO to the question, the script will automatically execute what is specified below the first compare and if(which is the compare for YES) anyway. This is probably why the script stops working at that point, because there shouldn't be a compare & if for when you click NO, at least not in this situation.

    Your script is also a bit too long. For some things, you jump through various unnecessary hoops to get to a certain result. The script can be shortened a bit, while still yielding the desired result.

    Those are the main flaws.

    I have tweaked your script to a shorter and more streamlined form, and I believe it works the way you intended it to. Please test it out in the game and report back the results!

    Spoiler:

    The tweaked script worked just as intended. Thanks for the help!
     

    ExitWound

    Boggle
    79
    Posts
    16
    Years
    • Seen Sep 22, 2016
    Hey guys! I have a problem...
    When all of my Pokémon faint, it tells me that I'm out of usable Pokémon and whatnot, but when the screen goes black, it never changes and just stays black. What can I do to fix that?
     
    15
    Posts
    11
    Years
    • Seen Mar 22, 2024
    Hey PokeCent.
    I need a little help editing Prof. Birch's Starter script in Emerald Version.
    I solved my issue with fetching the Battle Tent selection screen to give you Three Level 30 "rental" staters. My issue is getting the correct progression flags to set, and warping to the lab to continue regular progression.
    Here is the script for Birch's Bag on Route 101
    Spoiler:
     
    Status
    Not open for further replies.
    Back
    Top