• 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!
  • Which Pokémon Masters protagonist do you like most? Let us know by casting a vote in our Masters favorite protagonist poll here!
  • Red, Hilda, Paxton, or Kellyn - which Pokémon protagonist is your favorite? Let us know by voting in our poll!
  • 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.

[Graphics] Help with Gender-Dependent Sprites

  • 4
    Posts
    4
    Years
    • Seen Jun 12, 2021
    Hello Rom Hacking Community!

    So I've only recently gotten into rom hacking so there's still a lot I don't know. I wanted to ask for help with making an event's sprite be dependent on the player's gender. To explain, my FireRed rom hack will be including Red/Leaf as a secondary rival. How do I go about making Leaf's overworld sprite appear when the player is playing as Red, and vice versa? To follow that up, how can I make their in-battle sprites appear accordingly as well? Thanks for the help in advance! :)
     
    Hello Rom Hacking Community!

    So I've only recently gotten into rom hacking so there's still a lot I don't know. I wanted to ask for help with making an event's sprite be dependent on the player's gender. To explain, my FireRed rom hack will be including Red/Leaf as a secondary rival. How do I go about making Leaf's overworld sprite appear when the player is playing as Red, and vice versa? To follow that up, how can I make their in-battle sprites appear accordingly as well? Thanks for the help in advance! :)

    With a simple command known as checkgender. It's a little more complex then just putting it in, so you'll have to play around with it before making a script. This might help: https://www.youtube.com/watch?v=lyyQtr98TgY
     
    Hey! Thanks so much for the help, although I already have written scripts that use the checkgender command, including signposts and character dialogue that vary based on the player's gender. What I need now is help on making an event display a certain sprite (in this case Red's or Leaf's) based on the player's gender. I haven't been able to find any tutorials on how to make this work though.
     
    idk what it's called in binary, but I think what you want is what decomps call OBJ_EVENT_GFX_VAR_X and OBJ_EVENT_GFX_VAR_X (where X is one of 0-9, or A-F). You'd set the var to the appropriate object event graphics id based on the gender, and set up the object event to use that variable as its graphics.
     
    For the topic of overworld sprites, you can put one for Red, and one for Leaf, and mark them as hidden in AdvanceMap, and showsprite 0x(whatever) to show whichever sprite needs to be shown.
     
    Hello Rom Hacking Community!

    So I've only recently gotten into rom hacking so there's still a lot I don't know. I wanted to ask for help with making an event's sprite be dependent on the player's gender. To explain, my FireRed rom hack will be including Red/Leaf as a secondary rival. How do I go about making Leaf's overworld sprite appear when the player is playing as Red, and vice versa? To follow that up, how can I make their in-battle sprites appear accordingly as well? Thanks for the help in advance! :)

    Since its just the rival and I assume all text would be the same, what you do is this, you use a special to check for the gender of the player. (pretty sure there is one, but i just don't know what it is, I'll add a link after.)

    Every script that involves the rival must include a a variable value check.

    If you use an unused permanent variable, you can use the same one for the entire game.

    The first time at the start with the first rival appearance you need to define what variable you're going to use, and which values you will set it to.

    Like this


    if (special that checks gender) is (value for male player)
    set var (chosen variable number) 0x(some number)

    if (special that checks gender) is (value for female player)
    set var (same chosen variable number) 0x(some different number, like +1 the other number)

    from there use a goto, to the normal script but include this part in all rival scripts.

    if var (chosen variable number same as before) is (value for male)

    set flag 0x(some unused flag number)
    show sprite 0x(advancemap sprite id number for male rival on that map)


    if var (same chosen variable number) is (value for female rival)

    set flag 0x(different unused flag number)
    show sprite 0x(advancemap sprite id number for female rival on that map)

    Now in every case you have a rival doing any movement, you're going to need 2 different
    apply movement commands; one for each rival's ID number.

    Because of how the apply movement command works, we can use the same movement for any npc, as long
    as we chose the right person ID number.

    Now since we're trying to chose a variable that we can keep using you're going to include that part in quotes above in every rival script, to make it but we're not going to need the part where we set variable's value because we don't need to change it, since the player's gender isn't going to change at any time in the game.


    A few more details for setup, What you're going to want to do in advance map, is wherever you want the secondary rival to appear, overlap the npc sprites in advance map, and use the advance map toggle to switch between them.

    As long as you assign event scripts to either level scripts, or tiles on the map, instead of the npc themselves you can just use 1 event script instead of 2 every time they appear.

    The rival npc's must be sharing the exact same tile space, so you don't need multiple movement scripts.
    If they are starting from the same tile, they can use the same movement script and end up right where you want them to.


    Hide Sprite/Show Sprite

    Apply Movement
    Specials (check bottom of link page for the rest)
    Level Scripting Tutorial - Youtube


    Ok I believe that should be everything you need, for this, but I'll also share the main page those resources came from below.
    https://www.pokecommunity.com/threads/397107

    Now the basic theory of what I'm saying is sound, but there may be some things I didn't explain correctly as far as specific syntax etc.
    So follow the guides well to understand the full of what you need to do.

    Especially those youtube tutorials.
    You're going to need to know how to find all scripts on a map, how to change sprite picture id in advance map, and find the person number for each npc on a map, and how to reference them.

    How to set event scripts on a map to stop a player then activate, and how to use level scripts.

    I use advance map 1.9.5 and with that some event script stuff is easier than A-map 1.9.2 but the 1.9.5 version is somewhat buggy at times, so there's a little more potential risk for the benefit, but with frequent backups I think its somewhat avoidable.

    So look at everything and consider what tool you'll use, because the processes are a little different depending on that.
    Specifically A-map 1.9.5 has the "talking level" feature which lets you easily set event scripts to activate on walk over.

    Good luck.
     
    Last edited:
    Back
    Top