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!

Reply
 
Thread Tools
  #26    
Old March 19th, 2012 (11:07 AM).
Jambo51's Avatar
Jambo51 Jambo51 is offline
Glory To Arstotzka
     
    Join Date: Jun 2009
    Gender: Male
    Nature: Quiet
    Posts: 732
    Quote:
    Originally Posted by Xenesis View Post
    Haha, this is amazing.

    It's like playing legos with attacks.
    Yes, it rather is. Nice analogy.

    Quote:
    Originally Posted by redriders180 View Post
    But is it possible to expand the battle script pointer table as well? For instance, it only goes up to 213 right now, surely it can go to 255?
    I just updated the OP now. Yeah, it can support up to 255 effects without a rewrite.
    __________________
    Hey guys, please check out my recreations of the gen 1 and 2 music on my custom engine at my SoundCloud! - Here!
    Reply With Quote

    Relevant Advertising!

      #27    
    Old March 19th, 2012 (2:52 PM).
    droomph's Avatar
    droomph droomph is offline
    weeb
    • Crystal Tier
     
    Join Date: Sep 2011
    Location: nowhere spectacular
    Age: 20
    Gender: Male
    Nature: Impish
    Posts: 4,291
    Where's a compilation of your findings? Just asking.

    But anyways, if I'm not mistaken, there's a lot of differences between the games, right?
    Spoiler:
    Oh and btw in Emerald 0xC is "set-transparency" or something. It takes two parameters, usually 0xC and 0x8, as front-transparency (the yellow part), and the back-transparency (the black part). How the yellow-and-black got there, however, I don't know.

    Also, 0x8 is "end", and takes no arguments.
    I'm sorry if I'm so stupid sometimes.

    Many apologies, I'm only 15.
    __________________
    did u no there r 21 letters in the alphabet
    o i forgot 5
    uraqt


    Reply With Quote
      #28    
    Old March 19th, 2012 (3:57 PM).
    Jambo51's Avatar
    Jambo51 Jambo51 is offline
    Glory To Arstotzka
       
      Join Date: Jun 2009
      Gender: Male
      Nature: Quiet
      Posts: 732
      Quote:
      Originally Posted by droomph View Post
      Where's a compilation of your findings? Just asking.

      But anyways, if I'm not mistaken, there's a lot of differences between the games, right?
      Spoiler:
      Oh and btw in Emerald 0xC is "set-transparency" or something. It takes two parameters, usually 0xC and 0x8, as front-transparency (the yellow part), and the back-transparency (the black part). How the yellow-and-black got there, however, I don't know.

      Also, 0x8 is "end", and takes no arguments.
      I'm sorry if I'm so stupid sometimes.

      Many apologies, I'm only 15.
      No. The thing you quoted is an ANIMATION SCRIPT, while the thing I posted about is a BATTLE SCRIPT. One is used to execute the animation played when you use the move, while the other is used to actually execute the move and all its effects. Hope that helps.

      I somewhat suspect that the battle scripts and animations scripts will be identical (offsets aside, of course) between RSE and FRLG. I could be wrong, though.

      I don't really have a compilation of findings - I simply posted how you can go about creating any combination of effects by showing an example. Obviously, you can simply swap in different effects from the ones I showed (or add extra ones). Earlier in this thread, ChaosRush posted a very useful list of effect ID numbers and what they actually do, which I used to find the effects I needed.
      __________________
      Hey guys, please check out my recreations of the gen 1 and 2 music on my custom engine at my SoundCloud! - Here!
      Reply With Quote
        #29    
      Old March 19th, 2012 (4:43 PM). Edited March 20th, 2012 by droomph.
      droomph's Avatar
      droomph droomph is offline
      weeb
      • Crystal Tier
       
      Join Date: Sep 2011
      Location: nowhere spectacular
      Age: 20
      Gender: Male
      Nature: Impish
      Posts: 4,291
      Yeah, it seemed too good to be true anyways.

      Thanks! Yeah, it was kinda weird.

      Although, when I ran something from one of the posts before, it called the animation script, e.g. it actually ran (the commands I just mentioned) for the move. I don't really know...

      Never mind. I was reading something wrong.
      __________________
      did u no there r 21 letters in the alphabet
      o i forgot 5
      uraqt


      Reply With Quote
        #30    
      Old March 19th, 2012 (5:15 PM).
      Jambo51's Avatar
      Jambo51 Jambo51 is offline
      Glory To Arstotzka
         
        Join Date: Jun 2009
        Gender: Male
        Nature: Quiet
        Posts: 732
        Yeah, the Battle Scripts call the Animation Scripts as part of their procedure. It's not all that weird, really.
        __________________
        Hey guys, please check out my recreations of the gen 1 and 2 music on my custom engine at my SoundCloud! - Here!
        Reply With Quote
          #31    
        Old March 19th, 2012 (7:21 PM).
        redriders180's Avatar
        redriders180 redriders180 is offline
        Mastermind of Pokemon Glazed
           
          Join Date: Jun 2010
          Location: Path of Victory, Tunod
          Gender: Male
          Nature: Quirky
          Posts: 540
          OK, I'm either crazy, or just not seeing it...there aren't any existing effect bytes that lower the users stats? That seems crazy...surely there was one move out of the 354 introduced that would lower the users something >.>

          If I can't lower my own stats, It seems like alot of Gen IV and Gen V moves are undoable!

          Edit: I'm trying to reproduce Hammer Arm, so it needs to do damage as well...It's this "lowering stats" bit that's making me hit a road block.
          __________________


          I think I'm done with ROM hacking. I'll still pop in and visit, though.


          Reply With Quote
            #32    
          Old March 20th, 2012 (12:11 AM).
          droomph's Avatar
          droomph droomph is offline
          weeb
          • Crystal Tier
           
          Join Date: Sep 2011
          Location: nowhere spectacular
          Age: 20
          Gender: Male
          Nature: Impish
          Posts: 4,291
          Quote:
          Originally Posted by redriders180 View Post
          OK, I'm either crazy, or just not seeing it...there aren't any existing effect bytes that lower the users stats? That seems crazy...surely there was one move out of the 354 introduced that would lower the users something >.>

          If I can't lower my own stats, It seems like alot of Gen IV and Gen V moves are undoable!

          Edit: I'm trying to reproduce Hammer Arm, so it needs to do damage as well...It's this "lowering stats" bit that's making me hit a road block.
          I believe Overheat lowers your Sp. Atk. by two levels, you could probably look over on that.
          __________________
          did u no there r 21 letters in the alphabet
          o i forgot 5
          uraqt


          Reply With Quote
            #33    
          Old March 20th, 2012 (2:21 AM).
          Xenesis's Avatar
          Xenesis Xenesis is offline
          Syogun Changer
             
            Join Date: May 2006
            Location: Australia
            Nature: Sassy
            Posts: 55
            Superpower also lowers your attack and defence by one stage.
            Reply With Quote
              #34    
            Old March 20th, 2012 (6:19 AM).
            Fiori Fiori is offline
               
              Join Date: Dec 2011
              Gender: Male
              Posts: 10
              2E 85 3E 02 02 E6 15
              about the "E6"
              i think the highest bit means whether the effect depends on the effect accuracy
              1 means the effect always occurs,
              0 means the effect only has x%(effect accuracy) chance to occur.

              so "E6" always causes recoil , while "66" dpends on the effect accuracy
              Reply With Quote
                #35    
              Old March 20th, 2012 (12:27 PM).
              Rasenshurikenbum's Avatar
              Rasenshurikenbum Rasenshurikenbum is offline
              ASM is very cool!
                 
                Join Date: Apr 2011
                Location: Poland
                Age: 21
                Gender: Male
                Nature: Relaxed
                Posts: 70
                Is it possible to make new command for battle script? For example attack and lowering user's defense and special defense by one stage (like close combat)
                __________________
                Check out my tutorials:Next tutorials coming soon!
                Reply With Quote
                  #36    
                Old March 20th, 2012 (2:18 PM).
                Jambo51's Avatar
                Jambo51 Jambo51 is offline
                Glory To Arstotzka
                   
                  Join Date: Jun 2009
                  Gender: Male
                  Nature: Quiet
                  Posts: 732
                  Quote:
                  Originally Posted by Fiori View Post
                  2E 85 3E 02 02 E6 15
                  about the "E6"
                  i think the highest bit means whether the effect depends on the effect accuracy
                  1 means the effect always occurs,
                  0 means the effect only has x%(effect accuracy) chance to occur.

                  so "E6" always causes recoil , while "66" dpends on the effect accuracy
                  Hmm, that could be a really good shout. The game definitely does check this highest bit on reading it to execute effects.

                  Quote:
                  Originally Posted by Rasenshurikenbum View Post
                  Is it possible to make new command for battle script? For example attack and lowering user's defense and special defense by one stage (like close combat)
                  It's possible, but pointless. I explicitly explained how to use existing commands in a combination to produce effects like close combat. For creating NEW effects, I wrote a "callasm" command.
                  __________________
                  Hey guys, please check out my recreations of the gen 1 and 2 music on my custom engine at my SoundCloud! - Here!
                  Reply With Quote
                    #37    
                  Old March 20th, 2012 (2:25 PM).
                  droomph's Avatar
                  droomph droomph is offline
                  weeb
                  • Crystal Tier
                   
                  Join Date: Sep 2011
                  Location: nowhere spectacular
                  Age: 20
                  Gender: Male
                  Nature: Impish
                  Posts: 4,291
                  Also, for you Emerald people out there, the table of battle-instructions is located at 0x31BD10.
                  __________________
                  did u no there r 21 letters in the alphabet
                  o i forgot 5
                  uraqt


                  Reply With Quote
                    #38    
                  Old March 20th, 2012 (3:52 PM).
                  redriders180's Avatar
                  redriders180 redriders180 is offline
                  Mastermind of Pokemon Glazed
                     
                    Join Date: Jun 2010
                    Location: Path of Victory, Tunod
                    Gender: Male
                    Nature: Quirky
                    Posts: 540
                    Quote:
                    Originally Posted by Jambo51 View Post
                    Hmm, that could be a really good shout. The game definitely does check this highest bit on reading it to execute effects.



                    It's possible, but pointless. I explicitly explained how to use existing commands in a combination to produce effects like close combat. For creating NEW effects, I wrote a "callasm" command.
                    I tried to make a close combat that works, but it kept freezing up after the animation for the defense drop. I guess it's just bad programming...but I have a small annoyance. I wrote the following script for Hammer Arm:

                    Spoiler:
                    00 01 5E 69 1D 08 00 00 02 03 04 05 06 07 09 0A 0E 5C 00 3A 0B 00 0C 00 0D 12 40 00 0F 12 40 00 2E 85 3E 02 02 E6 15 2E 85 3E 02 02 03 15 28 47 69 1D 08


                    And while the speed drop does occur, it doesn't say so. How do I make it say that _____s speed dropped?

                    I know this seems like its turning into a question thread, but can someone maybe explain how to make multiple stats drop without freezing up?
                    __________________


                    I think I'm done with ROM hacking. I'll still pop in and visit, though.


                    Reply With Quote
                      #39    
                    Old March 20th, 2012 (9:35 PM).
                    droomph's Avatar
                    droomph droomph is offline
                    weeb
                    • Crystal Tier
                     
                    Join Date: Sep 2011
                    Location: nowhere spectacular
                    Age: 20
                    Gender: Male
                    Nature: Impish
                    Posts: 4,291
                    Quote:
                    Originally Posted by redriders180 View Post
                    I tried to make a close combat that works, but it kept freezing up after the animation for the defense drop. I guess it's just bad programming...but I have a small annoyance. I wrote the following script for Hammer Arm:

                    Spoiler:
                    00 01 5E 69 1D 08 00 00 02 03 04 05 06 07 09 0A 0E 5C 00 3A 0B 00 0C 00 0D 12 40 00 0F 12 40 00 2E 85 3E 02 02 E6 15 2E 85 3E 02 02 03 15 28 47 69 1D 08


                    And while the speed drop does occur, it doesn't say so. How do I make it say that _____s speed dropped?

                    I know this seems like its turning into a question thread, but can someone maybe explain how to make multiple stats drop without freezing up?
                    Hm...Have you tried looking into the script for AincentPower? Although that raises your stats, not decrease it, I think it could be the same process for the opposite...
                    __________________
                    did u no there r 21 letters in the alphabet
                    o i forgot 5
                    uraqt


                    Reply With Quote
                      #40    
                    Old March 20th, 2012 (11:35 PM). Edited March 20th, 2012 by Fiori.
                    Fiori Fiori is offline
                       
                      Join Date: Dec 2011
                      Gender: Male
                      Posts: 10
                      Quote:
                      Originally Posted by Jambo51 View Post
                      For creating NEW effects, I wrote a "callasm" command.
                      Could you share your code? and i'm curious what effects you did?

                      2E 85 3E 02 02 E6 15
                      also about "E6"
                      the second bit means the objective of the effect
                      0 : opponent
                      1 : user

                      the else 6 bits means what effect it does
                      01: sleep
                      02: poison
                      03: burn
                      04: freeze
                      05: paralyze
                      06: badly poison
                      07: confusion
                      08: flinch
                      09: paralyze
                      0a: uproar
                      0b: get money
                      0c: fight to death
                      0d: sand tomb
                      0e: recoil 1/4
                      0f: Attack Raising One Level
                      10: Defense
                      11: Speed
                      12: Special Attack
                      13: Special Defense
                      14: Accuracy
                      15: Evasion
                      16: Attack Lowering One Level
                      17: Defense
                      18: Speed
                      19: Special Attack
                      1a: Special Defense
                      1b: Accuracy
                      1c: Evasion
                      1d: need recovery energy
                      1e:
                      1f: steal item
                      20:
                      21:
                      22: ALL states Raising One Level
                      23:
                      24:
                      25: Attack and Defense Lowering One Level
                      26: recoil 1/3
                      27: Attack Raising Two Levels
                      28: Defense
                      29: Speed
                      2a: Special Attack
                      2b: Special Defense
                      2c: Accuracy
                      2d: Evasion
                      2e: Attack Lowering Two Levels
                      2f: Defense
                      30: Speed
                      31: Special Attack
                      32: Special Defense
                      33: Accuracy
                      34: Evasion
                      35: similar as Outrage
                      36: Knock Off
                      37:
                      38:
                      39:
                      3a:
                      3b: Special Attack Lowering Two Levels
                      3c:
                      3d:
                      3e:
                      3f:

                      over
                      Reply With Quote
                        #41    
                      Old March 21st, 2012 (12:09 PM).
                      Jambo51's Avatar
                      Jambo51 Jambo51 is offline
                      Glory To Arstotzka
                         
                        Join Date: Jun 2009
                        Gender: Male
                        Nature: Quiet
                        Posts: 732
                        Quote:
                        Originally Posted by redriders180 View Post
                        I wrote the following script for Hammer Arm:

                        Spoiler:
                        00 01 5E 69 1D 08 00 00 02 03 04 05 06 07 09 0A 0E 5C 00 3A 0B 00 0C 00 0D 12 40 00 0F 12 40 00 2E 85 3E 02 02 E6 15 2E 85 3E 02 02 03 15 28 47 69 1D 08
                        You didn't write that, I did. You copied the Flare Blitz effect verbatim. I explained step by step how to find the effect you want, and how to use it. You haven't done any of it in this case. Also, as I said, it will only work on BPRE 1.0. It WILL NOT work on any other ROM, or at least, not in the form that I gave it.

                        Quote:
                        Originally Posted by droomph View Post
                        Hm...Have you tried looking into the script for AincentPower? Although that raises your stats, not decrease it, I think it could be the same process for the opposite...
                        Hammer Arm lowers the user's speed, doesn't it? In which case, the code should be thus:

                        Code:
                        00 01 5E 69 1D 08 00 00 02 03 04 05 06 07 09 0A 0E 5C 00 3A 0B 00 0C 00 0D 12 40 00 0F 12 40 00 48 01 03 09 2E DE 3F 02 02 93 89 C1 62 8F 1D 08 12 40 00 28 47 69 1D 08
                        I knocked this up quickly, so it might not be 100% right.
                        __________________
                        Hey guys, please check out my recreations of the gen 1 and 2 music on my custom engine at my SoundCloud! - Here!
                        Reply With Quote
                          #42    
                        Old March 21st, 2012 (1:07 PM). Edited March 21st, 2012 by DoesntKnowHowToPlay.
                        DoesntKnowHowToPlay's Avatar
                        DoesntKnowHowToPlay DoesntKnowHowToPlay is offline
                        Tiny Umbrella with Lots and Lots of Good
                           
                          Join Date: Jan 2012
                          Posts: 258
                          Jambo, he probably made the same goof I did and copied the wrong thing, as he claimed to have a partially working Hammer Arm (which that clearly isn't). And your Flare Blitz actually seems to work just fine in vanilla FR.

                          If you don't mind piggybacking off the game's code (and are using FR), try this:

                          Quote:
                          2E 85 3E 02 02 58 28 00 69 1D 08
                          The 58 may be incorrect as I haven't tested this...it's basically Metal Claw/Steel Wing with the effect byte changed.

                          As for making a version that doesn't use the game's scripts, I knocked this up real quick from the Close Combat I made last night:

                          Quote:
                          00 01 5E 69 1D 08 00 00 02 03 04 05 06 07 09 0A 0E 5C 00 3A 0B 00 0C 00 0D 12 40 00 0F 12 40 00 2E 85 3E 02 02 58 15 28 47 69 1D 08
                          And if anyone was curious about the Close Combat script...it works, but it doesn't apply the debuffs in the graceful manner Superpower does- it plays the -defense animation twice rather than doing one animation appropriate to what is being debuffed.

                          Quote:
                          00 01 5E 69 1D 08 00 00 02 03 04 05 06 07 09 0A 0E 5C 00 3A 0B 00 0C 00 0D 12 40 00 0F 12 40 00 2E 85 3E 02 02 57 15 2E 85 3E 02 02 5A 15 28 47 69 1D 08
                          Reply With Quote
                            #43    
                          Old March 21st, 2012 (2:13 PM).
                          Jambo51's Avatar
                          Jambo51 Jambo51 is offline
                          Glory To Arstotzka
                             
                            Join Date: Jun 2009
                            Gender: Male
                            Nature: Quiet
                            Posts: 732
                            I also made a close combat one which rather ungracefully applies the stat changes. I'm not awfully sure why this happens, in all honesty.

                            I'm glad to see that people are willing to test this stuff out and push its limits though! I put a lot of time and effort into working out how and why the game did certain things, so it's nice to see it's appreciated.
                            __________________
                            Hey guys, please check out my recreations of the gen 1 and 2 music on my custom engine at my SoundCloud! - Here!
                            Reply With Quote
                              #44    
                            Old March 22nd, 2012 (8:25 AM).
                            redriders180's Avatar
                            redriders180 redriders180 is offline
                            Mastermind of Pokemon Glazed
                               
                              Join Date: Jun 2010
                              Location: Path of Victory, Tunod
                              Gender: Male
                              Nature: Quirky
                              Posts: 540
                              Sorry Jambo! It must've been a typo, because I was sure I copied the code from my Hex Editor, but I guess I selected the wrong thing.

                              The code you gave me does the same thing, it lowers the speed, and plays the animation, but it doesn't say "______s Speed fell!". I wonder if this is something worth trying to figure out. Actually, I think we should figure out how to make moves to display types of strings...It's probably dependent on the effect bytes, and not the move itself, but I'm sure you all knew that.

                              Also, Jambo, do you mind giving some insight on making moves that are NOT combinations of existing effects? I know you mentioned ASM, but I don't know where you'd put the ASM. Thanks!
                              __________________


                              I think I'm done with ROM hacking. I'll still pop in and visit, though.


                              Reply With Quote
                                #45    
                              Old March 24th, 2012 (3:49 PM). Edited March 24th, 2012 by droomph.
                              droomph's Avatar
                              droomph droomph is offline
                              weeb
                              • Crystal Tier
                               
                              Join Date: Sep 2011
                              Location: nowhere spectacular
                              Age: 20
                              Gender: Male
                              Nature: Impish
                              Posts: 4,291
                              Quote:
                              Originally Posted by Fiori View Post
                              Could you share your code? and i'm curious what effects you did?
                              Code:
                              2E 85 3E 02 02 E6 15
                              also about "E6"
                              the second bit means the objective of the effect
                              0 : opponent
                              1 : user

                              the else 6 bits means what effect it does
                              Spoiler:
                              Code:
                              01: sleep
                              02: poison
                              03: burn
                              04: freeze
                              05: paralyze
                              06: badly poison
                              07: confusion
                              08: flinch
                              09: paralyze
                              0a: uproar
                              0b: get money
                              0c: fight to death
                              0d: sand tomb
                              0e: recoil 1/4
                              0f: Attack Raising One Level
                              10: Defense
                              11: Speed
                              12: Special Attack
                              13: Special Defense
                              14: Accuracy
                              15: Evasion
                              16: Attack Lowering One Level
                              17: Defense
                              18: Speed
                              19: Special Attack
                              1a: Special Defense
                              1b: Accuracy
                              1c: Evasion
                              1d: need recovery energy
                              1e:
                              1f: steal item
                              20:
                              21:
                              22: ALL states Raising One Level
                              23:
                              24:
                              25: Attack and Defense Lowering One Level
                              26: recoil 1/3
                              27: Attack Raising Two Levels
                              28: Defense
                              29: Speed
                              2a: Special Attack
                              2b: Special Defense
                              2c: Accuracy
                              2d: Evasion
                              2e: Attack Lowering Two Levels
                              2f: Defense
                              30: Speed
                              31: Special Attack
                              32: Special Defense
                              33: Accuracy
                              34: Evasion
                              35: similar as Outrage
                              36: Knock Off
                              37:
                              38:
                              39:
                              3a:
                              3b: Special Attack Lowering Two Levels
                              3c:
                              3d:
                              3e:
                              3f:
                              over
                              I dunno what you mean, but here's what I've got:
                              Spoiler:
                              Code:
                              callable effects (0x02024335):
                              	0x0…0x80 - Nothing (May have some effects in between)
                              	0x81 - Opponent sleep
                              	0x82 - Opponent poison
                              	0x83 - Opponent burned
                              	0x84 - Opponent frozen
                              	0x85 - Opponent paralyzed
                              	0x86 - Opponent badly poisoned (Toxic)
                              	0x87 - Opponent confused
                              	0x88 - Opponent flinch
                              	0x89 - Opponent burned, frozen, paralyzed (Tri-Attack)
                              	0x8A - User causes UPROAR
                              	0x8B - Coins scattered everywhere (Payday)
                              	0x8C - Opponent uses same move as you (until faint?)
                              	0x8D - Trapped by SAND TOMB! Buffers move that caused being trapped, plays Constrict anim. okay wtf
                              	0x8E - Recoil
                              -----0x8F - Opponent's attack is raised (Swagger)
                              	0x90 - Opponent's defense is raised (For completion?)
                              	0x91 - Opponent's speed is raised
                              	0x92 - Opponent's special attack is raised
                              	0x93 - Opponent's special defense is raised
                              	0x94 - Opponent's accuracy is raised
                              	0x95 - Opponent's evasiveness is raised
                              -----0x96 - Opponent's attack is lowered
                              	0x97 - Opponent's defense is lowered
                              	…(same pattern as above)
                              	0x9C - Opponent's evasiveness is lowered
                              -----0x9D - Opponent must recharge! (Hyper Beam?)
                              	0x9E…0xA4 - Nothing (might have some in between)
                              	0xA5 - User's attack and defense fell!
                              	0xA6 - User got hit by recoil!
                              -----0xA7 - Opponent's attack sharply rose
                              	…
                              	0xAD - Opponent's evasiveness sharply rose
                              -----0xAE - Opponent's attack harshly fell
                              	…
                              	0xB4 - Opponent's evasiveness harshly fell
                              	0xB5…0xC8 - Nothing (might have some in between)
                              	0xC9 - Opponent frozen, burned, or paralyzed (Tri-Attack)
                              	0xCA - User is making an Uproar! (I don't know why)
                              	0xCB - Payday
                              
                              	0xCD - Constricted
                              	0xCE - User is hit with recoil
                              -----0xCF - User's attack is raised
                              	…
                              	0xD5 - User's evasiveness is raised
                              -----0xD6 - User's attack fell
                              	…
                              	0xDC - User's evasiveness fell
                              	0xDD…0xE4 - Nothing (might have some in between)
                              	0xE5 - User's Attack and Defense fell
                              	0xE6 - User is hit by recoil
                              -----0xE7 - User's attack sharply rose
                              	…
                              	0xED - User's evasiveness sharply rose
                              -----0xEE - User's attack harshly fell
                              	…
                              	0xF4 - User's evasiveness harshly fell
                              It's probably because I have Emerald (or because I called it directly through 0x15), but yeah. Nothing below 0x80 seems to do anything

                              PS How do you do the do um...How do you find the actual move-script (not the effects-script)?
                              __________________
                              did u no there r 21 letters in the alphabet
                              o i forgot 5
                              uraqt


                              Reply With Quote
                                #46    
                              Old March 25th, 2012 (2:20 AM).
                              Jambo51's Avatar
                              Jambo51 Jambo51 is offline
                              Glory To Arstotzka
                                 
                                Join Date: Jun 2009
                                Gender: Male
                                Nature: Quiet
                                Posts: 732
                                Quote:
                                Originally Posted by redriders180 View Post
                                Sorry Jambo! It must've been a typo, because I was sure I copied the code from my Hex Editor, but I guess I selected the wrong thing.
                                No need to apologise, everyone makes mistakes, but I had to assume you were using the wrong thing and try to correct you if you were.

                                Quote:
                                Originally Posted by redriders180 View Post
                                Also, Jambo, do you mind giving some insight on making moves that are NOT combinations of existing effects? I know you mentioned ASM, but I don't know where you'd put the ASM. Thanks!
                                Basically, I wrote a custom BS command which is just a clone of the scripting (over world scripting, I mean) Callasm.

                                I use it to check various things which need ASM and to write data to the RAM.

                                I also hacked the text string writer to use one index as a print anything sort of command. How that works is that I store the pointer using BS commands to a set RAM address, and then call the battle string writer with that index. It then reads the RAM address for the pointer, and then uses the pointer to write the actual text. Works kinda like the OW scripting message box command.
                                __________________
                                Hey guys, please check out my recreations of the gen 1 and 2 music on my custom engine at my SoundCloud! - Here!
                                Reply With Quote
                                  #47    
                                Old May 4th, 2012 (10:05 PM). Edited May 13th, 2012 by ShadowTails.
                                ShadowTails's Avatar
                                ShadowTails ShadowTails is offline
                                I'm working on a better Avatar
                                   
                                  Join Date: Aug 2005
                                  Age: 25
                                  Gender:
                                  Nature: Relaxed
                                  Posts: 638
                                  So, I've been tinkering around in Emerald with this, and I've gotten new attacks to work. However I'm wondering about the whole animations thing, reusing existing ones. I have two new moves currently and the first move is using Pound, as expected, but the second move is using a poisoned animation. I looked for similar data to the animation pointer table, but it doesn't seem to be effecting anything in game animation wise for the new moves I've added, I definitely found a pointer table and re-pointed the data. I'm just not getting the results I expected, and it doesn't seem like all the bytes in the pointer table are pointers, assuming there are 355 animations in the game, and I jumped in the pointer data in Fire Red as well to check, and there appears to be more than 355 animation pointers for attacks, and the final bit of the 1420 bytes from 1C68F4 don't look like pointer data. Unless I have the wrong pointer, which is entirely possible, as I'm doing this in Emerald. These bytes 2F00C3004001FFFF both appear before a pointer table in both roms, and in Fire Red those bytes are before 1C68F4 and in Emerald the pointer table after those bytes is at 2C8D6C.

                                  I decided to see if replacing the data at 2C8D6C in Emerald with 0's after re-pointing it to another part of the rom (which ends in 0, so like the first post warned, I did put it in the right place) would have any effect on the game, and now Sand Stream, Switching, Throwing a Pokeball, and various other things causes the game to reset. I'm not sure what's going on at all, is there another pointer for the animations table? I'm assuming that's what I've found, but I have no way of knowing. I guess I could try the same stuff I'm doing in Fire Red. I don't suppose this whole animation thing is on the top of my priorities, but it's still something I'd like to figure out...


                                  Nevermind I figured it out.
                                  __________________
                                  "This is the best signature on this website."- You, reading this.
                                  Reply With Quote
                                    #48    
                                  Old May 14th, 2012 (6:22 AM). Edited May 14th, 2012 by Leafbarrett.
                                  Leafbarrett's Avatar
                                  Leafbarrett Leafbarrett is offline
                                     
                                    Join Date: Mar 2009
                                    Age: 25
                                    Gender: Male
                                    Posts: 75
                                    Quote:
                                    Originally Posted by Jambo51 View Post
                                    Ok - This is what I have managed to come up with over the last few weeks/months.

                                    Once I stopped getting caught up in understanding what each and every command actually does, and started looking at the bigger picture, I realised that there are groups of commands which, when executed together, produce the effect we are looking for. If we were ever to create a compiler for battle scripts - I would term these as "super commands".

                                    So, without further ado - the combination of commands which activates the stat changing effects:

                                    Spoiler:

                                    48 [Side - Byte] [Colour - Byte] [Unknown - Byte] // Stat Change Animation
                                    2E [RAM Pointer - Always 0x02023FDE for this! - Word] [Effect - Byte] // Stores what effect to execute
                                    89 [Side - Byte] [ROM Pointer - Script to execute if failed (I think)] // Actually changes the stat, based on what you stored into 02023FDE above.
                                    12 40 00 // Puts [stat] fell/rose onto screen, and delays for a little over a second.


                                    Obviously, these differing bytes will all need quantified. I'll start at the top:

                                    Command 48:
                                    Spoiler:
                                    As far as I can tell, this is simply one of many animation commands, but this one is specifically set aside for the stat changing animations.

                                    Side - Can be either 0 or 1. 0 is the opponent, and 1 is the user.

                                    Colours - These are weird. There are only 3 colours however, so I've taken to using 3 numbers.
                                    0x2 - Red (Attack and Special Attack)
                                    0x3 - Blue (Everything else)
                                    0x4 - Green (Defense and Special Defense)

                                    Unknown Byte - This may control the direction of the animation, though I'm not sure.
                                    0x9 - Down
                                    0x0 - Up


                                    Command 2E (storebyte):
                                    Spoiler:
                                    This command stores a given byte into the RAM address given to the command.

                                    RAM Address - It can obviously be different for different effects, but most effects store a byte into the RAM Address 0x02023FDE.

                                    Effect to Trigger - This is gonna be a fairly long list!
                                    Spoiler:
                                    Note: There are far more effects than this, but I don't have a list of them to hand.

                                    Raising One Level:
                                    0x11 - Attack
                                    0x12 - Defense
                                    0x13 - Speed
                                    0x14 - Special Attack
                                    0x15 - Special Defense
                                    0x16 - Accuracy
                                    0x17 - Evasion

                                    Raising Two Levels:
                                    0x21 - Attack
                                    0x22 - Defense
                                    0x23 - Speed
                                    0x24 - Special Attack
                                    0x25 - Special Defense
                                    0x26 - Accuracy
                                    0x27 - Evasion

                                    Lowering One Level:
                                    0x91 - Attack
                                    0x92 - Defense
                                    0x93 - Speed
                                    0x94 - Special Attack
                                    0x95 - Special Defense
                                    0x96 - Accuracy
                                    0x97 - Evasion

                                    Lowering Two Levels:
                                    0xA1 - Attack
                                    0xA2 - Defense
                                    0xA3 - Speed
                                    0xA4 - Special Attack
                                    0xA5 - Special Defense
                                    0xA6 - Accuracy
                                    0xA7 - Evasion



                                    Command 89 (executestatchange):
                                    Spoiler:
                                    Executes the effect stored at 0x02023FDE.

                                    Side - It's actually more than this, but I wasn't able to work out what exactly. It definitely controls side as well, however.

                                    0xC1 - User
                                    0x41 - Opponent

                                    Script Pointer - A pointer to a battle script to branch to. Not entirely sure if this is for failure, but I suspect it is since the ROM continues execution of the existing script if the stat change succeeds.


                                    Command 12 (showstatus):
                                    Spoiler:
                                    Prints the result of the changed stat to screen. Takes a frame delay as a parameter. This seems to work out in the background (possibly by reading 0x02023FDE) what effect was executed.

                                    40 00 - 0x40 - 64 frame delay. At GBA's running speed. That is almost exactly 1 second of delay.


                                    Fantastic - So far I've only talked about changing stats. What about burning, poisoning or damaging the foe? Well, these require yet more different commands!

                                    Spoiler:
                                    So, we want to create a basic attack that does damage. This is how it's structured (all numbers are in hex):
                                    Spoiler:
                                    00 01 5E 69 1D 08 00 00 02 03 04 05 06 07 09 0A 0E 5C 00 3A 0B 00 0C 00 0D 12 40 00 0F 12 40 00 15 19 00 00 00 00 00 00 2E D8 3F 02 02 00 49 00 00 3D


                                    See why I put it in a spoiler? The thing is, if you search for this string in your BPRE ROM, you will find it already exists, so why do we need to know about it at all? Why not just directly call that existing script? The answer is because a lot of the new moves use combinations of existing effects. This is something we cannot achieve simply by using the existing scripts. However, what we CAN do, and I advise you should do, is branch back to this script at the earlist available opportunity, after executing your effects.

                                    Now, the most important part of that script for our purposes is towards the end. The 0x15 byte is the byte which takes care of any added effects that the attack may have. It reads from 0x02023E85 to find what effect it should execute. So why did I bother showing you what's above, I hear you asking.

                                    The stuff that is above isn't reliant on a branch back to this code! You can simply end the execution of the effect(s) by using the return command (0x3C or 0x3D).
                                    It basically comes down to this: If your attack does damage - use this new way, if it doesn't, use the older way from above.

                                    I'll try to explain this with an example: Let's say we want to have Flare Blitz. Flare Blitz does damage, causes recoil AND can cause a burn. This is a combination of 2 existing effects, but because it has to do damage as well, we can't simply use the stat changing method. What do we do?

                                    Firstly, we take care of the damage part of the attack. This is the section of the huge script from above that is in italics. All that nonsense takes care of causing damage to the opponent. So we need that:

                                    Current Code for Flare Blitz:
                                    Code:
                                    00 01 5E 69 1D 08 00 00 02 03 04 05 06 07 09 0A 0E 5C 00 3A 0B 00 0C 00 0D 12 40 00 0F 12 40 00
                                    Excellent. Our attack would now do damage, carry an animation and all that good stuff.
                                    Now, what effect gets executed next for Flare Blitz? Well - The recoil effect, of course! So, how to we go about finding how to use this effect?

                                    The recoil effect we want is already in the ROM, however, we cannot simply call that one, because the game wouldn't then go on to execute the burn effect. What we need to do is take the relevant part of the recoil effect and insert it into our script, then execute it.

                                    So, knowing that the recoil effect we want is number 198 (the same recoil effect as Double-Edge for anyone wondering where I pulled that number from), we can find the corresponding script easily enough. The table of effects starts at 0x1D65A8 in BPRE. So, we find the 198th entry in that table, and go to the script's location. What we see is what byte is stored, and to where, to execute the recoil effect. So we copy the storebyte command (2E) and all it's parameters to gain the effect.

                                    Current Code:
                                    Code:
                                    00 01 5E 69 1D 08 00 00 02 03 04 05 06 07 09 0A 0E 5C 00 3A 0B 00 0C 00 0D 12 40 00 0F 12 40 00 2E 85 3E 02 02 E6
                                    Now we must execute the effect. Well, that's easy. Command 0x15 executes effects, so we simply add a 15 to the script.

                                    Current Code:
                                    Code:
                                    00 01 5E 69 1D 08 00 00 02 03 04 05 06 07 09 0A 0E 5C 00 3A 0B 00 0C 00 0D 12 40 00 0F 12 40 00 2E 85 3E 02 02 E6 15
                                    Excellent - but so far, we've only added 1 of the 2 effects, and it's taken a lot of work! Thankfully, from here on out, it gets easier, as for each effect, you simply repeat the cycle of store and execute until completion. So we want to add the burn effect now. The burn effect byte is 0x3, so we now stick a storebyte for that byte into the end of the script, as well as an execute effect command.

                                    Current Code:
                                    Code:
                                    00 01 5E 69 1D 08 00 00 02 03 04 05 06 07 09 0A 0E 5C 00 3A 0B 00 0C 00 0D 12 40 00 0F 12 40 00 2E 85 3E 02 02 E6 15 2E 85 3E 02 02 03 15
                                    Now, that's all of the effects which can be added for this attack directly (the defrosting is handled passively elsewhere), so now what do we do?
                                    Ah yes, as per what I said earlier, we should return to the original script as soon as possible. So now we simply put a Goto command onto the end of the script, returning back to normal execution.

                                    Flare Blitz Code:
                                    Code:
                                    00 01 5E 69 1D 08 00 00 02 03 04 05 06 07 09 0A 0E 5C 00 3A 0B 00 0C 00 0D 12 40 00 0F 12 40 00 2E 85 3E 02 02 E6 15 2E 85 3E 02 02 03 15 28 47 69 1D 08
                                    There we have it! One functional Flare Blitz effect.The recoil will ALWAYS happen, so you don't need to worry about clashes between the recoil and the CHANCE of burning, but if you have 2 effects such as flinch and burning which both rely on chance, they both must share the same chance of happening. This is simply a limiation of the code's design. It is possible for BOTH effects to happen at the same time, so you can't have a chance for poison combined with a chance for paralysis (for example).


                                    Feel free to test out and use this battle script! Using this methodology, it is possible to combine any existing effects in the BPRE 1.0 ROM, which makes the vast majority of Gen 4's (and a fair number of Gen 5's) moves possible on Gen 3 ROMs, animations notwithstanding. A short health warning, all the pointers I include in this post apply specifically to BPRE. However, this string of commands:
                                    Spoiler:
                                    02 03 04 05 06 07 09 0A 0E 5C 00 3A 0B 00 0C 00 0D 12 40 00 0F 12 40 00 15 19


                                    should appear in all of the Gen 3 ROMs.
                                    First, is that Flare Blitz script compatible with Emerald?

                                    Second, am I supposed to be able to find free space somewhere in the table? Because the earliest available free space big enough for a command is nearly 600,000 bytes past the (apparent) first entry in the table (2D8A2E? in Emerald). Somehow I get the feeling I'm going to have to repoint the entire table if I want any free space for commands.

                                    Third, is there a full list of animations? And how do I tell the game to call a certain order of animations (for example, call Harden, then call Hidden Power)? I'm editing Emerald, if that changes anything.

                                    Lastly, can I get someone to better explain repointing the attack table (specifically in Emerald)? Because I'm reading the instructions right now and it's like trying to read Japanese: I have no idea what the hell any of it means. Not to mention I have no idea where the attack table in Emerald is. Scratch that, reverse it. I know exactly where the Emerald attack table is: 0x31C898. I don't know what to do with this information, though.
                                    Reply With Quote
                                      #49    
                                    Old May 14th, 2012 (6:57 AM).
                                    Jambo51's Avatar
                                    Jambo51 Jambo51 is offline
                                    Glory To Arstotzka
                                       
                                      Join Date: Jun 2009
                                      Gender: Male
                                      Nature: Quiet
                                      Posts: 732
                                      1) No, but it's pretty close to compatible. You would only need to change the pointer which follows the 01 command, as that is ROM specific. This is assuming the battle scripts are the same between FR and Emerald. They may not be.

                                      2) No, there isn't any free space in the table as standard. I keep pointing out what I post are research notes, no better. This is meant to be a semi-tutorial on how to combine existing move effects in BPRE 1.0. (aka FR US 1.0). At no stage do I ever claim it would be a good tutorial, that there is free space in the table, or that it would work on Emerald. In fact, I state that it is only applicable to BPRE!

                                      3) We know little to nothing about the animations. Research is ongoing. Chaos Rush has had some success creating custom animations, perhaps you could contact him?

                                      4) Repointing the attack table? Which one? There are at LEAST 3 tables related to attacks (if not more on Emerald). The main table (with base damage etc on it) is a simple repoint. The animation table is repoint and fill out with placeholders for now.
                                      The battle script pointers are somewhat more complicated. I have a solution for FR, which could theoretically work on Emerald, but right now, I have no intention of porting it to Emerald.
                                      __________________
                                      Hey guys, please check out my recreations of the gen 1 and 2 music on my custom engine at my SoundCloud! - Here!
                                      Reply With Quote
                                        #50    
                                      Old May 14th, 2012 (7:49 PM).
                                      Leafbarrett's Avatar
                                      Leafbarrett Leafbarrett is offline
                                         
                                        Join Date: Mar 2009
                                        Age: 25
                                        Gender: Male
                                        Posts: 75
                                        So basically I'm screwed and Flare Blitz is stuck with goddamn Odor Sleuth's animation, and I don't know what I'm supposed to be doing with that Flare Blitz script or where it needs to go. Absolutely fantastic.
                                        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

                                        Forum Jump


                                        All times are GMT -8. The time now is 4:16 AM.