• Just a reminder that providing specifics on, sharing links to, or naming websites where ROMs can be accessed is against the rules. If your post has any of this information it will be removed.
  • Ever thought it'd be cool to have your art, writing, or challenge runs featured on PokéCommunity? Click here for info - we'd love to spotlight your work!
  • Our weekly protagonist poll is now up! Vote for your favorite Conquest protagonist in the poll by clicking here.
  • 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.

Special ChoosePartyMon variables

  • 124
    Posts
    9
    Years
    • Seen Apr 5, 2024
    Which variables are set by the function ChoosePartyMon?
    I would like to know for example if it's VAR_0x8004, can I store that value into a string that i can display using {STR_VAR_1}?
     
    Which variables are set by the function ChoosePartyMon?
    I would like to know for example if it's VAR_0x8004, can I store that value into a string that i can display using {STR_VAR_1}?
    ChoosePartyMon effectively does use the var 0x8004. What's stored there is the slotid of the Pokémon that you chose.

    And yes, you can totally store it in a text buffer and print it.
    Inside an overworld script you'd use buffernumberstring, where as in C code you could use ConvertIntToDecimalStringN.
     
    ChoosePartyMon effectively does use the var 0x8004. What's stored there is the slotid of the Pokémon that you chose.

    And yes, you can totally store it in a text buffer and print it.
    Inside an overworld script you'd use buffernumberstring, where as in C code you could use ConvertIntToDecimalStringN.

    Yes, I understand it takes the slot ID but which var takes the SPECIES ID? I'd like to use it to compare or check for a specific SPECIES in the party
     
    Yes, I understand it takes the slot ID but which var takes the SPECIES ID? I'd like to use it to compare or check for a specific SPECIES in the party
    There are two ways you could find the answer:
    1. search for "ChoosePartyMon" in the data folder to find all scripts that use that special and check out some of them to see what variables they use.
    2. search for "ChoosePartyMon" in the src folder to find the C function that implements that special to see exactly what it does.

    Either way you would find that the special only gives you the slot id and you need to get the corresponding species id yourself.
     
    There are two ways you could find the answer:
    1. search for "ChoosePartyMon" in the data folder to find all scripts that use that special and check out some of them to see what variables they use.
    2. search for "ChoosePartyMon" in the src folder to find the C function that implements that special to see exactly what it does.

    Either way you would find that the special only gives you the slot id and you need to get the corresponding species id yourself.

    yes Lunos, thank you, I did exactly what you said. Im in the process of making a special that takes just that, although I dont have that much experience to make one I hope I can understand c code through enough trial and error and make the special I need, surprised it hasnt been made before, but thanks
     
    A way to check for a specific species? It has. In many different ways, in fact.
    https://www.pokecommunity.com/posts/10213715/

    Hey that's pretty good right there, thanks for pointing that out out, I can definitely use that. What I meant was for a special like choosepartymon that stores the species name into a string or variable that can be used for comparisons.

    To simplify I would like to choose my Swampert in the ChoosePartyMon menu, and the npc tell me something like "Oh yeah thats a swampert"

    or an npc that compares it for either trades or givemon reasons like "oh you have a swampert? here is a mudkip" or "thats a beedrill, so heres a better beedrill"

    that's what i meant, but either way, thanks for that previous post
     
    Hey that's pretty good right there, thanks for pointing that out out, I can definitely use that. What I meant was for a special like choosepartymon that stores the species name into a string or variable that can be used for comparisons.

    To simplify I would like to choose my Swampert in the ChoosePartyMon menu, and the npc tell me something like "Oh yeah thats a swampert"

    or an npc that compares it for either trades or givemon reasons like "oh you have a swampert? here is a mudkip" or "thats a beedrill, so heres a better beedrill"

    that's what i meant, but either way, thanks for that previous post
    Yes, the game has a special that you can use for that too, it's called BufferMonNickname. It stores the nickname of the species present in the slotId stored in the var 0x8004, inside of the 1st text buffer aka gStringVar1/STR_VAR_1.
     
    Yes, the game has a special that you can use for that too, it's called BufferMonNickname. It stores the nickname of the species present in the slotId stored in the var 0x8004, inside of the 1st text buffer aka gStringVar1/STR_VAR_1.

    yeah that worked great.

    your post solved one out of two of my problems, thank you for that

    ScriptGetPartyMonSpecies was exactly what i needed for species. The other problem I have is I would like to check level as well,
    I already checked for anything that checks level, maybe I'd have to make one similar to that last one.

    If anyone knows how I'd appreciate it
     
    Last edited:
    I actually made the special needed to check the level

    u8 ScriptGetPartyMonLevel(void)
    {
    return GetMonData(&gPlayerParty[gSpecialVar_0x8005], MON_DATA_LEVEL);
    }

    it worked perfectly, the from choosepartymon it read back to me what the species was and its level.
    glad to finally move on.
     
    I actually made the special needed to check the level

    u8 ScriptGetPartyMonLevel(void)
    {
    return GetMonData(&gPlayerParty[gSpecialVar_0x8005], MON_DATA_LEVEL);
    }

    it worked perfectly, the from choosepartymon it read back to me what the species was and its level.
    glad to finally move on.
    Are you sure that it works?
    Because ChoosePartyMon stores the slotId of the Pokémon selected in the var 0x8004, not the 0x8005.
    As is, that ScriptGetPartyMonLevel is reading the level of the Pokémon that comes after the one chosen through ChoosePartyMon.
     
    Are you sure that it works?
    Because ChoosePartyMon stores the slotId of the Pokémon selected in the var 0x8004, not the 0x8005.
    As is, that ScriptGetPartyMonLevel is reading the level of the Pokémon that comes after the one chosen through ChoosePartyMon.

    yeah it works, ill show you what i've written:

    script UltimateCheck
    {
    lock
    faceplayer
    special(ChoosePartyMon)
    waitstate
    specialvar(VAR_RESULT, ScriptGetPartyMonSpecies)
    if(var(VAR_RESULT) == SPECIES_DRATINI || var(VAR_RESULT) == SPECIES_DRAGONAIR || var(VAR_RESULT) == SPECIES_DRAGONITE)
    {
    special(BufferMonNickname)
    msgbox("It's a {STR_VAR_1}!", MSGBOX_AUTOCLOSE)
    specialvar(VAR_RESULT, ScriptGetPartyMonLevel)
    if (var(VAR_RESULT) <= 40)
    {
    buffernumberstring(STR_VAR_2, VAR_RESULT)
    msgbox("Aww, It's LV.{STR_VAR_2}", MSGBOX_AUTOCLOSE)
    }
    elif(var(VAR_RESULT) > 40)
    {
    buffernumberstring(STR_VAR_2, VAR_RESULT)
    msgbox("Hey! It's LV.{STR_VAR_2}", MSGBOX_AUTOCLOSE)
    }
    }
    release
    end
    }

    I think if I call the function after already storing the Idslot, it takes that slot's level and stores it in a different variable to use it in buffernumberstring. It works just fine and this is the most basic script I can add more lines to check for more pokemon and branch off to different outcomes depending on the spieces its looking for.

    EDIT:
    Yes Lunos, you were right, I had to change it to 8004 because it was only working correctly in the leading pokemon and not the rest so definitely thank you for pointing that out.
     
    Last edited:
    Back
    Top