The PokéCommunity Forums  

Go Back   The PokéCommunity Forums > ROM Hacking > Research & Development
Sign Up Rules/FAQ Live Battle Blogs Mark Forums Read

Notices

Research & Development Got a well-founded knack with ROM hacking? Love reverse-engineering the Pokémon games? Or perhaps you love your assembly language. 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!
Research & Development programs in this forum are subject to moderator approval before they are displayed.


Reply
 
Thread Tools
  #1    
Old January 5th, 2010, 09:27 PM
liuyanghejerry's Avatar
liuyanghejerry
Trainer
 
Join Date: Jan 2008
Location: China,Xi'an
Nature: Calm
Send a message via ICQ to liuyanghejerry Send a message via Windows Live Messenger to liuyanghejerry Send a message via Yahoo to liuyanghejerry
Well,I'm not sure if this thread is legal.But if this thread is legal,this forum will be one of my favorite forum

Most hack time,we use trainerbattle command only as trainerbattle 0x0 and trainerbattle 0x1.

But there's also an interesting trainerbattle,as trainerbattle 0x9,which is used for battle teaching.

It used just like:
Code:
trainerbattle 0x9 0x148 0x3 0x818DDEA 0x818DE1A
from FR US 0x1692F3.

This battle is interesting not only because it teaches you how to battle,but also because if you're defeat,you won't be white out.The battle will finish and you keep the script.While trainerbattle 0x0 and trainerbattle 0x1 won't let you go on your script.

Does anyone interested in this?And how to make a trainerbattle that can also go on when the player is defeat?Or even in a wildbattle?
__________________
Zel,thethethethe,LU-HO,Darthatron,HackMew,ZodiacDaGreat,Juan,score_under,JPAN,Tamah-chan,I really appreciate your kindness and your help!:D


I did something that really bad.But made all Chinese can hack Pokemon, too.If you guys hate me, I totally understand,but cannot do anything but force to keep everything.
If there must be someone to undertake all spit and curse, it must be me.
Reply With Quote
  #2    
Old January 7th, 2010, 12:55 PM
ZodiacDaGreat's Avatar
ZodiacDaGreat
Working on a Mobile System
 
Join Date: Feb 2007
Location: South Pacific
Age: 21
Gender: Male
Nature: Relaxed
Send a message via ICQ to ZodiacDaGreat
trainerbattle 0x3 also allows continuation of script execution.
Code:
...
trainerbattle 0x3 0x245 0x0 0x8809DA4
...
Thing is for 0x3 type, only battle defeat text.
__________________
Reply With Quote
  #3    
Old January 7th, 2010, 01:15 PM
hashtag's Avatar
hashtag
king cook
 
Join Date: Nov 2008
Location: Salisbury, England
Age: 19
Gender: Male
Hm, ZDG, what script is that executed in?
__________________
#OurLeaderTheMockingjay
Reply With Quote
  #4    
Old January 7th, 2010, 01:28 PM
ZodiacDaGreat's Avatar
ZodiacDaGreat
Working on a Mobile System
 
Join Date: Feb 2007
Location: South Pacific
Age: 21
Gender: Male
Nature: Relaxed
Send a message via ICQ to ZodiacDaGreat
Hehehe, that's part of a script from my hack XD
__________________
Reply With Quote
  #5    
Old January 7th, 2010, 02:15 PM
Juan
Brazilian with a bad English
 
Join Date: Jun 2007
Location: Pindamonhangaba - SP
Age: 23
Nature: Adamant
trainerbattle is a command that allows you to use with different parameters.


Quote:
trainerbattle byte byte hword pointer1


trainerbattle byte byte hword pointer1 pointer2

trainerbattle byte byte hword pointer1 pointer2 pointer3

Some subroutines called by the command 0x5C





At least in Fire Red, the maximum that can be used in the first parameter is 10(0x0-0x9).
And each of them calls a different subroutine.


