Advertisement
luckytyphlosion

BN6 NPC Command docs (just for readability)

Aug 19th, 2019
569
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.50 KB | None | 0 0
  1. From https://forums.therockmanexezone.com/modifying-map-npcs-t5333.html
  2.  
  3. r5 = 0x020057B0 + (index * 0xD8)
  4. Get map sprite script offsets routine: 08035134
  5. Breakpoint for script commands: 0809EBE6
  6. Command routines: [0x0809EC30 + (commandnumber * 4)]
  7.  
  8. NPC Loading Scripts:
  9. 00
  10. Terminates script
  11. 01
  12. Undefined
  13. (jumps to 00000000)
  14.  
  15. 02 p0 p0 p0 p0
  16. Jump to p0
  17. 03
  18. Full Terminator
  19.  
  20. 04 p0 p0 p1 p1 p1 p1
  21. IF flag p0 is checked jump to p1
  22.  
  23. 05 p0 p0 p1 p1 p1 p1
  24. IF flag p0 is not checked jump to p1
  25.  
  26. 06 p0 p0
  27. Sets Flag p0
  28.  
  29. 07 p0 p0
  30. Clear Flag p0
  31.  
  32. 08
  33. Initializes NPC loading? / Makes NPC visable?
  34. (sets type to solid NPC)?
  35.  
  36. 09
  37. Also a kind of initialization?
  38. Sets to invisable NPC type?
  39.  
  40. 0A p0
  41. Sets NPC bound radius
  42.  
  43. 0B p0
  44. [r5,0xD]=r0
  45.  
  46. 0C p0 p1 p2
  47. Shifts NPC center by X += p0 Y += p1 Z += p2 (signed)
  48.  
  49. 0D
  50. Enables NPC
  51.  
  52. 0E
  53. Disabled NPC
  54.  
  55. 0F p0
  56. Sets NPC palette to p0
  57.  
  58. 10 p0
  59. Delay Script execution by p0 frames
  60.  
  61. 11 p0 p1
  62. [r5, 4] = p0
  63. [r5, 5] = p1
  64.  
  65. 12
  66. NPC does turn to face player when spoken to
  67. 13
  68. NPC does not turns to face player when spoken to
  69.  
  70. 14 p0 p0 p1 p1 p2 p2
  71. Sets NPC Coordinates to X = po Y = p1 Z = p2 (signed)
  72.  
  73. 15 p0 p1 p2
  74. [r5, 0xE] = p0
  75. [r5, 0x4] = p1
  76. [r5, 0x5] = p2
  77.  
  78. 16 p0
  79. Set NPC animation to animation p0
  80.  
  81. 17 p0
  82. Set NPC Sprite to p0 from sprite list catigory 0x80
  83.  
  84. 18 p0
  85. Sets NPC dialog to entry p0 from first loaded text archive
  86.  
  87. 19
  88. Clears bits at (int)[r5,0x64]
  89.  
  90. 1A
  91. Sets (int)[r5,0x64] to 2
  92.  
  93. 1B
  94. Sets (int)[r5,0x64] to 3
  95.  
  96. 1C p0 p0 p0 p0
  97. writes p0 to [r5,0x68]
  98. (last 4 bits hides some oams)
  99.  
  100. 1D p0
  101. Sets bit (31-p0)? in [r5,0x68]
  102.  
  103. 1E p0
  104. Clears bit (31-p0)? in [r5,0x68]
  105.  
  106. 1F
  107. Makes NPC passable
  108.  
  109. 20
  110. Makes NPC inpassable
  111.  
  112. 21
  113. Clears bit 80 on [r5,0x60] and does something else?
  114.  
  115. 22
  116. Sets bits 0x180 on [r5,0x60]
  117.  
  118. 23
  119. Clears 0x80 clears bit 0x100 and does something else?
  120.  
  121. 24
  122. Clears bit 0x80 and does other things
  123. Sets sprite to current navi sprite
  124.  
  125. 25 p0 p1
  126. Sets NPC Sprite to p0 from spritelist catigory p1
  127.  
  128. 26
  129. Alternates bit 08 on [r5,0x60]
  130. (flips sprite)
  131. 27
  132. Sets bit 0x10 on [r5,0x60]
  133. Makes it passable?
  134.  
  135. 28 p0 p0
  136. ???
  137.  
  138. 29 p0 p0
  139. If something set to p0
  140.  
  141. 2A p0
  142. sets [r5, 0x80] to p0
  143. ends script
  144.  
  145. 2B p0 p0
  146. does stuff
  147. stores p0 in [r5, 0x6]
  148.  
  149. 2C
  150. undefined (jumps to 00000000)
  151.  
  152. 2D p0 p1
  153. ?
  154.  
  155. 2E p0
  156. ?
  157.  
  158. 2F p0 p1 p2
  159. ?
  160.  
  161. 30
  162. ?
  163.  
  164. 31 p0
  165.  
  166. 32 p0 p0 p0 p0
  167. jumps to p0
  168. (for other script type)
  169.  
  170.  
  171. 33 p0
  172. stores p0 in [r5,0x22]
  173. Terminates other script
  174. Waits p0 frames before resuming
  175.  
  176. 34
  177. [r0,0x22] = 0
  178. [r5,0x5C] = 0
  179. jumps script to 0
  180.  
  181. 35 p0 p0 p0 p0
  182. Terminates, writes p0 to [r5,0x7C] with link ([r5,0x8C])
  183. ( Ends script and executes routine at p0)
  184.  
  185. 36 p0 p0 p0 p0
  186. Jump to p0 with link ([r5,0x8C])
  187.  
  188. 37 p0 p1 p2 p3 p4 p4 p4 p4
  189. Writes currentoffset + 9 to [r5,0x8C]
  190. [r5,0x0E] = p0
  191. [r5,0x04] = p1
  192. [r5,0x05] = p2
  193. [r5,0x20] = p3
  194. , writes p4 to ([r5,0x7C])(executes routine).
  195.  
  196. 38 p0 p1 p2 p3 p3 p3 p3
  197. NPC moves in a path
  198. p0 - movement type
  199. p1 - speed
  200. p2 - distance
  201. p3 - offsets of sequence script
  202.  
  203. 39 p0
  204. Changes movement type
  205. 3A
  206. Returns to linked routine [r5,0x8C]
  207.  
  208. 3B p0 p1 p2 p2 p2 p2
  209. If story progress byte [0x02001b86] is
  210. greater than p0 and less than p1 jump script to p2
  211.  
  212. 3C p0 p1
  213. [0x02011C50 + r0] = r1
  214.  
  215. 3D p0 p1 p2 p2 p2 p2
  216. IF [0x02011C50 + r0] == r1
  217. Jump to p2
  218. 3F p0 p1
  219. stores p0 in [r5,0x80]
  220. stores p1 in [r5,0x84]
  221. Ends script
  222.  
  223. 40
  224. Clears bit 0x200 from [r5,0x60]
  225.  
  226. 41
  227. Sets bit 0x200 from [r5,0x60]
  228.  
  229. 42
  230. Undefined, jumps to 0x00000000
  231.  
  232. 43
  233. Undefined, jumps to 0x00000000
  234.  
  235. 44 p0 p1 p1 p1 p1
  236. (Sets NPC dialog to entry r0 from 2nd loaded text archive)
  237. Sets dialog p0 and sets bit 0x400 on [r5,0x60]
  238. Writes p1 to [r5,0x94]
  239.  
  240. 45 p0 p0
  241. Stores p0 at 0x02005C68 and terminates script? (r5 + 0x80)
  242. (Checked later and does stuff if it's set)
  243.  
  244. 46 p0
  245. Clears 0xC bits somewhere ([r5 + (([r5,2] >> 4)<<4) + 0x11]) , if p0 ==0 sets bit 8
  246.  
  247. 47 p0 p0
  248. ???
  249.  
  250. 48
  251. Sets 0x20 bit somewhere ([r5 + (([r5,2] >> 4)<<4) + 0x3])
  252. 49
  253. Clears 0x1 bit and 0x4 bit somewhere ([r5 + (([r5,2] >> 4)<<4) + 0x3])
  254. 4A p0 p1 p1
  255. writes p0 to [0200998E]
  256. writes p1 to [0200998C]
  257.  
  258. 4B p0 p1 p1 p1 p1
  259. if p0 != [r5,0x14]
  260. jump to p1
  261.  
  262. 4C p0
  263. Sets NPC's dialog to entry p0 from 2nd loaded text archive.
  264.  
  265. 4D p0 p0 p0 p0 p1 p1 p1 p1
  266. Jumps to p1?
  267.  
  268. 4E p0 p1 p2 p3
  269. writes p0-p3 to [r5,4-7]
  270. ends script
  271.  
  272. 4F p0 p1 p2
  273. writes p0-p2 to [r5,4-6]
  274. ends script
  275.  
  276. 50 p0 p1 p2 p3
  277. writes r0-p3 to [r5,4-7]
  278.  
  279. 51 p0 p0
  280. ?
  281. 52
  282. does stuff ( causes a jack out animation )
  283. 53 p0 p0 p0 p0
  284. Jumps to p0 if [0x0200A443] != 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement