DrayHackTutorials

[PtHGSS] Combining two move effects

Jun 30th, 2022 (edited)
2,091
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 13.83 KB | None | 0 0
  1. ===============================================================================================
  2. Introduction
  3. ===============================================================================================
  4. This is a write-up explaining how to use an unintended interaction in the move effects for a quick and dirty way to have one move fire off two effects, with effect meaning something like +1 Attack, +1 Attack/+1 Special Attack, +2 Special Defense etc.
  5.  
  6. This allows us to add in some newer generation boosting moves like Coil, Cotton Guard, Hone Claws, Quiver Dance and Work Up somewhat accurately.
  7.  
  8. This isn't the "proper" way to do it and it does have some caveats (mostly a boosting animation happening twice), but in terms of the end result it should work as you'd expect.
  9.  
  10. Big thanks to BluRose and Bubble for their hgss-moves repo that makes reading these files significantly easier.
  11.  
  12. This guide only applies to Gen IV games. Gen V has a completely different move system that makes this sort of thing a lot easier.
  13.  
  14. ===============================================================================================
  15. How do move files work?
  16. ===============================================================================================
  17. The general gist of how the move system works is by going through the following paths:
  18.  
  19. 1) Every move has an effect ID assigned to it in pl_waza_tbl (Pt) or a/0/1/1 (HGSS). When the move is used, it calls the file with that ID from the battle effect scripts file, which is be_seq.narc.
  20. 2) The battle effect script generally manipulates the move in whatever ways, and can then make references to a specific effect ID (e.g. doing the +1 SpAtk/+1 SpDef effect of Calm Mind).
  21. 3) A table in overlay_16 (Pt) or overlay_12 (HGSS) links this called effect ID to a file in sub_seq.narc. (This overlay table is why this part isn't easily expandable!)
  22. 4) The relevant file in sub_seq or a/0/0/1 is also run to produce the desired effect(s).
  23.  
  24. Note: In HG/SS, the be_seq.narc file is a/0/3/0, and the sub_seq.narc file is a/0/0/1.
  25.  
  26. sub_seq or a/0/0/1 also contain the actions for a lot of miscellaneous things like making Magic Guard skip over the damage from Sandstorm etc, though a lot of effects are also only included in the code of the overlays.
  27.  
  28. Anyway, for this tutorial, we're only going to be tinkering with the be_seq or a/0/3/0 file, as well as a slight change to a/0/1/1.
  29.  
  30. ===============================================================================================
  31. What's the trick?
  32. ===============================================================================================
  33. So amongst all the other bits, the files in be_seq actually have *two* ways of setting effects.
  34. You can get a "hard effect" which is generally used for status moves, meaning the effect ALWAYS happens. See Swords Dance, Growth, Calm Mind, Dragon Dance, etc.
  35. You can also get a "soft effect" which is generally used for damaging moves, which means the effect CAN happen based off the % move chance in the move data NARC. See Meteor Mash, Steel Wing, Charge Beam etc.
  36.  
  37. Now, although the game itself never actually does this, there's not actually anything stopping us from assigning both a hard and a soft effect in the same battle script.
  38. Assuming you set the move using this battle effect script to have a 100% effect chance, then this means both of these effects will fire off when the move is used.
  39. There is a caveat in that, using this method, the move will look a bit strange as you'll have two separate boosting animations, one for each effect.
  40. But aside from that, it should functionally work the same (although it might also appear a bit odd when some stats are maxed out and some aren't!).
  41.  
  42. Normally we are limited to effects that the game already has included, but by leveraging this trick we can make a discount version of some moves that boost multiple stats whose effects aren't usually available in Gen IV.
  43. For example, Coil, Quiver Dance, Hone Claws and Work Up are all feasible.
  44.  
  45. ===============================================================================================
  46. What's the internal file structure?
  47. ===============================================================================================
  48. Let's break down a couple files in be_seq.
  49.  
  50. The syntax used here is used with reference to BluRose and Bubble's hgss-moves repository (https://github.com/BluRosie/hgss-moves) which defines these with more human readable code.
  51.  
  52. This is be_seq-10, which is the move effect used for a status move that gives +1 Attack (e.g. Meditate).
  53. 32 00 00 00 07 00 00 00 02 00 00 00 0F 00 00 40 E0 00 00 00
  54.  
  55. Let's break down the individual bits:
  56. 32 00 00 00 = Command "changevar": change a variable's value.
  57. 07 00 00 00 = Type "VAR_OP_SET": set the following variable to a particular value. (As opposed to add etc)
  58. 02 00 00 00 = Modify variable "VAR_ADD_STATUS1", i.e. set the "hard effect" we discussed earlier.
  59. 0F 00 00 40 = Value: It's a big long number 0x4000000F. The "0F" part is the effect ID that we're after. The "40" means this effect should apply to the attacker.
  60. E0 00 00 00 = This is just an "endscript" closing statement, which you'll see on any of them pretty much.
  61.  
  62. The "0F" from that fourth line is what says "give me +1 Atk".
  63.  
  64. Next, this is be_seq-139, which is the move effect used for a damaging move that has a chance of raising the user's Attack by +1 (e.g. Meteor Mash, Metal Claw).
  65. 32 00 00 00 07 00 00 00 03 00 00 00 0F 00 00 40 26 00 00 00 0F 00 00 00 E0 00 00 00
  66.  
  67. Again, let's break down the individual bits:
  68. 32 00 00 00 = Command "changevar": change a variable's value.
  69. 07 00 00 00 = Type "VAR_OP_SET": set the following variable to a particular value. (As opposed to add etc)
  70. 03 00 00 00 = Modify variable "VAR_ADD_STATUS2". This is how we get the soft effect we discussed earlier.
  71. 0F 00 00 40 = Value: Big long number. Notice that it's the same as be_seq-10? That's because they both want to raise the user's Attack by +1.
  72. 26 00 00 00 = This is "critcalc", calculating if the move will be a critical hit or not. It references a function stored elsewhere.
  73. 0F 00 00 00 = This is "damagecalc", calculating how much damage the move will do. It references a function stored elsewhere.
  74. E0 00 00 00 = This is just "endscript".
  75.  
  76. So to recap, there's two ways to set effects, with the relevant hex lines being the following:
  77. 32 00 00 00 07 00 00 00 02 00 00 00 0F 00 00 40 - Set the hard effect
  78. 32 00 00 00 07 00 00 00 03 00 00 00 0F 00 00 40 - Set the soft effect
  79.  
  80. ===============================================================================================
  81. How do we combine them into one move script?
  82. ===============================================================================================
  83. Luckily this is pretty easy. We literally just have to stick them together.
  84.  
  85. For example, this could be your battle script file:
  86. 32 00 00 00 07 00 00 00 02 00 00 00 0F 00 00 40
  87. 32 00 00 00 07 00 00 00 03 00 00 00 0F 00 00 40
  88. E0 00 00 00
  89.  
  90. Which going line by line is just: set the hard effect to +1 Atk; set the soft effect to +1 Atk; end the script.
  91. Then when that is invoked by a move, the user's Attack will rise, and then it's Attack will rise again, then the move ends.
  92.  
  93. So you'd just need to insert this into your be_seq.narc file somehow. As it's easily expandable, I'd suggest adding these as new files to your be_seq.narc.
  94. You can easily unpack and pack NARCs using knarc (https://github.com/kr3nshaw/knarc/releases/tag/1.0.0).
  95.  
  96. ===============================================================================================
  97. How do we get other move effects?
  98. ===============================================================================================
  99. So for doing these cominbing stat boost effects, we're basically just going to be using the structure of the script above over and over.
  100. The main parts we're interested in changing are these starred bytes:
  101.  
  102. 32 00 00 00 07 00 00 00 02 00 00 00 *0F* 00 00 40
  103. 32 00 00 00 07 00 00 00 03 00 00 00 *0F* 00 00 40
  104. E0 00 00 00
  105.  
  106. As said before, 0F is the +1 Attack effect.
  107. Game Freak were luckily kind enough to make a system that has +1 and +2 for any stat, even if the game never actually uses it.
  108. Then thanks to existing moves like Bulk Up, Calm Mind and Dragon Dance, we've got some dual move effects to play with as well, meaning we can get up to three stats.
  109. There's also nothing stopping you from using the same effect twice, if you want to do a drastically boosting move like Cotton Guard or the modern Tail Glow.
  110.  
  111. So, basically, just change the 0Fs to be whatever stats you want to boost. The possibilities are as follows:
  112.  
  113. 0F = +1 Attack
  114. 10 = +1 Defense
  115. 11 = +1 Speed
  116. 12 = +1 Special Attack
  117. 13 = +1 Special Defense
  118. 14 = +1 Accuracy
  119. 15 = +1 Evasion
  120. 22 = +1 to all stats (Ancient Power/Silver Wind/Ominous Wind)
  121.  
  122. 27 = +2 Attack
  123. 28 = +2 Defense
  124. 29 = +2 Speed
  125. 2A = +2 Special Attack
  126. 2B = +2 Special Defense
  127. 2C = +2 Accuracy (?) (Not tested, but likely follows the pattern)
  128. 2D = +2 Evasion (?) (Not tested, but likely follows the pattern)
  129.  
  130. 37 = +1 Defense and +1 Special Defense (Cosmic Power)
  131. 38 = +1 Attack and +1 Defense (Bulk Up)
  132. 3A = +1 Special Attack and +1 Special Defense (Calm Mind)
  133. 3B = +1 Attack and +1 Speed (Dragon Dance)
  134. 58 = +1 Attack, +1 Defense and -1 Speed (Curse)
  135.  
  136. ===============================================================================================
  137. Example Files
  138. ===============================================================================================
  139. I've put some examples below of what you'd need for some of the boosting moves from Gen V.
  140. Regrettably, an accurate Shell Smash isn't possible to achieve with this method. :(
  141.  
  142. Coil
  143. ----
  144. This should do +1 Attack, +1 Defense, and +1 Accuracy.
  145. For this we combine Bulk Up's effect (0x38) with the +1 accuracy (0x14).
  146.  
  147. 32 00 00 00 07 00 00 00 02 00 00 00 38 00 00 40
  148. 32 00 00 00 07 00 00 00 03 00 00 00 14 00 00 40
  149. E0 00 00 00
  150.  
  151. Cotton Guard
  152. ---
  153. This should do +2 Defense and +1 Defense, for an end result of +3 Defense.
  154. For this we combine the +2 Defense (0x28) with the +1 Defense (0x10).
  155.  
  156. 32 00 00 00 07 00 00 00 02 00 00 00 28 00 00 40
  157. 32 00 00 00 07 00 00 00 03 00 00 00 10 00 00 40
  158. E0 00 00 00
  159.  
  160. Hone Claws
  161. ---
  162. This should do +1 Attack and +1 Accuracy.
  163. For this we combine the +1 Attack (0xF) with the +1 accuracy (0x14).
  164.  
  165. 32 00 00 00 07 00 00 00 02 00 00 00 0F 00 00 40
  166. 32 00 00 00 07 00 00 00 03 00 00 00 14 00 00 40
  167. E0 00 00 00
  168.  
  169. Quiver Dance
  170. ---
  171. This should do +1 Special Attack, +1 Special Defense, and +1 Speed.
  172. For this we combine Calm Mind's effect (0x3A) with the +1 Speed (0x11).
  173.  
  174. 32 00 00 00 07 00 00 00 02 00 00 00 3A 00 00 40
  175. 32 00 00 00 07 00 00 00 03 00 00 00 11 00 00 40
  176. E0 00 00 00
  177.  
  178. Tail Glow
  179. ---
  180. This should do +2 Special Attack and +1 Special Attack, for an end result of +3 Special Attack like Gen V's Tail Glow.
  181. For this we combine the +2 Special Attack (0x2A) with the +1 Special Attack (0x12).
  182.  
  183. 32 00 00 00 07 00 00 00 02 00 00 00 2A 00 00 40
  184. 32 00 00 00 07 00 00 00 03 00 00 00 12 00 00 40
  185. E0 00 00 00
  186.  
  187. Work Up
  188. ---
  189. This should do +1 Attack and +1 Special Attack.
  190. For this we combine the +1 Attack (0xF) with the +1 Special Attack (0x12).
  191.  
  192. 32 00 00 00 07 00 00 00 02 00 00 00 0F 00 00 40
  193. 32 00 00 00 07 00 00 00 03 00 00 00 12 00 00 40
  194. E0 00 00 00
  195.  
  196. ===============================================================================================
  197. So how do we link this together?
  198. ===============================================================================================
  199. So first you need to actually get these files into your be_seq.narc as a whole.
  200. As mentioned before, I'd suggest adding these as new files to your be_seq.narc.
  201. You can easily unpack and pack NARCs using knarc (https://github.com/kr3nshaw/knarc/releases/tag/1.0.0).
  202.  
  203. Note the file ID of the things you've inserted into be_seq.narc.
  204.  
  205. After that, you'll need to change a move to actually point at this new file in be_seq.narc.
  206.  
  207. If you want to do it via hex, then it's the first two bytes of the relevant move's file.
  208. e.g. Meteor Mash is move #309, and its first two types are 8B 00 which translates to 139 in decimal.
  209. You just change these bytes to be your new be_seq file's ID (in little endian, of course).
  210.  
  211. If you want to do it via Pokeditor, then I believe you can do it with this method:
  212. - In your Pokeditor folder, go to Program Files and open the Effects.txt file.
  213. - At the end of the file you should see "Chance of raising user's SpAtk".
  214. - Add a new line for each effect you've added in file ID order and give them a description of some sort, then save.
  215. - Use Pokeditor to update anything from your spreadsheets.
  216. - This should then add the new effect to the "DO NOT TOUCH" sheet, which'll let you select the effect in the move sheet.
  217. - Then next you update your moves, it should write it with the correct effect ID.
  218.  
  219. ALSO, you need to make sure you set the move using these effects to have 100% effect chance, or the soft effect part may not fire.
  220.  
  221. Once you've got all that in place, your new move effects should work!
  222.  
  223. ===============================================================================================
  224. Closing Notes
  225. ===============================================================================================
  226. This is kind of a discount way of doing these, and the proper way would be to have an appropriate battle subscript in sub_seq that your be_seq file calls.
  227. But functionally this should work fine as long as you don't mind the double boost animation issue.
  228.  
  229. If you want to learn more about how moves work, I'd highly suggest having a look at BluRose and Bubble's hgss-moves repo, especially the battle effect scripts:
  230. https://github.com/BluRosie/hgss-moves
  231. https://github.com/BluRosie/hgss-moves/tree/gen5/movescripts/battleeffectscripts
Advertisement
Add Comment
Please, Sign In to add comment