The PokéCommunity Forums  

Go Back   The PokéCommunity Forums > Fan Games > Binary ROM Hacking > Binary Hack Research & Development
Reload this Page Code ASM Resource Thread

Notices
For all updates, view the main page.

Binary Hack Research & Development Got a well-founded knack with your binary Pokémon hacks? Love reverse-engineering them? For the traditional Pokémon ROM hacker, this is the spot for polling and gathering your ideas, and then implementing them! Share your hypothesis, get ideas from others, and collaborate to create!

Ad Content
Reply
 
Thread Tools
  #326   Link to this post, but load the entire thread.  
Old December 17th, 2014 (9:07 PM).
Blah's Avatar
Blah Blah is offline
Free supporter
 
Join Date: Jan 2013
Location: Unknown Island
Gender: Male
Posts: 1,924
Quote:
Originally Posted by jiangzhengwenjzw View Post
I think that's a big problem. Not only the scene of registering Pokemon data is not right, but the data in Pokedex is also wrong when I open it to see the data. For example, I caught Gary's squirtle but in the Pokedex the data of Pidgey is obtained and squirtle is still marked not caught. I challenged another trainer with 2 Pokemon and the same thing happened.
Hi, thank you for your reports. I've now fixed the bugs and will attach the fixes to this post.

Quote:
Originally Posted by DarkPsychic View Post
Thank you so much!!! ^_^
Now I can start my hack....

It will be interesting to see if others use this as well...

Honestly I was just happy to get a reply at all for them requests,
I read the terms of the thread and wasn't even going to post but I thought hell with it midas well try...
I figured what the answers would be, but thought that it would be a good idea to get a programmers opinion on the subjects.
Usually to get a reply at all from the top asm programmers, scripters and graphic artist on here is a shot in the dark. So I do really appreciate it!

I would like to add though that I did try to make the Dawn Stone an its because of the gendercheck that it needs asm... From what I have been told, But you are right GoGo has it but wont release it until he feels the need I guess... sadly >_<
But that can always be worked around....

Again though THANK YOU!!!!!!
You need a donation button >_<
Alright, I'll make a Pokemon Gender check routine for you next time I've got time.

Quote:
Originally Posted by Aruaruu View Post
Yeah that is true. Going through all those item scripts and such is going to be a nightmare if I truly want to do it. XD

Well the idea is to prevent that. I know I filled up my bag with full restores and revives. :D
Hmmm, alright I'll look into it. It's just going to be painful because I'd need to make look-up tables and people need to keep those tables updated and such.

Quote:
Originally Posted by Urobolos View Post
How do you randomize the Trainer ID, because skipping the Oak Intro causes it to default at 000000.
Oh, that's an interesting side effect. Yes, I can change it really easily using my Random number generator. Routine may come sometime tomorrow.


Trainer Pokemon Capturing bug fixes



There were two bugs that needed squashing. The first one was the Pokedex being incorrectly updated. The second one was the pokedex graphic being incorrectly updated. These routines are fixes for specifically trainer capturing, however, they will do no harm at all if you insert them into a ROM without the trainer hack. For those of you with buggy Pokedexes, I suggest you pay some attention, because this is the key to fixing those as well.

I'll attach some technical explanations of how the thing is implemented later, and the cause of the bug.


Fixing the Pokedex update



The Pokedex is incorrectly updated in the case you don't capture the opponent's first Pokemon. This is because the game assumes that the Pokemon captured is in the first slot. There aren't any double wild battles in FireRed, so the case of two Pokemon aren't covered. Not to mention that it was never originally intended for the player to be able to capture trainer Pokemon. If anyone is planning on double wild battles in FireRed, this is how you would fix the capturing system here as well.

How to insert:

Compile and insert into free space the following routine:

Spoiler:

Code:
.text
.align 2
.thumb
.thumb_func	

main:
	push {r0-r2}
	ldr r2, .OpponentID
	ldr r2, [r2]
	mov r4, #0x0
	
loop:
	cmp r4, #0x5
	beq default
	ldr r0, .OpponentParty
	mov r1, #0x64
	mul r1, r1, r4
	add r0, r0, r1
	mov r1, r0
	ldr r0, [r0]
	cmp r0, r2
	beq writeSlot
	add r4, r4, #0x1
	b loop
	
default:
	ldr r1, .OpponentParty

writeSlot:
	mov r4, r1
	mov r0, r4
	mov r1, #0xB
	mov r2, #0x0
	push {r3}
	ldr r3, =(0x803FBE8 +1)
	bl linker
	pop {r3}
	mov r5, r0
	pop {r0-r2}
	ldr r0, =(0x802D96E +1)
	bx r0
	
	
linker:
	bx r3
	
	
.align 2

.OpponentID:
	.word 0x2023C84

.OpponentParty:
	.word 0x202402C


Compiled version:
Code:
07 B4 0F 4A 12 68 00 24 05 2C 09 D0 0D 48 64 21 61 43 40 18 01 1C 00 68 90 42 02 D0 01 34 F3 E7 08 49 0C 1C 20 1C 0B 21 00 22 08 B4 06 4B 00 F0 05 F8 08 BC 05 1C 07 BC 04 48 00 47 18 47 C0 46 84 3C 02 02 2C 40 02 02 E9 FB 03 08 6F D9 02 08
Now navigate to 0x2D95E and insert the following byte changes:
Code:
00 00 00 48 00 47 XX XX XX 08
Where XX XX XX is the reverse hex pointer to where you inserted this routine +1


Usage:

There isn't a usage for this hack. It's run internally and is 100% (tested) and safe for wild battles as well.



Fixing the Pokedex graphic



