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
  #401   Link to this post, but load the entire thread.  
Old December 26th, 2014 (5:38 PM).
tzujm33 tzujm33 is offline
 
Join Date: Jul 2014
Posts: 205
I have an idea about limiting the amounts of items that one can carry. however i wouldnjt like it to be like in red or silver. I would like it to be that you have a maximum of kg you can carry and hat each item weighs a diffrent amount of kg. for example a bike could weittgh 10 kg(or some other unit) and pokeball 1 kg. If the limit of the bag is 100 kg, you could be carry either 100 pokeballs or 90 pokeballs and one bike.


Another idea would be like the "game over when whiting out" thing, with the differnce, that the whiting out does occur after your last Pokemon died, or in other words that you dont go to game over after whiting out, aslong as one has pokemons in the box or pension.


I'd totally appreciate someone implementing these ideas! And thx for all the stuff that is already there!
__________________
Firered with beta mons: Pokemon retrieved Firered
Reply With Quote
  #402   Link to this post, but load the entire thread.  
Old December 26th, 2014 (8:44 PM).
Trainer 781
Guest
 
Posts: n/a
Quote:
Originally Posted by FBI agent View Post
Thanks :)
Jeez KDS, I don't wanna have to update the first post this often :P
Good job, lol.
Keep working harder and toil, matey. ;P
Reply With Quote
  #403   Link to this post, but load the entire thread.  
Old December 26th, 2014 (11:59 PM).
El Diabeetus's Avatar
El Diabeetus El Diabeetus is offline
Amateur Voice Actor / ROM Editor ('Hacker')
 
Join Date: Jul 2006
Age: 29
Nature: Lonely
Posts: 1,064
Hm, just thought of another potential thing that hasn't been done. May not be do able, but what about Critical Capture?
__________________
Hacks I'm currently working on (at a super slow pace):

Chinpokomon Big/Small (would leave the titles, but apparently exceeded sig limit)

Check my Japanese inspired Logo edits for Gens 1-7!:
http://www.pokecommunity.com/showpost.php?p=9137003
Reply With Quote
  #404   Link to this post, but load the entire thread.  
Old December 27th, 2014 (3:28 AM).
RuFF's Avatar
RuFF RuFF is offline
Hope you're having a RuFF day!
 
Join Date: Aug 2012
Location: Philippines
Age: 25
Gender: Male
Nature: Lonely
Posts: 363
I don't know if i'm the only one requesting a routine for pokemon ruby
I don't have something to contribute because i don't know how to asm
well i have 2 requests I hope you don't mind

1. You know when it's raining on the overworld it's raining in a pokemon battle. I'd like to see routine that when it's snowing/ashesfalling it's hailing in pokemon battle.

2. And a routine just like in JPAN's Hacked engine where you can make your own items that work with your custom scripts.

it's okay for me if this is not answered because i know that most of you hack fire red now
__________________
My Hack:
Reply With Quote
  #405   Link to this post, but load the entire thread.  
Old December 27th, 2014 (6:26 AM).
LocksmithArmy's Avatar
LocksmithArmy LocksmithArmy is offline
Mew!
 
Join Date: Feb 2013
Age: 34
Gender: Male
Posts: 416
Quote:
Originally Posted by quil09 View Post
2. And a routine just like in JPAN's Hacked engine where you can make your own items that work with your custom scripts.
This has been done... infact, complete item editor does it for you... super simple to implement
__________________
Reply With Quote
  #406   Link to this post, but load the entire thread.  
Old December 27th, 2014 (12:08 PM).
Volt-Ikazuchi's Avatar
Volt-Ikazuchi Volt-Ikazuchi is offline
 
Join Date: Dec 2013
Gender: Male
Posts: 33
Thanks for the No EXP Routine. This will really help to extract the salt of players who think they can level up mid Gym-Battle and get a advantage or something.
__________________
Ever seen a Stadium 2 Hack? There's one, and it needs your help!
Reply With Quote
  #407   Link to this post, but load the entire thread.  
