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

Joltix

Don't Steal My Thunder
19
Posts
10
Years
    • Seen Oct 19, 2016
    Thanks a lot! However when I compile with the squarebrackets it just converts the brackets into spaces and plops 'black em' into the chatbox

    Have you tried removing the black_em as I think black is the default color.
     

    M0ZEPH

    Formally 'Resultz' - Returned!
    76
    Posts
    10
    Years
    • Seen Mar 30, 2014
    Have you tried removing the black_em as I think black is the default color.

    That could explain it, although i always thought it was grey, haha. Thanks :)


    OKAY,
    Sorry to be annoying but when I talk to this guy in game I get glitchy text.
    I need him to block a way until pokedex has been received, then battle you and hide after losing.
    Spoiler:
     
    Last edited:
    252
    Posts
    11
    Years
    • Seen Jul 6, 2019
    That could explain it, although i always thought it was grey, haha. Thanks :)


    OKAY,
    Sorry to be annoying but when I talk to this guy in game I get glitchy text.
    I need him to block a way until pokedex has been received, then battle you and hide after losing.
    Spoiler:
    Well I'm seeing checkflag 0x861, but where's setflag 0x861? You need to set a flag before you check it lol. I made a change to your script (in bold), see if that works out.

    EDIT: nvm, this will set the flag after you talk to the guy, which you don't want. Edit the script of the professor so that the flag is set when you get the pokedex from him lol
     
    Last edited:

    karatekid552

    What happens if I push it?....
    1,771
    Posts
    11
    Years
  • Well I'm seeing checkflag 0x861, but where's setflag 0x861? You need to set a flag before you check it lol. I made a change to your script (in bold), see if that works out.

    Dude, no you don't. Flags overreach into other scripts, meaning you could set a flag at the beginning of the game and then check it in the hall of fame. In this case, flags in the 0x800s tend to be used for items like badges and the pokedex/pokemon menus. Meaning you don't need to set them before checking them.
     
    252
    Posts
    11
    Years
    • Seen Jul 6, 2019
    Dude, no you don't. Flags overreach into other scripts, meaning you could set a flag at the beginning of the game and then check it in the hall of fame. In this case, flags in the 0x800s tend to be used for items like badges and the pokedex/pokemon menus. Meaning you don't need to set them before checking them.
    Yeah sorry about that, that was a mistake on my part lol. My brain never functions correctly when I'm tired :p. Anyway I edited my post acknowledging my mistake.
     

    M0ZEPH

    Formally 'Resultz' - Returned!
    76
    Posts
    10
    Years
    • Seen Mar 30, 2014
    The flag is not yet set could that be the problem though? and yeah it's Emerald's pokedex menu. im not yet round to scripting that part.

    Is there any massive hole in the script that could easily be recognisable as a problem?

    Thanks!
     
    9
    Posts
    10
    Years
  • I have been working on a script this morning and everything is working fine. But i got 1 problem which i cant find a solution for. At the end of the script (I made it colored green so its easier to find) I make the player warp towards the pokemon lab. And after that I hide the last remaining sprite on the map. But apparently the warp command takes some time and before i'm warped out I can see the last sprite disappearing which looks really bad. Is there a way to still hide the sprite after I warp out without seeing it on screen? (I want the sprite to hide so the next time you enter the map all the sprites are gone)

    Spoiler:
     

    cjcman95

    codycarol95
    35
    Posts
    10
    Years
  • Does anyone know how to make a script where when you receive the pokemon from a person, that pokemon has a specific set moves instead of having it's regular moves?
     
    1,085
    Posts
    14
    Years
    • Seen Aug 26, 2023
    I've made a script for a givepokemon, but I forgot to add the fadescreen and the hidesprite so that he doesn't stay there anymore, and you don't have to go back into the house. Problem is, I've converted it into Advance-Map format and now it's way more difficult. If anyone could help me, it would be awesome:

    Code:
    '---------------
    #org 0x739F59
    lock
    faceplayer
    checkflag 0x1200
    if 0x1 goto 0x8739879
    msgbox 0x87398B7 MSG_YESNO '"PROF BIRCH: Hey, [player]! How are..."
    compare LASTRESULT 0x1
    if 0x1 goto 0x8739885
    msgbox 0x8739974 MSG_NORMAL '"Oh? I thought you always wanted a\..."
    release
    end
    
    '---------------
    #org 0x739879
    faceplayer
    msgbox 0x8739A70 MSG_NORMAL '"How's Eevee? I wish you luck on\ny..."
    release
    end
    
    '---------------
    #org 0x739885
    faceplayer
    msgbox 0x87399D0 MSG_NORMAL '"Awesome! Here you go, I hope you\n..."
    givepokemon 0x85 0x5 0x0 0x0 0x0 0x0
    fanfare 0x13E
    msgbox 0x8739A58 MSG_NORMAL '"[player] recieved an Eevee!"
    waitfanfare
    setflag 0x1200
    msgbox 0x87399FF MSG_NORMAL '"Eevee's happy! I'm sure you'll be\..."
    release
    end
    
    
    '---------
    ' Strings
    '---------
    #org 0x7398B7
    = PROF BIRCH: Hey, [player]! How are you?\nI've been looking for you\leverywhere. Your mother had asked\lme to gift you a POKéMON, and I\lwas like why not? So do you want\lan Eevee? It's really cute!
    
    #org 0x739974
    = Oh? I thought you always wanted a\nPOKéMON. I'll still be waiting\lhere, so take your time!
    
    #org 0x739A70
    = How's Eevee? I wish you luck on\nyour journey, [player]. I suggest you go\land collect the 8 Gym Badges of\lTropio. It will help Eevee become\lmore better, and it will train you\las a person too! Maybe, one day\lyou can look up to becoming the\lchampion! Good luck, [player]! I'm\lrooting for you!
    
    #org 0x7399D0
    = Awesome! Here you go, I hope you\nlike Eevee!
    
    #org 0x739A58
    = [player] recieved an Eevee!
    
    #org 0x7399FF
    = Eevee's happy! I'm sure you'll be\na great trainer. Don't forget to\lsay bye to your mom!
     

    destinedjagold

    You can contact me in PC's discord server...
    8,593
    Posts
    16
    Years
    • Seen Dec 23, 2023
    I have been working on a script this morning and everything is working fine. But i got 1 problem which i cant find a solution for. At the end of the script (I made it colored green so its easier to find) I make the player warp towards the pokemon lab. And after that I hide the last remaining sprite on the map. But apparently the warp command takes some time and before i'm warped out I can see the last sprite disappearing which looks really bad. Is there a way to still hide the sprite after I warp out without seeing it on screen? (I want the sprite to hide so the next time you enter the map all the sprites are gone)

    Spoiler:

    the warp command should always be a last command in a script, because the other commands after it won't be executed anymore.
    Code:
    ...
    applymovement 0xFF @move6
    msgbox @talk5 0x6
    hidesprite 0x04
    [COLOR="Blue"]setflag 1201[/COLOR]
    [COLOR="Red"]warp 0x1 0x4 0x0 0x0 0x0[/COLOR]
    end
    ...
    ...also, are you sure that it's [setflag 1201], not [setflag 0x1201]?
     

    AstralComet

    PKMN-Trainer
    21
    Posts
    10
    Years
    • Seen Jan 21, 2015
    What version of XSE do you have? I have seen this issue with v1.0.0. You need the latest from Gamer2020's tools thread. Also, that var is a terrible option in my opinion. var 0x4000 is very unreliable due to being a temporary var.

    I downloaded the newest XSE and compiled it again and now it worked. Thanks! :)
    Also, which var would you suggest if 0x4000 is unstable?
     
    9
    Posts
    10
    Years
  • XSE gives me a error on line 9. Error code: Type mismatch no #define. But i have no clue what i'm doing wrong.
    Spoiler:
     

    karatekid552

    What happens if I push it?....
    1,771
    Posts
    11
    Years
  • XSE gives me a error on line 9. Error code: Type mismatch no #define. But i have no clue what i'm doing wrong.
    Spoiler:

    LASTRESULT is not defined, which means you are missing the key std.rbc file that comes with XSE. You can manually define it like I did in your spoiler above.
     

    Joexv

    ManMadeOfGouda joexv.github.io
    1,037
    Posts
    11
    Years
  • OK so im having a few issues with some scripts. First off everytime i fight this trainer it causes it to be a double battle
    Spoiler:
    He is checked as a trainer in a-map, he only has one pokemon and it is not set as a double battler in a-trainer. This also happens to 2 others who have almost the exact same script.

    Also im having a level script issue.
    Spoiler:
    The flag in a-map is set to 4095, and the value to 4000. it is using the [2] script type. The issue with this is that it wont hide the sprite on the previous map. yea does have his person id set to 1017 too.
    Thanks!
     

    ShyRayq

    Unprofessional Unprofessional
    1,856
    Posts
    16
    Years
    • Seen Apr 2, 2024
    OK so im having a few issues with some scripts. First off everytime i fight this trainer it causes it to be a double battle
    Spoiler:
    He is checked as a trainer in a-map, he only has one pokemon and it is not set as a double battler in a-trainer. This also happens to 2 others who have almost the exact same script.

    Also im having a level script issue.
    Spoiler:
    The flag in a-map is set to 4095, and the value to 4000. it is using the [2] script type. The issue with this is that it wont hide the sprite on the previous map. yea does have his person id set to 1017 too.
    Thanks!

    Okay, to the trainerbattle script, I've had this a couple times, and I think its because the original slot there belonged to a Double Trainer battle and its hardcoded that way or something, so just change the slot a few times and it should work. Also its "Chief" not "Cheif"

    For the level script, you have a few issues.
    1. The value should be 0. In order for it to be 4000, you'd have to put setvar 0x4095 0x4001 somewhere in your script. The value is the value you set your var as - 1.
    2. Don't use setflag 0x1017. I'm guessing you're using Fire Red, and that flag is unsafe. Check in the tutorial section for KarateKid's Vars, and Flags tutorial for a list of all the safe flags.
    3. Also, that command "SpriteInvisible". I've never seen it before, so I'm not sure if it actually works. To be safe, I'd just move the sprite somewhere off screen and do a setflag then, but just test it first.
     

    Joexv

    ManMadeOfGouda joexv.github.io
    1,037
    Posts
    11
    Years
  • Okay, to the trainerbattle script, I've had this a couple times, and I think its because the original slot there belonged to a Double Trainer battle and its hardcoded that way or something, so just change the slot a few times and it should work. Also its "Chief" not "Cheif"

    For the level script, you have a few issues.
    1. The value should be 0. In order for it to be 4000, you'd have to put setvar 0x4095 0x4001 somewhere in your script. The value is the value you set your var as - 1.
    2. Don't use setflag 0x1017. I'm guessing you're using Fire Red, and that flag is unsafe. Check in the tutorial section for KarateKid's Vars, and Flags tutorial for a list of all the safe flags.
    3. Also, that command "SpriteInvisible". I've never seen it before, so I'm not sure if it actually works. To be safe, I'd just move the sprite somewhere off screen and do a setflag then, but just test it first.
    With the trainers i just went back to remake them like you suggested and it turns out i was stupid and checked the double battle on accident.XD

    1Ok ill change the value, idk why but i had it somewhere else so i figured thats what i needed to use again.
    2alright i switch flags. I forgot that the was a list of that kind of thing.
    3Spriteinvisible is a command that can hide a sprite thats not on the same map.
    so it would be used spriteinvisible 0x(person event #) 0x(map bank) 0x(map number)
    its super helpful.
     
    Last edited:

    cjcman95

    codycarol95
    35
    Posts
    10
    Years
  • #dynamic 0x800311

    #org 0x2403DD
    checkflag 0x1215
    if 0x1 goto @done
    if 0x0 goto @battle
    lock
    faceplayer
    callstd 0x6
    cry 0xFC 0x6
    release
    end

    #org @battle
    wildbattle 0xFC 0xA 0x6E
    fadescreen 0x0
    setflag 0x200
    release
    end

    #org @done
    hidesprite LASTTALKED
    release
    end

    I have this set-up(im kinda new at scripting...) ._. it does the battle with the pokemon but after the battle, the pokemon is still there. help? I want the pokemon sprite to disappear after the battle.[/B][/SIZE][/COLOR][/FONT]
     

    destinedjagold

    You can contact me in PC's discord server...
    8,593
    Posts
    16
    Years
    • Seen Dec 23, 2023
    #dynamic 0x800311

    #org 0x2403DD
    checkflag 0x1215
    if 0x1 goto @done
    if 0x0 goto @battle
    lock
    faceplayer
    callstd 0x6
    cry 0xFC 0x6
    release
    end

    #org @battle
    wildbattle 0xFC 0xA 0x6E
    fadescreen 0x0
    setflag 0x200
    release
    end

    #org @done
    hidesprite LASTTALKED
    release
    end

    I have this set-up(im kinda new at scripting...) ._. it does the battle with the pokemon but after the battle, the pokemon is still there. help? I want the pokemon sprite to disappear after the battle.[/B][/SIZE][/COLOR][/FONT]

    Write the flag on the PKMN NPC's Person ID.
    Spoiler:
     

    wheat32

    smittywheat
    11
    Posts
    10
    Years
  • I'm very new to ROM hacking, and I've searched nearly everywhere to find something that could help me with this. This may be very n00by to a lot of you, but it's new to me. I'm receiving an error when I try to debug my script. The error is as follows: Error 13 "Type Mismatch" on Line 6. Missing dynamic label.
    Here is the script:
    Spoiler:

    Any help would be appreciated! :)
     
    Last edited:
    Status
    Not open for further replies.
    Back
    Top