The Pokedex graphic suffered the same issue as the Pokedex update, however the routines aren't connected, so you need to fix both to yield a proper result.

How to insert:

Compile and insert the following routine into free space:

Spoiler:

Code:
.text
.align 2
.thumb
.thumb_func	

main:
	ldr r2, .OpponentID
	ldr r2, [r2]
	mov r4, #0x0
	
loop:
	cmp r4, #0x5
	beq default
	ldr r0, .OpponentParty
	mov r1, #0x64
	mul r1, r1, r4
	add r0, r0, r1
	mov r1, r0
	ldr r0, [r0]
	cmp r0, r2
	beq writeSlot
	add r4, r4, #0x1
	b loop
	
default:
	ldr r1, .OpponentParty

writeSlot:
	mov r0, r1
	mov r1, #0xB
	mov r2, #0x0
	push {r3}
	ldr r3, =(0x803FBE8 +1)
	bl linker
	pop {r3}
	mov r5, r0
	ldr r0, =(0x802D9EA +1)
	bx r0
	
	
linker:
	bx r3
	
	
.align 2

.OpponentID:
	.word 0x2023C84

.OpponentParty:
	.word 0x202402C


Compiled version:
Code:
0D 4A 12 68 00 24 05 2C 09 D0 0C 48 64 21 61 43 40 18 01 1C 00 68 90 42 02 D0 01 34 F3 E7 07 49 08 1C 0B 21 00 22 08 B4 05 4B 00 F0 04 F8 08 BC 05 1C 04 48 00 47 18 47 84 3C 02 02 2C 40 02 02 E9 FB 03 08 EB D9 02 08
Now navigate to 0x2D9DC and insert the following byte changes:
Code:
00 48 00 47 XX XX XX 08
Where XX XX XX is the reverse hex pointer to where you inserted your routine +1.

Usage:

There isn't a usage, it's run interally. I'm about 23% sure this might fix some people's Pokedex image bug as well.
__________________
...
Reply With Quote
  #327   Link to this post, but load the entire thread.  
Old December 17th, 2014 (9:43 PM). Edited May 9th, 2017 by Spherical Ice.
Blah's Avatar
Blah Blah is offline
Free supporter
 
Join Date: Jan 2013
Location: Unknown Island
Gender: Male
Posts: 1,924
Quote:
Originally Posted by Urobolos View Post
How do you randomize the Trainer ID, because skipping the Oak Intro causes it to default at 000000.
In response to this:

Setting a random Secret and Trainer ID



Requires the insertion of Random Number generator
So apparently TID isn't set if you skip the intro, and I'm sure SID is probably also not set. The following routine will randomize them for you!


To insert:

There's some orange text here, set it to be the pointer to where you inserted the random number generator routine +1 (keep the 0x8 prefix, but don't reverse the pointer).

After you've fixed the pointer, compile and insert into free space.

Spoiler:

Code:
.text
.align 2
.thumb
.thumb_func	

main:
	push (r0-r3, lr}
	ldr r0, .random
	ldr r1, =(0x20370B8) @generate first half of ID
	mov r2, #0xFF
	lsl r2, r2, #0x8
	add r2, r2, #0xFF
	strh r2, [r1]
	bl linker
	mov r3, r0
	ldr r1, =(0x20370B8) @generate second half of ID
	mov r2, #0xFF
	lsl r2, r2, #0x8
	add r2, r2, #0xFF
	strh r2, [r1]
	push {r3}
	bl linker
	pop {r3}
	lsl r0, r0, #0x10
	lsr r3, r3, #0x10
	orr r3, r3, r0
	ldr r0, =(0x300500C)
	ldr r0, [r0]
	add r0, r0, #0xA
	ldr r1, =(0x20370BA)
	ldrb r1, [r1]
	add r0, r0, r1
	strh r3, [r0] @set ID
	cmp r1, #0x1
	bne setRam
	pop {r0-r3, pc}
	
setRam:
	ldr r1, =(0x2020000) @set RAM Pointer to TID
	strh r3, [r1]
	pop {r0-r3, pc}
	
	
linker:
	bx r0
	
	
.align 2

.random:
	.word 0x8[random]



Usage:

setvar 0x8001 0x0
callasm 0x[this routine +1]
setvar 0x8001 0x2
callasm 0x[this routine +1]

Call it twice like I have, setting var 0x8001 to 0x0 and 0x2 respectively, it will generate a random PID and SID.
__________________
...
Reply With Quote
  #328   Link to this post, but load the entire thread.  
Old December 18th, 2014 (2:50 AM). Edited December 18th, 2014 by Trainer 781.
Trainer 781
Guest
 
