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
  #201   Link to this post, but load the entire thread.  
Old December 9th, 2014 (8:42 PM). Edited December 9th, 2014 by Turtl3Skulll.
Turtl3Skulll's Avatar
Turtl3Skulll Turtl3Skulll is offline
Blue Turtl3
 
Join Date: Jun 2013
Location: Utah, U.S.A.
Age: 27
Gender: Male
Nature: Bold
Posts: 76
Quote:
Originally Posted by FBI agent View Post

Special Shiny Pokemon box!



Navigate to offset 0x44472 and insert the following byte changes:
Code:
01 48 00 47 00 00 01 00 84 08
Upon replacing these bytes, if I open the pokemon summary page the game goes to & stays in a black screen, the asm hasn't even been called at this point, any suggestions??
Reply With Quote
  #202   Link to this post, but load the entire thread.  
Old December 9th, 2014 (9:28 PM). Edited December 9th, 2014 by Blah.
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 Turtl3Skulll View Post
Upon replacing these bytes, if I open the pokemon summary page the game goes to & stays in a black screen, the asm hasn't even been called at this point, any suggestions??
Sorry, I completely forgot :X
It should be
Code:
01 4D 28 47 00 00 XX XX XX 08
where XX XX XX is the pointer to the routine +1. I inserted my test routine at 0x840000, and forgot to change it to xx xx xx in the temple :P
I'll edit my post!

Quote:
Originally Posted by DJTiKi View Post
I recently began planning for a hack and for what I wanted to do, it involved changing the overworld colors inbetween segments. Although it is graphical hack, I am curious(since it sort of has to do with the mechanics of Fire Red)

Turn the coloring of the game's overworld to the same Black and White Filter used in Flashbacks.

By this, flashbacks use a filter that turns all colors to Black and White. If you could set some var and use this on the spot, that'd be cool. I mainly want to do this because detective monolouges are always cool(or super emotional cutscenes, your preference)
Looks like it's already been implemented. Keep the suggestions coming though :D

Quote:
Originally Posted by DrFuji View Post
I'm really enjoying this thread. Its great seeing so many interesting routines being churned out, whether they're big or small. Its the first thread I open up whenever I log on to PC now. Keep up the excellent work FBI and the same goes for all of the hard-working elves who pop-in now and then to assist :P

You can already do this with a writebytetooffset command as shown here. There's also some talk about it on the 19th page of the Quick R&D thread which should allow you to revert the game's colour back to normal without warping.
Thanks for saving me the work. I actually knew that this was already done before, but I couldn't find it! I think Colcostyles figured this out many years ago, but he built a routine for it and back then no one knew enough to utilize his findings (I might be dreaming all along though).


Announcement:



I'm going to be working on two major projects, both of which are rather massive in size. They are new battle modes and a completely reworked daycare/breeding system!



Battle modes:


I'm going to be doing a battle overhaul, so the requests coming up are going to be a little slower on the implementations (current my todo list is just implementing the deletion of fainted Pokemon, which got me here).