Code:
ROM:08080228
ROM:08080228 @ ¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦ S U B R O U T I N E ¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦
ROM:08080228
ROM:08080228
ROM:08080228 sub_8080228:                            @ CODE XREF: cmd_0x5C+6p
ROM:08080228                 PUSH    {R4,R5,LR}
ROM:0808022A                 ADD     R5, R0, #0
ROM:0808022C                 BL      sub_8080110
ROM:08080230                 LDR     R4, =0x20386AC
ROM:08080232                 ADD     R0, R5, #0
ROM:08080234                 BL      Read8bitsValue
ROM:08080238                 LSL     R0, R0, #0x18
ROM:0808023A                 LSR     R0, R0, #0x18
ROM:0808023C                 STRH    R0, [R4]
ROM:0808023E                 LDRH    R0, [R4]
ROM:08080240                 SUB     R0, #1
ROM:08080242                 CMP     R0, #8
ROM:08080244                 BHI     loc_8080318     @ 0x0 or > 0x9
ROM:08080246                 LSL     R0, R0, #2
ROM:08080248                 LDR     R1, =off_8080258
ROM:0808024A                 ADD     R0, R0, R1
ROM:0808024C                 LDR     R0, [R0]
ROM:0808024E                 MOV     PC, R0
ROM:0808024E @ ---------------------------------------------------------------------------
ROM:08080250 dword_8080250:  .long 0x20386AC         @ DATA XREF: sub_8080228+8r
ROM:08080254 off_8080254:    .long off_8080258       @ DATA XREF: sub_8080228+20r
ROM:08080254                                         @ 
ROM:08080258 off_8080258:    .long loc_808028C       @ DATA XREF: sub_8080228:off_8080254o
ROM:08080258                                         @ 0x1
ROM:0808025C                 .long loc_808028C       @ 0x2
ROM:08080260                 .long loc_808027C       @ 0x3
ROM:08080264                 .long loc_8080284       @ 0x4
ROM:08080268                 .long loc_80802D8       @ 0x5
ROM:0808026C                 .long loc_8080294       @ 0x6
ROM:08080270                 .long loc_80802AC       @ 0x7
ROM:08080274                 .long loc_8080294       @ 0x8
ROM:08080278                 .long loc_8080304       @ 0x9
ROM:0808027C @ ---------------------------------------------------------------------------
...
...
...
Quote:
Originally Posted by liuyanghejerry View Post
this forum will be one of my favorite forum^^
[2] :D

Quote:
Originally Posted by The Doctor View Post
Hm, ZDG, what script is that executed in?
In fire red has scripts that use this type of script.


Quote:
value
local
script type
script offset
command
Code:
0x0:
VIRIDIAN FOREST [1.0]
Person 3
0x160571
trainerbattle 0x0 0x66 0x0 0x81722C7 0x81722F9

0x1:
VIRIDIAN CITY [5.1]
Person 8
0x169ECA
trainerbattle 0x1 0x15E 0x0 0x818F352 0x818F43F 0x8169F04

0x2:
ROCKET HIDEOUT [1.42]
Person 5
0x16120A
trainerbattle 0x2 0x16A 0x0 0x817503A 0x817505A 0x8161225

0x3:
MT. MOON [1.3]
Person 3
0x1606C2
trainerbattle 0x3 0xAA 0x0 0x8172B99


0x4:
VICTORY ROAD [1.41]
Person 11
0x16115F
trainerbattle 0x4 0x1E5 0x0 0x8174D0C 0x8174D45 0x8174D96

0x5:
ROUTE 3 [3.21]
Person 2
0x1A957B
trainerbattle 0x5 0x76 0x0 0x81C15F9 0x8183891

0x6:
none

0x7:
ROUTE 8 [3.26]
Person #12
0x1AA349
trainerbattle 0x7 0x1E4 0x0 0x81C19E5 0x81845D0 0x8184616

0x8:
none

0x9:
ROUTE 22 [3.41]
Script 0
0x16828C
trainerbattle 0x9 0x149 0x0 0x8188959 0x818DE1A
OBS: copied from the dump done by HackMew
__________________
Reply With Quote
  #6    
Old January 8th, 2010, 01:52 AM
linkandzelda's Avatar
linkandzelda
n00b desu ka?
 
Join Date: Dec 2006
Location: Hastings, England
Gender: Male
Nature: Careful
ive used trainerbattle 0x9 before in my hack. I has two texts, the first is if you beat the trainer they say their defeat text and the second is if you loose they come back onto the battle field and say that text. and after that the script will continue. but unfortunitly if you loose it wont continue :(

Link
__________________
Reply With Quote
  #7    
Old January 9th, 2010, 06:51 AM
liuyanghejerry's Avatar
liuyanghejerry
Trainer
 
Join Date: Jan 2008
Location: China,Xi'an
Nature: Calm
Send a message via ICQ to liuyanghejerry Send a message via Windows Live Messenger to liuyanghejerry Send a message via Yahoo to liuyanghejerry
Quote:
Originally Posted by ZodiacDaGreat View Post
trainerbattle 0x3 also allows continuation of script execution.
Code:
...
trainerbattle 0x3 0x245 0x0 0x8809DA4
...
Thing is for 0x3 type, only battle defeat text.
Is this can keep running your script and not white out?
I'll try while my computer get update...(It's broken...and I'm using my father's...)