Posts: n/a
Wide Lens (Raises wielder's accuracy by 10%)

Spoiler:

At 1E050: 00 4A 10 47 XX+1 XX XX 08
ZZ is the mystery byte of your item.

Code:
.text
.align 2
.thumb
.thumb_func

ldr r0, =0x2023d6b
ldrb r0, [r0, #0x0]
mul r0, r5
add r0, r0, r7
add r0, #0x2e
ldrh r0, [r0, #0x0]
bl geteffect
cmp r0, #0xZZ
bne noboost

mov r0, #0x6E
mul r0, r4
mov r1, #0x64
bl divide
lsl r0, r0, #0x10
lsr r4, r0, #0x10

noboost:
mov r0, #0x0
str r0, [sp, #0x0]
mov r0, #0x13
mov r1, #0x0
ldr r2, return 
bx r2

divide:
ldr r2, divider
bx r2

geteffect:
ldr r1, getbyte
bx r1


.align 2
getbyte: .word 0x0809A925
divider: .word 0x081E4019
return: .word 0x0801E059
Reply With Quote
  #329   Link to this post, but load the entire thread.  
Old December 18th, 2014 (3:23 AM).
DarkPsychic's Avatar
DarkPsychic DarkPsychic is offline
 
Join Date: Jul 2012
Location: CO
Gender: Male
Nature: Timid
Posts: 146
No rush at all...
I am very appreciative for not only the Bank System I have been trying to get for years but every single contribution you bring to the community ^_^
So I again Thank and applaud you an even the rest of the contributors!!!

Joexv,
Dawn Stone- Effect: Causes Male Kirlia to evolve into Gallade.
Causes Female Snorunt to evolve into Froslass.

http://bulbapedia.bulbagarden.net/wiki/Evolutionary_stone

It will be a great addition to the game for sure ^_^
Reply With Quote
  #330   Link to this post, but load the entire thread.  
Old December 18th, 2014 (3:55 AM).
Lance32497's Avatar
Lance32497 Lance32497 is offline
LanceKoijer of Pokemon_Addicts
 
Join Date: Aug 2014
Location: Criscanto town-Ginoa Region xD
Gender: Male
Nature: Adamant
Posts: 792
Quote:
Originally Posted by FBI agent View Post


Compiled version:
Code:
0D 4A 12 68 00 24 05 2C 09 D0 0C 48 64 21 61 43 40 18 01 1C 00 68 90 42 02 D0 01 34 F3 E7 07 49 08 1C 0B 21 00 22 08 B4 05 4B 00 F0 04 F8 08 BC 05 1C 04 48 00 47 18 47 84 3C 02 02 2C 40 02 02 E9 FB 03 08 EB D9 02 08
Now navigate to 0x2D9DC and insert the following byte changes:
Code:
00 48 00 47 XX XX XX 08
Where XX XX XX is the reverse hex pointer to where you inserted your routine +1.

Usage:

There isn't a usage, it's run interally. I'm about 23% sure this might fix some people's Pokedex image bug as well.
Will these codes fix the graphic problem of expanded pokemon? It shares the same pokemon
__________________
This signature has been disabled.
Scrollbar appears
Please review and fix the issues by reading the signature rules.

You must edit it to meet the limits set by the rules before you may remove the [sig-reason] code from your signature. Removing this tag will re-enable it.

Do not remove the tag until you fix the issues in your signature. You may be infracted for removing this tag if you do not fix the specified issues. Do not use this tag for decoration purposes.
Reply With Quote
  #331   Link to this post, but load the entire thread.  
Old December 18th, 2014 (4:35 AM). Edited December 18th, 2014 by jiangzhengwenjzw.
jiangzhengwenjzw's Avatar
jiangzhengwenjzw jiangzhengwenjzw is offline
now working on katam
 
Join Date: Sep 2012
Gender: Male
Posts: 175
Great work! The current problem was solved but I found another bug. When the old man in Firered taught you how to catch pokemon, the weedle he caught was registered on the Pokedex and it appeared in my team!
Edit: Moreover, when I watched the Teachy TV, as it caught a Jigglypuff, it didn't appear in my team but is registered in the Pokedex and marked as caught!
Reply With Quote
  #332   Link to this post, but load the entire thread.  
Old December 18th, 2014 (2:08 PM).
Urobolos Urobolos is offline
 
Join Date: Nov 2014
Posts: 15
Quote:
Originally Posted by FBI agent View Post
In response to this:
To insert:

There's some orange text here, set it to be the pointer to where you inserted the random number generator routine +1 (keep the 0x8 prefix, but don't reverse the pointer).

After you've fixed the pointer, compile and insert into free space.

Spoiler:

[code]
.text
.align 2
.thumb
.thumb_func

main:
push (r0-r3, lr}
ldr r0, .random
ldr r1, =(0x20370B8) @generate first half of ID
mov r2, #0xFFFF
strh r2, [r1]
bl linker
mov r3, r0
ldr r1, =(0x20370B8) @generate second half of ID
mov r2, #0xFFFF
strh r2, [r1]
push {r3}
bl linker
pop {r3}
lsl r0, r0, #0x10
lsr r3, r3, #0x10
orr r3, r3, r0
ldr r0, =(0x300500C)
ldr r0, [r0]
add r0, r0, #0xA
ldr r1, =(0x20370BA)
ldrb r1, [r1]
add r0, r0, r1
strh r3, [r0] @set ID
cmp r1, #0x1
bne setRam
pop {r0-r3, pc}

setRam:
ldr r1, =(0x2020000) @set RAM Pointer to TID
strh r3, [r1]
pop {r0-r3, pc}


linker:
bx r0


.align 2

.random:
.word 0x8[random]
[code]



Usage:

setvar 0x8001 0x0
callasm 0x[this routine +1]
setvar 0x8001 0x2
callasm 0x[this routine +1]

Call it twice like I have, setting var 0x8001 to 0x0 and 0x2 respectively, it will generate a random PID and SID.
It won't compile in HackMew's compiler. It complains for both "mov r2, 0xFFFF" lines that 0xFFFF/65535 is "out of range".
Reply With Quote
  #333   Link to this post, but load the entire thread.  
Old December 18th, 2014 (3:45 PM).
Blah's Avatar
Blah Blah is offline
Free supporter
 
Join Date: Jan 2013
Location: Unknown Island
Gender: Male
Posts: 1,924
Quote:
Originally Posted by KDS View Post
Wide Lens (Raises wielder's accuracy by 10%)

Spoiler:

At 1E050: 00 4A 10 47 XX+1 XX XX 08
ZZ is the mystery byte of your item.

Code:
.text
.align 2
.thumb
.thumb_func

ldr r0, =0x2023d6b
ldrb r0, [r0, #0x0]
mul r0, r5
add r0, r0, r7
add r0, #0x2e
ldrh r0, [r0, #0x0]
bl geteffect
cmp r0, #0xZZ
bne noboost

mov r0, #0x6E
mul r0, r4
mov r1, #0x64
bl divide
lsl r0, r0, #0x10
lsr r4, r0, #0x10

noboost:
mov r0, #0x0
str r0, [sp, #0x0]
mov r0, #0x13
mov r1, #0x0
ldr r2, return 
bx r2

divide:
ldr r2, divider
bx r2

geteffect:
ldr r1, getbyte
bx r1


.align 2
getbyte: .word 0x0809A925
divider: .word 0x081E4019
return: .word 0x0801E059
Good job!


Quote:
Originally Posted by Lance32497 View Post
Will these codes fix the graphic problem of expanded pokemon? It shares the same pokemon
It likely won't. There's a lot of things that go wrong, there's limiting code everywhere. So unless you fix those and keep the data/clean and consistent you're going to get bugs all day :)

Quote:
Originally Posted by jiangzhengwenjzw View Post
Great work! The current problem was solved but I found another bug. When the old man in Firered taught you how to catch pokemon, the weedle he caught was registered on the Pokedex and it appeared in my team!
Edit: Moreover, when I watched the Teachy TV, as it caught a Jigglypuff, it didn't appear in my team but is registered in the Pokedex and marked as caught!
Woah. That's actually a cool side-effect imo (especially since you can change what Pokemon the old guy catches you). But you can overcome with this clever use of the PSS full party swap routine. Basically call it at the start of the techy tv script, then use the PSS again at the end of the script.

Quote:
Originally Posted by Urobolos View Post
It won't compile in HackMew's compiler. It complains for both "mov r2, 0xFFFF" lines that 0xFFFF/65535 is "out of range".
I've made some fixes
__________________
...
Reply With Quote
  #334   Link to this post, but load the entire thread.  
Old December 18th, 2014 (4:14 PM).
urzzz urzzz is offline
 
Join Date: May 2006
Gender:
Nature: Naughty
Posts: 17
Hi,

Using the Battle Mode + Remove White Out add-on. Is there any flag or variable to check whether I won or lost the last battle? (particularly for trainers)

I'm trying to branch a script using the 0x1 Trainerbattle byte. With a trainer having a 'victory' message and a 'defeated' message.

Many thanks :-)
Reply With Quote
  #335   Link to this post, but load the entire thread.  
Old December 18th, 2014 (5:56 PM). Edited December 18th, 2014 by Blah.
Blah's Avatar
Blah Blah is offline
Free supporter
 
Join Date: Jan 2013
Location: Unknown Island
Gender: Male
Posts: 1,924

Check Pokemon Gender



This is a simple routine to check a certain Pokemon in your party's gender given a slot number.

How to insert:

Compile the following routine into Free space:
Spoiler:

Code:
.text
.align 2
.thumb
.thumb_func

@Genderless = 0
@Female = 1
@Male = 2

main:
	push {r0-r4, lr}
	ldr r0, =(0x20370C0)
	ldrb r0, [r0]
	mov r1, #0x64
	mul r1, r1, r0
	ldr r0, =(0x2024284)
	add r0, r0, r1 @slot
	mov r4, r0

getGender:
	mov r1, #0xB
	ldr r2, =(0x803FBE8 +1) @get species
	bl linker
	mov r2, r0 @species
	push {r2}
	mov r0, r4
	mov r1, #0x0
	ldr r2, =(0x803FBE8 +1) @get PID
	bl linker
	pop {r2}
	mov r1, r0 @PID
	mov r0, r2 @species
	ldr r2, =(0x803F78C +1)
	bl linker

fixReturn:
	ldr r1, =(0x20370B8)
	mov r2, #0xFF
	sub r0, r2, r0
	cmp r0, r2
	bne store
	mov r0, #0x2
	
store:
	strb r0, [r1]
	pop {r0-r4, pc}

linker:
	bx r2

.align 2


Here's a compiled version:
Code:
1F B5 10 48 00 78 64 21 41 43 0F 48 40 18 04 1C 0B 21 0E 4A 00 F0 15 F8 02 1C 04 B4 20 1C 00 21 0A 4A 00 F0 0E F8 04 BC 01 1C 10 1C 08 4A 00 F0 08 F8 08 49 FF 22 10 1A 90 42 00 D1 02 20 08 70 1F BD 10 47 C0 70 03 02 84 42 02 02 E9 FB 03 08 8D F7 03 08 B8 70 03 02

Usage:

setvar 0x8004 0x[slot number]
callasm 0x[this routine]

The return value from the routine will be in variable 0x8000.

Genderless = 0
Female = 1
Male = 2


Quote:
Originally Posted by urzzz View Post
Hi,

Using the Battle Mode + Remove White Out add-on. Is there any flag or variable to check whether I won or lost the last battle? (particularly for trainers)

I'm trying to branch a script using the 0x1 Trainerbattle byte. With a trainer having a 'victory' message and a 'defeated' message.

Many thanks :-)
RAM location 0x2023E8A will be zero if they lost. Something else if they won.
__________________
...
Reply With Quote
  #336   Link to this post, but load the entire thread.  
Old December 18th, 2014 (6:03 PM).
Lance32497's Avatar
Lance32497 Lance32497 is offline
LanceKoijer of Pokemon_Addicts
 
Join Date: Aug 2014
Location: Criscanto town-Ginoa Region xD
Gender: Male
Nature: Adamant
Posts: 792
Quote:
Originally Posted by FBI agent View Post

Check Pokemon Gender



This is a simple routine to check a certain Pokemon in your party's gender given a slot number.

How to insert:

Compile the following routine into Free space:
Spoiler:

Code:
.text
.align 2
.thumb
.thumb_func

@Genderless = 0
@Female = 1
@Male = 2

main:
	push {r0-r4, lr}
	ldr r0, =(0x20370C0)
	ldrb r0, [r0]
	mov r1, #0x64
	mul r1, r1, r0
	ldr r0, =(0x2024284)
	add r0, r0, r1 @slot
	mov r4, r0

getGender:
	mov r1, #0xB
	ldr r2, =(0x803FBE8 +1) @get species
	bl linker
	mov r2, r0 @species
	push {r2}
	mov r0, r4
	mov r1, #0x0
	ldr r2, =(0x803FBE8 +1) @get PID
	bl linker
	pop {r2}
	mov r1, r0 @PID
	mov r0, r2 @species
	ldr r2, =(0x803F78C +1)
	bl linker

fixReturn:
	ldr r1, =(0x20370B8)
	mov r2, #0xFF
	sub r0, r2, r0
	cmp r0, r2
	bne store
	mov r0, #0x2
	
store:
	strb r0, [r1]
	pop {r0-r4, pc}

linker:
	bx r2

.align 2


Here's a compiled version:
Code:
1F B5 10 48 00 78 64 21 41 43 0F 48 40 18 04 1C 0B 21 0E 4A 00 F0 15 F8 02 1C 04 B4 20 1C 00 21 0A 4A 00 F0 0E F8 04 BC 01 1C 10 1C 08 4A 00 F0 08 F8 08 49 FF 22 10 1A 90 42 00 D1 02 20 08 70 1F BD 10 47 C0 70 03 02 84 42 02 02 E9 FB 03 08 8D F7 03 08 B8 70 03 02

Usage:

setvar 0x8004 0x[slot number]
callasm 0x[this routine]

The return value from the routine will be in variable 0x8000.

Genderless = 0
Female = 1
Male = 2



There isn't. I'll edit the routine to have one shortly.
This is awesome!
Upgrading your Party Item Checker Routine
A new var will be set making the game checks If an specified Pokemon holding an specified item in an specified party slot.
Example, A bulbasaur holding Master ball in Party Slot number 1.
__________________
This signature has been disabled.
Scrollbar appears
Please review and fix the issues by reading the signature rules.

You must edit it to meet the limits set by the rules before you may remove the [sig-reason] code from your signature. Removing this tag will re-enable it.

Do not remove the tag until you fix the issues in your signature. You may be infracted for removing this tag if you do not fix the specified issues. Do not use this tag for decoration purposes.
Reply With Quote
  #337   Link to this post, but load the entire thread.  
Old December 18th, 2014 (6:10 PM).
Blah's Avatar
Blah Blah is offline
Free supporter
 
Join Date: Jan 2013
Location: Unknown Island
Gender: Male
Posts: 1,924
Quote:
Originally Posted by Lance32497 View Post
This is awesome!
Upgrading your Party Item Checker Routine
A new var will be set making the game checks If an specified Pokemon holding an specified item in an specified party slot.
Example, A bulbasaur holding Master ball in Party Slot number 1.
This is what it's capable of currently. It works with a species argument, and if you don't provide a species it will just look for the item.
__________________
...
Reply With Quote
  #338   Link to this post, but load the entire thread.  
Old December 18th, 2014 (6:18 PM).
Lance32497's Avatar
Lance32497 Lance32497 is offline
LanceKoijer of Pokemon_Addicts
 
Join Date: Aug 2014
Location: Criscanto town-Ginoa Region xD
Gender: Male
Nature: Adamant
Posts: 792
Quote:
Originally Posted by FBI agent View Post
This is what it's capable of currently. It works with a species argument, and if you don't provide a species it will just look for the item.
Huh? I dont understand,... Is it possible to your routine?
__________________
This signature has been disabled.
Scrollbar appears
Please review and fix the issues by reading the signature rules.

You must edit it to meet the limits set by the rules before you may remove the [sig-reason] code from your signature. Removing this tag will re-enable it.

Do not remove the tag until you fix the issues in your signature. You may be infracted for removing this tag if you do not fix the specified issues. Do not use this tag for decoration purposes.
Reply With Quote
  #339   Link to this post, but load the entire thread.  
Old December 18th, 2014 (8:17 PM).
Deokishisu's Avatar
Deokishisu Deokishisu is offline
Mr. Magius
 
Join Date: Feb 2006
Location: If I'm online, it's a safe bet I'm at a computer.
Gender: Male
Nature: Relaxed
Posts: 984
Quote:
Originally Posted by Lance32497 View Post
Huh? I dont understand,... Is it possible to your routine?
Yes, he's saying that the routine is able to check whether a certain species in the party is carrying a specific item. If you give it a species to check for as well as an item, it will check both. If you give it just the item, it'll simply try to find the item.
Reply With Quote
  #340   Link to this post, but load the entire thread.  
Old December 18th, 2014 (9:23 PM).
Lance32497's Avatar
Lance32497 Lance32497 is offline
LanceKoijer of Pokemon_Addicts
 
Join Date: Aug 2014
Location: Criscanto town-Ginoa Region xD
Gender: Male
Nature: Adamant
Posts: 792
Quote:
Originally Posted by Deokishisu View Post
Yes, he's saying that the routine is able to check whether a certain species in the party is carrying a specific item. If you give it a species to check for as well as an item, it will check both. If you give it just the item, it'll simply try to find the item.
No, That is Not what I mean, I know that routines usage. what I mean is The game will check not only the Specie and Item but also party slot,
example: A bulbasaur holding Master ball in 1st slot only.
__________________
This signature has been disabled.
Scrollbar appears
Please review and fix the issues by reading the signature rules.

You must edit it to meet the limits set by the rules before you may remove the [sig-reason] code from your signature. Removing this tag will re-enable it.

Do not remove the tag until you fix the issues in your signature. You may be infracted for removing this tag if you do not fix the specified issues. Do not use this tag for decoration purposes.
Reply With Quote
  #341   Link to this post, but load the entire thread.  
Old December 18th, 2014 (9:33 PM).
Blah's Avatar
Blah Blah is offline
Free supporter
 
Join Date: Jan 2013
Location: Unknown Island
Gender: Male
Posts: 1,924
Quote:
Originally Posted by Lance32497 View Post
No, That is Not what I mean, I know that routines usage. what I mean is The game will check not only the Specie and Item but also party slot,
example: A bulbasaur holding Master ball in 1st slot only.
I'm telling you that is exactly what it does...

Code:
#dyn 0x740000
#org @start
lock
faceplayer
setvar 0x8000 0xspecies
setvar 0x8001 0xItemID
storevar 0x0 0x8000
storevar 0x1 0x8001
callasm 0x[Where you inserted the above routine +1]
compare 0x8000 0x6
if == jump @notFound
storevar 0x2 0x8000
msgbox @result
callstd MSG_NORMAL
release
end

#org @notFound
msgbox @failed
callstd MSG_NORMAL
release
end

#org @failed
= No match found for /v/h02 with a /v/h03

#org @result
= /v/h02 with a /v/h03 found in /v/h04
__________________
...
Reply With Quote
  #342   Link to this post, but load the entire thread.  
Old December 18th, 2014 (11:21 PM).
Lance32497's Avatar
Lance32497 Lance32497 is offline
LanceKoijer of Pokemon_Addicts
 
Join Date: Aug 2014
Location: Criscanto town-Ginoa Region xD
Gender: Male
Nature: Adamant
Posts: 792
Quote:
Originally Posted by FBI agent View Post
I'm telling you that is exactly what it does...

Code:
#dyn 0x740000
#org @start
lock
faceplayer
setvar 0x8000 0xspecies
setvar 0x8001 0xItemID
storevar 0x0 0x8000
storevar 0x1 0x8001
callasm 0x[Where you inserted the above routine +1]
compare 0x8000 0x6
if == jump @notFound
storevar 0x2 0x8000
msgbox @result
callstd MSG_NORMAL
release
end

#org @notFound
msgbox @failed
callstd MSG_NORMAL
release
end

#org @failed
= No match found for /v/h02 with a /v/h03

#org @result
= /v/h02 with a /v/h03 found in /v/h04
All it does is tell the exact slot of an specified Pokemon holding specified item...
what I really mean is it will check only in 1st slot(lets say) Even though you have bulbasaur holding masterball in 2nd, 3rd, 4th, 5th, or 6th slot, it ignores it because it just needs to check only in 1st.
By the way, how if I have 2 Bulbasaurs holding Masterball in same party, will this not affect the entire script? (thats why I request this routine to add new var that will be set in order for the game to check only in an specific area
: another example:
Code:
...
setvar 0x8000 0xspecies
setvar 0x8001 0xItemID
setvar 0x8002 0xSlotnumber(0-5:just an example)
storevar 0x0 0x8000
storevar 0x1 0x8001
storevar 0x2 0x8002
callasm 0x[Where you inserted the above routine +1]
compare 0x8000 0x6
...
__________________
This signature has been disabled.
Scrollbar appears
Please review and fix the issues by reading the signature rules.

You must edit it to meet the limits set by the rules before you may remove the [sig-reason] code from your signature. Removing this tag will re-enable it.

Do not remove the tag until you fix the issues in your signature. You may be infracted for removing this tag if you do not fix the specified issues. Do not use this tag for decoration purposes.
Reply With Quote
  #343   Link to this post, but load the entire thread.  
Old December 19th, 2014 (2:57 AM).
DarkPsychic's Avatar
DarkPsychic DarkPsychic is offline
 
Join Date: Jul 2012
Location: CO
Gender: Male
Nature: Timid
Posts: 146
Quote:
Originally Posted by Lance32497 View Post
All it does is tell the exact slot of an specified Pokemon holding specified item...
what I really mean is it will check only in 1st slot(lets say) Even though you have bulbasaur holding masterball in 2nd, 3rd, 4th, 5th, or 6th slot, it ignores it because it just needs to check only in 1st.
By the way, how if I have 2 Bulbasaurs holding Masterball in same party, will this not affect the entire script? (thats why I request this routine to add new var that will be set in order for the game to check only in an specific area
: another example:
Code:
...
setvar 0x8000 0xspecies
setvar 0x8001 0xItemID
setvar 0x8002 0xSlotnumber(0-5:just an example)
storevar 0x0 0x8000
storevar 0x1 0x8001
storevar 0x2 0x8002
callasm 0x[Where you inserted the above routine +1]
compare 0x8000 0x6
...

Hello Lance32497 ,
Now I might be wrong here but
I think "compare 0x8000 0x6" is the slots...
ergo "0x6" is comparing the routine to all 6 slots in the party...
Try changing that to "0x1"...

Now again I am not a scripter and am just starting to really learn my self...
so take my advice with a grain of salt... >_<

Oh an so this post is not off topic,
This is not really a request but more of "is it even possible"
Changing the Battle system to Action Battle System like Mystery Dungeon...
Example would be when you get into a battle, "Player" and challenging Trainer are warped to a simple small map where battle...
Here is the link that gave me the idea, Check it out when you have time FBI Agent an again I would just like to know if this can even be done?
Cause I assume Asm could do it is the only reason I bring it up...

http://youtu.be/XNPuaPBm6ss
Reply With Quote
  #344   Link to this post, but load the entire thread.  
Old December 19th, 2014 (3:02 AM).
Lance32497's Avatar
Lance32497 Lance32497 is offline
LanceKoijer of Pokemon_Addicts
 
Join Date: Aug 2014
Location: Criscanto town-Ginoa Region xD
Gender: Male
Nature: Adamant
Posts: 792
Quote:
Originally Posted by DarkPsychic View Post
Hello Lance32497 ,
Now I might be wrong here but
I think "compare 0x8000 0x6" is the slots...
ergo "0x6" is comparing the routine to all 6 slots in the party...
Try changing that to "0x1"...

Now again I am not a scripter and am just starting to really learn my self...
so take my advice with a grain of salt... >_<

Oh an so this post is not off topic,
This is not really a request but more of "is it even possible"
Changing the Battle system to Action Battle System like Mystery Dungeon...
Example would be when you get into a battle, "Player" and challenging Trainer are warped to a simple small map where battle...
Here is the link that gave me the idea, Check it out when you have time FBI Agent an again I would just like to know if this can even be done?
Cause I assume Asm could do it is the only reason I bring it up...

http://youtu.be/XNPuaPBm6ss
Ill try to warch that if I am on PC... thanks ^_^
__________________
This signature has been disabled.
Scrollbar appears
Please review and fix the issues by reading the signature rules.

You must edit it to meet the limits set by the rules before you may remove the [sig-reason] code from your signature. Removing this tag will re-enable it.

Do not remove the tag until you fix the issues in your signature. You may be infracted for removing this tag if you do not fix the specified issues. Do not use this tag for decoration purposes.
Reply With Quote
  #345   Link to this post, but load the entire thread.  
Old December 19th, 2014 (3:27 AM). Edited December 19th, 2014 by urzzz.
urzzz urzzz is offline
 
Join Date: May 2006
Gender:
Nature: Naughty
Posts: 17
Quote:
Originally Posted by FBI agent View Post
RAM location 0x2023E8A will be zero if they lost. Something else if they won.
This worked a treat!, copied the byte from RAM to a varaible and branched from there. Thank you very much, and keep up the good work :-)

if I could suggest/request one more thing (if it's feasible?). When you knock out/faint another trainers Pokémon. You are shown the next Pokémon the trainer will be using and also prompted if you want to switch out your current in-play Pokémon.

Is it possible to skip the prompt (without switching) and continue through to the 'go [bufferedpokemon]!' message and continue the battle?

I'm aiming to have a system where the Player is on an even playing field with the AI. Where if the player wanted to switch a pokémon for any reason, they would have to sacrifice a full turn to do so.

Many thanks
Reply With Quote
  #346   Link to this post, but load the entire thread.  
Old December 19th, 2014 (6:03 AM).
Lance32497's Avatar
Lance32497 Lance32497 is offline
LanceKoijer of Pokemon_Addicts
 
Join Date: Aug 2014
Location: Criscanto town-Ginoa Region xD
Gender: Male
Nature: Adamant
Posts: 792
Teaching a move in certain pokemon using Script
So this is different in Teaching moves in overworld, instead of choosing who is the pokemon compatible for the move, it will automagically replaces the 1st or the Last move that the pokemon knows.
__________________
This signature has been disabled.
Scrollbar appears
Please review and fix the issues by reading the signature rules.

You must edit it to meet the limits set by the rules before you may remove the [sig-reason] code from your signature. Removing this tag will re-enable it.

Do not remove the tag until you fix the issues in your signature. You may be infracted for removing this tag if you do not fix the specified issues. Do not use this tag for decoration purposes.
Reply With Quote
  #347   Link to this post, but load the entire thread.  
Old December 19th, 2014 (8:34 AM).
DoesntKnowHowToPlay's Avatar
DoesntKnowHowToPlay DoesntKnowHowToPlay is offline
Tiny Umbrella with Lots and Lots of Good
 
Join Date: Jan 2012
Posts: 264
Quote:
Originally Posted by urzzz View Post
This worked a treat!, copied the byte from RAM to a varaible and branched from there. Thank you very much, and keep up the good work :-)

if I could suggest/request one more thing (if it's feasible?). When you knock out/faint another trainers Pokémon. You are shown the next Pokémon the trainer will be using and also prompted if you want to switch out your current in-play Pokémon.

Is it possible to skip the prompt (without switching) and continue through to the 'go [bufferedpokemon]!' message and continue the battle?

I'm aiming to have a system where the Player is on an even playing field with the AI. Where if the player wanted to switch a pokémon for any reason, they would have to sacrifice a full turn to do so.

Many thanks

Either turn set mode on in the options, or put 28 92 87 1D 08 at x1D8727. Be warned that the latter approach has a nasty side effect; scrubs will complain about your hack being "bugged" or that you removed a feature that should've stayed.
__________________

Yet Another Fire Red Hack

Physical/Special Split
Reply With Quote
  #348   Link to this post, but load the entire thread.  
Old December 19th, 2014 (10:20 AM).
Blah's Avatar
Blah Blah is offline
Free supporter
 
Join Date: Jan 2013
Location: Unknown Island
Gender: Male
Posts: 1,924
Quote:
Originally Posted by Lance32497 View Post
Teaching a move in certain pokemon using Script
So this is different in Teaching moves in overworld, instead of choosing who is the pokemon compatible for the move, it will automagically replaces the 1st or the Last move that the pokemon knows.
You just want to overwrite a Pokemon's first move? That sounds like a bad idea. What's wrong with the over-world ingame move tutor?

Quote:
Originally Posted by Lance32497 View Post
All it does is tell the exact slot of an specified Pokemon holding specified item...
what I really mean is it will check only in 1st slot(lets say) Even though you have bulbasaur holding masterball in 2nd, 3rd, 4th, 5th, or 6th slot, it ignores it because it just needs to check only in 1st.
By the way, how if I have 2 Bulbasaurs holding Masterball in same party, will this not affect the entire script? (thats why I request this routine to add new var that will be set in order for the game to check only in an specific area
: another example:
Code:
...
setvar 0x8000 0xspecies
setvar 0x8001 0xItemID
setvar 0x8002 0xSlotnumber(0-5:just an example)
storevar 0x0 0x8000
storevar 0x1 0x8001
storevar 0x2 0x8002
callasm 0x[Where you inserted the above routine +1]
compare 0x8000 0x6
...
Alright. This is a minor edit of the existing code. Use 0x8004 for slot number. Everything else is the same.
Spoiler:

Code:
.text
.align 2
.thumb
.thumb_func

main:
	push {r0-r6, lr}
	ldr r5, =(0x20370C0)
	ldrb r5, [r5]
	mov r0, #0x64
	mul r0, r0, r5
	mov r1, r0
	ldr r0, =(0x2024284)
	add r0, r0, r1
	mov r4, r0
	mov r1, #0xC
	ldr r2, =(0x803FBE8 +1)
	bl linker
	ldr r3, .ITEM
	ldrb r3, [r3]
	cmp r0, r3
	beq PokeMatch

none:
	ldr r0, .MON
	mov r1, #0x6
	strb r1, [r0]
	pop {r0-r6, pc}	

	

PokeMatch:
	ldr r4, .MON
	ldrh r4, [r4]
	cmp r4, #0x0
	beq found
	ldr r2, =(0x803FBE8 +1)
	mov r0, r4
	mov r1, #0xB
	bl linker
	ldr r4, .MON
	ldrh r4, [r4]
	cmp r0, r4
	bne none

found:
	ldr r2, .MON
	strb r5, [r2]
	pop {r0-r6, pc}
	
	
linker:
	bx r2
	
	
.align 2

.ITEM:
	.word 0x020270B8 + (0x8001 * 2) @ITEM ID
.MON:
	.word 0x020270B8 + (0x8000 *2) @PKMN SPECIES


Quote:
Originally Posted by DoesntKnowHowToPlay View Post
Either turn set mode on in the options, or put 28 92 87 1D 08 at x1D8727. Be warned that the latter approach has a nasty side effect; scrubs will complain about your hack being "bugged" or that you removed a feature that should've stayed.
Thanks for saving me time :)
__________________
...
Reply With Quote
  #349   Link to this post, but load the entire thread.  
Old December 19th, 2014 (11:02 AM).
urzzz urzzz is offline
 
Join Date: May 2006
Gender:
Nature: Naughty
Posts: 17
Quote:
Originally Posted by DoesntKnowHowToPlay View Post
Either turn set mode on in the options, or put 28 92 87 1D 08 at x1D8727. Be warned that the latter approach has a nasty side effect; scrubs will complain about your hack being "bugged" or that you removed a feature that should've stayed.
Completely forgot about the options menu. But yeah the idea was to force the option. Haters gonna hate!

Much appreciated!
Reply With Quote
  #350   Link to this post, but load the entire thread.  
Old December 19th, 2014 (3:13 PM).
Kenny1's Avatar
Kenny1 Kenny1 is offline
On a break from Rom hacking, to improve other skills.
 
Join Date: Nov 2013
Gender: Male
Posts: 86
Finally, thanks to Jambo, the routine is finished
Changing textboxes depending on var
This uses variable 40F0, but it can be changed(probably :P)

First compile this routine:
Spoiler:
Code:
.text
.thumb
.thumb_func
.align 2

Main:
push {r0}
ldr r0, .Var
bl Decrypt
ldrh r0, [r0, #0x0]
ldr r1, .Table
lsl r0, r0, #0x2
ldr r1, [r1, r0]
pop {r0}
mov r2, #0xA0
lsl r2, r2, #0x2
ldr r3, .Ret
bx r3

Decrypt:
ldr r1, .Decrypt
bx r1

.align 2
.Var
	.word 0x000040F0

.Decrypt:
	.word 0x0806E455

.Table
 	.word 0xDEADBEEF

.Ret:
	.word 0x0814FECF
Compiled:
Spoiler:
Code:
01 B4 07 48 00 F0 09 F8 00 88 07 49 80 00 09 58 01 BC A0 22 92 00 05 4B 18 47 02 49 08 47 C0 46 F0 40 00 00 55 E4 06 08 EF BE AD 08 CF FE 14 08

Change DEADBEEF to the offset of this table(add the extra images):
Code:
C8 F1 41 08 0C 0B 47 08


Lastly the hook:
Spoiler:
Code:
00 49 08 47 XX XX XX 08
Replace XX XX XX with the pointer to your routine +1
Insert this at 0x0814FEC4


Usage:
You would setvar 0x40F0 to the number of your choice, 0x0 would be the first, 0x1 second etc.
__________________
I'm no longer active here, I check back every now and then to see what happens, but that's it. I no longer hack either.
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 8:46 AM.