What I mean by battle overhaul is that I'm going to be implementing a few different battle types, which currently include:
- Challenger Cup and other tournament battle modes
- Oak tutorial battle (A battle which continues after you lose, minus Oak's blabbering)
- Wild battle via script (For the script to continue after the battle regardless of result - good for legendary battles)
- Battle ending early (Basically just a battle which will end if certain conditions are met)
- Trainer sliding (Big maybe, right now it's not working properly and I'm not feeling like fixing it :P)

For the battle ending early, I will make it expandable, that way YOU can add features in which you believe should end the battle.


Day care system rework:



I'm going to update the thing into new generation functionality. Right now the breeding system is rather weird, and the game's current code doesn't open itself to easy customization and expandibility for newer generation daycare systems. I'm gonna fix all of these problems, and add some customizability so you can change certain things which you want your daycare to be like. Certain features I'm thinking of allowing customization to:

- Exp gains (the speed which daycare pokemon level up in)
- Size of daycare
- Items affecting breeding
- Shiny calculations!
- Full customization possibilities for daycare eggs! (stats and moves)

For items affecting breeding, it's going to take some work for the user to expand existing items. That's because you will have to write the routines yourself (or request them, yay FBI you're so nice!).

So yeah, requests are going to be onhold until I finish these projects. I truly believe that both of these will add new possibilities for upcoming hacks and definitely make them more interesting to play :)
__________________
...
Reply With Quote
  #203   Link to this post, but load the entire thread.  
Old December 9th, 2014 (9:54 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
Oh! My God!
I thought youll not working in Challenge Cup!
Its very awesome feature :3
Im also waiting for your trainer interruption routine!
Awesome. I am running out of ideas, I should rest my little brain too >_<
Goodluck!
(Still waiting for Special Pokemon that calls weather even though it has no Drizzle and Drought ability)
__________________
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
  #204   Link to this post, but load the entire thread.  
Old December 9th, 2014 (10:57 PM).
Turtl3Skulll's Avatar
Turtl3Skulll Turtl3Skulll is offline
Blue Turtl3
 
Join Date: Jun 2013
Location: Utah, U.S.A.
Age: 27
Gender: Male
Nature: Bold
Posts: 76
Quote:
Originally Posted by FBI agent View Post
Sorry, I completely forgot :X
It should be
Code:
01 4D 28 47 00 00 XX XX XX 08
where XX XX XX is the pointer to the routine +1. I inserted my test routine at 0x840000, and forgot to change it to xx xx xx in the temple :P
Thanks so much!! It worked, no more black screen, though I wasn't able to get the second routine to work properly on a rom patched w/ JPAN's engine, it did work on a clean rom, I won't ask you to look into it since you did me enough of a favor by working with a graphic hacks, but if you can that'd be great too.

Good luck on your projects, really looking foward to the new daycare system:D
will it be completely separate from the old one or is it playing off the old code??
Reply With Quote
  #205   Link to this post, but load the entire thread.  
Old December 9th, 2014 (11:48 PM).
Red John's Avatar
Red John Red John is offline
Progressing Assembly hacker
 
Join Date: May 2014
Location: Where ever there is peace and darkness
Gender: Male
Nature: Lonely
Posts: 137
This means we can have a Masuda Method like feature?
__________________
Reply With Quote
  #206   Link to this post, but load the entire thread.  
Old December 10th, 2014 (6:09 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
Oh! My God!
I thought youll not working in Challenge Cup!
Its very awesome feature :3
Im also waiting for your trainer interruption routine!
Awesome. I am running out of ideas, I should rest my little brain too >_<
Goodluck!
(Still waiting for Special Pokemon that calls weather even though it has no Drizzle and Drought ability)
Challenger Cup is something that I thought would be a nice "side feature", I'm adding it as an addon :3

Quote:
Originally Posted by Turtl3Skulll View Post
Thanks so much!! It worked, no more black screen, though I wasn't able to get the second routine to work properly on a rom patched w/ JPAN's engine, it did work on a clean rom, I won't ask you to look into it since you did me enough of a favor by working with a graphic hacks, but if you can that'd be great too.

Good luck on your projects, really looking foward to the new daycare system:D
will it be completely separate from the old one or is it playing off the old code??
You can't get the second routine to work? I don't particularly do anything except set a byte in the Pokemon's data structure which is unused. I believe that it doesn't work maybe because you're setting the variable incorrectly? Try setting var 0x8004 to 0x0 in a script and callasming to the second routine +1. It SHOULD give your first Pokemon the border. There is no reason why it's not compatible with JPAN's hack, because it is indeed standalone :x


Quote:
Originally Posted by Knight of Duty View Post
This means we can have a Masuda Method like feature?
Yes, comming soon to a daycare near you!

Quote:
Originally Posted by pokemontutorialTV View Post
So... I want to make a feature, that poisions my pokémon, but i dont want to poision Pokémon, that is from the type poision or steel. So I have to check for the type. You have made an implimentation wit a modifided special 0x12b, but i dont need first result, i need the result in slot X (which is determined by var 0x8005 if this would be poissible).
EDIT: I modifided the offset of your routine from 8. dec.
Here is a routine I made a day ago which checks the type of a Pokemon: http://www.pokecommunity.com/showpost.php?p=8525633&postcount=185

You will need to edit this routine to return in var 0x8005 rather than 0x8000.

Quote:
Also I had the idea to implement the critical capture feature, which captures a pokémon faster, if you have more pokémon in your pokédex. It would be great if you could relize that :)

Also it would be great, if you could implement new answers for the easy chat system. Here is a link if you dont know what i am talking about.
Requests are onhold right now but I will look into the easy chat system next time I'm free.
__________________
...
Reply With Quote
  #207   Link to this post, but load the entire thread.  
Old December 10th, 2014 (10:38 AM).
Turtl3Skulll's Avatar
Turtl3Skulll Turtl3Skulll is offline
Blue Turtl3
 
Join Date: Jun 2013
Location: Utah, U.S.A.
Age: 27
Gender: Male
Nature: Bold
Posts: 76
Quote:
Originally Posted by FBI agent View Post
You can't get the second routine to work? I don't particularly do anything except set a byte in the Pokemon's data structure which is unused. I believe that it doesn't work maybe because you're setting the variable incorrectly? Try setting var 0x8004 to 0x0 in a script and callasming to the second routine +1. It SHOULD give your first Pokemon the border. There is no reason why it's not compatible with JPAN's hack, because it is indeed standalone :x
Well I got it working on a clean rom, I used the same routines, pointers, and scripts on both yet it doesn't work on my patched rom.

IF you can I'll leave my IPS file linked and you can try seeing if there's something there.

https://www.dropbox.com/s/x15g0lyb2ci5wlu/Turtl3Skulll%27s%20patch%20%28idk%20needed%20a%20name%29.ips?dl=0

Quote:
Originally Posted by FBI agent View Post
Yes, comming soon to a daycare near you!
!!!!!!!!! :D
Reply With Quote
  #208   Link to this post, but load the entire thread.  
Old December 10th, 2014 (11:49 AM). Edited January 5th, 2015 by Blah.
Blah's Avatar
Blah Blah is offline
Free supporter
 
Join Date: Jan 2013
Location: Unknown Island
Gender: Male
Posts: 1,924

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:
	.word 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.


Addons for Battle by move:



Prevent loss (white out):
Spoiler:

Code:
.text
.align 2
.thumb
.thumb_func

main:	
	push {r0-r1, lr}
	ldr r0, =(0x2023E8A)
	ldrb r1, [r0]
	cmp r1, #0x1
	bhi setZero
	b end

setZero:
	cmp r1, #0x5
	beq end
	mov r1, #0x0
	strb r1, [r0]

end:
	pop {r0-r1, pc}



Battle by turn:



This routine will run all of it's referenced routines at the end of the turn (right before the turn counter in incremented.

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.
Last entry in the table needs to be 00 00 00 00.

Credits to daniilS for helping with optimization.
Spoiler:

Code:
.text
.align 2
.thumb
.thumb_func
 
main:
        @check flag 0x2F8 to toggle routines (0xBE*4 = 0x2F8)
        mov r0, #0xBE
        lsl r0, r0, #0x2
        ldr r2, =(0x806E6D0 +1)
        bl linker
        cmp r0, #0x0
        beq skip
        ldr r4, .table
 
loop:
        ldr r2, [r4]
        cmp r2, #0x00
        beq skip
        bl linker @call table routine
        add r4, #0x4 @get next table routine
        b loop
       
skip:
        ldr r1, = 0x3004F90
        ldrb r0, [r1, #0x13]
        cmp r0, #0xFE
        bhi replacer
        add r0, #0x1
        strb r0, [r1, #0x13]
 
replacer:
        ldr r2, = (0x8013CBC + 1)
 
linker:
        bx r2
 
.align 2
 
.table:
        .word 0x[pointer to Routine table]


Now navigate to 0x13CB0 and insert the following byte changes:
Code:
00 48 00 47 XX XX XX 08

Usage:
The routine is toggled by flag 0x2F8. 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.

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
__________________
...
Reply With Quote
  #209   Link to this post, but load the entire thread.  
Old December 10th, 2014 (11:56 AM).
Caeles Caeles is offline
 
Join Date: Oct 2014
Gender: Male
Posts: 2
I'm here just to say that you're doing an amazing work. All the routines you have done are incredible and I really love all of them, especially the type-check, the Silent Evolution and all the PSS thing. Thanks! ^^
Reply With Quote
  #210   Link to this post, but load the entire thread.  
Old December 10th, 2014 (12:27 PM).
Zehn's Avatar
Zehn Zehn is offline
Sacred Fire
 
Join Date: Oct 2014
Location: England
Gender: Male
Nature: Relaxed
Posts: 987
hey man, I was wondering if you knew if it was possible to have implement gen 4 style double battles with AMS/scripting? by this I mean when you and another NPC can fight in the same battle on the same team, and they still have randomised attacks and what-not. Thanks in advance!
__________________
I'm not spying I was here first
Reply With Quote
  #211   Link to this post, but load the entire thread.  
Old December 10th, 2014 (12:54 PM). Edited December 10th, 2014 by Urobolos.
Urobolos Urobolos is offline
 
Join Date: Nov 2014
Posts: 15
If I use the "Skip Professor Oak Intro" patch on my game, is there a way to implement naming my trainer outside that introduction without sticking with the default name?

EDIT: Also, is there a way to randomize an enemy trainer's starting pokemon?
Reply With Quote
  #212   Link to this post, but load the entire thread.  
Old December 10th, 2014 (1:22 PM).
ShyRayq's Avatar
ShyRayq ShyRayq is offline
Unprofessional Unprofessional
 
Join Date: Aug 2007
Gender: Male
Nature: Adamant
Posts: 1,855
Quote:
Originally Posted by Urobolos View Post
If I use the "Skip Professor Oak Intro" patch on my game, is there a way to implement naming my trainer outside that introduction without sticking with the default name?

EDIT: Also, is there a way to randomize an enemy trainer's starting pokemon?
http://www.pokecommunity.com/showpost.php?p=8520099&postcount=136
This lets you choose a name your own name using ASM, but its probably more advanced and complicated for a simple run. Its more suitable for a hack with specific characters.

And for your second point, you can use a randomiser program. There's a few in the "Tools and Resources" section. Or just use Google. Type in "Pokemon _____ Randomiser".
__________________
3DS Friend Code: 5069-3944-3902
IGN: Peter; (X, Y, OR, AS, S, M, US, UM)
Friend Safari: (Fighting) Throh, Meditite, Breloom
Living Pokedex Complete: Y, C, R, LG, E, D, Pl, HG, B, B2, X, Y, OR, AS, M, UM, LGP, Sw, LA
Big thanks especially to DestinedJagold, Xerneas_X, Elements1, ~RNC~ and ThePoke Man

PM me if you want to trade, or add my FC.
Reply With Quote
  #213   Link to this post, but load the entire thread.  
Old December 10th, 2014 (1:31 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 Caeles View Post
I'm here just to say that you're doing an amazing work. All the routines you have done are incredible and I really love all of them, especially the type-check, the Silent Evolution and all the PSS thing. Thanks! ^^
Wow, your first post on the forums is to thank me. I'm glad you find use for all of these :)


Quote:
Originally Posted by ThatOnePokeTrainer View Post
hey man, I was wondering if you knew if it was possible to have implement gen 4 style double battles with AMS/scripting? by this I mean when you and another NPC can fight in the same battle on the same team, and they still have randomised attacks and what-not. Thanks in advance!
Touched is already working on this, though from what I hear it's very difficult.


Quote:
Originally Posted by Urobolos View Post
If I use the "Skip Professor Oak Intro" patch on my game, is there a way to implement naming my trainer outside that introduction without sticking with the default name?

EDIT: Also, is there a way to randomize an enemy trainer's starting pokemon?
Yeah, here's a post by sonic about naming the player in OW: http://www.pokecommunity.com/showthread.php?p=7087946#7087946

For randomizing the enemy's starting Pokemon, I'm not sure what you mean. Can't you just pick random Pokemon in a trainer editor? what's the difference. You might end up fighting a legendary or OP pokemon if you randomize it :x

Quote:
Originally Posted by ShyRayq View Post
http://www.pokecommunity.com/showpost.php?p=8520099&postcount=136
This lets you choose a name your own name using ASM, but its probably more advanced and complicated for a simple run. Its more suitable for a hack with specific characters.

And for your second point, you can use a randomiser program. There's a few in the "Tools and Resources" section. Or just use Google. Type in "Pokemon _____ Randomiser".
Thanks, yes that routine is used for hacks which want static names for the player based on gender. Unfortunately, it is rather specific :/
__________________
...
Reply With Quote
  #214   Link to this post, but load the entire thread.  
Old December 10th, 2014 (2:10 PM).
Vivacity's Avatar
Vivacity Vivacity is offline
still learning
 
Join Date: Dec 2014
Gender: Female
Nature: Calm
Posts: 6
This is such an awesome thread! :D I've already managed to insert Snag Balls into my hack, which I never would've been able to do before, and that's just scratching the surface of all the new possibilities you've opened up. Cheers, FBI, you're awesome :D

...I mean, I was going to leave it at that, but just looking at the first post gets me excited! New Bags, the PSS, Berries, backsprites, Start Menu mods... if I ever run out of ideas, I'm just gonna come back here to get a truckload of new ones, haha. You're an inspiration to the rest of us, seriously. :)

So I'm here mainly to show appreciation and say thank you, but since you're doing battle stuff anyway, I figured it couldn't hurt to suggest something. :) With the current implementation of the Snag Ball mechanic, the battle ends right after you catch a Trainer's Pokémon, even if they had more to send out. Also, I've searched Spherical Ice's script reference and there doesn't seem to be a way to check how a Trainer battle ended.

So I'm just interested in the following:

1) Might there be a way to force the battle to continue even after you've caught a Trainer's Pokémon? (Just so that players aren't restricted to snagging only one Pokémon from every Trainer they encounter.)
2) Is there any way of checking whether a Pokémon was stolen after the battle ends? (I'd like to set off a different series of events if a Pokémon was snagged - to me, it seems like a Trainer would act differently if you stole their Pokémon.)

Please don't worry about these if you think they'd take too much time, though! :) Thanks again for all your hard work already, and I hope you're having a fab day! :D
Reply With Quote
  #215   Link to this post, but load the entire thread.  
Old December 10th, 2014 (2:55 PM).
Urobolos Urobolos is offline
 
Join Date: Nov 2014
Posts: 15
Yeah I was hoping more to access the "name your trainer" screen outside the Oak Intro than a series of specific names.

And about the randomizing comment I meant that out of a trainer's own Pokemon, I want to randomize which Pokemon out that group is sent out first.
Reply With Quote
  #216   Link to this post, but load the entire thread.  
Old December 10th, 2014 (3:59 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 Vivacity View Post
Complements
Aww, you, I like you :3

Quote:
Originally Posted by Vivacity View Post
So I'm here mainly to show appreciation and say thank you, but since you're doing battle stuff anyway, I figured it couldn't hurt to suggest something. :) With the current implementation of the Snag Ball mechanic, the battle ends right after you catch a Trainer's Pokémon, even if they had more to send out. Also, I've searched Spherical Ice's script reference and there doesn't seem to be a way to check how a Trainer battle ended.

So I'm just interested in the following:

1) Might there be a way to force the battle to continue even after you've caught a Trainer's Pokémon? (Just so that players aren't restricted to snagging only one Pokémon from every Trainer they encounter.)
2) Is there any way of checking whether a Pokémon was stolen after the battle ends? (I'd like to set off a different series of events if a Pokémon was snagged - to me, it seems like a Trainer would act differently if you stole their Pokémon.)

Please don't worry about these if you think they'd take too much time, though! :) Thanks again for all your hard work already, and I hope you're having a fab day! :D
Unfortunately, the Pokemon catch routine assumes the battle is over if you capture a trainer's Pokemon. I tried doing what I did with the whiteout routine here, and instead I'm left with an endless Pokemon selection loop. So that pretty much concludes that the only probable way is to rewrite that capture code. Actually this is a problem in later generations as well. if you recall DPPTs double wild battles, the battle prevents you from capturing a Pokemon till only one is left alive (I assume for the same reason, because the battle is signified as over once a pokemon has been caught.) So yeah, I won't be able to allow the battle to continue after a trainer has had his Pokemon stolen, but in hindsight, what kinda trainer would continue the battle after having their Pokemon snagged? :D

For 2, yeah there is!
I would use trainerbattle 0x9 0xID 0x0 @strings @strings
This is a special trainer battle, (which I haven't seen anyone discover before). Basically it allows for the script to continue after the battle (if you win) AND it will allow the trainer to have a view radius in A-Map. So the trainer will walk up to you. Have these commands after the trainer battle command:
Code:
checkflag 0x[flag if it's stolen
if 0x1 jump @stolen
copybyte 0x2023E8A 0x20370D0 'copy battle result into last result
compare LASTRESULT 0x7
if == jump @stolen
msgbox @goodBattle
callastd MSG_NORMAL
release
end

#org @stolen
' Maybe set a flag here so the trainer remembers all the time
msgbox @IHadMyPokemonStolen
callstd MSG_NORMAL
release
end
Use the copybyte command to access that offset, and then compare it to 0x7. Remember that the 0x7 is overwritten everybattle the trainer enters, so this is the only REAL way to do it.

Quote:
Originally Posted by Urobolos View Post
Yeah I was hoping more to access the "name your trainer" screen outside the Oak Intro than a series of specific names.

And about the randomizing comment I meant that out of a trainer's own Pokemon, I want to randomize which Pokemon out that group is sent out first.
The post from sonic1 which I liked you does exactly that :D
Oh, randomize the trainer's party? You can do this in a script :)
Code:
random 0x[pick from 0 to however many Pokemon you've inserted]
addvar LASTRESULT 0x1
addpokemon LASTRESULT 0xLevelInHex 0xItemID 0x0 0x0 0x0
I'm not sure why I'm posting scripts for people, perhaps I'm in a good mood :3
__________________
...
Reply With Quote
  #217   Link to this post, but load the entire thread.  
Old December 10th, 2014 (4:14 PM). Edited December 10th, 2014 by Urobolos.
Urobolos Urobolos is offline
 
Join Date: Nov 2014
Posts: 15
Quote:
Originally Posted by FBI agent View Post
Aww, you, I like you :3



Unfortunately, the Pokemon catch routine assumes the battle is over if you capture a trainer's Pokemon. I tried doing what I did with the whiteout routine here, and instead I'm left with an endless Pokemon selection loop. So that pretty much concludes that the only probable way is to rewrite that capture code. Actually this is a problem in later generations as well. if you recall DPPTs double wild battles, the battle prevents you from capturing a Pokemon till only one is left alive (I assume for the same reason, because the battle is signified as over once a pokemon has been caught.) So yeah, I won't be able to allow the battle to continue after a trainer has had his Pokemon stolen, but in hindsight, what kinda trainer would continue the battle after having their Pokemon snagged? :D

For 2, yeah there is!
I would use trainerbattle 0x9 0xID 0x0 @strings @strings
This is a special trainer battle, (which I haven't seen anyone discover before). Basically it allows for the script to continue after the battle (if you win) AND it will allow the trainer to have a view radius in A-Map. So the trainer will walk up to you. Have these commands after the trainer battle command:
Code:
checkflag 0x[flag if it's stolen
if 0x1 jump @stolen
copybyte 0x2023E8A 0x20370D0 'copy battle result into last result
compare LASTRESULT 0x7
if == jump @stolen
msgbox @goodBattle
callastd MSG_NORMAL
release
end

#org @stolen
' Maybe set a flag here so the trainer remembers all the time
msgbox @IHadMyPokemonStolen
callstd MSG_NORMAL
release
end
Use the copybyte command to access that offset, and then compare it to 0x7. Remember that the 0x7 is overwritten everybattle the trainer enters, so this is the only REAL way to do it.



The post from sonic1 which I liked you does exactly that :D
Oh, randomize the trainer's party? You can do this in a script :)
Code:
random 0x[pick from 0 to however many Pokemon you've inserted]
addvar LASTRESULT 0x1
addpokemon LASTRESULT 0xLevelInHex 0xItemID 0x0 0x0 0x0
I'm not sure why I'm posting scripts for people, perhaps I'm in a good mood :3
For the first thing, sorry, I was thinking of another link back there. Thanks.

As for the second thing, I meant pick from random which of an enemy trainer's first pokemon he or she will send out first, like if he or she has a rattata, a pidgey, and a charmander in his team, than I want to make it so that the game selects which of these he or she will send out first. I could hackishly create multiple entries in A-Trainer, but is there a way for the game to pick one of an enemy trainer's pokemon to be sent out first?

EDIT: Well, the trainer name screen screen comes up and makes the change when I callasm 0x09FC91, but I seem to come back to the map with the start menu active and my character still being able to move, but at least the name changes.
Reply With Quote
  #218   Link to this post, but load the entire thread.  
Old December 10th, 2014 (4:59 PM).
Joexv's Avatar
Joexv Joexv is offline
ManMadeOfGouda
joexv.github.io
 
Join Date: Oct 2012
Location: Oregon
Age: 25
Gender: Male
Nature: Sassy
Posts: 1,035
Quote:
Originally Posted by FBI agent View Post

Battle Modes!

Yes. Just yes. Nothing more. Nothing less.
__________________
New living flesh vessel who dis?
Reply With Quote
  #219   Link to this post, but load the entire thread.  
Old December 11th, 2014 (4:21 AM).
Seth1353's Avatar
Seth1353 Seth1353 is offline
 
Join Date: May 2013
Location: Australia
Gender: Male
Nature: Jolly
Posts: 107
Thank you for this thread it helps so many people even though I've only used a couple of these ams routines because I haven't fully understood asm too much I thank you for this thread! :)
__________________
Reply With Quote
  #220   Link to this post, but load the entire thread.  
Old December 11th, 2014 (5:19 AM).
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
The battle system needs its own thread. It's amazing, I'll definitely be writing a few addons for it.
Also, won't it be more user-friendly to put the addons into a table? That way you never need to recompile.
__________________
Reply With Quote
  #221   Link to this post, but load the entire thread.  
Old December 11th, 2014 (9:28 AM). Edited December 13th, 2014 by Blah.
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 Seth1353 View Post
Thank you for this thread it helps so many people even though I've only used a couple of these ams routines because I haven't fully understood asm too much I thank you for this thread! :)
Thanks. Though I would like to point out, to use them all you really need to know is how to insert them and what they do. I've documented a guide on how to insert for beginners (it's a link in the FAQ first post). If you don't understand something or don't see how some routine works, feel free to ask!

Quote:
Originally Posted by joexv View Post
Yes. Just yes. Nothing more. Nothing less.
:3

Quote:
Originally Posted by Urobolos View Post
For the first thing, sorry, I was thinking of another link back there. Thanks.

As for the second thing, I meant pick from random which of an enemy trainer's first pokemon he or she will send out first, like if he or she has a rattata, a pidgey, and a charmander in his team, than I want to make it so that the game selects which of these he or she will send out first. I could hackishly create multiple entries in A-Trainer, but is there a way for the game to pick one of an enemy trainer's pokemon to be sent out first?

EDIT: Well, the trainer name screen screen comes up and makes the change when I callasm 0x09FC91, but I seem to come back to the map with the start menu active and my character still being able to move, but at least the name changes.
I'm still not understanding the incentive to randomizing the starting Pokemon. I suppose it would be a small bit of "game change" if someone were to play your hack more than once, but the feature seems a little useless to me :/

Quote:
Originally Posted by daniilS View Post
The battle system needs its own thread. It's amazing, I'll definitely be writing a few addons for it.
Also, won't it be more user-friendly to put the addons into a table? That way you never need to recompile.
Yeah it definitely could, and should read off of a table. I'll have to redo that little bit :x


Battle Modes addon: Delete fainted Pokemon



For those hackers who like minigames, this routine will delete Pokemon who have fainted in battle. There's a few things that need to happen for this effect to occur.

1) Pokemon who die in battle must be deleted
2) Eggs are spared
3) Pokemon who die outside of battle must be deleted (Poison or another similar effect)

However, if you put this in turn basis, you will NEED to make another routine to delete the Player's party if he/she loses the match. This is because the turn counter isn't reached on the last turn the player loses :x

If you're lazy like me you can just put this routine in as a battle by move addon and cover the whiteout case. Which is actually fine. It's rather fast, because it deletes the Pokemon as they die, so the worse case scenario is unforeseeable. And if a Pokemon dies it will only need to loop 5 times only doing operations on one of the 5 loops. If you're curious looping a maximum of 21 times is the worst case scenario (all 6 of your Pokemon die in 1 turn i.e never, and even if that did happen it'd be done in less .25 seconds). So it's fine to put in the battle by move section without expecting the game to lag.


How to insert:
Insert as addon to battle modes battle by move.
You will notice that near the start of the routine there is some commented out code (denoted by a prefix "@" symbol). That's for a flag check. Change [flag/4] = your flag/4 in hex if you want to toggle by flag. Of course the normal battle mode toggle flag should be used as well.

Spoiler:

Code:
.text
.align 2
.thumb
.thumb_func

main:
	push {r0-r5, lr}
	@mov r0, #0x[flag/4]
	@lsl r0, r0, #0x2
	@ldr r3, =(0x806E6D0 +1)
	@bl linker
	@cmp r0, #0x0
	@beq end
	ldr r0, =(0x2023E8A)
	ldrb r0, [r0]
	cmp r0, #0x0
	beq realEnd
	mov r5, #0x0

loop:
	ldr r0, =(0x2024029)
	ldrb r4, [r0]
	cmp r5, r4
	beq end
	ldr r0, =(0x2024284)
	mov r1, #0x64
	mul r1, r1, r5 @slot
	add r0, r0, r1 @address
	mov r1, #0x39 @C_HP
	ldr r3, =(0x803FBE8 +1)
	bl linker
	cmp r0, #0x0
	beq adjustSlots

skip:
	add r5, r5, #0x1
	b loop


adjustSlots:
	cmp r5, #0x5
	bge writeLastZero	
	mov r2, #0x5
	sub r2, r2, r5
	mov r0, #0x64
	mul r2, r2, r0 @size
	mov r1, r5
	mul r1, r1, r0
	ldr r0, =(0x2024284)
	add r0, r0, r1 @dest
	mov r1, #0x64
	add r1, r0, r1 @src
	ldr r3, =(0x8040B08 +1)
	bl linker


writeLastZero:
	ldr r0, =(0x2024478)
	mov r1, #0x0
	mov r2, #0x64
	ldr r3, =(0x81E5ED8 +1)
	bl linker

correctCounters:
	ldr r0, =(0x2024029)
	ldrb r1, [r0]
	sub r1, r1, #0x1
	strb r1, [r0]
next:
	mov r5, #0x0
	b loop	

end:
	ldr r0, =(0x2024029)
	ldrb r0, [r0]
	cmp r0, #0x0
	bne realEnd
	mov r0, #0x5E
	lsl r0, r0, #0x4
	ldr r3, =(0x806E6A8 +1)
	bl linker
	b realEnd


linker:
	bx r3

realEnd:
	pop {r0-r5, pc}


.align 2



Usage:
If you opted to use a flag, set it to allow further battles to delete Pokemon as they faint. If you didn't just sit back and let the unicorns inside the game do the rest.
__________________
...
Reply With Quote
  #222   Link to this post, but load the entire thread.  
Old December 11th, 2014 (2:50 PM).
HidoranBlaze's Avatar
HidoranBlaze HidoranBlaze is offline
 
Join Date: Apr 2013
Age: 26
Gender: Male
Posts: 252
I'd like to announce that I've created routines for damp rock, icy rock and heat rock. I'll update my smooth rock post with these routines.

Happy hacking!
Reply With Quote
  #223   Link to this post, but load the entire thread.  
Old December 11th, 2014 (6:08 PM).
Joexv's Avatar
Joexv Joexv is offline
ManMadeOfGouda
joexv.github.io
 
Join Date: Oct 2012
Location: Oregon
Age: 25
Gender: Male
Nature: Sassy
Posts: 1,035
Quote:
Originally Posted by FBI agent View Post

Battle Modes addon: Delete fainted Pokemon

So really if you insert this then you would kinda have to add the game over otherwise you would get some messy gameplay glitches. Or is there a way to make it so a certain pokemon is never deleted?
__________________
New living flesh vessel who dis?
Reply With Quote
  #224   Link to this post, but load the entire thread.  
Old December 11th, 2014 (6:34 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 joexv View Post
So really if you insert this then you would kinda have to add the game over otherwise you would get some messy gameplay glitches. Or is there a way to make it so a certain pokemon is never deleted?
No, it's standalone and clears the Pokemon flag is the player has run out of Pokemon. So the "worst" glitch that can happen is that the player walks into wild grass without any Pokemon. The behavior there is the same as if this hack wasn't inplace and the trainer walked into grass, they would send out a "?" Pokemon.
If you added the reset feature you can avoid this "loop whole", or you can try and handle it in a different way.

Mini update:
I decided against rewriting the daycare system because I don't think it's "portable" to hacks. By that I mean that a routine that works in my ROM will be specific to my methods of Pokemon/item/stat table location insertions. That and I don't have a FR ROM with all the Pokemon/items in it to try the newer generation things. Also who breeds in hacks?

INSTEAD I'm doing roaming Pokemon! Basically, you might know that current Roaming is rather buggy and systematic. I'm going to be updating to the newer generation's roam mechanics and also allow for expansion of what's roaming. Current roaming Pokemon hacks (JPANs) is basically just the wild Pokemon roaming about and encouterable anywhere in the wild. This leads to things like Raikou in the middle of the ocean. I'm also going to do the 4 guaranteed 31 IVs thing :3
__________________
...
Reply With Quote
  #225   Link to this post, but load the entire thread.  
Old December 11th, 2014 (8:33 PM).
HidoranBlaze's Avatar
HidoranBlaze HidoranBlaze is offline
 
Join Date: Apr 2013
Age: 26
Gender: Male
Posts: 252
Here's another new item for y'all.

Light Clay

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

main:
lsl r0, r1, #0x1
add r0, r0, r1
lsl r0, r0, #0x2
mov r1, lr 
add r0, r0, r4
push {r0-r3}
bl itemcheck
cmp r0, #0x4C
beq extend
pop {r0-r3}
add r1, #0x7
mov lr, r1
mov r1, #0x5
b return

itemcheck:
ldr r0, .routine
bx r0

extend:
pop {r0-r3}
add r1, #0x7
mov lr, r1
mov r1, #0x8

return:
bx lr

.align 2
.routine: .word 0x08800001

@ insert FE 46 00 48 00 47 XX XX XX 08 at 0802889E and 0802755E
This routine also utilizes the item check routine located in this post: http://www.pokecommunity.com/showpost.php?p=8515067&postcount=57

Replace the address at .routine with the item check routine's address.

Cheers!
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.