Old December 27th, 2014 (8:28 PM).
TheRabbit TheRabbit is offline
Banned
 
Join Date: Jul 2014
Gender: Male
Posts: 69
FBI - I know you said you aren't developing routines anymore but I was just looking for some insight. Have you ever looked into changing the events that affect the player's trainer card in FR?

As an example, if I wanted to make it so finishing a new event gives a trainer card star instead of that stupid Doduo game. How would I do this?
Reply With Quote
  #408   Link to this post, but load the entire thread.  
Old December 27th, 2014 (9:14 PM).
kearnseyboy6 kearnseyboy6 is offline
Aussie's Toughest Mudder
 
Join Date: Dec 2008
Posts: 300
Quote:
Originally Posted by TheRabbit View Post
FBI - I know you said you aren't developing routines anymore but I was just looking for some insight. Have you ever looked into changing the events that affect the player's trainer card in FR?

As an example, if I wanted to make it so finishing a new event gives a trainer card star instead of that stupid Doduo game. How would I do this?
I'm pretty sure it's either a variable or flag that affects the trainer card. Just make your own events that change these variables.
__________________
HOLIDAYING CURRENTLY!!
Reply With Quote
  #409   Link to this post, but load the entire thread.  
Old December 28th, 2014 (2:41 AM).
Spherical Ice's Avatar
Spherical Ice Spherical Ice is offline
 
Join Date: Nov 2007
Location: Leicester, UK
Age: 25
Posts: 5,251
Quote:
Originally Posted by TheRabbit View Post
FBI - I know you said you aren't developing routines anymore but I was just looking for some insight. Have you ever looked into changing the events that affect the player's trainer card in FR?

As an example, if I wanted to make it so finishing a new event gives a trainer card star instead of that stupid Doduo game. How would I do this?
Quote:
Originally Posted by kearnseyboy6 View Post
I'm pretty sure it's either a variable or flag that affects the trainer card. Just make your own events that change these variables.
Just a reminder guys, not necessarily targeted only at you two, that this is for ASM resources, and so questions don't belong here. Instead, post in the ASM & Disassembly Help Thread in the future. Thanks!
__________________
Reply With Quote
  #410   Link to this post, but load the entire thread.  
Old December 31st, 2014 (2:58 PM).
DizzyEgg's Avatar
DizzyEgg DizzyEgg is offline
 
Join Date: Feb 2014
Location: Poland
Age: 25
Gender: Male
Nature: Quiet
Posts: 794
Hey, I've got a simple request.
Could you change the boost that held items such as mystic water, charcoal, magnet, twisted spoon etc. give from 10% to 20%.
Reply With Quote
  #411   Link to this post, but load the entire thread.  
Old December 31st, 2014 (3:44 PM). Edited December 31st, 2014 by Lance32497.
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

Battle Modes!



In this post, we will be implementing a base skeleton structure to allow the hacker to add in their own battle modes, I'll also be including some example "add-ons" so you know how to do it yourself. The post currently contains possibilities for the hacker to implement routines which run once at the end of each turn (perfect for tournament clauses) and a routine which runs once every move is chosen and used (perfect for trainer sliding *hint hint danillS*).

I'm calling it a skeleton, but it's actually more like a hook into a routine which runs your routines!
It works like this:
1) Hook from original to routine which runs routines
2) If flag is set, routine runs the routines it's told to run
3) Returns back to hooking location

