• 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.
5,256
Posts
16
Years
  • Hey guys. Can someone help me get my script to work which starts a wild battle after defeating a trainer? I have this so far, but as of now, the game exits the script and only battles after I click on the same sprite again. I can't seem to identify what is wrong, and it shouldn't even be that difficult. Help?

    Spoiler:

    You need to use trainerbattle 0x1

    Code:
    #dynamic 0x80BEBE
    
    #org @start
    trainerbattle 0x1 0x00F 0x1 @before @after @snippet1
    
    #org @snippet1
    wildbattle 0x9F 0x19 0xD1
    fadescreen 0x1
    fadescreen 0x0
    msgbox @beaten 0x6
    fadescreen 0x0
    //Hidesprites are so that you can only challenge one of the trainers
    hidesprite 0x7
    hidesprite 0x8
    hidesprite 0x9
    setflag 0x1212
    release
    end
    
    #org @before
    = Sorry, to break it to you, but I'm\nnot about to let you pass.\pUnless you think you can beat me?
    
    #org @after
    = Y-You... You're tough! TRUDLEY and\nFOLLY can't be blamed for losing!\pI guess I have to use my SHADOW\nPOKEMON!
    
    #org @beaten
    = You haven't seen the last of us!

    edit the flag you're using is unsafe. iirc, 0x200 to 0x400 are the only truly safe flags, definitely 0x200 to 0x2ff
     
    Last edited:
    510
    Posts
    11
    Years
    • Seen May 11, 2024
    Thanks for the reply. So special 0x108 is for the diploma? IIRC, there should be two, one for regional and another for national dex, right? Where is the other one? And where do I change the amount of Pokémon for the national dex?

    Thanks in advance.

    Can anyone clarify this, please?
     

    GoGoJJTech

    (☞゚ヮ゚)☞ http://GoGoJJTech.com ☜(゚ヮ゚☜)
    2,475
    Posts
    11
    Years
  • Can anyone clarify this, please?

    Actually, they're the same special. They just check what dex you currently own, and then choose the text and tilemap that go with it. That's all. It has a few branches in between that decide this.
     
    510
    Posts
    11
    Years
    • Seen May 11, 2024
    Actually, they're the same special. They just check what dex you currently own, and then choose the text and tilemap that go with it. That's all. It has a few branches in between that decide this.

    But if I replace it by the command givepokemon, as mentioned above, how does it check the dex I have? My plan was to give one pokémon after completing the regional dex, and another after completing the national dex. But if I understood you correctly, if I remove the special it doesn't check anything, right?
     
    26
    Posts
    12
    Years
    • Seen Aug 10, 2015
    Game: FireRed
    Editor: XSE

    Hello, so my problem is that this is supposed to be a starter battle (like a rival battle in the beginning of the game) my problem is that if I lose I black out and reappear in my house, is there a way to get the script to continue even if I lose the battle?

    Someone already told me to switch trainerbattle 0x9 0x03A 0x0 -> trainerbattle 0x9 0x03A 0x3
    But that didn't make a difference in the game :/

    Spoiler:
     

    thetripplenine

    tripple.
    98
    Posts
    11
    Years
  • Game: FireRed
    Editor: XSE

    Hello, so my problem is that this is supposed to be a starter battle (like a rival battle in the beginning of the game) my problem is that if I lose I black out and reappear in my house, is there a way to get the script to continue even if I lose the battle?

    Someone already told me to switch trainerbattle 0x9 0x03A 0x0 -> trainerbattle 0x9 0x03A 0x3
    But that didn't make a difference in the game :/

    Spoiler:

    Try changing the 0x0 to 0x3 in the trainerbattle part that allows the script to continue after you lose.
     
    26
    Posts
    12
    Years
    • Seen Aug 10, 2015
    Try changing the 0x0 to 0x3 in the trainerbattle part that allows the script to continue after you lose.

    :D thanks that worked, but now my problem is that there are two battles, back-to-back, and adding 0x03 makes it repeat oaks script :/ is there a way to bypass that?
     
    26
    Posts
    12
    Years
    • Seen Aug 10, 2015
    Can you show what the new script looks like, and the part that repeats itself.

    I have no idea what part is Oak's.


    Spoiler:


    The red parts are the two back-to-back battles that are the initial rival battles, my original problem was that if I lost the battle, it blacked out, this was fixed by replacing the 0x0 with 0x3 in the trainerbattle line, but now my problem is that the 0x3 initiates Oak's script (which is basically him teaching you how to fight in the beginning of the game) but if I add this to both the trainerbattles then Oak's script repeats itself in both battles

    My question would be is it be possible to have my battle script continue even if I lose, but without having to have Oak's script there?
     

    Tlachtli

    Crit happens.
    267
    Posts
    12
    Years
  • Editor: BSP

    Is it possible to call an asm routine from within a battle script? I'm trying to make some new move effects, but unlike overworld scripting it doesn't seem to have a callasm command predefined.
     

    Rezordaxx

    Asks many questions!
    290
    Posts
    10
    Years
  • made this script looks fine to me compiles fine but then if i open it again it looks wierd

    I took 1000 bytes space
    editor is XSE

    original
    Spoiler:


    after compile and save
    Spoiler:
     
    416
    Posts
    11
    Years
    • Seen Feb 10, 2024
    try changing your battle style from 0x4 to 0x1... 0x1 is a continuation battle, 0x4 is a double battle, I see by your text that you have a double battle there... but for the fight you select double battle in A-trainer. the 0x4 battle type is for connecting 2 sprites into a double battle I think... and Im not sure how it works. but making that a 0x1 should fix your script.

    If that fails... try making it a 0x3 battle with an actual text box for the script before the battle, and only one offset to the text when you win the battle. then dont jump to another offset...

    something like this:

    ...
    hidepokepic
    msgbox @beforematch
    showmsg
    trainerbattle 0x3 0x19 @aftermatch
    showpokepic 0x4 0x0 0x4
    msgbox @003 0x6
    ...

    #org @beforematch
    = LETS RUMBLE!

    #org @aftermatch
    = NO YOU FOOL!\nYOU kILLED US BOTH!
     

    Zen-senpai

    Intermediate Scripter
    21
    Posts
    11
    Years
    • Seen Dec 4, 2016
    I'm trying to test this script out on my new, upcoming hack (Pokemon Asper). However, it seems very glitchy for some unknown reason. Plus, the person is not in the location it's supposed to be. Here is my script: (editor is XSE, idea is that an old man moves up to you, gives you a pkmn and then moves to the side of the 'Steels Cave')

    Spoiler:
     

    destinedjagold

    You can contact me in PC's discord server...
    8,593
    Posts
    16
    Years
    • Seen Dec 23, 2023
    I'm trying to test this script out on my new, upcoming hack (Pokemon Asper). However, it seems very glitchy for some unknown reason. Plus, the person is not in the location it's supposed to be. Here is my script: (editor is XSE, idea is that an old man moves up to you, gives you a pkmn and then moves to the side of the 'Steels Cave')

    Spoiler:

    Code:
    ...
    givepokemon [COLOR="Red"]0x304[/COLOR] 0x5 0x0 0x0 0x0 0x0
    ...
    Converting the hex number 0x304 to decimal, and you get 772.
    There is no PKMN (in the 3rd gen games) that has that number.
    If you are confused with hex numbers, then I suggest you simply type...

    Code:
    givepokemon [COLOR="red"]304[/COLOR] 0x5 0x0 0x0 0x0 0x0
    ...and XSE will automatically convert decimal numbers into hex.

    Code:
    ...
    fanfare 0x13E
    msgbox @2 [COLOR="Blue"]0x4[/COLOR]
    waitfanfare
    closeonkeypress
    ...
    If you are going to use the [closeonkeypress] command, the message should be 0x4 instead of 0x6.

    the person is not in the location it's supposed to be.

    Check that map if it has level scripts that moves the NPC elsewhere in the map.
     

    Zen-senpai

    Intermediate Scripter
    21
    Posts
    11
    Years
    • Seen Dec 4, 2016
    Code:
    ...
    -snip-[/quote]
    
    Thanks a ton! I really appreciate the help.
    
    I wasn't paying attention for the 0x304 part for givepokemon... -_- sigh... I rush too much.
    
    I'm not home to try it at the moment but I will try it asap and report back on the "person isn't where it's supposed to be" issue.
    
    Thanks again!
     

    Jehowi

    Your Master Superior
    61
    Posts
    15
    Years
  • Could someone please help me out with this issue I'm having with my Pokémon Firered rom?

    I started changing the map of Pallet Town in Advanced Map. The biggest changes I did was changing the tileset from 1 to 3 (3 is the Pewter City tileset, since I wanted to add the Pewter Museum) and I also made the map a bit bigger. I didn't change any scripts, nor places where they occur, I didn't move anything around... all I did was changing the map a bit.

    So... the problem. When I tested it out, I get to the intro of Professor Oak. All is good at that point. Right after the intro, I appear in my house in Pallet Town, upstairs, but instead of appearing in front of the SNES, I appear left of my bed. When I go downstairs and out of the house, everything's black and the game is unplayable. I made a backup before changing the map, and when I tested that one out, so without any changes to Pallet Town, it worked just fine.

    Here's the video of the issue i'm having:

    https://youtu.be/d3x3vd05RQM

    if anybody wants to try out the game, send me a pm and I'll upload the file. I'll be testing out a few more things myself as well.

    Edit: Apparently this happens because I changed the size of the map. This never happened on the Pokémon Ruby hack I made before though... Any way to fix this?
     
    Last edited:
    25
    Posts
    10
    Years
    • Seen Feb 21, 2018
    Could someone please help me out with this issue I'm having with my Pokémon Firered rom?

    I started changing the map of Pallet Town in Advanced Map. The biggest changes I did was changing the tileset from 1 to 3 (3 is the Pewter City tileset, since I wanted to add the Pewter Museum) and I also made the map a bit bigger. I didn't change any scripts, nor places where they occur, I didn't move anything around... all I did was changing the map a bit.

    So... the problem. When I tested it out, I get to the intro of Professor Oak. All is good at that point. Right after the intro, I appear in my house in Pallet Town, upstairs, but instead of appearing in front of the SNES, I appear left of my bed. When I go downstairs and out of the house, everything's black and the game is unplayable. I made a backup before changing the map, and when I tested that one out, so without any changes to Pallet Town, it worked just fine.

    Here's the video of the issue i'm having:

    https://youtu.be/d3x3vd05RQM

    if anybody wants to try out the game, send me a pm and I'll upload the file. I'll be testing out a few more things myself as well.

    Edit: Apparently this happens because I changed the size of the map. This never happened on the Pokémon Ruby hack I made before though... Any way to fix this?


    not quire sure why you start off in a different place, same thing happened to me when i was editing pallet town but i was doing scripting instead of map making... anyway this may sound obvious but you should double check on the warps and make sure its going to the right place, this happens to a lot of people even though its so simple... i also advise u make sure your 'door' that you're exiting into your new pallet town has the right behaviour bytes (block editor... if its not the standard door in the map)... if u want to check whether its the map and not another issue, you should start a normal fresh game, save in game in the first route then overrite that game gba. file (to the one u edited with new pallet town) and walk down into the route and see what happens...

    okay so in my hack after beating the league the second time prof. oak is supposed to walk up to you and tell you that johto is now open bla bla bla...

    ive done some testing and it seems my problem is that i dont have a working flag that indicates that the league has been beaten twice... i was using 'checktrainerflag 0x2E5' (as u have to fight THIS particular new improved gary), but when i beat him theres no difference... can someone help me? or tell me a better usable flag, cause there seems to be none :(
     
    Last edited by a moderator:
    416
    Posts
    11
    Years
    • Seen Feb 10, 2024
    okay so in my hack after beating the league the second time prof. oak is supposed to walk up to you and tell you that johto is now open bla bla bla...

    ive done some testing and it seems my problem is that i dont have a working flag that indicates that the league has been beaten twice... i was using 'checktrainerflag 0x2E5' (as u have to fight THIS particular new improved gary), but when i beat him theres no difference... can someone help me? or tell me a better usable flag, cause there seems to be none :(

    Trainerflags are simply regular flags -500... so try just checkflag 0x7E5

    heres the problem. GENERALLY when you beat the E4 you clear out those flags so you can fight the E4 again. so its likely that flag is not set. If this is not the issue, try actually setting a safe flag after beating the E4 the second time... and checking for that flag...
     
    25
    Posts
    10
    Years
    • Seen Feb 21, 2018
    Trainerflags are simply regular flags -500... so try just checkflag 0x7E5

    heres the problem. GENERALLY when you beat the E4 you clear out those flags so you can fight the E4 again. so its likely that flag is not set. If this is not the issue, try actually setting a safe flag after beating the E4 the second time... and checking for that flag...

    yeah that's what i was trying for ages but setting flags there always ended up in some kind of glitch, but turns out i was setting it at the wrong place... now my flag works :)... but none of my scripts do -.-... him walking to you doesn't work (tried every type of script type in header view, even tried to incorporate it in the current scripts), him simply appearing at a spot for you to talk to doesn't work either (header view again), and my level scripts, the ones preventing you from actually leaving pallet town don't work either -.-
     
    Status
    Not open for further replies.
    Back
    Top