• 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] Events based on first pokemon in party

15
Posts
4
Years
    • Seen Jun 16, 2019
    Is there a way to script an event that will only occur if you have a specific pokemon in the first slot in ur party?
     
    20
    Posts
    5
    Years
    • Seen Jul 16, 2019
    Yes indeed there is a way to do that. I don't know how good your scripting understanding is but here is what I know about variables.

    Variables are different from normal Flags
    They can have different Values, and it's Value can be changed by scripts

    If you pick a Starter the value of the variable will be one two or three.

    Depending on which Starter you picked one of the Legendary Johto Dogs will appear using the Variables Value as condition for it.

    In your case you can use Variables just like this but be sure you use an unused Variable for safety reasons.
     

    DrFuji

    [I]Heiki Hecchara‌‌[/I]
    1,691
    Posts
    14
    Years
  • If you're using FR, you can do this pretty easily with special 0xFF. It takes the value of variable 0x8004, selects the party position indicated by it and then returns the species number of that Pokemon. Here's an example of it in action:

    Code:
    ...
    setvar 0x8004 0x0 // 0x0 makes special 0xFF check the first party slot
    special2 0x8000 0xFF // Stores the species number in variable 0x8000
    compare 0x8000 0x19 // Checks if Pikachu was the returned result
    if 0x1 goto @PikachuIsFirst // Branches the script if true
    ...

    Hopefully that's what you're after.
     
    157
    Posts
    7
    Years
    • Seen Nov 19, 2023
    If you're using FR, you can do this pretty easily with special 0xFF. It takes the value of variable 0x8004, selects the party position indicated by it and then returns the species number of that Pokemon. Here's an example of it in action:

    Code:
    ...
    setvar 0x8004 0x0 // 0x0 makes special 0xFF check the first party slot
    special2 0x8000 0xFF // Stores the species number in variable 0x8000
    compare 0x8000 0x19 // Checks if Pikachu was the returned result
    if 0x1 goto @PikachuIsFirst // Branches the script if true
    ...

    Hopefully that's what you're after.

    Is there an Emerald equivalent of that method friend?
     

    DrFuji

    [I]Heiki Hecchara‌‌[/I]
    1,691
    Posts
    14
    Years
  • Is there an Emerald equivalent of that method friend?

    Aye, special2 0x149 is the equivalent in Emerald and works exactly the same way. Its used by the Name Rater to check if you have an egg, but it can be used to check for other Pokemon as well.
     
    157
    Posts
    7
    Years
    • Seen Nov 19, 2023
    Aye, special2 0x149 is the equivalent in Emerald and works exactly the same way. Its used by the Name Rater to check if you have an egg, but it can be used to check for other Pokemon as well.
    Legend. Had no clue you were a fellow Aussie! Also, the screenshots for Lilac look amazing so far. I hope it all goes well for you with that project.
     
    Back
    Top