Quote:
Originally Posted by Juan View Post
trainerbattle is a command that allows you to use with different parameters.





Some subroutines called by the command 0x5C





At least in Fire Red, the maximum that can be used in the first parameter is 10(0x0-0x9).
And each of them calls a different subroutine.


Code:
ROM:08080228
ROM:08080228 @ ¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦ S U B R O U T I N E ¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦
ROM:08080228
ROM:08080228
ROM:08080228 sub_8080228:                            @ CODE XREF: cmd_0x5C+6p
ROM:08080228                 PUSH    {R4,R5,LR}
ROM:0808022A                 ADD     R5, R0, #0
ROM:0808022C                 BL      sub_8080110
ROM:08080230                 LDR     R4, =0x20386AC
ROM:08080232                 ADD     R0, R5, #0
ROM:08080234                 BL      Read8bitsValue
ROM:08080238                 LSL     R0, R0, #0x18
ROM:0808023A                 LSR     R0, R0, #0x18
ROM:0808023C                 STRH    R0, [R4]
ROM:0808023E                 LDRH    R0, [R4]
ROM:08080240                 SUB     R0, #1
ROM:08080242                 CMP     R0, #8
ROM:08080244                 BHI     loc_8080318     @ 0x0 or > 0x9
ROM:08080246                 LSL     R0, R0, #2
ROM:08080248                 LDR     R1, =off_8080258
ROM:0808024A                 ADD     R0, R0, R1
ROM:0808024C                 LDR     R0, [R0]
ROM:0808024E                 MOV     PC, R0
ROM:0808024E @ ---------------------------------------------------------------------------
ROM:08080250 dword_8080250:  .long 0x20386AC         @ DATA XREF: sub_8080228+8r
ROM:08080254 off_8080254:    .long off_8080258       @ DATA XREF: sub_8080228+20r
ROM:08080254                                         @ 
ROM:08080258 off_8080258:    .long loc_808028C       @ DATA XREF: sub_8080228:off_8080254o
ROM:08080258                                         @ 0x1
ROM:0808025C                 .long loc_808028C       @ 0x2
ROM:08080260                 .long loc_808027C       @ 0x3
ROM:08080264                 .long loc_8080284       @ 0x4
ROM:08080268                 .long loc_80802D8       @ 0x5
ROM:0808026C                 .long loc_8080294       @ 0x6
ROM:08080270                 .long loc_80802AC       @ 0x7
ROM:08080274                 .long loc_8080294       @ 0x8
ROM:08080278                 .long loc_8080304       @ 0x9
ROM:0808027C @ ---------------------------------------------------------------------------
...
...
...

[2] :D


In fire red has scripts that use this type of script.




Code:
0x0:
VIRIDIAN FOREST [1.0]
Person 3
0x160571
trainerbattle 0x0 0x66 0x0 0x81722C7 0x81722F9
 
0x1:
VIRIDIAN CITY [5.1]
Person 8
0x169ECA
trainerbattle 0x1 0x15E 0x0 0x818F352 0x818F43F 0x8169F04
 
0x2:
ROCKET HIDEOUT [1.42]
Person 5
0x16120A
trainerbattle 0x2 0x16A 0x0 0x817503A 0x817505A 0x8161225
 
0x3:
MT. MOON [1.3]
Person 3
0x1606C2
trainerbattle 0x3 0xAA 0x0 0x8172B99
 
 
0x4:
VICTORY ROAD [1.41]
Person 11
0x16115F
trainerbattle 0x4 0x1E5 0x0 0x8174D0C 0x8174D45 0x8174D96
 
0x5:
ROUTE 3 [3.21]
Person 2
0x1A957B
trainerbattle 0x5 0x76 0x0 0x81C15F9 0x8183891
 
0x6:
none
 
0x7:
ROUTE 8 [3.26]
Person #12
0x1AA349
trainerbattle 0x7 0x1E4 0x0 0x81C19E5 0x81845D0 0x8184616
 
0x8:
none
 
