The PokéCommunity Forums  

Go Back   The PokéCommunity Forums > ROM Hacking > Tools, Tutorials & Resources
Sign Up Rules/FAQ Live Battle Blogs Mark Forums Read

Notices

Tools, Tutorials & Resources Various tools to help you develop your hacks can be found here.
New threads in this forum are to be approved by a moderator before they are displayed.

Reply
 
Thread Tools
  #1    
Old May 16th, 2013 (04:21 PM).
Jambo51's Avatar
Jambo51
Glory To Arstotzka
 
Join Date: Jun 2009
Gender: Male
Nature: Quiet
Ever wondered how the Incense items are handled in Gen 3, and have you ever wondered about adding NEW Incense items? Well, wonder no more! As always, what I present works on BPRE 1.0 only, but could easily be ported over to RSE.

First up, some more ASM code to assemble:

Code:
.text
.align 2
.thumb
.thumb_func
.global eggspecieschangeitem

main:
	mov r0, #0xAF
	lsl r0, r0, #0x1
	cmp r1, r0
	bne newchecks
	ldr r0, returnone
	bx r0
newchecks:	bl getparentdata
	push {r3-r5,r7}
	ldr r7, terminator
	ldr r4, newtable
	mov r0, #0x0
loop:	lsl r3, r0, #0x1
	add r3, r3, r0
	lsl r3, r3, #0x1
	add r3, r3, r4
	ldrh r5, [r3, #0x0]
	cmp r5, r7
	beq end
	cmp r1, r5
	bne skip
	ldrh r5, [r3, #0x2]
	cmp r2, r5
	beq end
	cmp r6, r5
	beq end
	ldrh r1, [r3, #0x4]
	b end
skip:	add r0, #0x1
	b loop
end:	pop {r3-r5,r7}
	add r0, r1, #0x0
	strh r0, [r4, #0x0]
	pop {r4-r7}
	pop {r0}
	bx r0
getparentdata:	push {lr}
	push {r1}
	add r0, r5, #0x0
	mov r1, #0xC
	bl decrypt
	add r6, r0, #0x0
	add r0, r5, #0x0
	add r0, #0x8C
	mov r1, #0xC
	bl decrypt
	add r2, r0, #0x0
	pop {r1}
	pop {r0}
	bx r0
decrypt:	ldr r2, decry
	bx r2
.align
terminator:	.word 0x0000FEFE
newtable:	.word 0x08FFFFFF
returnone:	.word 0x08045FB9
decry:		.word 0x0803FD45
Now, navigate to 0x45FB4, and put in an ASM branch by changing the code to:

Code:
00 48 00 47 XX XX XX 08
Where the XX's are to point to the insert location of your routine + 1 for THUMB mode.

Finally, you need to add a new table to your ROM, and repoint the newtable: .word 0x08FFFFFF to it. The table should be arranged as such:

Code:
[Species - Half-Word][Held Item - Half-Word][Species 2 - Half-Word]
Now, I head you ask, why are there 2 species? Well, the first species ID is the baby Pokémon. That is, if we were adding Marill to the table, the species ID we would put first would be Azurill's. Get it? Remember, you must put the index number of the Pokémon, NOT it's national dex number.

After that, you put in the ID of the item which allows you to breed to the baby species. Simple enough.

Finally, you put the species that it should revert to if the item is absent. So, in the above example, I'd put Marill's index number.

Thus, the final result (if I were doing Marill/Azurill egg changing) would be:

Code:
5E 01 DC 00 B7 00
You simply repeat this until you have completed all the new Pokémon, and then tag on a FE FE 00 00 to finish it off

Code:
5E 01 DC 00 B7 00 FE FE 00 00
The FEFE0000 at the end is necessary to limit the table length. On reading that number, the game will stop searching for egg species.

The table can be as long or as short as you desire. Just ensure it's correctly aligned and has the FEFE0000 delimiter at the end.

Please note, you should not put Azurill/Marill or Wynaut/Wobbuffet on your new table because they are handled before this routine. This table is explicitly for NEW incense style items/pokemon combinations!
__________________
Hey guys, please check out my recreations of the gen 1 and 2 music on my custom engine at my SoundCloud! - Here!
Reply With Quote
  #2    
Old May 17th, 2013 (02:31 AM).
Elaitenstile
I am legend
 
Join Date: Feb 2013
Send a message via Skype™ to Elaitenstile
This is AWESOME. I can only imagine the load of finding the offsets and that routine must've been a terror. It's nice to know that you've finally found a way to do this. Another reason why you are so awesome is this.

#nextbestthingtonewevostones

With this I may be able to get in Happiny and Mantyke without having to make them preavailable or direct breeding so many thanks, and Imma taking this rightaway!

Great work!

Er... another question. Can I make it like two items for a Pokémon A, and if item A is held then the egg contains Pokémon B, but if item B is held by the same Pokémon A, the egg contains Pokémon C?

This'd help me out with Fakemon ideas.
__________________
~
Reply With Quote
  #3    
Old May 17th, 2013 (04:11 AM).
Jambo51's Avatar
Jambo51
Glory To Arstotzka
 
Join Date: Jun 2009
Gender: Male
Nature: Quiet
No, it's explicitly an extension of the existing system. To do anything more complex, like what you suggest, would require new custom ASM.
__________________
Hey guys, please check out my recreations of the gen 1 and 2 music on my custom engine at my SoundCloud! - Here!
Reply With Quote
  #4    
Old May 17th, 2013 (04:38 AM).
Elaitenstile
I am legend
 
Join Date: Feb 2013
Send a message via Skype™ to Elaitenstile
Oh, I see. Well, this is great work! Thanks anyway!
__________________
~
Reply With Quote
Reply
Quick Reply

Sponsored Links
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Minimum Characters Per Post: 25



All times are UTC -8. The time now is 12:20 PM.


Style by Nymphadora, artwork by Sa-Dui.
Like our Facebook Page Follow us on Twitter © 2002 - 2014 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 - 2014 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.