home *** CD-ROM | disk | FTP | other *** search
/ The Hacker's Encyclopedia 1998 / hackers_encyclopedia.iso / pc / softdox / dn_specs.txt < prev    next >
Encoding:
Text File  |  2003-06-11  |  31.0 KB  |  709 lines

  1. ===========================================================================
  2.  
  3.                          The Unofficial Specs for
  4.                               Duke Nukem 3D
  5.  
  6.                                  V1.1
  7.  
  8.                          By Vincent Nguyen Quang Do
  9.                          E-Mail : 101366.1734@compuserve.com
  10.                          Compuserve: 101366,1734
  11.  
  12. ===========================================================================
  13.  
  14. What's new in this version:
  15.  
  16. - Simply the list of all the keywords and their use. I hadn't the time to
  17. finish this part when I uploaded the first version.
  18.  
  19. ===========================================================================
  20.  
  21. These specs are highly preliminary, and are far from complete. It requires 
  22. a certain programming knowledge to understand what I have written, but 
  23. fortunately, not much.
  24.  
  25. It is not a complete documentation with every aspect of the script 
  26. language. You have to examine the .CON files for yourself using what you 
  27. have learned from reading this text.
  28.  
  29. First, with the usual stuff: as stated in the .CON files, Apogee and 3D 
  30. Realms do not support experiments with these files. To be more precise, 
  31. here is the official policy :
  32.  
  33. " 3D Realms encourages you to experiment freely with the parameters 
  34. contained in this file, and to share your discoveries with the rest of the 
  35. world.  However, BE ADVISED that 3D Realms does NOT offer  any technical 
  36. support on how to use this file or other user-modifiable  features of this 
  37. game.  Do NOT call 3D Realms or Apogee Software for advice or help with 
  38. this subject. " 
  39.  
  40. Next thing : I cannot be held responsible for any damage to your softwares, 
  41. hard-drive, computer and anything related to you modifying the .CON files. 
  42. The bottom line is : MAKE BACKUP COPIES FIRST. Although I don't think it 
  43. can be damaging to your hard drive to modify these files, who knows ?
  44.  
  45. At last, you can distribute this file around you, unless someone from 3D 
  46. Realms or Apogee tells you you can't anymore (they didn't tell me I was 
  47. violating some kind of copyrights, so I assume I can write this specs).
  48.  
  49. Finally, I am french, so please forgive me for any bad written english.
  50.  
  51. No let's start with the fun part.
  52.  
  53.  
  54. ===========================================================================
  55. PART I : The Basics
  56.  
  57.  
  58. As many of you probably noticed, when you start Duke Nukem 3D, the game 
  59. starts a compiler that takes as paramater the GAME.CON file in the game 
  60. directory.
  61.  
  62. The very beginning of this GAME.CON file is the following : 
  63.  
  64. include defs.con
  65. include user.con
  66.  
  67. These files are processed first. The defs.con contains all the " define " 
  68. for the game. The user.con contains all the parameters that can be changed 
  69. in the game (damage for each weapon, hitpoints for each monster and so 
  70. on...).
  71.  
  72. So, we're going to start with the DEFS.CON file. This file is simply a 
  73. bunch of define. Five types of objects are defined in this manner : the 
  74. sprites (more on this later), the basic actions, the weapons, the different 
  75. player actions, the inventory action and the sound effects.
  76.  
  77.  
  78. Ex :
  79.  
  80. define FIRSTGUNSPRITE 21
  81. define CHAINGUNSPRITE 22
  82. define RPGSPRITE 23
  83. define FLAMETHROWERSPRITE 24           <= The sprite for the flamethrower
  84. .
  85. .
  86. .
  87. define face_player 1              <= The basic actions used in the AI code
  88. define geth 2
  89. define getv 4
  90. .
  91. .
  92. .
  93. define KNEE_WEAPON         0                  <= Weapon definition
  94. define PISTOL_WEAPON       1
  95. define SHOTGUN_WEAPON      2
  96. define CHAINGUN_WEAPON     3
  97. define RPG_WEAPON          4
  98. define HANDBOMB_WEAPON     5
  99. define SHRINKER_WEAPON     6
  100. define FLAMETHROWER_WEAPON 7
  101. define TRIPBOMB_WEAPON     8
  102.  
  103. define pstanding 1                            <=  Stands for Player Standing
  104. define pwalking 2
  105. define prunning 4
  106. define pducking 8
  107. define pfalling 16
  108. .
  109. .
  110. .
  111. define GET_STEROIDS     0                  <=  Inventory Actions
  112. define GET_SHIELD       1
  113. define GET_SCUBA        2
  114. define GET_HOLODUKE     3
  115. .
  116. .
  117. .
  118. define KICK_HIT                         0       <= Sound Effects
  119. define PISTOL_RICOCHET                  1
  120. define PISTOL_BODYHIT                   2
  121. define PISTOL_FIRE                      3
  122. define EJECT_CLIP                       4
  123. define INSERT_CLIP                      5
  124.  
  125.  
  126. The USER.CON file for itself contains all the user modifiable stuff and is 
  127. not very interesting in itself (unless someone tells me he doesn't 
  128. understand anything in the file, I won't write anything more about this 
  129. one).
  130.  
  131.  
  132. Now for the hard part, and what you've all been waiting for: the GAME.CON 
  133. file
  134.  
  135. This file is primarly used by DN3D for it's monsters' AI. Modifying this 
  136. file allows for VERY interesting effects, such as creating new monsters ; 
  137. modifying weapons effects, monsters' behavior and so on... Let's start with 
  138. the basic notion of the game.con file : the " actor ".
  139.  
  140. action RUBCANDENT 1 1 1 1 1
  141. action RUBCAN
  142.  
  143. actor RUBBERCAN WEAK
  144.     ifaction RUBCANDENT { ifactioncount 16 { strength 0 action RUBCAN break 
  145. } }
  146.     else ifhitweapon
  147.     {
  148.         ifwasweapon THROWFLAME { state rats ifrnd 48 spawn BURNING debris 
  149. SCRAP3 4 /* spawn EXPLOSION2 */ killit }
  150.         else ifwasweapon RADIUSEXPLOSION { state rats ifrnd 48 spawn 
  151. BURNING debris SCRAP3 12 /* spawn EXPLOSION2 */ killit }
  152.         else action RUBCANDENT
  153.     }
  154. enda
  155.  
  156.  
  157. Every object, monster, in short anything Duke can deal with is an actor. 
  158. This actor is referenced in the map by a number. This number is related to 
  159. the bunch of define in the DEFS.CON file. For example, the basic trooper is 
  160. referenced by the LIZTROOP keyword, which in itself is defined as the 
  161. integer 1680 (see the DEFS.CON file). Not only is this number used for 
  162. identification purpose, but also for display purpose. You'll understand 
  163. more about this later.
  164.  
  165. So, let's suppose you have the actor RUBBERCAN in the map. The above 
  166. definition shows that this RUBBERCAN has 5 hitpoints (keyword WEAK). The 
  167. code within the " actor " and the " enda " keywords defines how the 
  168. RUBBERCAN is handled, in this particular case when it is hit by a weapon.
  169.  
  170. This code is always running as long as the actor is " alive ", namely it 
  171. hasn't been killed with the " killit " keyword. Now, what can we do with 
  172. this actor, and how are the sprites displayed ? If you take a look at the 
  173. code above, you can see the keyword " ifaction ". Still above, there are 
  174. two action definitions. In fact, an " action " in the .CON files is simply 
  175. a sequence of sprite. As long as the " actor " is performing an action, 
  176. these sprites are displayed in sequence. This speed as well as the 
  177. different sprites of this sequence are determined by the numbers after the 
  178. action name. I'll explain this later with a more interesting actor.
  179.  
  180. We have here the basic notions of the GAME.CON file. Every object, monster, 
  181. is an ACTOR which is performing a certain ACTION. These ACTION are related 
  182. to the sprites displayed. With the " ifaction " and the " action " 
  183. keywords, the game knows what action the actor is performing, and can 
  184. change this action. On the above example, the script performs the following:
  185.  
  186. If the RUBBERCAN is performing the RUBBERCANDENT action, then it counts how 
  187. many times (" ifactioncount ") this action has already been processed. If 
  188. this number is below 16, it does nothing and runs again.
  189. If this number is 16, then it calls the action RUBCAN. The action 
  190. RUBBERCANDENT is associated to the sprites showing the RUBBERCAN with a 
  191. small dent. The action RUBCAN is the standard RUBBERCAN.
  192.  
  193. If the action is not RUBBERCANDENT, then the script tests if the RUBBERCAN 
  194. was hit by a weapon, and what kind of weapon. If this is an explosion or a 
  195. flamethrower, then the RUBBERCAN is destroyed. Else, the scripts performs 
  196. the RUBBERCANDENT action.
  197.  
  198. This the very first example of what can be done with the programming 
  199. language. One could for example spawn an ammo if the rubbercan is 
  200. destroyed. Or you could generate a particular sound. Or spawn rats. Or 
  201. anything else comes to mind (almost...)
  202.  
  203. Let's take a deeper look into the action keyword (you can find the 
  204. following line in the game.con file) :
  205.  
  206. action ATROOPWALKING     0    4    5    1   12
  207.  
  208. As stated before, each monster is referenced by a number. For the basic 
  209. trooper, this number is 1680, for the PIGCOP it is 2000. The keyword action 
  210. allows to define what frames are to be displayed when an actor is 
  211. performing a certain action. The first number is the RELATIVE first frame 
  212. number. Why relative ? Simply because to obtain the real sprite number, you 
  213. have to add the actor number, here 1680. The second number is the number of 
  214. frames to be displayed, the third is how many frames you actually skip 
  215. between each frame you actually display, the last is a multiplier (allowing 
  216. to cycle through the frames backward), and the last is a tempo. Hence, the 
  217. above action would display the relative frames 0,5,10 and 15 (add 1680 to 
  218. have the absolute frame). Note that this is a 3D Sprite, so if you turn 
  219. around the monster, you can see different orientation, without changing 
  220. anything in the script.
  221.  
  222. action ATROOPWALKINGBACK     15    4    5    -1   12
  223.  
  224. This action would display the frames 15,10,5,0.
  225.  
  226. The other important keywords are " move ", " ai " and " state ".
  227.  
  228. move allows to define a speed : " move TROOPWALKVELS 72 "
  229.  
  230. ai allows to associate an action with a subroutine and a basic action :
  231. ai AITROOPSEEKENEMY  ATROOPWALKING   TROOPWALKVELS seekplayer
  232.         ATROOPWALKING is the action
  233.         TROOPWALKVELS is the speed
  234. seekplayer is a basic action, directly performed by the 
  235. program, without the help of the script. It allows the actor to "move"
  236. toward the player without having to program everything.
  237.  
  238.  
  239. As for the "state" keyword, we have to examine more closely the actor :
  240.  
  241. actor LIZTROOP TROOPSTRENGTH ATROOPSTAND state troopcode enda
  242.  
  243. LIZTROOP is the actor number (1680), TROOPSTRENGTH is the hitpoints, 
  244. ATROOPSTAND is the first action performed by this actor. The keyword 
  245. "state" calls a kind of sub-routine, defined in the scripts between the 
  246. "state" and "ends" keywords.
  247.  
  248. Here is the code for this state :
  249.  
  250. state troopcode fall    <= drop an actor to the floor
  251.     ifinwater ifrnd 1 spawn WATERBUBBLE
  252.     ifaction ATROOPSTAND { ifrnd 192 ai AITROOPSHOOTING else ai 
  253. AITROOPSEEKPLAYER }    
  254.  
  255. If the action is ATROOPSTAND, then there is one 3 chances on 4 (192 out of 
  256. 256) that the actor will perform the AI subroutine AITROOPSHOOTING. 
  257. Otherwise it performs the AI subroutine AITROOPSEEKPLAYER.
  258.  
  259.     ifinwater ifrnd 4 spawn WATERBUBBLE
  260.     else ifaction ATROOPPLAYDEAD
  261.     {
  262.         ifhitweapon
  263.         {
  264.             ifwasweapon RADIUSEXPLOSION { sound SQUISHED state 
  265. troop_body_jibs state standard_jibs state delete_enemy }
  266.             break
  267.         }
  268.         else state checksquished
  269.  
  270.         ifcount PLAYDEADTIME { addkills -1 soundonce PRED_ROAM cstat 257 
  271. strength 1 ai AITROOPSHOOTING }
  272.         else ifp pfacing resetcount
  273.  
  274.         break
  275.     }
  276.  
  277. If the trooper is playing dead, we still have to check wether the lying 
  278. body is destroyed by an explosion or is squished. If the PLAYDEADTIME is 
  279. over, then trooper rises again (with a strength of 1) and tries to shoot 
  280. the player.
  281.  
  282.     else ifaction ATROOPDEAD
  283.     {
  284.         strength 0
  285.         ifrespawn ifcount RESPAWNTIME { spawn TRANSPORTERSTAR cstat 257 
  286. strength TROOPSTRENGTH ai AITROOPSEEKENEMY }
  287.         ifhitweapon
  288.         {
  289.             ifwasweapon RADIUSEXPLOSION { sound SQUISHED state 
  290. troop_body_jibs state standard_jibs state delete_enemy }
  291.             break
  292.         }
  293.         else state checksquished
  294.         break
  295.     }
  296.  
  297. If the trooper is dead, then it"s strength is zero. The program checks if 
  298. the respawn flag is set, and if so let the trooper rise again. If the body 
  299. is hit by an explosion, then it is definitely "killed"
  300.  
  301.     else ifaction ATROOPSUFFERDEAD
  302.     {
  303.         ifactioncount 2
  304.         {
  305.             ifrnd 64 { resetcount action ATROOPPLAYDEAD }
  306.             else { soundonce PRED_DYING action ATROOPDEAD }
  307.         }
  308.     }
  309.  
  310. This action is performed when the trooper is shot and is on the ground in 
  311. pain. It has 3 chances out of 4 to die, and one chance to play dead (see 
  312. above)
  313.  
  314.     else ifaction ATROOPDYING { state troopdying break }
  315.     else ifaction ATROOPSUFFERING
  316.         { state troopsufferingstate ifhitweapon state checktroophit break }
  317.     else ifaction ATROOPFLINTCH { ifactioncount 4 ai AITROOPSEEKENEMY }
  318.     else
  319.     {
  320.         ifai AITROOPSEEKPLAYER state troopseekstate
  321.         else ifai AITROOPJETPACK { state troopjetpackstate soundonce 
  322. DUKE_JETPACK_IDLE }
  323.         else ifai AITROOPSEEKENEMY state troopseekstate
  324.         else ifai AITROOPSHOOTING state troopshootstate
  325.         else ifai AITROOPFLEEING state troopfleestate
  326.         else ifai AITROOPFLEEINGBACK state troopfleestate
  327.         else ifai AITROOPDODGE state troopseekstate
  328.         else ifai AITROOPDUCKING state troopduckstate
  329.         else ifai AITROOPSHRUNK state troopshrunkstate
  330.         else ifai AITROOPHIDE { state troophidestate break }
  331.     }
  332.  
  333.     ifhitweapon state checktroophit else state checksquished
  334. ends
  335.  
  336. The rest is simple and deals with the other action the trooper can perform.
  337.  
  338.  
  339. What you must remember :
  340.  
  341. An action is simply a list of frames. You can make the actor do something 
  342. based upon this action, but it doesnÆt act on itself. You have to 
  343. explicitely use the "ifaction" keyword.
  344. On the other hand, an AI seems to allow a certain degree of freedom for the 
  345. actor : it does act on it's own... You can however have the actor perform 
  346. something more difficult by using the "ifai" keyword. Note that this is 
  347. purely an hypothesis.
  348.  
  349. Now, let's go back to the frames. The following action is performed when 
  350. the trooper is effectively dead.
  351.  
  352. action ATROOPDEAD       54
  353.  
  354. The relative frame number number 54 (add 1680 for absolute). What happens 
  355. if you change this number ? Well, for example, try 320. Instead of a dead 
  356. body, you have a standing pigcop. Remember the PIGCOP number (2000) ? And 
  357. 2000-1680 happens to be 320... So every sprite can be accessed with this 
  358. method. In fact, remember that even if a body is lying on the ground, it 
  359. still an actor with it's own action and script. I think that the game 
  360. deletes old actor when there are too much actor in the level.
  361.  
  362. You could also replace the above with
  363.  
  364. action ATROOPDEAD      0    4    5    1   12
  365.  
  366. You would have a walking corpse !
  367.  
  368. What I can tell you is now to experiment. As you can see, it isnÆt a very 
  369. hard language. A few comments though : it seems there are no variables, the 
  370. "ifpdistl" keyword stands for ifplayerdistancelower, and the "ifpdistg" 
  371. stands for iplayerdistancegreater (took a while to figure that one out !)
  372.  
  373. ===========================================================================
  374. Part II : Keywords
  375.  
  376.  
  377. Now that you understand the basic concepts of the script language used in
  378. Duke Nukem, here is a list off all the keywords with their associated
  379. effects (at least, those I understood). I hope I won't forget any. If you
  380. find a mistake, do not hesitate to contact me ! This list is the result of
  381. many trials and errors, and as such is prone to mistakes. I do not claim to
  382. have the supreme knowledge. That said, let's go back to our list. When 
  383. necessary, I used the <...> and [...] symbols. What's between the first
  384. symbols seem to required, while what's between the second symbols is optional.
  385.  
  386. action <name> ...       Define an action and it's associated sprites
  387.                         (see above). You can also use this one within a code
  388.                         to change the actor's current action.
  389.  
  390. actor <name> <strength> [actioname] [ai ainame] [statename]
  391.                         If you define more the ai and/or the state performed,
  392.                         you must end your list with the keyword "enda"
  393.  
  394. addinventory <object> <quantity>        Guess what ? The list of available
  395.                                         objects is in the defs.con file.
  396.  
  397. addphealth <no>         <no> can be negative. This allows to substract health
  398.                         from the player (used in the Octabrain code)
  399.  
  400. break                   Forces the program to exit the current function. This
  401.                         allows to bypass some code if certain requirements are
  402.                         met.
  403.  
  404. cactor <actor_name>     Call an actor. In fact, it only calls the actor code
  405.                         not the actor definition (action, ai, and so on)
  406.                         This can be used for example when creating multiple
  407.                         monsters with the same basic design: you create the
  408.                         actors which in turn call the basic actor. To
  409.                         understand this better, I suggest you take a look at
  410.                         the alien trooper definition.
  411.  
  412. cstat <no>              Change the actor status. I don't have all the numbers
  413.                         but here is what I know:
  414.                                 32768 hides the sprite (not sure)
  415.                                 257 ressurects the actor once more
  416.                                 0 kills it
  417.  
  418. debris <debris_name> <number>   Spawns flying debris. The kind of debris is
  419.                                 defined by debris_name, the number by...
  420.  
  421. endoflevel <??>         This is used when you want the script to end the
  422.                         level. Usually when you kill a boss. The number
  423.                         following it is unknown to me however. Maybe a tempo ?
  424.  
  425. else                    I think this one is quite clear.
  426.  
  427. fall                    Apparently, this instantly drops the actor to the
  428.                         floor. However, I am not quite sure about this one.
  429.  
  430. globalsound <sound_name>        What's the difference with "sound" and
  431.                                 "soundonce" ? I don't know.
  432.  
  433. guts <guts_name> <number>       Spawns flying guts. The difference with the
  434.                                 above is not obvious.
  435.  
  436. hitradius <range> <strength1> <strength2> <strength3> <strength4>
  437.  
  438.                         This generates an explosion. Damage to monsters and
  439.                         other players depends of the distance between the
  440.                         explosion and these actors. Damages range from
  441.                         strength1 to strength4.
  442.  
  443. ifai <ai_name>          Checks whether the actor's current ai is ai_name
  444. ifaction <action_name>  Same thing for the action
  445.  
  446. ifactioncount <number>  When called from within an action, counts the number
  447.                         of times this action has been processed and then
  448.                         checks whether it is greater than the number.
  449.                         If so, it performs the following code.
  450.  
  451. ifcansee                Checks whether the actor can see another actor.
  452.  
  453. ifcanseetarget          Apparently used for inventory items. This checks
  454.                         whether the player can see the actor.
  455.  
  456. ifcanshoottarget        Checks whether the actor can shoot the player. This
  457.                         usually used with the "ifcansee" keyword.
  458.  
  459. ifceilingdistl <no>     Stands for "If Ceiling Distance Lower Than"
  460.  
  461. ifcount <number>        This one was quite hard to figure out. Apparently, it
  462.                         checks whether the time is greater than the number. It
  463.                         allows to check whether an actor was kept in a certain
  464.                         action.
  465.  
  466.                         Ex:
  467.                         state genericshrunkcode
  468.                             ifcount 32 { ifpdistl RETRIEVEDISTANCE pstomp }
  469.                         ...
  470.  
  471.                         When a monster is shrunk, it can be squished by the
  472.                         player if he steps on it. Raising the number allows
  473.                         the monster to survive longer, as the player must stay
  474.                         longer within RETRIEVEDDISTANCE to stomp it.
  475.  
  476. ifdead                  Checks whether the actor has been killed.
  477.  
  478. iffloordistl <no>       Stands for "If Floor Distance Lower Than"
  479.  
  480. ifgapzl                 I wasn't able to figure that one out... I initially
  481.                         thought it was "if gap in z coordinate is lower than"
  482.                         but it doesn't fit with the main game.con file.
  483.                         Any hint would be appreciated...
  484.  
  485. ifhitspace              Checks whether the player hit the spacebar. Allows
  486.                         to run a special code in some instances. Ex: when
  487.                         there is a water fountain, Duke can drink and gain 1
  488.                         health point. This is performed in the game.con file
  489.  
  490. ifhitweapon             If the actor was hit by a weapon, then performs the
  491.                         following code
  492.  
  493. ifinwater               Checks whether the actor is underwater
  494.  
  495. ifmove <no>             Checks against <no> what is the speed of the current
  496.                         actor.
  497.  
  498. ifonwater               Checks whether the actor is swimming at the surface
  499.  
  500. ifp                     Checks something on the player
  501.  
  502. ifpdistl <no>           Stands for "If PLayer Distance Lower than"
  503. ifpdistg <no>           Do you guess that one ?
  504.  
  505. ifphealthl <no>         Stands for "If Player Health Lower Than"
  506.  
  507. ifrespawn               Checks whether the respawn flag is set.
  508.  
  509. ifrnd <number>          Generates a random number and checks whether it is
  510.                         lower to the following number. If so, it executes
  511.                         the following action.
  512.  
  513.             Ex: ifrnd 192 ai AILIZGETENEMY
  514.  
  515.             If the random number is lower than 192, then the actor
  516.             changes it's ai state to AILIZGETENEMY.
  517.  
  518. ifspawnedby <actor_name>        When you use the "spawn" keyword within an
  519.                                 actor, the spawned actor keeps in mind what
  520.                                 spawned it (!!!). You could use this to set
  521.                                 up traps for players (such as having the ammo
  522.                                 dropped by a trooper detonate if a player
  523.                                 tries to pick it up...)
  524.  
  525. ifspritepal <no>        Checks whether the sprite palette is <no>
  526.  
  527. ifsquished              Apparently, this checks whether the actor is squished.
  528.                         However, since I don't know what squishing means in
  529.                         the game...
  530.  
  531. ifwasweapon <weapon_type>       I think you already guessed that one ?
  532.                                 Available weapon_type are:
  533.                                         RPG
  534.                                         THROWFLAME
  535.                                         SHRINKSPARK
  536.                                         RADIUSEXPLOSION
  537.                                         FIREEXT (??)
  538.                                         KNEE
  539.                                         FIRELASER
  540.                                         COOLEXPLOSION1 (Octabrain Shot)
  541.                                         SHOTSPARK1
  542.  
  543.                                Maybe some more, but they were not used in the
  544.                                main script. You could also try the following:
  545.                                         SHOTGUN
  546.                                         FIRSTGUN
  547.                                         ???
  548.  
  549. include            As stuff said, includes another file
  550.  
  551. killit                  Erase the current actor from the game. The script for
  552.                         this actor no longer runs.
  553.  
  554. move <speed> [no]       Define a speed. Is mainly used with the "ai" keyword.
  555.                         However, you can also use it within a state function.
  556.                         no is a number that defines a special action performed
  557.                         by the actor.
  558.  
  559.                         Ex: move TURRVEL face_player
  560.  
  561.                         This moves the actor at speed TURRVEL so that it faces
  562.                         the player. The list of possible action is in the
  563.                         defs.con file.
  564.  
  565. operate                 I don't know what this one is used for. It probably
  566.                         allows an actor to operate a switch, a door or an
  567.                         elevator. However, I've never seen a monster
  568.                         performs such a thing. Maybe because when they don't
  569.                         see the player, they are as dumb as a wall.
  570.  
  571. palfrom                 I must say I don't know how this one works...
  572.  
  573. palive                  Checks whether the player is alive. It must be used in
  574.                         cunjunction with the "ifp" keyword. The other options
  575.                         are: pstanding, pwalking, ... See in the defs.con file
  576.  
  577. pstomp                  This one is funny. It is used in the genericshrunk
  578.                         code (see above). It shows the player stomping on
  579.                         a monster. You can usually use it with very small
  580.                         monsters, although it can be also done on big ones,
  581.                         if you can manage to climb on one (g).
  582.  
  583. resetactioncount        Reset to Zero the number of times this action has been
  584.                         processed.
  585.  
  586. resetcount              Reset to Zero the time check used by "ifcount"
  587.  
  588. shadeto <no>            This in fact dim or brighten the actor, depending on
  589.                         the value of <no>. -127 renders (temporarly) the actor
  590.                         black, while 127 renders it white. However, I must
  591.                         confess I didn't very good results. It seems there is
  592.                         a palette involved, and I couldn't determine the
  593.                         relationship. The best example is in the Octabrain
  594.                         code (JELLYFISH in the script).
  595.  
  596. shoot <weapon_type>     The actor shoots with a weapon. Weapon types include
  597.                         the following:  FIRELASER
  598.                                         RPG
  599.                                         FLAMETHROWER
  600.                                         MORTER
  601.                                         CHAINGUN
  602.                                         SHOTGUN
  603.                         There might be some others...
  604.  
  605. sizeto <nx> <ny>        This one is fun. It shrinks the actor at nx/256 and
  606.                         ny/256 it's original size. So, if you take 512, you
  607.                         would double the size of the actor. However, there
  608.                         are a few things to keep in mind when using this.
  609.                         First, the shrinking is not instantaneous. It takes a
  610.                         while until the corresponding code is performed. If
  611.                         you want to shrink an actor, you must always use the
  612.                         "ifaction" keyword in order to wait before it does
  613.                         anything else. Try it and you'll understand. Second,
  614.                         it seems you must periodically resize the actor. If
  615.                         you use this keyword just once, then it will revert
  616.                         back to it's original size a while after.
  617.  
  618. sound <sound_name>      Generates a sound. The list of available is in the
  619.                         defs.con file (I think)
  620.  
  621. soundonce <sound_name>  Also generates a sound, but only once (?)
  622.  
  623. spawn <actor>           Spawns an actor. Note that not every sprite is
  624.                         spawnable. It must somehow have been defined as
  625.                         spawnable... So you can only spawn existing actor
  626.                         and cannot define new ones (using a number above 4000
  627.                         for example, as might be hinted by looking at the
  628.                         defs.con file)
  629.  
  630. spritepal <no>          Change the palette sprite to the palette no. Usually,
  631.                         an actor is always referenced by a number. But there
  632.                         is also a palette that can be used for multiple monster
  633.                         definition. For example, the trooper captain (with the
  634.                         teleporter) is a standard trooper with a different
  635.                         palette. You can test what palette the current actor
  636.                         has with the "ifspritepal" keyword.
  637.  
  638. state ... ends        Can be used in two manner:
  639.             Defining the function and it's code
  640.                         Calling the function. It must have been defined before
  641.                         You don't have to use the "ends" keyword when calling
  642.                         a state.
  643.  
  644. strength <number>       Defines the actor's strength. Note that you must
  645.                         also change the status of the actor using the "cstat"
  646.                         keyword if you want to ressurect a monster (see below)
  647.  
  648. quote <no>              This displays the quote number <no>.See in the defs.con
  649.                         file for more information.
  650.  
  651.  
  652. Well, I think that's all. I hope I didn't forget anything. If so, please
  653. forgive me and give me a call so I can correct my mistake. Any information
  654. on any of the missing features would be greatly appreciated.
  655.  
  656. ===========================================================================
  657. Part III : Some Examples
  658.  
  659. Why not start with some examples ?
  660.  
  661. Well, you noticed that sometimes a trooper drops a pistol ammo. Here is the 
  662. code :
  663.  
  664. state checktroophit
  665.     ifaction ATROOPSUFFERING { stopsound LIZARD_BEG sound PRED_DYING cstat 
  666. 0 strength 0 action ATROOPSUFFERDEAD break }
  667.     ifdead
  668.     {
  669.         state drop_ammo           <= Here. It calls the drop_ammo state
  670.         state random_wall_jibs
  671.         addkills 1
  672.  
  673. Well, you could have it drop a TRIPBOMB, no ? Just add the line 
  674. "spawn TRIPBOMBSPRITE" and there you go, you can pick up a trip bomb. 
  675. Unfortunately, there is no sprite for it in the shareware version, so donÆt 
  676. be surprised if you don't see it, it's normal. Furthermore, you can use it 
  677. only as long as you don't switch to another weapon, because I didn't find a 
  678. way to reselect it.
  679.  
  680. You can try all the weapons in this manner (SHRINKERSPRITE and 
  681. FLAMETHROWERSPRITE).
  682.  
  683. You could also have it respawn another monster... such as a PIGCOP, or a 
  684. JELLYFISH (Octabrain), or... a BOSS1 (aaaaargh...).
  685.  
  686. Better still. You can replace all the basic trooper in the game with a 
  687. PIGCOP. All you have to do is define the PIGCOP ("define PIGCOP 2000" in 
  688. the DEFS.CON file) as number 1680. Of course, you still get the frames for 
  689. the trooper, but it would act like a PIGCOP, and shoot with a shotgun... If 
  690. you want to have the correct frames, you have to modify the pigcop's 
  691. actions and add 320 to each basic frame. But remember that this only deals 
  692. with the standard standing trooper. Ducking trooper and flying trooper 
  693. would remain the same. Until they hit the ground...
  694.  
  695.  
  696. There are tons of things to experiment. If I have the time, I'll upload a 
  697. few of our creations (a friend and me).
  698.  
  699. What I need know is FEEDBACK as well as some information on what I didn't
  700. quite figure out in the language. So if you think you discovered something
  701. that would be of interest, feel free to write me a little E-mail.
  702.  
  703. If you have any question, I can be reached at the following E-Mail adress :
  704. 101366.1734@compuserve.com
  705.  
  706. Have fun !
  707.  
  708. Vincent Nguyen Quang Do
  709.