0x9:
ROUTE 22 [3.41]
Script 0
0x16828C
trainerbattle 0x9 0x149 0x0 0x8188959 0x818DE1A
OBS: copied from the dump done by HackMew
This is a HUGE routine,and seems much more difficult than item running.I just saw your item subject.I'm also interesting in item running.So I decide to research items firstAnd research trainerbattle commands later(If I can...)
__________________
Zel,thethethethe,LU-HO,Darthatron,HackMew,ZodiacDaGreat,Juan,score_under,JPAN,Tamah-chan,I really appreciate your kindness and your help!:D


I did something that really bad.But made all Chinese can hack Pokemon, too.If you guys hate me, I totally understand,but cannot do anything but force to keep everything.
If there must be someone to undertake all spit and curse, it must be me.
Reply With Quote
  #8    
Old January 21st, 2010, 05:48 AM
558122_DG's Avatar
558122_DG
Learning how to make mistakes
 
Join Date: Nov 2009
Gender: Male
Quote:
Originally Posted by ZodiacDaGreat View Post
trainerbattle 0x3 also allows continuation of script execution.
Code:
...
trainerbattle 0x3 0x245 0x0 0x8809DA4
...
Thing is for 0x3 type, only battle defeat text.

so are the 3 dots in the begginging and end required?


Also for the script

trainerbattle 0x3 0xXXX 0x9 @intro @defeat

is it possible to change what the person says?

I.E oak usually says:

Pushy as always, you haven't been in a trainer battle have you?

^I expect it would require some ASM though :/
__________________
This signature has been disabled.
Spoilers are forbidden in signatures
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
  #9    
Old January 21st, 2010, 06:15 AM
Tropical Sunlight's Avatar
Tropical Sunlight
The Faltine
 
Join Date: Mar 2008
Location: Slovenia
Age: 18
Gender: Male
Send a message via Windows Live Messenger to Tropical Sunlight
So, what happens in the person defeats you? Your Pokemon get healthy again or what?
Reply With Quote
  #10    
Old January 21st, 2010, 06:28 AM
558122_DG's Avatar
558122_DG
Learning how to make mistakes
 
Join Date: Nov 2009
Gender: Male
Quote:
Originally Posted by H2O Turquoise View Post
So, what happens in the person defeats you? Your Pokemon get healthy again or what?
I don't believe so, all that happens is the script continues BUT it will gliche up UNLESS you have a special 0x0 command in there. I.E lets say rival beats you...then the game will crash. Atleast thats what happened to me :/
__________________
This signature has been disabled.
Spoilers are forbidden in signatures
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
  #11    
Old March 7th, 2010, 06:02 AM
chatsalot7777
Beginning Trainer
 
Join Date: Mar 2009
I believe trainerbattle 0x3 is for the elite four.
Can someone explain how the other commands work?
Reply With Quote
  #12    
Old March 7th, 2010, 02:28 PM
Shiny Quagsire's Avatar
Shiny Quagsire
Unexpectedly Gone until Aug 13
 
Join Date: May 2009
Location: Hoenn Safari Zone
Age: 16
Gender: Male
Nature: Jolly
I think this might be useful in some hacks. I've always wondered how that worked, but I never really checked it out.
__________________



Reply With Quote
  #13    
Old March 11th, 2010, 04:17 AM
Prof. Briar
Beginning Trainer
 
Join Date: Apr 2008
Gender:
I don't know if anyone else has thought of this, but could this be used in conjunction with the Safari system somehow; so that when you have no pokemon to fight with you can use stones, bait, and balls to handle wild pokemon? Maybe you could do something with trainers where some of them you don't have to battle, but others will block your path or drive you off unless you can/do battle them. That might be neat, and would solve the whole problem I've always had of "Gah! Not another psycho battle-maniac!" Plus, it might mean you could do a hack where you actually go out and catch your first pokemon, instead of being handed it...sorry, maybe I'm getting carried away. Still, I think some neat things could be done by changing the way defeat is handled.
__________________
Support RPG Toolkit, the best free engine ever!

Waitwhat?
Reply With Quote
  #14    
Old March 11th, 2010, 02:42 PM
NarutoActor's Avatar
NarutoActor
The rocks cry out to me
Community Supporter
 
Join Date: Jan 2009
Location: Brooklyn/Marlboro
Age: 20
Gender: Female
Nature: Bashful
Send a message via AIM to NarutoActor Send a message via Windows Live Messenger to NarutoActor
you could always use checkflags so that way some trainers battle you and some don't.
__________________
~There are those people who understand hex, F the rest
Reply With Quote
  #15    
