instr 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305
  1. USING THE SWITCH COMMANDS
  2. -------------------------
  3. IMPORTANT - All scripts for switches or activator blocks must end with :
  4. dc.w SWITCH_END
  5. The complete list of commands (so far) are:
  6. SWITCH_WAIT
  7. SWITCH_COUNT
  8. SWITCH_SET_COUNT
  9. SWITCH_ADD_BLOCK
  10. SWITCH_ADD_DESTROY_BLOCK
  11. SWITCH_ADD_ALIEN
  12. SWITCH_ADD_ALIEN_TO_MAP
  13. SWITCH_CHANGE_BLOCK
  14. SWITCH_CHANGE_BLOCK_COLUMN
  15. SWITCH_CHANGE_BLOCK_ROW
  16. SWITCH_DEACTIVATE
  17. SWITCH_REACTIVATE
  18. EVENT_DEACTIVATE
  19. EVENT_REACTIVATE
  20. SWITCH_END
  21. SWITCH WAIT
  22. -----------
  23. The command SWITCH_WAIT just does that. It stops the execution of the
  24. script until the next (alien) frame round. This allows for pauses or delays
  25. to be introduced - very useful for when doing a complex script (i.e adding
  26. lots of blocks on screen)
  27. dc.w SWITCH_WAIT ;wait for 2 frames
  28. dc.w SWITCH_WAIT
  29. SWITCH COUNT
  30. ------------
  31. If longer pauses are wanted - to save writing loads of SWITCH_WAIT's, the
  32. SWITCH_COUNT command can be used - before using the command the
  33. SWITCH_SET_COUNT must be used to set the count up :
  34. dc.w SWITCH_SET_COUNT
  35. dc.w 4 ;the frames to wait for
  36. dc.w SWITCH_WAIT ;one of these must be here
  37. dc.w SWITCH_COUNT
  38. dc.w 0 ;this value will be written over
  39. ;by the SWITCH_SET_COUNT command
  40. SWITCH ADD BLOCK
  41. ----------------
  42. This command is used when a block is to be changed ON SCREEN, the block
  43. appear anim will play over the top of this block :
  44. dc.w SWITCH_ADD_BLOCK
  45. dc.w 10 ;block x position
  46. dc.w 14 ;block y position
  47. dc.w 222 ;map block number
  48. SWITCH ADD DESTROY BLOCK
  49. ------------------------
  50. This command is the same as SWITCH_ADD_BLOCK except that the small block
  51. explosion is played over the block :
  52. dc.w SWITCH_ADD_DESTROY_BLOCK
  53. dc.w 10 ;block x position
  54. dc.w 10 ;block y position
  55. dc.w 222 ;map block number
  56. SWITCH ADD ALIEN
  57. ----------------
  58. This command will add an alien at a specified x,y co-ordinate - not
  59. a block co-ordinate :
  60. dc.w SWITCH_ADD_ALIEN
  61. dc.w 100 ;x pixel pos on map
  62. dc.w 100 ;y pixel pos on map
  63. dc.l Pig_Alien ;alien structure - see struct list
  64. SWITCH ADD ALIEN TO MAP
  65. -----------------------
  66. This command will add an alien at a specified x,y co-ordinate and will
  67. also add the alien to the map so that if added off screen the alien
  68. will appear when you get to it - e.g the chest - this is added to the
  69. map so that when you go off screen and come back it is still there.
  70. The position specified is a pixel position but this value will be
  71. converted into a block position by the code for adding it to a map :
  72. dc.w SWITCH_ADD_ALIEN_TO_MAP
  73. dc.w Chest ;alien number
  74. dc.w 63*16,55*16 ;alien x and y position
  75. dc.l Chest_Object ;alien structure - see struct list
  76. SWITCH CHANGE BLOCK
  77. -------------------
  78. This command should be used for adding blocks OFF SCREEN :
  79. dc.w SWITCH_CHANGE_BLOCK
  80. dc.w 63 ;block x position
  81. dc.w 55 ;block y position
  82. dc.w 45 ;map block number
  83. SWITCH CHANGE BLOCK COLUMN
  84. --------------------------
  85. This command should be used to change a whole column of OFF SCREEN
  86. blocks at once. The number of blocks to change is determined by the
  87. list length. The list should be terminated with $ffff :
  88. dc.w SWITCH_CHANGE_BLOCK_COLUMN
  89. dc.w 58,22 ;block x and y pos start
  90. dc.w 1,1,1,1,1 ;list of block nums to change to
  91. dc.w $ffff ;terminator
  92. e.g this command will change 5 blocks starting at 58,22 to 1 - so
  93. 58,22, 58,23, 58,24, 58,25, 58,26 will be affected
  94. SWITCH CHANGE BLOCK ROW
  95. -----------------------
  96. This command should be used to change a whole row of OFF SCREEN
  97. blocks at once. The number of blocks to change is determined by the
  98. list length. The list should be terminated with $ffff :
  99. dc.w SWITCH_CHANGE_BLOCK_ROW
  100. dc.w 58,22 ;block x and y pos start
  101. dc.w 1,1,1,1,1 ;list of block nums to change to
  102. dc.w $ffff ;terminator
  103. e.g this command will change 5 blocks starting at 58,22 to 1 - so
  104. 58,22, 59,22, 60,22, 61,22, 62,22 will be affected
  105. SWITCH DEACTIVATE
  106. -----------------
  107. This command will deactivate a switch ( not an event!! ) :
  108. dc.w SWITCH_DEACTIVATE
  109. dc.w 1 ;switch num ( 0-19 )
  110. SWITCH REACTIVATE
  111. -----------------
  112. This command will reactivate a switch ( not an event!! ) :
  113. dc.w SWITCH_REACTIVATE
  114. dc.w 1 ;switch num ( 0-19 )
  115. EVENT DEACTIVATE
  116. -----------------
  117. This command will deactivate an event ( not a switch!! ) :
  118. dc.w EVENT_DEACTIVATE
  119. dc.w 1 ;switch num ( 0-59 )
  120. EVENT REACTIVATE
  121. -----------------
  122. This command will reactivate an event ( not an switch!! ) :
  123. dc.w EVENT_REACTIVATE
  124. dc.w 1 ;switch num ( 0-59 )
  125. SWITCH END
  126. ----------
  127. This command terminates a script :
  128. dc.w SWITCH_END
  129. Examples of much needed scripts
  130. -------------------------------
  131. To add a pig appear object :
  132. dc.w SWITCH_ADD_ALIEN
  133. dc.w (53*16),(75*16)
  134. dc.l Fast_Appear_Pig_Object
  135. To add a gold chest :
  136. dc.w SWITCH_CHANGE_BLOCK
  137. dc.w 63,55
  138. dc.w CHEST_SOLID_BLOCK
  139. dc.w SWITCH_ADD_ALIEN
  140. dc.w (63*16)-2,(55*16)-5
  141. dc.l Fast_Appear_Object
  142. dc.w SWITCH_WAIT
  143. dc.w SWITCH_WAIT
  144. dc.w SWITCH_WAIT
  145. dc.w SWITCH_WAIT
  146. dc.w SWITCH_WAIT
  147. dc.w SWITCH_ADD_ALIEN_TO_MAP
  148. dc.w Chest ; alien number 31
  149. dc.w 63*16,55*16
  150. dc.l Chest_Object
  151. To add a key chest :
  152. dc.w SWITCH_CHANGE_BLOCK
  153. dc.w 63,55
  154. dc.w CHEST_SOLID_BLOCK
  155. dc.w SWITCH_ADD_ALIEN
  156. dc.w (63*16)-2,(55*16)-5
  157. dc.l Fast_Appear_Object
  158. dc.w SWITCH_WAIT
  159. dc.w SWITCH_WAIT
  160. dc.w SWITCH_WAIT
  161. dc.w SWITCH_WAIT
  162. dc.w SWITCH_WAIT
  163. dc.w SWITCH_ADD_ALIEN_TO_MAP
  164. dc.w Key_Chest ; alien number 67
  165. dc.w 63*16,55*16
  166. dc.l Key_Chest_Object
  167. The current list of alien numbers are :
  168. Hostage - 13
  169. Pig_Alien - 14
  170. RedJumpFlower - 23
  171. BlueJumpFlower - 24
  172. Key - 25
  173. Spikey - 28
  174. Gold Chest - 31
  175. Silver_Chest - 38
  176. Fish_Bob_Left - 44
  177. Fish_Bob_Right - 45
  178. Statue_Head - 48
  179. Wasp_Nest - 49
  180. FishUpBob - 51
  181. Pig_Generator - 55 ( 5 skulls )
  182. Pig_Generator2 - 56 ( 4 skulls )
  183. Pig_Generator3 - 57 ( 3 skulls )
  184. Pig_Generator4 - 58 ( 2 skulls )
  185. Pig_Generator5 - 59 ( 1 skulls )
  186. Pig_GeneratorNoSkull - 60
  187. Maggot - 61
  188. Maggot speed 2 - 62
  189. Maggot speed 3 - 63
  190. Maggot_Generator - 64
  191. End Level Generator - 66
  192. Key_Chest - 67
  193. Fire_Key - 68
  194. GoldMoney1 - 69
  195. SilverMoney1 - 70
  196. GoldMoney lots 2 - 71
  197. SilverMoney lots 2 - 72
  198. If you would rather use names rather than numbers when using SWITCH_ADD
  199. _ALIEN_TO_MAP then look in alien_data.s as this contains a complete list.
  200. Current list of alien structures are ( used when using SWITCH_ADD_ALIEN
  201. and SWITCH_ADD_ALIEN_TO_MAP ) :
  202. Standard_Key_Object
  203. Chest_Object
  204. Silver_Chest_Object
  205. Generic_Splash_Object
  206. Appear_Object
  207. Fast_Appear_Object
  208. Small_Gold_Coin
  209. Small_Silver_Coin
  210. Small_Gold_Coins
  211. Small_Silver_Coins
  212. Pig_Alien
  213. Spikey_Object
  214. Fish_Bob_Left_Object
  215. Fish_Bob_Right_Object
  216. Statue_Object
  217. WaspNest_Object
  218. FishUpBob_Alien
  219. Pig_Generator_Object
  220. Maggot_Alien
  221. Maggot_Alien2
  222. Maggot_Alien3
  223. Fast_Appear_Pig_Object
  224. Maggot_Generator_Alien
  225. Key_Chest