The PokéCommunity Forums

The PokéCommunity Forums (https://www.pokecommunity.com/index.php)
-   Binary ROM Hacking (https://www.pokecommunity.com/forumdisplay.php?f=284)
-   -   Other Choose gender from overworld? (https://www.pokecommunity.com/showthread.php?t=354587)

Dr. Seuss August 24th, 2015 4:40 PM

Choose gender from overworld?
 
In my hack I disable the oak intro and make a custom intro, but I need make the gender selection in a normal script via multichoice, but I don't know how to make it (I know how to make a multichoice, but I don't know how to make the gender selection works?

And for the names, I use the FBI Agent's ASM routine to use preset names of the heroes.

Joexv August 25th, 2015 4:30 AM

If I remember correctly the player's gender is a byte stored at 0x03005014 (0/m 1/f)
It may be as simple as a
Code:

writebytetooffset 0x3005014 0x#


# being what ever gender you would like to set.

Captain_Jack September 5th, 2015 8:08 AM

Quote:

Originally Posted by joexv (Post 8903785)
If I remember correctly the player's gender is a byte stored at 0x03005014 (0/m 1/f)
It may be as simple as a
Code:

writebytetooffset 0x3005014 0x#


# being what ever gender you would like to set.

For some reason that's not doing anything for me. Will this still work if you've previously selected boy/girl in the intro?

Blah September 5th, 2015 8:16 AM

Quote:

Originally Posted by joexv (Post 8903785)
If I remember correctly the player's gender is a byte stored at 0x03005014 (0/m 1/f)
It may be as simple as a
Code:

writebytetooffset 0x3005014 0x#


# being what ever gender you would like to set.

The trainer data is dynamic, meaning the trainer data is not something you can access directly. At 0x300500C, the game holds a pointer to the trainer data. You need to load the pointer, then add 8 bytes and load the following byte to get the gender. Following a pointer in a script isn't possible as far as I know. You'd need to use ASM.

@OP: I made one in the ASM resource thread for FireRed some time ago. Have a look.

EDIT: Maybe I didn't make one. You can let me know if I didn't :P

Dr. Seuss September 5th, 2015 8:50 AM

Quote:

Originally Posted by FBI agent (Post 8917079)
The trainer data is dynamic, meaning the trainer data is not something you can access directly. At 0x300500C, the game holds a pointer to the trainer data. You need to load the pointer, then add 8 bytes and load the following byte to get the gender. Following a pointer in a script isn't possible as far as I know. You'd need to use ASM.

@OP: I made one in the ASM resource thread for FireRed some time ago. Have a look.

EDIT: Maybe I didn't make one. You can let me know if I didn't :P

Thanks for the explanation, but my dear Javi4315♪ share me a routine to make this, because with WBTO command is impossible do it.

The routine for the gender swap via script is this:
Code:

.align 2
.thumb

push {r0-r1,lr}
ldr r0, .asdf
ldr r1, [r0]
mov r0, #0x0
ldr r0, .var_8000
ldrb r0, [r0]
strb r0, [r1,#0x8]
pop {r0-r1,pc}

.asdf: .word 0x0300500C
.var_8000: .word 0x020370B8




All times are GMT -8. The time now is 2:30 AM.


Like our Facebook Page Follow us on Twitter © 2002 - 2018 The PokéCommunity™, pokecommunity.com.
Pokémon characters and images belong to The Pokémon Company International and Nintendo. This website is in no way affiliated with or endorsed by Nintendo, Creatures, GAMEFREAK, The Pokémon Company or The Pokémon Company International. We just love Pokémon.
All forum styles, their images (unless noted otherwise) and site designs are © 2002 - 2016 The PokéCommunity / PokéCommunity.com.
PokéCommunity™ is a trademark of The PokéCommunity. All rights reserved. Sponsor advertisements do not imply our endorsement of that product or service. User generated content remains the property of its creator.

Acknowledgements
Use of PokéCommunity Assets
vB Optimise by DragonByte Technologies Ltd © 2023.