The PokéCommunity Forums  

Go Back   The PokéCommunity Forums > Fan Games > Binary ROM Hacking
Reload this Page Battle Preventing a wild Pokemon from being caught [gen 3]

Notices
For all updates, view the main page.

Binary ROM Hacking Need a helping hand or just want to talk about binary ROM hacks? Get comments and answers to any ROM Hacking-related problems, questions or thoughts you have here.

Ad Content
Reply
 
Thread Tools
  #1   Link to this post, but load the entire thread.  
Old January 28th, 2019 (2:54 PM).
Sapphire Jester Sapphire Jester is offline
 
Join Date: Jan 2019
Location: United States
Gender: Male
Posts: 11
You know how in Black 2 and White 2 you are unable to capture the wild fused Kyurem? I want to do something like that in my hack, where you have to battle a legendary Pokemon but aren't allowed to catch them. Has someone figured out a way to do so? All I could think of is setting the catch rate to zero but that would still allow the player to (uselessly) throw Pokeballs.
Reply With Quote
  #2   Link to this post, but load the entire thread.  
Old January 28th, 2019 (2:59 PM). Edited January 28th, 2019 by ghoulslash.
ghoulslash's Avatar
ghoulslash ghoulslash is offline
 
Join Date: Mar 2016
Gender: Male
Posts: 238
Quote:
Originally Posted by Sapphire Jester View Post
You know how in Black 2 and White 2 you are unable to capture the wild fused Kyurem? I want to do something like that in my hack, where you have to battle a legendary Pokemon but aren't allowed to catch them. Has someone figured out a way to do so? All I could think of is setting the catch rate to zero but that would still allow the player to (uselessly) throw Pokeballs.
Here is a routine I wrote for dream ball/sport ball that prevents you from using the pokeball if you aren't in the correct map. You could easily add in a wild pokemon species check to prevent use against a pokemon as well. Do you know assembly language at all?

EDIT: this is for FR. I'm not sure what the hook would be for emerald currently.

Spoiler:

Code:
.text
.align 2
.thumb
.thumb_func
.global prevent_pokeball_usage
/*
00 49 08 47 (xx+1) xx xx 08 at a1e1c

*/

.equ Offset, 0x08xxxxxx		@where you will insert

main:
	push {r0, r4, lr}
	ldr r0, =(0x0203ad30)
	ldrh r0, [r0]
	cmp r0, #0xx		@ item ID of dream ball
	beq DreamBall
	cmp r0, #0xZZ		@ item ID of sport ball
	bne usable
	
SportBall:
	ldr r0, =(0x03005008)
	ldr r0, [r0]
	ldrb r1, [r0, #0x4]
	ldrb r0, [r0, #0x5]
	cmp r0, #0xYY	@ national forest bank num
	bne prevent
	cmp r0, #0xYY	@ map num
	bne prevent
	b usable
	
DreamBall:
	ldr r0, =(0x03005008)
	ldr r0, [r0]
	ldrb r1, [r0, #0x4]
	ldrb r0, [r0, #0x5]
	cmp r1, #0xYY		@ bank number for entree foreset
	bne prevent
	cmp r0, #0xYY		@ map number for entree forest
	bne prevent

usable:
	pop {r0}
	mov r4, r0
	bl GetInfo
	ldr r1, =(0x080a1e26 +1)
	bx r1

prevent:
	pop {r0}
	mov r1, #0x2
	ldr r2, =(Offset+prevent_string)	@ or just put in offset
	ldr r3, =(0x0810a1f8 +1)
	bl BagPrint
	pop {r4, pc}
	
BagPrint:
	ldr r4, =(0x08108e70 +1)
	bx r4

GetInfo:
	ldr r3, =(0x08040f6c +1)
	bx r3

prevent_string:
.byte [string], 0xff
__________________

Pokeemerald Works
Reply With Quote
  #3   Link to this post, but load the entire thread.  
Old January 28th, 2019 (3:09 PM).
Sapphire Jester Sapphire Jester is offline
 
Join Date: Jan 2019
Location: United States
Gender: Male
Posts: 11
Wow, I didn't expect such a quick response. Thank you very much.

Truthfully I don't know assembly language, though if that's what's needed to add this feature then I'll have to learn it. I'm still in the planning stages of figuring out everything I want to do with my hack, still teaching myself the basics. I'll be sure to remember this code once I do get to the point that I can use it.
Reply With Quote
  #4   Link to this post, but load the entire thread.  
Old January 28th, 2019 (4:54 PM). Edited January 28th, 2019 by ghoulslash.
ghoulslash's Avatar
ghoulslash ghoulslash is offline
 
Join Date: Mar 2016
Gender: Male
Posts: 238
Quote:
Originally Posted by Sapphire Jester View Post
Wow, I didn't expect such a quick response. Thank you very much.

Truthfully I don't know assembly language, though if that's what's needed to add this feature then I'll have to learn it. I'm still in the planning stages of figuring out everything I want to do with my hack, still teaching myself the basics. I'll be sure to remember this code once I do get to the point that I can use it.
No problem! Let me know if you need any help configuring the function to accomodate your request.

If you want to learn a new coding language going forward, it might help to understand assembly, but all of the dissasembly projects are done in C, so that would be more beneficial.

Good luck with your hack!
__________________

Pokeemerald Works
Reply With Quote
  #5   Link to this post, but load the entire thread.  
Old January 28th, 2019 (7:59 PM).
Noodlewhiz's Avatar
Noodlewhiz Noodlewhiz is offline
 
Join Date: Apr 2017
Posts: 71
You could also use this routine made by Squeetz: https://pastebin.com/fH4z4PCS
It allows you to toggle the capturability of Pokemon by setting a flag.
Reply With Quote
  #6   Link to this post, but load the entire thread.  
Old April 5th, 2019 (7:12 PM).
Just A Remixer's Avatar
Just A Remixer Just A Remixer is offline
a low iq rom hacker
 
Join Date: Feb 2019
Location: No Palette Town
Gender: Male
Nature: Quiet
Posts: 37
Well at least there is one of these for FR. Honestly, Fire Red gets to much attention, which is a good thing, and a BAD thing
__________________
2020 Guys... May dear Rosa finally be at peace
All media
Spoiler:
Instagram(I rarely post here. When I do, it's mostly memes):https://www.instagram.com/johto_trainer_max/
Deviantart(I Post here more frequently, but not that much. It has Pokemon sprites that you can actually use in your actual ROM hacks/fan games, just GIVE CREDIT in a txt folder or the endgame credits): https://www.deviantart.com/just-a-remaker
YouTube (Content): https://www.youtube.com/channel/UCYQFlrZRXJPG4wpvIXstfXA?

Projects
Spoiler:
Current projects:
Bronze
Reply With Quote
Reply

Quick Reply

Join the conversation!

Create an account to post a reply in this thread, participate in other discussions, and more!

Create a PokéCommunity Account
Ad Content
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

Forum Jump


All times are GMT -8. The time now is 9:13 AM.