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

Alice

(>^.(>0.0)>
3,077
Posts
15
Years
  • So, I'm having a strange issue with showpokepic. Spent the better part of today searching for fixes or anyone having the same problem at all, and can't find anything. This is what it looks like:
    attachment.php

    Here's the whole script. It uses the player's position to determine which pokeball he's looking at, so I can use the same script on all three of them. I've tried removing that and changing the vars used, and it hasn't helped.
    Code:
    #dynamic 0x801E9C
    
    #org @main
    lock
    getplayerpos 0x4000 0x4001
    compare 0x4000 0x6
    if 0x1 goto @bulbasaurDisplay
    release
    end
    
    ;---------------------------BULBASAUR STUFFS------------------------------
    #org @bulbasaurDisplay
    cry 0x1 0x0
    showpokepic 0x1 0xA 0x3
    msgbox @bulbasaurMessage1 0x5
    closeonkeypress
    compare 0x800D 0x1
    if 0x1 goto @bulbasaurChoose
    hidepokepic
    end
    
    #org @bulbasaurChoose
    hidepokepic
    givepokemon 0x1 0x5 0x0 0x0 0x0 0x0
    fanfare 0x13E
    msgbox @bulbasaurMessage2 0x4
    waitfanfare
    closeonkeypress
    setflag 0x800 ;activate pokemon menu
    hidesprite 0x5
    setflag 0x1206 
    end
    
    #org @bulbasaurMessage1
    = Do you want to take\nthe GRASS type BULBASAUR?
    
    #org @bulbasaurMessage2
    = \v\h01 received the BULBASAUR!
    ;-------------------------------------------------------------------------
     

    Renegade

    Time for real life...
    995
    Posts
    12
    Years
  • So, I'm having a strange issue with showpokepic. Spent the better part of today searching for fixes or anyone having the same problem at all, and can't find anything. This is what it looks like:
    attachment.php

    Here's the whole script. It uses the player's position to determine which pokeball he's looking at, so I can use the same script on all three of them. I've tried removing that and changing the vars used, and it hasn't helped.
    Code:
    #dynamic 0x801E9C
    
    #org @main
    lock
    getplayerpos 0x4000 0x4001
    compare 0x4000 0x6
    if 0x1 goto @bulbasaurDisplay
    release
    end
    
    ;---------------------------BULBASAUR STUFFS------------------------------
    #org @bulbasaurDisplay
    cry 0x1 0x0
    showpokepic 0x1 0xA 0x3
    msgbox @bulbasaurMessage1 0x5
    closeonkeypress
    compare 0x800D 0x1
    if 0x1 goto @bulbasaurChoose
    hidepokepic
    end
    
    #org @bulbasaurChoose
    hidepokepic
    givepokemon 0x1 0x5 0x0 0x0 0x0 0x0
    fanfare 0x13E
    msgbox @bulbasaurMessage2 0x4
    waitfanfare
    closeonkeypress
    setflag 0x800 ;activate pokemon menu
    hidesprite 0x5
    setflag 0x1206 
    end
    
    #org @bulbasaurMessage1
    = Do you want to take\nthe GRASS type BULBASAUR?
    
    #org @bulbasaurMessage2
    = \v\h01 received the BULBASAUR!
    ;-------------------------------------------------------------------------

    This happened to me when I used to hack R/S/E. I'm not sure what the problem is, but just throwing a wild guess out there: Try giving the player the National Pokedex (because bulbasaur is not from the Hoen region) before the "showpokepic" command is executed. I've had this problem before, and I tried everything that I could to fix it but I never tried the National Pokedex.
     

    Satoshi Ookami

    Memento Mori
    14,254
    Posts
    15
    Years
  • So, I have a script which works completely fine except for the fadescreen commands. I want the screen to fade until the end of the script but for some reason it won't stay faded. I even added a pause in there to try to delay when the screen fades back to normal but it won't work. The idea that the script is supposed to execute is unfinished but I wanted to test it before continuing. Can anyone let me know what I am doing wrong? PS. the character starts in black tiles if you need to know.

    Spoiler:
    Can I advise not to use so many movements? IIRC my scripting days there's a limit to how many movements can be executed in one applymovement for script to work...
    It's better to have the OW hidden and then just show it with applymovement =)
     

    Alice

    (>^.(>0.0)>
    3,077
    Posts
    15
    Years
  • This happened to me when I used to hack R/S/E. I'm not sure what the problem is, but just throwing a wild guess out there: Try giving the player the National Pokedex (because bulbasaur is not from the Hoen region) before the "showpokepic" command is executed. I've had this problem before, and I tried everything that I could to fix it but I never tried the National Pokedex.
    The player already has the pokedex and national dex at this point. =/ I tried it without having the pokedex too, and got the same result. I also just tested it with treecko (used 277) instead of bulbasaur, and got this:
    attachment.php
     

    mikefromindyindy

    EDM producer/ pokemon hacker
    7
    Posts
    10
    Years
    • Age 30
    • Seen Jul 27, 2014
    I'm trying to add a script (Person Event) in my Pokémon emerald to activate an "in-game" trade with an npc..(ADD a trade, not edit one.) I've looked EVERYWHERE for tutorial's on this and have literally found not one, in fact, its the sole purpose I even created an account at this website..
    if anyone could help with this or even point me in the right direction, it would be GREATLY appreciated.
     

    Wobbu

    bunger bunger bunger bunger
    2,794
    Posts
    12
    Years
  • The player already has the pokedex and national dex at this point. =/ I tried it without having the pokedex too, and got the same result. I also just tested it with treecko (used 277) instead of bulbasaur, and got this:
    attachment.php

    This worked fine for me.
    excerpt:
    Code:
    showpokepic 0x53 0xA 0x3
    msgbox @msg 0x5
    hidepokepic

    The message says something like 'Farfetch'd, the Wild Duck Pokémon. Is this the Pokémon you want?'
    You may want to check if the actual sprites aren't corrupted.

    I'm trying to add a script (Person Event) in my Pokémon emerald to activate an "in-game" trade with an npc..(ADD a trade, not edit one.) I've looked EVERYWHERE for tutorial's on this and have literally found not one, in fact, its the sole purpose I even created an account at this website..
    if anyone could help with this or even point me in the right direction, it would be GREATLY appreciated.

    Welcome to PC :D
    If you're using XSE, then read this.

    WARNING: MASSIVE WALL OF TEXT!
    WARNING: MASSIVE WALL OF TEXT!
    WARNING: MASSIVE WALL OF TEXT!
    Spoiler:
     
    Last edited:

    Alice

    (>^.(>0.0)>
    3,077
    Posts
    15
    Years
  • Are you sure it's Treecko? Haven't you accidentally written the number of one of 25 ???s?
    I did at first, because I did treecko's actual national dex number, and got the same result. Then I looked up the list of pokemon on diegoisawesome's tutorial thread and it said treecko's number is 277. I also tried 278 just in case, and every time I've gotten the same result.
     

    mikefromindyindy

    EDM producer/ pokemon hacker
    7
    Posts
    10
    Years
    • Age 30
    • Seen Jul 27, 2014
    Thanks much for the reponse and effort in trying to help jsziede, but I still don't understand where u insert the pokemon(s) that are getting traded, levels ect.. ive copyed the mauville (ralts for seedot) trade script and have been toying with it for a couple days now.. added my own offset and flag (just for an example), now when I load it into the rom it works, but its the same as the mauville trade (obviously) I just cant figure out how to change the pokemon up for trade.. after I do that I can easily change the texts and stuff.. heres what it looks like..


    #org 0x800000
    lock
    faceplayer
    checkflag 0x1200
    if 0x1 goto 0x82159D5
    setvar 0x8008 0x0
    copyvar 0x8004 0x8008
    special2 LASTRESULT 0xFF
    copyvar 0x8009 LASTRESULT
    msgbox 0x82159E8 MSG_YESNO '"Huh? My POKéMON is cute?\nSure, I ..."
    compare LASTRESULT 0x0
    if 0x1 goto 0x82159BD
    special 0xA2
    waitstate
    copyvar 0x800A 0x8004
    compare 0x8004 0xFF
    if 0x1 goto 0x82159BD
    copyvar 0x8005 0x800A
    special2 LASTRESULT 0x102
    copyvar 0x800B LASTRESULT
    comparevars LASTRESULT 0x8009
    if 0x5 goto 0x82159C7
    copyvar 0x8004 0x8008
    copyvar 0x8005 0x800A
    special 0x100
    special 0x101
    waitstate
    msgbox 0x8215A77 MSG_KEEPOPEN '"Eheheh[.]\nPlease be good to my PO..."
    setflag 0x1200
    release
    end
    '---------------
    #org 0x2159D5
    msgbox 0x8215B17 MSG_KEEPOPEN '"Any POKéMON can be cute if you rai..."
    release
    end
    '---------------
    #org 0x2159BD
    msgbox 0x8215ACE MSG_KEEPOPEN '"Oh, if you don't want to, that's o..."
    release
    end
    '---------------
    #org 0x2159C7
    bufferpokemon 0x0 0x8009
    msgbox 0x8215A9D MSG_KEEPOPEN '"Huh? That doesn't look anything li..."
    release
    end

    '---------
    ' Strings
    '---------
    #org 0x2159E8
    = Huh? My POKéMON is cute?\nSure, I knew that.\pBut if you really want, I'm willing\nto trade it to you.\pI'll trade you my [buffer2] for\na [buffer1] if you want.
    #org 0x215A77
    = Eheheh[.]\nPlease be good to my POKéMON.
    #org 0x215B17
    = Any POKéMON can be cute if you raise\nit with care and kindness.
    #org 0x215ACE
    = Oh, if you don't want to, that's okay.\nBut my POKéMON is cute, you know[.]
    #org 0x215A9D
    = Huh? That doesn't look anything like\na [buffer1] to me.



    idk how to make a "spoiler" thing so if someone could tell me, that would be great..
     

    Wobbu

    bunger bunger bunger bunger
    2,794
    Posts
    12
    Years
  • Thanks much for the reponse and effort in trying to help jsziede, but I still don't understand where u insert the pokemon(s) that are getting traded, levels ect.. ive copyed the mauville (ralts for seedot) trade script and have been toying with it for a couple days now.. added my own offset and flag (just for an example), now when I load it into the rom it works, but its the same as the mauville trade (obviously) I just cant figure out how to change the pokemon up for trade.. after I do that I can easily change the texts and stuff.. heres what it looks like..


    Spoiler:

    To make a spoiler, have spoiler tags surround the text that you want to hide.
    [SPOILER]This is an example.[/SPOILER]

    I found a tutorial, but I think that you need to use thingy32 (a hex editor) because the hex editor that I tried couldn't find the names of the Pokémon.

    Spoiler:
     

    destinedjagold

    You can contact me in PC's discord server...
    8,593
    Posts
    16
    Years
    • Seen Dec 23, 2023
    So, I'm having a strange issue with showpokepic. Spent the better part of today searching for fixes or anyone having the same problem at all, and can't find anything. This is what it looks like:
    attachment.php

    Here's the whole script. It uses the player's position to determine which pokeball he's looking at, so I can use the same script on all three of them. I've tried removing that and changing the vars used, and it hasn't helped.
    Code:
    #dynamic 0x801E9C
    
    #org @main
    lock
    getplayerpos 0x4000 0x4001
    compare 0x4000 0x6
    if 0x1 goto @bulbasaurDisplay
    release
    end
    
    ;---------------------------BULBASAUR STUFFS------------------------------
    #org @bulbasaurDisplay
    cry 0x1 0x0
    showpokepic 0x1 0xA 0x3
    msgbox @bulbasaurMessage1 0x5
    closeonkeypress
    compare 0x800D 0x1
    if 0x1 goto @bulbasaurChoose
    hidepokepic
    end
    
    #org @bulbasaurChoose
    hidepokepic
    givepokemon 0x1 0x5 0x0 0x0 0x0 0x0
    fanfare 0x13E
    msgbox @bulbasaurMessage2 0x4
    waitfanfare
    closeonkeypress
    setflag 0x800 ;activate pokemon menu
    hidesprite 0x5
    setflag 0x1206 
    end
    
    #org @bulbasaurMessage1
    = Do you want to take\nthe GRASS type BULBASAUR?
    
    #org @bulbasaurMessage2
    = \v\h01 received the BULBASAUR!
    ;-------------------------------------------------------------------------

    Try this...
    Code:
    ...
    showpokepic 0x1 0xA 0x3
    pause 0x1
    showpokepic 0x1 0xA 0x3
    ...
    In theory, although I already proven this, the first pokepic box will display the wrong palletes, and I never actually learned how to fix that.
    Although a temporary solution is to quickly hide the first showpokpic command and then add a second showpokepic command.


    The player already has the pokedex and national dex at this point. =/ I tried it without having the pokedex too, and got the same result. I also just tested it with treecko (used 277) instead of bulbasaur, and got this:
    attachment.php

    Make sure you wrote
    Code:
    showpokepic [COLOR="Blue"]277[/COLOR] 0xA 0x3
    instead of
    Code:
    showpokepic [COLOR="Red"]0x277[/COLOR] 0xA 0x3
     

    DrFuji

    [I]Heiki Hecchara‌‌[/I]
    1,691
    Posts
    14
    Years
  • Thanks much for the reponse and effort in trying to help jsziede, but I still don't understand where u insert the pokemon(s) that are getting traded, levels ect.. ive copyed the mauville (ralts for seedot) trade script and have been toying with it for a couple days now.. added my own offset and flag (just for an example), now when I load it into the rom it works, but its the same as the mauville trade (obviously) I just cant figure out how to change the pokemon up for trade.. after I do that I can easily change the texts and stuff.. heres what it looks like..

    In addition to what jsziede has said, ZodiacDaGreat's tool, Trader Advanced, allows you to easily change what Pokemon the game asks for in a trade as well as customising what you will receive in return.
     

    Tlachtli

    Crit happens.
    267
    Posts
    12
    Years
  • I posted this in the thread for the Gen IV move split in Gen III, but I thought I'd ask here as well in case anyone here is familiar with Darthatron's work. I want to try to port his routine for the Physical/Special/Status sprites he designed for FR to Emerald. This is the original post, and this is a post by Jambo51 with some fix suggestions.

    Change these bytes:
    Code:
    @0813A130: 0x2F
    @0813A17B: 0x47
    @0813A1A0: [Pointer to Routine, plus 1 (one).]

    I'm trying to do an Emerald hack and see no one has successfully ported the sprites for Emerald yet (or at least done so and posted it yet). I want to do it myself, but I have a question: what is the purpose of changing those first two bytes? I'm trying to find their Emerald equivalents, but no luck yet. I've tried putting read breaks on them in a FR rom, but never seem to trigger a read so I can't tell what they do.

    I have an idea of numbers should work for BPEE, but since I haven't found the right address for the routine pointer in Emerald yet I haven't tested it:
    Code:
    .MoveBase:  .word 0x0831C898
    .number: .word 0x00003258
    .CurMoveIndex: .word 0x0201170C
    .Move_List_Loc:  .word 0x0201042C
    .VRAM:   .word 0x06001800  [B][1][/B]
    .SplitImages: .word 0x08E3CFB0 (just where I have it stored)
    .Some_Offset: .word 0x0203cf1c  [B][2][/B]
    .Return_Addr: .word 0x081C3F6C  [B][2][/B]
    [1] I assume this is empty/otherwise unused VRAM used to store the sprites? It doesn't seem to be used in a clean rom.
    [2] I have potential 2 addresses in mind here, but I haven't been able to test to see which works, if at all.
     

    karatekid552

    What happens if I push it?....
    1,771
    Posts
    11
    Years
  • I posted this in the thread for the Gen IV move split in Gen III, but I thought I'd ask here as well in case anyone here is familiar with Darthatron's work. I want to try to port his routine for the Physical/Special/Status sprites he designed for FR to Emerald. This is the original post, and this is a post by Jambo51 with some fix suggestions.



    I'm trying to do an Emerald hack and see no one has successfully ported the sprites for Emerald yet (or at least done so and posted it yet). I want to do it myself, but I have a question: what is the purpose of changing those first two bytes? I'm trying to find their Emerald equivalents, but no luck yet. I've tried putting read breaks on them in a FR rom, but never seem to trigger a read so I can't tell what they do.

    I have an idea of numbers should work for BPEE, but since I haven't found the right address for the routine pointer in Emerald yet I haven't tested it:
    Code:
    .MoveBase:  .word 0x0831C898
    .number: .word 0x00003258
    .CurMoveIndex: .word 0x0201170C
    .Move_List_Loc:  .word 0x0201042C
    .VRAM:   .word 0x06001800  [B][1][/B]
    .SplitImages: .word 0x08E3CFB0 (just where I have it stored)
    .Some_Offset: .word 0x0203cf1c  [B][2][/B]
    .Return_Addr: .word 0x081C3F6C  [B][2][/B]
    [1] I assume this is empty/otherwise unused VRAM used to store the sprites? It doesn't seem to be used in a clean rom.
    [2] I have potential 2 addresses in mind here, but I haven't been able to test to see which works, if at all.

    Those two bytes are the hex representation of bx r5. Meaning, that his change changes the pointer that was loaded into r5 earlier, and now you are branching to that address.

    The vram should be the same, as that is GBA Hardware based, and not game specific. That is the actual location that the screen reads images from, meaning you are writing the images directly to the screen.

    The RAM offsets (02XXXXXX) are going to be different, so you need to find where they are the same. The current move index should be easy. Just use the cheat finder in VBA to find RAM bytes that always display the current move.

    The return address is returning to the routine which was branched. You will have to find the routine by searching for similar bytes in a hex editor.

    Edit: This is in the wrong thread. This goes in Simple Questions.
     
    1
    Posts
    10
    Years
    • Seen Aug 11, 2013
    hi, i have a script to give a zubat as a starter, the script works fine only when compiled it gives a nidoran. I looked up the hex value for zubat in the stdpoke.rbh file, and its 0x29, but when compiled xse changes that to 0x1D. what am I doing wrong?

    here's the script
    Spoiler:
     

    karatekid552

    What happens if I push it?....
    1,771
    Posts
    11
    Years
  • hi, i have a script to give a zubat as a starter, the script works fine only when compiled it gives a nidoran. I looked up the hex value for zubat in the stdpoke.rbh file, and its 0x29, but when compiled xse changes that to 0x1D. what am I doing wrong?

    here's the script
    Spoiler:

    Why would you ever give Zubat as a starter??? You must not have grown up without Flash in Dark Cave. /me shudders....
    ----

    Anyways.XD Read this: http://www.romhackersonline.com/showthread.php?t=14110-Flags-Vars-and-Script-Tiles

    That will help with some other issues in your script. Your issue does not happen to me. It compiles fine in my case. Make sure you are using XSE 1.1.1 or the version found on Gamer2020's tools thread.

    Edit:
    Code:
    #include stditems.rbh
    #include stdpoke.rbh
    
    '---------------
    #org 0x3B4D84
    faceplayer
    lock
    hidesprite LASTTALKED
    fanfare 0x13E
    msgbox 0x83B4DCB MSG_NORMAL '"[player] found a /nZubat!"
    givepokemon PKMN_ZUBAT 0x5 ITEM_NONE 0x0 0x0 0x0
    waitfanfare
    setflag 0x1000
    setflag 0x800
    msgbox 0x83B4DE1 MSG_YESNO '"Would you like to give a nickname ..."
    compare LASTRESULT 0x1
    if 0x1 call 0x83B4DC4
    closeonkeypress
    release
    end
    
    '---------------
    #org 0x3B4DC4
    call 0x81A74EB
    return
    
    '---------------
    #org 0x1A74EB
    fadescreen 0x1
    special 0x9E
    waitstate
    return
    
    
    '---------
    ' Strings
    '---------
    #org 0x3B4DCB
    = [player] found a /nZubat!
    
    #org 0x3B4DE1
    = Would you like to give a nickname to Zubat?

    This is what it compiled to in my test rom.
     

    Alice

    (>^.(>0.0)>
    3,077
    Posts
    15
    Years
  • Try this...
    Code:
    ...
    showpokepic 0x1 0xA 0x3
    pause 0x1
    showpokepic 0x1 0xA 0x3
    ...
    In theory, although I already proven this, the first pokepic box will display the wrong palletes, and I never actually learned how to fix that.
    Although a temporary solution is to quickly hide the first showpokpic command and then add a second showpokepic command.
    I hate to say it, but there's no difference whatsoever. Copied it exactly as you wrote it.

    Edit: If I display the picture of one pokemon, and then show another afterward, only the first one is messed up, like you said... but it only works if the two pokemon are different.


    Make sure you wrote
    Code:
    showpokepic [COLOR=Blue]277[/COLOR] 0xA 0x3
    instead of
    Code:
    showpokepic [COLOR=Red]0x277[/COLOR] 0xA 0x3
    Omg, I'm so dumb... I told it to show pokemon 600-something. lol
     
    Last edited:
    69
    Posts
    11
    Years
    • Seen Nov 17, 2013
    Does anyone know how to change which map the player spawns in? I know the "sethealplace" command (I think that's what its called) but how do I change which map it makes you come to?
     

    karatekid552

    What happens if I push it?....
    1,771
    Posts
    11
    Years
  • Does anyone know how to change which map the player spawns in? I know the "sethealplace" command (I think that's what its called) but how do I change which map it makes you come to?

    That is the command that will change where you go when you whiteout after losing a battle. It has preset locations:

    FireRed:
    0x01 = Player's House
    0x02 = Viridian City
    0x03 = Pewter City
    0x04 = Cerulean City
    0x05 = Lavender Town
    0x06 = Vermilion City
    0x07 = Celadon City
    0x08 = Fuchsia City
    0x09 = Cinnabar Island
    0x0A = Indigo Plateau/Pokemon League Entrance
    0x0B = Saffron City
    0x0C = Route 4/Mt. Moon Entrance
    0x0D = Route 10/Rock Tunnel Entrance
    0x0E = One Island
    0x0F = Two Island
    0x10 = Three Island
    0x11 = Four Island
    0x12 = Five Island
    0x13 = Seven Island
    0x14 = Six Island

    ^Notice Seven and Six Island are switched

    Emerald (Probably the same as RS):
    0x01 = Player's Room (male)
    0x02 = Player's Room (female)
    0x03 = Petalburg City
    0x04 = Slateport City
    0x05 = Mauville City
    0x06 = Rustboro City
    0x07 = Fortree City
    0x08 = Lilycove City
    0x09 = Mossdeep City
    0x0A = Sootopolis City
    0x0B = Ever Grande City (Victory Road)
    0x0C = Littleroot Town (left)
    0x0D = Littleroot Town (right)
    0x0E = Oldale Town
    0x0F = Dewford Town
    0x10 = Lavaridge Town
    0x11 = Fallarbor Town
    0x12 = Verdanturf Town
    0x13 = Pacifidlog Town
    0x14 = Ever Grande City (Pokemon League)
    0x15 = Southern Island Edit: <-OMG
    0x16 = Battle Frontier
     
    69
    Posts
    11
    Years
    • Seen Nov 17, 2013
    What if I wanted to make the player spawn in the middle of Pallet town, for example? Thanks for the list of locations!
     
    Status
    Not open for further replies.
    Back
    Top