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!

Draconius GO
Reply
 
Thread Tools
  #1    
Old January 5th, 2010 (9:27 PM).
liuyanghejerry's Avatar
liuyanghejerry liuyanghejerry is offline
     
    Join Date: Jan 2008
    Location: China,Xi'an
    Nature: Calm
    Posts: 219
    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
    Reply With Quote

    Relevant Advertising!

      #2    
    Old January 7th, 2010 (12:55 PM).
    ZodiacDaGreat's Avatar
    ZodiacDaGreat ZodiacDaGreat is offline
    Working on a Mobile System
       
      Join Date: Feb 2007
      Location: South Pacific
      Age: 25
      Gender: Male
      Nature: Relaxed
      Posts: 429
      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 (1:15 PM).
      Logan's Avatar
      Logan Logan is offline
      • Platinum Tier
       
      Join Date: Nov 2008
      Location: Salisbury, England
      Age: 22
      Gender: Male
      Nature: Sassy
      Posts: 10,040
      Hm, ZDG, what script is that executed in?
      Reply With Quote
        #4    
      Old January 7th, 2010 (1:28 PM).
      ZodiacDaGreat's Avatar
      ZodiacDaGreat ZodiacDaGreat is offline
      Working on a Mobile System
         
        Join Date: Feb 2007
        Location: South Pacific
        Age: 25
        Gender: Male
        Nature: Relaxed
        Posts: 429
        Hehehe, that's part of a script from my hack XD
        __________________
        Reply With Quote
          #5    
        Old January 7th, 2010 (2:15 PM).
        Juan Juan is offline
        Brazilian with a bad English
           
          Join Date: Jun 2007
          Location: Pindamonhangaba - SP
          Age: 26
          Nature: Adamant
          Posts: 92
          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 (1:52 AM).
          linkandzelda's Avatar
          linkandzelda linkandzelda is offline
          n00b desu ka?
             
            Join Date: Dec 2006
            Location: Hastings, England
            Gender: Male
            Nature: Careful
            Posts: 776
            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 (6:51 AM).
            liuyanghejerry's Avatar
            liuyanghejerry liuyanghejerry is offline
               
              Join Date: Jan 2008
              Location: China,Xi'an
              Nature: Calm
              Posts: 219
              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
              Reply With Quote
                #8    
              Old January 21st, 2010 (5:48 AM).
              558122_DG's Avatar
              558122_DG 558122_DG is offline
              Learning how to make mistakes
                 
                Join Date: Nov 2009
                Gender: Male
                Posts: 739
                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 (6:15 AM).
                Tropical Sunlight's Avatar
                Tropical Sunlight Tropical Sunlight is offline
                The Faltine
                   
                  Join Date: Mar 2008
                  Location: Slovenia
                  Age: 21
                  Gender: Male
                  Posts: 3,578
                  So, what happens in the person defeats you? Your Pokemon get healthy again or what?
                  Reply With Quote
                    #10    
                  Old January 21st, 2010 (6:28 AM).
                  558122_DG's Avatar
                  558122_DG 558122_DG is offline
                  Learning how to make mistakes
                     
                    Join Date: Nov 2009
                    Gender: Male
                    Posts: 739
                    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 (6:02 AM).
                    chatsalot7777 chatsalot7777 is offline
                       
                      Join Date: Mar 2009
                      Posts: 3
                      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 (2:28 PM).
                      Shiny Quagsire's Avatar
                      Shiny Quagsire Shiny Quagsire is offline
                      I'm Still Alive, Elsewhere
                         
                        Join Date: May 2009
                        Location: Hoenn Safari Zone
                        Age: 19
                        Gender: Male
                        Nature: Jolly
                        Posts: 700
                        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 (4:17 AM).
                        Prof. Briar Prof. Briar is offline
                           
                          Join Date: Apr 2008
                          Gender:
                          Posts: 47
                          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 (2:42 PM).
                          NarutoActor's Avatar
                          NarutoActor NarutoActor is offline
                          The rocks cry out to me
                          • Silver Tier
                           
                          Join Date: Jan 2009
                          Location: Brooklyn/Marlboro
                          Age: 24
                          Gender: Female
                          Nature: Bashful
                          Posts: 1,979
                          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 trebornosliw is offline
                          Learning
                             
                            Join Date: Jul 2009
                            Age: 25
                            Gender: Male
                            Nature: Adamant
                            Posts: 523
                            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 (4:19 PM).
                            tajaros's Avatar
                            tajaros tajaros is offline
                            Hi I'm dawg
                               
                              Join Date: Apr 2012
                              Location: Philippines
                              Age: 18
                              Gender: Male
                              Nature: Timid
                              Posts: 857
                              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

                              Join the conversation!

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

                              Create a PokéCommunity Account

                              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

                              Forum Jump


                              All times are GMT -8. The time now is 7:05 PM.