So all you really need to do to add new battle modes, is add to the list of routines we call (Which is simple, I'll explain in detail later). I should also mention that these routines are called in ALL types of battle including wild, trainer, and scripted. Happy hacking!

Battle Routine By Move:



This routine will run, on average four times per turn. Once you select your move, once you use your move, once the opponents uses their move and at the end of the aftermath. This makes the routine a perfect branching place for an Oak-tutorial like battle.

How to insert:
Look at the routine below. The last line .table has an incomplete pointer. It says 0x[pointer to routine table]. Find enough free space (takes 4 byte per routine) in your ROM and set the pointer for .table to that. You do not add +1 to the pointer, nor is it in reverse hex. Once you've fixed the pointer, compile the routine into free space. The last pointer in the routine NEEDS to be 00 00 00 00.


Spoiler:

Code:
.text
.align 2
.thumb
.thumb_func

main
	push {r0-r4}
	mov r0, #0xBF @flag to check divided by 4
	lsl r0, r0, #0x2
	ldr r1, =(0x806E6D0 +1)
	bl linker
	cmp r0, #0x0
	beq noCrash
	ldr r4, .table

loop:
	ldr r1, [r4]
	cmp r1, #0x0 @check table entry is null
	beq noCrash
	bl linker @call table routine
	add r4, r4, #0x4 @get next table routine
	b loop
	

noCrash:
	pop {r0-r4}
	lsl r0, r0, #0x18
	lsr r0, r0, #0x18
	mov r10, r0
	lsl r1, r1, #0x10
	lsr r1, r1, #0x10
	ldr r2, =(0x2022874)
	ldr r0, =(0x800E2EA +1)
	bx r0

linker:
	bx r1
	
	
.align 2

.table:
	0x[pointer to routine table] @THIS IS FREE SPACE IF IT'S YOUR FIRST TIME USING THIS ROUTINE
Navigate to


Now navigate to 0xE2E0 and insert the byte changes:
Code:
00 4D 28 47 XX XX XX 08
Where XX XX XX is the reverse hex pointer to your routine +1.



Usage:
The routine is toggled by flag 0x2FC. Activate the flag to toggle routines called by this routine. To add routines into the list of called routines, navigate to the pointer of freespace you made .table point to. Insert into that table pointers in reverse hex +1 to wherever you compiled the addon routines make sure they have the 0x8 prefix. The structure of the table should be: [routine pointer in reverse hex +1 (4 bytes)] for each pointer in the table. I.e if I put the addon at 0x740000, the pointer would read 01 00 74 08.
why I got this error?


help please

Quote:
Originally Posted by FBI agent View Post

Battle by turn addons:



Sleeping clause:
Spoiler:

Code:
.text
.align 2
.thumb
.thumb_func

main:
	push {r0-r3,lr}
	mov r2, #0x0 @pokemon counter
	mov r3, #0x0 @sleeping counter

loop:
	cmp r2, #0x5
	beq validateBattle
	ldr r0, =(0x202402C + 0x50)
	mov r1, #0x64
	mul r1, r1, r2
	add r0, r0, r1
	ldrb r0, [r0]
	lsl r0, r0, #0x5
	lsr r0, r0, #0x5
	cmp r0, #0x0 @check sleeping
	beq next
	add r3, r3, #0x1
next:
	add r2, r2, #0x1
	b loop

validateBattle:
	cmp r3, #0x1 @check amount sleeping <=1
	ble end
	ldr r0, =(0x2023E8A)
	mov r1, #0x5
	strb r1, [r0]	

end:
	pop {r0-r3, pc}
	
	
.align 2


Battle end by turn:
Spoiler:

Code:
.text
.align 2
.thumb
.thumb_func

main:
	push {r0-r1,lr}
	ldr r0, =(0x20370CC)
	ldrb r0, [r0]
	ldr r1, =(0x3994FA3)
	ldrb r1, [r1]
	cmp r1, r0
	bne end
	ldr r0, =(0x2023E8A)
	mov r1, #0x5
	strb r1, [r0]	
end:
	pop {r0-r1, pc}
	
	
.align 2
Hi, if flag 0x2f8 has been set, will Sleeping clause and battle by end turn function simultaneously?
__________________
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
  #412   Link to this post, but load the entire thread.  
Old December 31st, 2014 (3:56 PM).
daniilS's Avatar
daniilS daniilS is offline
busy trying to do stuff not done yet
 
Join Date: Aug 2013
Age: 23
Gender: Male
Posts: 409
Quote:
Originally Posted by Lance32497 View Post
why I got this error?


help please
You need to put .word before the 0xpointerToTable I think.
__________________
Reply With Quote
  #413   Link to this post, but load the entire thread.  
Old December 31st, 2014 (7:24 PM).
Aruaruu Aruaruu is offline
 
Join Date: Sep 2011
Gender: Male
Posts: 199
Quote:
Originally Posted by DizzyEgg View Post
Hey, I've got a simple request.
Could you change the boost that held items such as mystic water, charcoal, magnet, twisted spoon etc. give from 10% to 20%.
This can be done in nearly any item editor. Just change the second special value to whatever you want.
Reply With Quote
  #414   Link to this post, but load the entire thread.  
Old January 1st, 2015 (3:16 PM).
DizzyEgg's Avatar
DizzyEgg DizzyEgg is offline
 
Join Date: Feb 2014
Location: Poland
Age: 25
Gender: Male
Nature: Quiet
Posts: 794
Hey. I've got some ideas that could make the game more similar to the newer ones. I don't know if they're all doable in ASM or if they could be done without it. If so, sorry. Anyway, here's my ideas:
- Electric types are immune to paralysis.
- Sturdy negates all hits that would OHKO-ed them and leaves Pokemon with 1 HP
- Grass types' immunity to powder moves i.e spore, poison powder etc.
- New items such as toxic orb, flame orb, focus sash, scope lens etc.
__________________
Support Pokeemerald!

Pokeemerald starter pack:
Emerald Expansion
Reply With Quote
  #415   Link to this post, but load the entire thread.  
Old January 2nd, 2015 (4:28 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
Use special 0x9F to select the Pokemon then callasm.


EV Reducing berries



Speaking of special 0x9F, I finished EV reducing berries which was rather easy.
First of all, follow this tutorial: http://www.pokecommunity.com/showthread.php?t=258426
until you get to the part where you have to give the item an effect via script.

Compile and insert into free space the following routine:
Spoiler:

Code:
.text
.align 2
.thumb
.thumb_func

main:
	push {r0-r4, lr}
	ldr r0, = (0x20370C0)
	ldrb r1, [r0]
	ldr r0, =(0x2024284)
	mov r2, #0x64
	mul r1, r1, r2
	add r0, r0, r1
	mov r4, r0
	ldr r2, =(0x20370D0)
	ldrb r1, [r2]
	push {r4}
	ldr r3, =(0x803FBE8 +1)
	bl linker
	pop {r4}
	ldr r2, =(0x20370B8)
	ldrb r3, [r2]
	cmp r3, r0
	bhi NoEffect
	sub r0, r0, r3
	mov r3, r0

end:
	mov r0, r4
	ldr r2, =(0x20370D0)
	ldrb r1, [r2]
	strh r3, [r2]
	ldr r3, =(0x804037C +1)
	bl linker
	pop {r0-r3, pc}

noEffect:
	ldr r2,  =(0x20370d0)
	mov r1, #0xFF
	strb r1, [r2]
	pop {r0-r4, pc}
	

linker:
	bx r3

.align 2
Here's a compiled version:
Code:
1F B5 10 48 01 78 10 48 64 22 51 43 40 18 04 1C 0E 4A 11 78 10 B4 0E 4B 00 F0 13 F8 10 BC 0D 4A 13 78 83 42 FE D8 C0 1A 03 1C 20 1C 07 4A 11 78 13 80 09 4B 00 F0 05 F8 0F BD 04 4A FF 21 11 70 1F BD 18 47 C0 70 03 02 84 42 02 02 D0 70 03 02 E9 FB 03 08 D2 70 03 02 7D 03 04 08


For the part of inserting a script to give your item functionality, you need to insert this script.
Code:
#dyn 0x740000
#org @start
special 0x9f
waitspecial
storepartypokemon 0x0 0x8004 'bufferpokemon2 in xse
setvar LASTRESULT 0x[EV to modify]
setvar 0x8000 0x[amount to decrease EV by]
callasm 0x[routine +1]
compare LASTRESULT 0xFF
if == jump @failed
storevar 0x1 0x800F 'buffervar in xse
msgbox @gain
callstd MSG_NORMAL
removeitem 0x[ID] 0x1
release
end

#org @failed
msgbox @noEffect
callstd MSG_NORMAL
release
end

#org @noEffect
= It would have no effect!

#org @gain
= \v\h02 gained \v\h03\nInsert the EV your berry gives
In variable 0x8000 put the amount the EV is to decrease by.
In variable 0x800D put which EV you want to modify, in this format:
0x1A - HP EV
0x1B - Attack EV
0x1C - Defence EV
0x1D - Speed EV
0x1E - Sp. Attack EV
0x1F - Sp. Defence EV
Tried and tested but it doesnt work
__________________
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
  #416   Link to this post, but load the entire thread.  
Old January 2nd, 2015 (5:17 AM).
Mickey` Mickey` is offline
 
Join Date: May 2011
Posts: 88
Quote:
Originally Posted by FBI agent View Post

Adjusting Shiny encounter chance



[...]

After you've done that, compile and insert the following routine into free space:

Spoiler:

Code:
.text
.align 2
.thumb
.thumb_func


main:
	push {r0-r3}
	mov r0, #0x1 @item ID
	mov r1, #0x1
	ldr r2, =(0x8099F40 +1)
	bl linker
	cmp r0, #0x0
	beq normal
	mov r0, #0xA
	lsl r0, r0, #0x7
	add r0, r0, #0x55 @1/1365 chance with shiny charm
	b calcChance
	
normal:
	mov r0, #0x20
	lsl r0, r0, #0x7 @1/4096 chance normally
	
calcChance:
	ldr r1, =(0x20370B8)
	strh r0, [r1]
	ldr r2, .random
	bl linker
	cmp r0, #0xFF
	bne
	ldr r1, =(0x20370BC)
	strb r0, [r1]
	ldr r1, =(0x20370B8)
	mov r0, #0x0
	strh r0, [r1]

end:
	pop {r0-r3}
	sub SP, SP, #0x20
	mov r7, r0
	ldr r4, [SP, #0x40]
	ldr r4, [SP, #0x48]
	mov r5, #0xE
	ldr r6, =(0x803DAD8 +1)
	bx r6
	
linker:
	bx r2
	
	
.align 2

.random:
	.word 0x8[RANDOM +1]



[...]

I have two questions :

First, what did you forget after the bne in calcChance ? I don't really understand what this check does.

Also, if I want to change the shiny encounter chance (without the shiny charm), I have to change this two lines, right ?

Code:
mov r0, #0x20
lsl r0, r0, #0x7 @1/4096 chance normally
For example,

Code:
mov r0, #0x2
lsl r0, r0, #0x0
With this code, I have one chance on two to find a shiny Pokemon ?

Thanks ! :)
Reply With Quote
  #417   Link to this post, but load the entire thread.  
Old January 2nd, 2015 (1:38 PM).
AkameTheBulbasaur's Avatar
AkameTheBulbasaur AkameTheBulbasaur is offline
Akame Marukawa of Iyotono
 
Join Date: May 2013
Location: A place :D
Age: 25
Gender: Male
Nature: Docile
Posts: 408
Quote:
Originally Posted by Lance32497 View Post
Tried and tested but it doesnt work
How does it not work for you? Does is not run the script? Or does it run the script but not cause any effect? I was able to get it to run a script, and it seems to have worked for me. You can PM me and I'll help you out more.
__________________
"The human sacrificed himself, to save the Pokemon. I pitted them against each other, but not until they set aside their differences did I see the true power they all share deep inside. I see now that the circumstances of one's birth are irrelevant; it is what you do with the gift of life that determines who you are." -Mewtwo
Reply With Quote
  #418   Link to this post, but load the entire thread.  
Old January 2nd, 2015 (2:57 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 daniilS View Post
You need to put .word before the 0xpointerToTable I think.
Yeah, you're right. I miss some stuff from time to time when I port them from my computer to the site :x

Quote:
Originally Posted by Lance32497 View Post
Tried and tested but it doesnt work
I know 2 confirmed people who've gotten it working. Uhhh...maybe you inserted it incorrectly or something.

Quote:
Originally Posted by Mickey` View Post
I have two questions :

First, what did you forget after the bne in calcChance ? I don't really understand what this check does.

Also, if I want to change the shiny encounter chance (without the shiny charm), I have to change this two lines, right ?

Code:
mov r0, #0x20
lsl r0, r0, #0x7 @1/4096 chance normally
For example,

Code:
mov r0, #0x2
lsl r0, r0, #0x0
With this code, I have one chance on two to find a shiny Pokemon ?

Thanks ! :)
That should say, "bne end" sorry. Yes, your version would make it 50% chance for a shiny (though at that point you don't need the lsl)
__________________
...
Reply With Quote
  #419   Link to this post, but load the entire thread.  
Old January 2nd, 2015 (3:22 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 know 2 confirmed people who've gotten it working. Uhhh...maybe you inserted it incorrectly or something.
huh? I check it off, by the way, I used LockSmithArmys complete item editor
__________________
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
  #420   Link to this post, but load the entire thread.  
Old January 2nd, 2015 (4:07 PM).
Mickey` Mickey` is offline
 
Join Date: May 2011
Posts: 88
Quote:
Originally Posted by FBI agent View Post
That should say, "bne end" sorry. Yes, your version would make it 50% chance for a shiny (though at that point you don't need the lsl)
Okay, so I was right, but it doesn't work. I compile the 3 routines correctly, and it works only if I set the variable 8002 to 0xFF. But if I don't set the var to this value, the wild Pokemon isn't shiny. I tryed to set a great probability to encounter a shiny in the routine (1/2), but the wild Pokemon is still normal, not shiny...
Reply With Quote
  #421   Link to this post, but load the entire thread.  
Old January 2nd, 2015 (4:43 PM).
daniilS's Avatar
daniilS daniilS is offline
busy trying to do stuff not done yet
 
Join Date: Aug 2013
Age: 23
Gender: Male
Posts: 409
Quote:
Originally Posted by Lance32497 View Post


I got this error in your routine, the bne something
FBI had explained it should have been a bne end.
__________________
Reply With Quote
  #422   Link to this post, but load the entire thread.  
Old January 3rd, 2015 (12:45 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
huh? I check it off, by the way, I used LockSmithArmys complete item editor
I don't use many tools, so I'm not sure how that really works. I just know the routine is fine and dandy.

Quote:
Originally Posted by Mickey` View Post
Okay, so I was right, but it doesn't work. I compile the 3 routines correctly, and it works only if I set the variable 8002 to 0xFF. But if I don't set the var to this value, the wild Pokemon isn't shiny. I tryed to set a great probability to encounter a shiny in the routine (1/2), but the wild Pokemon is still normal, not shiny...
It should work. I've tested the routine myself on a clean ROM and simply just pasted the code over here with some minor edits to make it insertable for others. Also it calls the random number generating routine to determine the chance. Did you insert that as well?

If you want to send me your ROM, I can point out what exactly is going downhill for you. Most of the time with these kind of problems it's a simple mistake somewhere or a missing routine.

I know for a fact this routine system works because I've also used it in other places like chain fishing (which I've also tested).
__________________
...
Reply With Quote
  #423   Link to this post, but load the entire thread.  
Old January 3rd, 2015 (12:59 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
I dont know why but all the scripts I made and inserted in LSA-Complete item editor came in an error, I really dont know why? I should contact him.
__________________
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
  #424   Link to this post, but load the entire thread.  
Old January 3rd, 2015 (3:27 AM). Edited January 3rd, 2015 by Mickey`.
Mickey` Mickey` is offline
 
Join Date: May 2011
Posts: 88
Quote:
Originally Posted by FBI agent View Post
It should work. I've tested the routine myself on a clean ROM and simply just pasted the code over here with some minor edits to make it insertable for others. Also it calls the random number generating routine to determine the chance. Did you insert that as well?

If you want to send me your ROM, I can point out what exactly is going downhill for you. Most of the time with these kind of problems it's a simple mistake somewhere or a missing routine.

I know for a fact this routine system works because I've also used it in other places like chain fishing (which I've also tested).
Finally, I found the problem !

It's in the code of the shiny encounter chance :

Code:
.text
.align 2
.thumb
.thumb_func


main:
	push {r0-r3}
	
normal:
	mov r0, #0x2
	lsl r0, r0, #0x0 @1/2 chance normally
	
calcChance:
	ldr r1, =(0x20370B8) @ var 8000
	strh r0, [r1] @ var 8000 = r0
	ldr r2, .random
	bl linker @ random between 0 et r0
	cmp r0, #0xFF
	bne end
	@ if equal to 0xFF, the Pokemon is shiny
	ldr r1, =(0x20370BC)
	strb r0, [r1]
	ldr r1, =(0x20370B8)
	mov r0, #0x0
	strh r0, [r1]

end:
	pop {r0-r3}
	sub SP, SP, #0x20
	mov r7, r0
	ldr r4, [SP, #0x40]
	ldr r4, [SP, #0x48]
	mov r5, #0xE
	ldr r6, =(0x803DAD8 +1)
	bx r6
	
linker:
	bx r2
	
	
.align 2

.random:
	.word 0x8C00001
In fact, if I set r0 to 2 (for example), the random value will be 0 or 1. Generally speaking, if I set r0 to a value under 0xFF, r0 will never be equal to 0xFF, so the Pokemon won't be shiny.

I wrote cmp r0, #0x0 instead of. And also, because we must set 8002 to 0xFF to make a Pokemon shiny, I added the line mov r0, #0xFF.

Here is my new code :

Code:
.text
.align 2
.thumb
.thumb_func


main:
	push {r0-r3}
	
normal:
	mov r0, #0x2
	lsl r0, r0, #0x0 @1/2 chance normally
	
calcChance:
	ldr r1, =(0x20370B8)
	strh r0, [r1]
	ldr r2, .random
	bl linker
	cmp r0, #0x0
	bne end
	mov r0, #0xFF
	ldr r1, =(0x20370BC)
	strb r0, [r1]
	ldr r1, =(0x20370B8)
	mov r0, #0x0
	strh r0, [r1]

end:
	pop {r0-r3}
	sub SP, SP, #0x20
	mov r7, r0
	ldr r4, [SP, #0x40]
	ldr r4, [SP, #0x48]
	mov r5, #0xE
	ldr r6, =(0x803DAD8 +1)
	bx r6
	
linker:
	bx r2
	
	
.align 2

.random:
	.word 0x8C00001
It works perfectly. Thank you for your work fbi, you're great ! {XD}
Reply With Quote
  #425   Link to this post, but load the entire thread.  
Old January 4th, 2015 (3:58 PM). Edited January 4th, 2015 by Lance32497.
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
Usage:
setvar 0x8002 0xFF 'This line makes it so the next Pokemon you encounter, or are given is a shiny Pokemon with a properly generated PID. I've made it so the code sets 0xFF back to 0x0 so you don't have to disable it after. There's only an enable switch :)
so this code works?
Quote:
...
setvar 0x8002 0xFF
callasm [routine+1]
...
because it doesnt work for me if I just set the var

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
Hello ^_^
What is the mystery byte?
There's no item wide lens in Gen3 right? then Should I create new item? then what is next?
__________________
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
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:47 AM.