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

Script Help Thread (DO NOT REQUEST SCRIPTS)

Status
Not open for further replies.

deoxys121

White Kyurem Cometh
1,254
Posts
13
Years
  • Retrying Post: Changing First Encounter

    I posted this about a week ago, but didn't get a response. So, I'm trying again.

    I'd like to know if there is a way to change which Pokemon you encounter in Pokemon Ruby after you choose your starter. I would like to make this change to a specific Pokemon for an important plot point. I am able to open the scripts that appear on the Route 101 Map using AdvanceMap 1.90 and PKSV. This is the script from the Bag which contains the Pokeballs, but I'm not sure if this is where I start. Any help would be appreciated. I have little experience with scripting, but would like to learn more.


    Code:
    #org 0x814EA7F
    '-----------------------------------
    lock
    faceplayer
    setflag RS_POKEMON
    setflag 0x52
    fadescreen FADEOUT_BLACK
    disappear 0x4
    movesprite 0xFF 0x6 0xD
    applymovement PLAYER 0x81A083F ' raw_27 end
    pauseevent 0x0
    special CHOOSE_POKEMON
    waitspecial
    applymovement 0x2 0x814EAD7 ' walk_right_slow end
    pauseevent 0x0
    msgbox 0x816D191 ' PROF. BIRCH: Whew......
    callstd MSG_NOCLOSE ' Non-closing message
    special HEAL_POKEMON
    setflag 0x2D0
    clearflag 0x2D1
    setflag 0x2BC
    setvar 0x4084 0x2
    setvar 0x4060 0x3
    clearflag 0x4000
    warp 0x1 0x4 0xFF 0x6 0x5
    waitspecial
    release
    end
    
    
    #org 0x816D191
    = PROF. BIRCH: Whew...\pI was in the tall grass studying wild\nPOK\eMON when I was jumped.\pYou saved me.\nThanks a lot!\pOh?\pHi, you're \v\h01\v\h05!\pThis is not the place to chat, so come\nby my POK\eMON LAB later, okay?
    
    #org 0x81A083F
    M raw_27 end
    
    #org 0x814EAD7
    M walk_right_slow end
     

    Complans

    Trainer
    98
    Posts
    14
    Years
    • Seen Aug 27, 2015
    I posted this about a week ago, but didn't get a response. So, I'm trying again.

    I'd like to know if there is a way to change which Pokemon you encounter in Pokemon Ruby after you choose your starter. I would like to make this change to a specific Pokemon for an important plot point. I am able to open the scripts that appear on the Route 101 Map using AdvanceMap 1.90 and PKSV. This is the script from the Bag which contains the Pokeballs, but I'm not sure if this is where I start. Any help would be appreciated. I have little experience with scripting, but would like to learn more.


    Code:
    #org 0x814EA7F
    '-----------------------------------
    lock
    faceplayer
    setflag RS_POKEMON
    setflag 0x52
    fadescreen FADEOUT_BLACK
    disappear 0x4
    movesprite 0xFF 0x6 0xD
    applymovement PLAYER 0x81A083F ' raw_27 end
    pauseevent 0x0
    special CHOOSE_POKEMON
    waitspecial
    applymovement 0x2 0x814EAD7 ' walk_right_slow end
    pauseevent 0x0
    msgbox 0x816D191 ' PROF. BIRCH: Whew......
    callstd MSG_NOCLOSE ' Non-closing message
    special HEAL_POKEMON
    setflag 0x2D0
    clearflag 0x2D1
    setflag 0x2BC
    setvar 0x4084 0x2
    setvar 0x4060 0x3
    clearflag 0x4000
    warp 0x1 0x4 0xFF 0x6 0x5
    waitspecial
    release
    end
    
    
    #org 0x816D191
    = PROF. BIRCH: Whew...\pI was in the tall grass studying wild\nPOK\eMON when I was jumped.\pYou saved me.\nThanks a lot!\pOh?\pHi, you're \v\h01\v\h05!\pThis is not the place to chat, so come\nby my POK\eMON LAB later, okay?
    
    #org 0x81A083F
    M raw_27 end
    
    #org 0x814EAD7
    M walk_right_slow end

    I don't think it's a good idea to edit important script from the game, you will be better of re-writing it so you have more freedom.
     
    6
    Posts
    13
    Years
    • Seen Feb 12, 2012
    Making people disappear

    ok on my script i got the guys to say what i want him to say, and he gives me the pokemon i want him to give, but, when i use "hidesprite <person id>" nothing happens, the screen fades and then, nothing it just shows him STILL standing there, please help me...

    Extra notes: here is my exact part of the script im having trouble near

    fade 0x0
    hidesprite 17
    release
    end

    tell me if im doing something wrong...
    by the way, the person id is 0023 and in hex form is 17...
     

    Complans

    Trainer
    98
    Posts
    14
    Years
    • Seen Aug 27, 2015
    ok on my script i got the guys to say what i want him to say, and he gives me the pokemon i want him to give, but, when i use "hidesprite <person id>" nothing happens, the screen fades and then, nothing it just shows him STILL standing there, please help me...

    Extra notes: here is my exact part of the script im having trouble near

    fade 0x0
    hidesprite 17
    release
    end

    tell me if im doing something wrong...
    by the way, the person id is 0023 and in hex form is 17...

    You will have to set your Person ID something higher than 1000.

    Try this:

    fadescreen 0x1
    fadescreen 0x0
    hidesprite 0x[person id]
    setflag 0x[person id]
    release
    end
     
    6
    Posts
    13
    Years
    • Seen Feb 12, 2012
    making people disappear

    i tryed that, and i cant tell if the guy disappeared cause my screen stays black after talking to him now...
     

    Complans

    Trainer
    98
    Posts
    14
    Years
    • Seen Aug 27, 2015
    You probably have three fadescreens. 0x1 makes the screen go to black, and 0x0 makes it return to normal. So, you probably have an 0x1 after an 0x0.

    fadescreen 0x1
    fadescreen 0x0
     
    Last edited:
    6
    Posts
    13
    Years
    • Seen Feb 12, 2012
    You probably have three fadescreens. 0x1 makes the screen go to black, and 0x0 makes it return to normal. So, you probably have an 0x1 after an 0x0.

    fadescreen 0x1
    fadescreen 0x0

    no man, i only have one, see heres my script

    '---------------
    #org 0x71A388
    lock
    faceplayer
    msgbox 0x871A3A4 MSG_NORMAL '"Hey, you got some crack man?\nJu-j..."
    givepokemon 0x97 0x1E 0x1 0x0 0x0 0x0
    fadescreen 0x1
    fadescreen 0x0
    hidesprite 0x01896
    setflag 0x01896
    release
    end

    then thats it...
    also i dont know if im supposed to HEX the person ids...
     

    Complans

    Trainer
    98
    Posts
    14
    Years
    • Seen Aug 27, 2015
    no man, i only have one, see heres my script

    '---------------
    #org 0x71A388
    lock
    faceplayer
    msgbox 0x871A3A4 MSG_NORMAL '"Hey, you got some crack man?\nJu-j..."
    givepokemon 0x97 0x1E 0x1 0x0 0x0 0x0
    fadescreen 0x1
    fadescreen 0x0
    hidesprite 0x01896
    setflag 0x01896
    release
    end

    then thats it...
    also i dont know if im supposed to HEX the person ids...

    Yes, you do. Hidesprite is the overworld number, and also setflag has 5 numbers.
     

    metapod23

    Hardened Trainer
    673
    Posts
    15
    Years
    • Seen Aug 18, 2016
    no man, i only have one, see heres my script

    '---------------
    #org 0x71A388
    lock
    faceplayer
    msgbox 0x871A3A4 MSG_NORMAL '"Hey, you got some crack man?\nJu-j..."
    givepokemon 0x97 0x1E 0x1 0x0 0x0 0x0
    fadescreen 0x1
    fadescreen 0x0
    hidesprite 0x01896
    setflag 0x01896
    release
    end

    then thats it...
    also i dont know if im supposed to HEX the person ids...

    You don't use the person ID # for the sprite. Use the Person event # for the hidesprite command (make sure to convert hex if needed - i.e. 0x10 = 0xa ... 0x15 = 0xf).
     
    6
    Posts
    13
    Years
    • Seen Feb 12, 2012
    You don't use the person ID # for the sprite. Use the Person event # for the hidesprite command (make sure to convert hex if needed - i.e. 0x10 = 0xa ... 0x15 = 0xf).

    ok so i did that and he still doesnt disappear... is anyone planning on helping me...
    cause now i decided to make a new script and it keeps saying, error on line 7 correct line is 6
    heres my script

    '---------------
    #dynamic 0x71A388
    #org @start
    lock
    faceplayer
    givepokemon 0x96 0x1E 0x0 0x0 0x0
    hidesprite 0xA
    setflag 0xA
    release
    end
    msgbox @1 0x6 boxset 0x6
    #org @1
    = Hi.
     
    Last edited:

    metapod23

    Hardened Trainer
    673
    Posts
    15
    Years
    • Seen Aug 18, 2016
    ok so i did that and he still doesnt disappear... is anyone planning on helping me...
    cause now i decided to make a new script and it keeps saying, error on line 7 correct line is 6
    heres my script

    '---------------
    #dynamic 0x71A388
    #org @start
    lock
    faceplayer
    givepokemon 0x96 0x1E 0x0 0x0 0x0
    hidesprite 0xA
    setflag 0xA
    release
    end
    msgbox @1 0x6 boxset 0x6
    #org @1
    = Hi.

    The setflag is the person ID, the hidesprite is the person event # - they're different. The flag should be an unused flag in the game.

    You might have too many parameters for the givepokemon command - I'm not sure, I can't remember how many you're supposed to have.
     
    23
    Posts
    16
    Years
  • Ok I've kinda given up on my Snorlax spript becasue it's unimportant but I need your help on this script.

    It is a Pokeball that is supposed to give you a Poliwhirl and then disappear but when I try it I get the Poliwhirl but it won't disappear. I have the Person ID set to 1201 and the Person Event # is 1 but it still won't work. Can you help meh?

    Code:
    #org $script
    lock
    message $poliwhirl
    $poliwhirl 1 = Oh!\nHere is my POLIWHIRL.
    boxset 6
    pause 0x10
    message $gotpoliwhirl
    $gotpoliwhirl 1 = \v\h01 picked up his POLIWHIRL.
    boxset 4
    givepokemon 61 5 0x00
    setflag 0x828
    fadescreen 1
    removesprite 1 
    setflag 0x1201
    setvar 0x6000 0x01
    pause 0x10
    fadescreen 0
    release
    end

    Also there is the code to stop someone from leaving the area applied to two script boxes that is supposed to stop the player and tell them they forgot their Poliwhirl but it won't stop the player (it seems every script I make doesn't work). This the reason for the setvar in the above script.

    Code:
    #org $forgot
    jingle
    message $youforgot
    applymovement 1 $move
    $move 1 ; #binary 0x62 0xFE
    pausemove 0x0000
    $youforgot 1 = Oops!\nI forgot my POLIWHIRL on the\ltable.
    applymovemont 1 $move2
    $move2 1 ; #binary 0x10 0xFE
    pausemove 0x0000
    release
    end

    Thanks in advance!
     
    Last edited:

    Pokepal17

    More cowbell~
    1,519
    Posts
    15
    Years
  • ok so i did that and he still doesnt disappear... is anyone planning on helping me...
    cause now i decided to make a new script and it keeps saying, error on line 7 correct line is 6
    heres my script

    #dynamic 0x800000

    #org @start
    msgbox @1 0x2
    givepokemon 0x96 0x1E 0x0 0x0 0x0 0x0
    hidesprite LASTTALKED
    setflag 0x1000
    end

    #org @1
    = Hi.

    What Metapod said about the flags is true; the flag needs to be different from the person number. Also, parts of your script are in the wrong order. You have the message executing after the script ends and its parameters are wrong.

    Just for this example, we'll use the flag 0x1000 for the person ID. Also, if you're talking to a sprite, you can use LASTTALKED instead of having to manually find the event number. Oh, the givepokemon needs an extra parameter too.

    For your dynamic offset, it is recommended that you start from 0x800000. And using msgbox type 0x2 eliminates the need for lock, faceplayer and release.

    Fixes in quote~
     

    deoxys121

    White Kyurem Cometh
    1,254
    Posts
    13
    Years
  • How to Make Legendary Pokemon Disappear

    Fist of all, I'm using PKSV and hacking Pokemon Ruby.

    I'm having an issue with my legendary Pokemon scripts with which I cannot figure out what exactly I'm doing wrong. I'm trying to make it just like any other legendary battle in the sense that the sprite disappears permanently after you catch or defeat it. I've tried including the command "disappear lasttalked" in the script, but as soon as I move, the sprite reappears. I have also tried to include a map script that activates when you enter. The map script I was using was this:

    Code:
    #org 0x8740108
    '-----------------------------------
    checkflag 0x1100
    if true call 0x815F312
    end
    
    #org 0x815F312
    '-----------------------------------
    disappear LASTTALKED
    return

    I had included a "setflag 0x1100" command in the battle script. Everything with the battle script works perfectly otherwise. Any help would be appreciated.
     
    7
    Posts
    13
    Years
    • Seen May 16, 2011
    Okay, I'm still trying to figure out how to do this. I just tried to change the scripts, FireRed, so that instead of Oak appearing just before you enter the grass on Route One, he appears the moment you set foot on the second row grass tiles. Now when I set foot on the grass Oak appears, but he's invisible and when I enter the lab it's from the back of the building.

    I tried to alter the script on XSE but it's like I can't save any changes to the actual script, what am I doing wrong? Please help.

    '---------------
    #org 0x1655F9
    lockall
    setvar 0x4001 0x1
    goto 0x8165605

    '---------------
    #org 0x165605
    setvar 0x8004 0x0
    setvar 0x8005 0x2
    special 0x174
    textcolor 0x0
    pause 0x1E
    playsong 0x12E 0x0
    preparemsg 0x817D72C '"OAK: Hey! Wait!\nDon't go out!"
    waitmsg
    pause 0x55
    closeonkeypress
    applymovement MOVE_PLAYER 0x81A75ED
    waitmovement 0x0
    sound 0x15
    applymovement MOVE_PLAYER 0x81A75DB
    waitmovement 0x0
    pause 0x1E
    showsprite 0x3
    compare 0x4001 0x0
    if 0x1 call 0x81656B8
    compare 0x4001 0x1
    if 0x1 call 0x81656C3
    pause 0x1E
    msgbox 0x871A372 MSG_KEEPOPEN '"OAK: That was close!\nWild POKéMON..."
    closeonkeypress
    pause 0x1E
    compare 0x4001 0x0
    if 0x1 call 0x81656CE
    compare 0x4001 0x1
    if 0x1 call 0x81656E0
    setdooropened 0x10 0xD
    doorchange
    applymovement 0x3 0x816572E
    applymovement MOVE_PLAYER 0x8165758
    waitmovement 0x0
    setdoorclosed 0x10 0xD
    doorchange
    setvar 0x4055 0x1
    clearflag 0x2B
    setvar 0x4050 0x1
    setflag 0x2C
    setflag 0x4001
    warp 0x4 0x3 0xFF 0x6 0xC
    waitstate
    releaseall
    end

    '---------------
    #org 0x1656B8
    applymovement 0x3 0x81656F2
    waitmovement 0x0
    return

    '---------------
    #org 0x1656C3
    applymovement 0x3 0x81656FB
    waitmovement 0x0
    return

    '---------------
    #org 0x1656CE
    applymovement 0x3 0x8165705
    applymovement MOVE_PLAYER 0x8165731
    waitmovement 0x0
    return

    '---------------
    #org 0x1656E0
    applymovement 0x3 0x8165719
    applymovement MOVE_PLAYER 0x8165744
    waitmovement 0x0
    return


    '---------
    ' Strings
    '---------
    #org 0x17D72C
    = OAK: Hey! Wait!\nDon't go out!

    #org 0x71A372
    = OAK: That was close!\nWild POKéMON live in tall grass!\pWhew[.]\pA pokmeon can appear at anytime in\ntall grass. \pYou need your own POKéMON for\nyour protection.\pI know!\nHere, come with me!


    '-----------
    ' Movements
    '-----------
    #org 0x1A75ED
    #raw 0x2D 'Face Down (Delayed)
    #raw 0xFE 'End of Movements

    #org 0x1A75DB
    #raw 0x62 'Exclamation Mark (!)
    #raw 0xFE 'End of Movements

    #org 0x16572E
    #raw 0x11 'Step Up (Normal)
    #raw 0x60 'Hide
    #raw 0xFE 'End of Movements

    #org 0x165758
    #raw 0x13 'Step Right (Normal)
    #raw 0x11 'Step Up (Normal)
    #raw 0x60 'Hide
    #raw 0xFE 'End of Movements

    #org 0x1656F2
    #raw 0x11 'Step Up (Normal)
    #raw 0x11 'Step Up (Normal)
    #raw 0x13 'Step Right (Normal)
    #raw 0x11 'Step Up (Normal)
    #raw 0x11 'Step Up (Normal)
    #raw 0x13 'Step Right (Normal)
    #raw 0x11 'Step Up (Normal)
    #raw 0x11 'Step Up (Normal)
    #raw 0xFE 'End of Movements

    #org 0x1656FB
    #raw 0x13 'Step Right (Normal)
    #raw 0x11 'Step Up (Normal)
    #raw 0x11 'Step Up (Normal)
    #raw 0x13 'Step Right (Normal)
    #raw 0x11 'Step Up (Normal)
    #raw 0x11 'Step Up (Normal)
    #raw 0x13 'Step Right (Normal)
    #raw 0x11 'Step Up (Normal)
    #raw 0x11 'Step Up (Normal)
    #raw 0xFE 'End of Movements

    #org 0x165705
    #raw 0x10 'Step Down (Normal)
    #raw 0x12 'Step Left (Normal)
    #raw 0x10 'Step Down (Normal)
    #raw 0x10 'Step Down (Normal)
    #raw 0x10 'Step Down (Normal)
    #raw 0x10 'Step Down (Normal)
    #raw 0x10 'Step Down (Normal)
    #raw 0x10 'Step Down (Normal)
    #raw 0x10 'Step Down (Normal)
    #raw 0x10 'Step Down (Normal)
    #raw 0x10 'Step Down (Normal)
    #raw 0x10 'Step Down (Normal)
    #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 0x2E 'Face Up (Delayed)
    #raw 0xFE 'End of Movements

    #org 0x165731
    #raw 0x10 'Step Down (Normal)
    #raw 0x10 'Step Down (Normal)
    #raw 0x12 'Step Left (Normal)
    #raw 0x10 'Step Down (Normal)
    #raw 0x10 'Step Down (Normal)
    #raw 0x10 'Step Down (Normal)
    #raw 0x10 'Step Down (Normal)
    #raw 0x10 'Step Down (Normal)
    #raw 0x10 'Step Down (Normal)
    #raw 0x10 'Step Down (Normal)
    #raw 0x10 'Step Down (Normal)
    #raw 0x10 'Step Down (Normal)
    #raw 0x10 'Step Down (Normal)
    #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 0xFE 'End of Movements

    #org 0x165719
    #raw 0x10 'Step Down (Normal)
    #raw 0x12 'Step Left (Normal)
    #raw 0x12 'Step Left (Normal)
    #raw 0x10 'Step Down (Normal)
    #raw 0x10 'Step Down (Normal)
    #raw 0x10 'Step Down (Normal)
    #raw 0x10 'Step Down (Normal)
    #raw 0x10 'Step Down (Normal)
    #raw 0x10 'Step Down (Normal)
    #raw 0x10 'Step Down (Normal)
    #raw 0x10 'Step Down (Normal)
    #raw 0x10 'Step Down (Normal)
    #raw 0x10 'Step Down (Normal)
    #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 0x2E 'Face Up (Delayed)
    #raw 0xFE 'End of Movements

    #org 0x165744
    #raw 0x10 'Step Down (Normal)
    #raw 0x10 'Step Down (Normal)
    #raw 0x12 'Step Left (Normal)
    #raw 0x12 'Step Left (Normal)
    #raw 0x10 'Step Down (Normal)
    #raw 0x10 'Step Down (Normal)
    #raw 0x10 'Step Down (Normal)
    #raw 0x10 'Step Down (Normal)
    #raw 0x10 'Step Down (Normal)
    #raw 0x10 'Step Down (Normal)
    #raw 0x10 'Step Down (Normal)
    #raw 0x10 'Step Down (Normal)
    #raw 0x10 'Step Down (Normal)
    #raw 0x10 'Step Down (Normal)
    #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 0xFE 'End of Movements
     

    colcolstyles

    Yours truly
    1,588
    Posts
    15
    Years
  • Is there a command (XSE) I can use to change the player's OW sprite?

    Not that I know of. It can be done but it depends on what, exactly, you want to do. Most long-term solutions would require ASM but if it's merely temporary, you could use a different OW and "pretend" it's the player.
     

    Complans

    Trainer
    98
    Posts
    14
    Years
    • Seen Aug 27, 2015
    Not that I know of. It can be done but it depends on what, exactly, you want to do. Most long-term solutions would require ASM but if it's merely temporary, you could use a different OW and "pretend" it's the player.

    What I'm trying to do is; there is a lapras in the seashore that when you talk to it asks if you want to use surf, if yes, it changes your overworld to a custom lapras sprite (with player ontop), and when you reach another part of another city it dismounts you.

    So, how would I change the player's sprite to another one temporary?
     

    deoxys121

    White Kyurem Cometh
    1,254
    Posts
    13
    Years
  • Creating Landorus Circumstances

    I would like to know if there is any way to recreate the circumstances for being able to battle Landorus in my Pokemon Ruby hack. I'm using PKSV for my script editor. The script works perfectly in all ways for just battling Landorus. But, if possible, I would like to change the script so that you can only battle Landorus if you have Tornadus and Thundurus in your party. In my hack, I have replaced Regirock with Tornadus, Regice with Thundurus, and Registeel with Landorus. Here is the current battle script I have for Landorus, which works perfectly as I said before.

    Code:
    #org 0x8904092
    '-----------------------------------
    checkflag 0x27F
    if true jump 0x89040C5 ' Flag is set
    cry 0xA1 0x193
    pause 0x28
    msgbox 0x89040CB 
    callstd MSG_LOCK ' Built-in lock command
    battle registeel 50 NONE
    special BATTLE_PIXELLATE
    applymovement 0x5 0x89040C7 ' hide walk_up_slow wa...
    pauseevent 0x0
    setflag 0x27F
    release
    end
    
    #org 0x89040C5
    '-----------------------------------
    release
    end
    
    
    #org 0x89040CB
    = Laaooooorrr!!!
    
    #org 0x89040C7
    M hide walk_up_slow walk_up_slow end
     
    Last edited:
    Status
    Not open for further replies.
    Back
    Top