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

Question: How do you set flags for picking a specific Starter in Firered?

  • 30
    Posts
    7
    Years
    • Seen Aug 24, 2023
    So, I thought I could just place flag 0x1201 in any script in the starter pokeballs, but that completely glitches the game and adds really weird scripts.

    Is there any way to put certain flags on starters?

    Such as 1201 when picking up Bulb, 1202 on Squirtle, etc

    I want to use this to create give Pokémon scripts that would check if certain starters were chosen and not give the selected starter to the player.
     
    First, I'd recommend you to read this to know what flags are safe and not safe to use: https://www.pokecommunity.com/threads/302347
    Flag 0x1201 is 100% not safe, I suggest using one in the range of 200-2FF, but you still need to check what flags are safe in that range in the post I linked above.

    But, actually, there is no need to put any new flags on starters. You see, the game already has a check for what starter did you pick. When you choose a starter, a var 0x4031 is set (0 for Bulbasaur, 1 for Squirtle, 2 for Charmander). So all you need to do is to put a compare command in your script to check to which value the variable is set. For example, here is a script that gives you a Johto starter depending on which Kanto starter you chose:

    Spoiler:


    Hope it helps and feel free to ask any question!
     
    Last edited:
    You are amazing! Thank you so much.

    But I don't get this part of the script:

    compare 0x4031 0x2

    edit:

    Oh, I get it:

    So 0x4031 0x0 is bulb?

    and 4031 0x1 is Squirtle?
     
    Last edited:
    So i learned that var4031 has starter data, but I want to specify how to use this var
     
    First, I'd recommend you to read this to know what flags are safe and not safe to use: https://www.pokecommunity.com/threads/302347
    Flag 0x1201 is 100% not safe, I suggest using one in the range of 200-2FF, but you still need to check what flags are safe in that range in the post I linked above.

    But, actually, there is no need to put any new flags on starters. You see, the game already has a check for what starter did you pick. When you choose a starter, a var 0x4031 is set (0 for Bulbasaur, 1 for Squirtle, 2 for Charmander). So all you need to do is to put a compare command in your script to check to which value the variable is set. For example, here is a script that gives you a Johto starter depending on which Kanto starter you chose:

    Spoiler:


    Hope it helps and feel free to ask any question!


    So here's the script I made for getting bulbasaur. I am trying to make the trainer not receive one when already picked Bulbasaur::



    Spoiler:
     
    Last edited:
    var 0x4031 determines what legendary dog will roam late game.
    It will copy its value with var 0x4001 in the OAK gives you pokemon script.

    I don't understand what you want to do.
    Well, if you want to change the starters given.
    Simply switch the var 0x4002 to the national pokedex number of the pokemon you want.

    var 0x4003 determines what pokemon your rival will take.

    var 0x4004 determines the pokeball that will be removed by your rival in the Oak's Lab.
     
    var 0x4031 determines what legendary dog will roam late game.
    It will copy its value with var 0x4001 in the OAK gives you pokemon script.

    I don't understand what you want to do.
    Well, if you want to change the starters given.
    Simply switch the var 0x4002 to the national pokedex number of the pokemon you want.

    var 0x4003 determines what pokemon your rival will take.

    var 0x4004 determines the pokeball that will be removed by your rival in the Oak's Lab.

    First thanks for the help:

    Essentially, I am trying to give out a bulbasaur. I don't want to give out a bulbasaur if bulbasaur was already selected as a starter.

    How would you make this happen?

    This is the script I made after some suggestions:

    Spoiler:


    But it glitches out. I don't know how to specify which starter was selected for the script.
     
    Last edited:
    I see,

    compare 0x4031 0x0
    if 0x1 goto @already


    This script will check if the value of 4031 is 0, it will go @already
    Remember 4031 was given a value when you take a pokemon from Oak's Lab.

    I think it is fine, you get some text error there.
    change the @already1 at the bottom of the script to @already

    Which part of the script gives error?
     
    Last edited:
    I see,

    compare 0x4031 0x0
    if 0x1 goto @already


    This script will check if the value of 4031 is 0, it will go @already
    Remember 4031 was given a value when you take a pokemon from Oak's Lab.

    I think it is fine, you get some text error there.
    change the @already1 at the bottom of the script to @already

    Which part of the script gives error?

    So when i talk to the npc after selecting Bulbasaur, he still gives me a bulbasaur and continues to give me one
     
    I think it has something to do with the :

    checkflag 0x201
    if 0x0 goto @


    The if 0x0 here only applies to compare command.
    As the if doesn't have any value that needs to be compared.

    Changes if to 0x1 and switch the scripts.
     
    Last edited:
    I think it has something to do with the :

    checkflag 0x201
    if 0x0 goto @


    The if 0x0 here only applies to compare command.
    As the if doesn't have any value that needs to be compared.

    Changes if to 0x1 and switch the scripts.

    I'm sorry, I don't understand, but I'm sure I will get it.

    So make it like this?:

    checkflag 0x201
    if 0x1 goto @


    Thanks so much btw
     
    I'm sorry, I don't understand, but I'm sure I will get it.

    So make it like this?:

    checkflag 0x201
    if 0x1 goto @

    Thanks so much btw

    Yes, you need to switch the if 0x1 goto @Alreadygiveyoubulbasaur
    then continue the @givespokemon

    ======
    Explanation
    ======
    Your checkflag 0x201
    if 0x0 goto __

    I believe that the error is here because if 0x0 is only used with compare command.
    Because compare is always followed up with a value.
    Example :
    compare 0x4001 0x5
    if 0x1 goto @sample


    The game will compare if variable 4001 is 5.
    And if it is 5, it will go to @sample

    compare 0x4001 0x5
    if 0x0 goto @sample


    The game will compare if variable 4001 is lower than 5
    If it is lower than 5, it will go to @sample

    checkflag 0x201
    if 0x0 goto __

    I don't know about this, but i assume that you think that 0x0 means zero but it is actually lower than.
    So i think the command here is failing due to it doesn't have any value to be compared with.
     
    Yes, you need to switch the if 0x1 goto @Alreadygiveyoubulbasaur
    then continue the @givespokemon

    ======
    Explanation
    ======
    Your checkflag 0x201
    if 0x0 goto __

    I believe that the error is here because if 0x0 is only used with compare command.
    Because compare is always followed up with a value.
    Example :
    compare 0x4001 0x5
    if 0x1 goto @sample


    The game will compare if variable 4001 is 5.
    And if it is 5, it will go to @sample

    compare 0x4001 0x5
    if 0x0 goto @sample


    The game will compare if variable 4001 is lower than 5
    If it is lower than 5, it will go to @sample

    checkflag 0x201
    if 0x0 goto __

    I don't know about this, but i assume that you think that 0x0 means zero but it is actually lower than.
    So i think the command here is failing due to it doesn't have any value to be compared with.

    I will try this and let you know
    Thank you so much
     
    I see,

    compare 0x4031 0x0
    if 0x1 goto @already


    This script will check if the value of 4031 is 0, it will go @already
    Remember 4031 was given a value when you take a pokemon from Oak's Lab.

    I think it is fine, you get some text error there.
    change the @already1 at the bottom of the script to @already

    Which part of the script gives error?

    So how do you get rid of unknown keyword on xse?

    Thanks again!
     
    So how do you get rid of unknown keyword on xse?

    Thanks again!

    Unknown error occurs when XSE believes that your script is broken, it usually comes with line number.
    Ex : Unknown error at line 7
    means that there is some error in the line 7 and you need to fix it.

    Is the script still not working?
     
    Last edited:
    checkflag 0x201
    if 0x0 goto __

    I don't know about this, but i assume that you think that 0x0 means zero but it is actually lower than.
    So i think the command here is failing due to it doesn't have any value to be compared with.

    Actually, it does: "checkflag" command acts exactly as "compare" command, the only thing different is that it's automatically compares a selected flag to 1. So it should work properly in theory. I suggest trying to go with "if 0x1 goto @destination" and see if that works.

    EDIT: Also there is no need for setflag 0x828 in this script. When this flag is set, the "POKeMON" option is shown in the Start Menu. As this flag sets when you choose your starter in Oak's lab, there is no need for setting it again.
     
    Last edited:
    Unknown error occurs when XSE believes that your script is broken, it usually comes with line number.
    Ex : Unknown error at line 7
    means that there is some error in the line 7 and you need to fix it.

    Is the script still not working?

    Actually, it does: "checkflag" command acts exactly as "compare" command, the only thing different is that it's automatically compares a selected flag to 1. So it should work properly in theory. I suggest trying to go with "if 0x1 goto @destination" and see if that works.

    EDIT: Also there is no need for setflag 0x828 in this script. When this flag is set, the "POKeMON" option is shown in the Start Menu. As this flag sets when you choose your starter in Oak's lab, there is no need for setting it again.

    It works now.

    Thanks guys.
     
    Actually, it does: "checkflag" command acts exactly as "compare" command, the only thing different is that it's automatically compares a selected flag to 1. So it should work properly in theory. I suggest trying to go with "if 0x1 goto @destination" and see if that works.
    I don't know though, i never see any checkflag script followed by a if 0x0 .

    It works now.
    Thanks guys.
    Great, keep in mind that if 0x0 means lower than and if 0x2 means higher than.
    And for the Charmander and Squirtle, simply reuse your script and this time, edit the compare script to :

    Charmander :
    compare 0x4031 0x2
    if 0x1 goto @GetCharmanderScript

    Squirtle :
    compare 0x4031 0x1
    if 0x1 goto @GetSquirtleScript
     
    I don't know though, i never see any checkflag script followed by a if 0x0 .


    Great, keep in mind that if 0x0 means lower than and if 0x2 means higher than.
    And for the Charmander and Squirtle, simply reuse your script and this time, edit the compare script to :

    Charmander :
    compare 0x4031 0x2
    if 0x1 goto @GetCharmanderScript

    Squirtle :
    compare 0x4031 0x1
    if 0x1 goto @GetSquirtleScript

    Thanks!!!

    So I got that, but I have a problem with inserting sprite:

    So I have a sprite here:

    imgur.com/llN3Q1q

    I edited and cropped it to the correct size, I decreased pallet to 16 colors, and also switched the back ground pallet to the first pallete and did everything i was suppose to do. But the sprites refuse to come out right. Can you help? Thanks again
     
    Last edited:
    Back
    Top