Old June 3rd, 2012, 11:43 AM
trebornosliw's Avatar
trebornosliw
Learning
 
Join Date: Jul 2009
Age: 21
Gender: Male
Nature: Adamant
Well, it says no revival limit so I'll leave a note here in case anyone comes looking.
Quote:
Originally Posted by 558122_DG View Post
so are the 3 dots in the begginging and end required?


Also for the script

trainerbattle 0x3 0xXXX 0x9 @intro @defeat

is it possible to change what the person says?

I.E oak usually says:

Pushy as always, you haven't been in a trainer battle have you?

^I expect it would require some ASM though :/
First, I assume you mean this:
trainerbattle 0x9 0xXXX 0x3 @victory @defeat
1. trainerbattle 0x3 is followed by only one text pointer and I have no idea what that 0x9 would do in the command you wrote.
2. the first text pointer in trainerbattle 0x9 shows if you win the battle, not at the battle's start (thus, not intro).

Second, I imagine you could go in and hex edit the text... it has to be stored somewhere. There's a tutorial about hex editing text somewhere on this forum (now I'm interested... I'm going to have to look this up).

Quote:
Originally Posted by Tropical Sunlight View Post
So, what happens in the person defeats you? Your Pokemon get healthy again or what?
I've been testing, and your Pokemon will automatically be healed if you lose in trainerbattle 0x9 0x??? 0x3, but will not be healed if you win (you have to add the special 0x0). Now, if you lose a trainerbattle 0x9 0x??? 0x0 you are just sent to the last Pokemon center.
I'm trying to find some way to have a battle without Oak's dialogue where the trainer's Pokemon are still healed after a loss. Is there a list of the effects of that third variable anywhere (the one that's set as 0x3 for the Oak dialogue)?
__________________
Credit for my avatar goes to the Lego company.
Reply With Quote
  #16    
Old November 10th, 2012, 04:19 PM
tajaros's Avatar
tajaros
Hi I'm dawg
 
Join Date: Apr 2012
Location: Philippines
Age: 15
Gender: Male
Nature: Timid
Send a message via Windows Live Messenger to tajaros
Quote:
Originally Posted by trebornosliw View Post
Well, it says no revival limit so I'll leave a note here in case anyone comes looking.

First, I assume you mean this:
trainerbattle 0x9 0xXXX 0x3 @victory @defeat
1. trainerbattle 0x3 is followed by only one text pointer and I have no idea what that 0x9 would do in the command you wrote.
2. the first text pointer in trainerbattle 0x9 shows if you win the battle, not at the battle's start (thus, not intro).

Second, I imagine you could go in and hex edit the text... it has to be stored somewhere. There's a tutorial about hex editing text somewhere on this forum (now I'm interested... I'm going to have to look this up).


I've been testing, and your Pokemon will automatically be healed if you lose in trainerbattle 0x9 0x??? 0x3, but will not be healed if you win (you have to add the special 0x0). Now, if you lose a trainerbattle 0x9 0x??? 0x0 you are just sent to the last Pokemon center.
I'm trying to find some way to have a battle without Oak's dialogue where the trainer's Pokemon are still healed after a loss. Is there a list of the effects of that third variable anywhere (the one that's set as 0x3 for the Oak dialogue)?
You can edit the text using A-text.

And found something I'm using this script in my hack and used it further but it seems if you have more than 1 Pokemon the Game Freezes or Crashes.

After your first Pokemon is defeated you'll select your next Pokemon and no Sprite will appear and it will crash when the 2nd Pokemon Loses.
__________________
Reply With Quote
Reply
Quick Reply

Sponsored Links
Thread Tools

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

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



All times are UTC -8. The time now is 11:01 PM.


Style by Nymphadora, artwork by Sa-Dui.
Like our Facebook Page Follow us on Twitter © 2002 - 2014 The PokéCommunity™, pokecommunity.com.
Pokémon characters and images belong to The Pokémon Company International and Nintendo. This website is in no way affiliated with or endorsed by Nintendo, Creatures, GAMEFREAK, The Pokémon Company or The Pokémon Company International. We just love Pokémon.
All forum styles, their images (unless noted otherwise) and site designs are © 2002 - 2014 The PokéCommunity / PokéCommunity.com.
PokéCommunity™ is a trademark of The PokéCommunity. All rights reserved. Sponsor advertisements do not imply our endorsement of that product or service. User generated content remains the property of its creator.