home *** CD-ROM | disk | FTP | other *** search
/ Micromanía 30 / IMAGE.img / quake / niveles / addons / quakec.txt < prev    next >
Text File  |  1997-01-13  |  10KB  |  282 lines

  1.                     
  2.                    / ======================\
  3.                  /                         ||
  4.                /         How to make your  ||
  5.              /|      /=====================/
  6.            /  |     ||-------------------/
  7.           |   |     ||
  8.           |   |     ||
  9.         QUAKE |     ||
  10.           |   |     ||
  11.           |   |     \=======================\
  12.           |    \                            ||
  13.            \     \         own patches      ||
  14.              \     \========================/
  15.                \             1.00          /
  16.                  \------------------------/
  17.            by Paul Healey, 101325,1604@COMPUSERVE.COM
  18. =========
  19. CONTENTS
  20. =========
  21.  
  22. INTRODUCTION
  23. ----------------------------------------------
  24. SECTION 1 Getting started
  25. [1.0] What you need to make your own patch.
  26. [1.1] Where to get the utilities from.
  27. ----------------------------------------------
  28. SECTION 2 How to make your own patch.
  29. [2.0] To begin with.
  30. [2.1] What files are.
  31. ----------------------------------------------
  32. SECTION 3 The end.
  33. [3.0] Summary
  34. [3.1] Acknowledgements.
  35. ----------------------------------------------
  36.  
  37. ============
  38. INTRODUCTION
  39. ============
  40.  
  41. This readme gives a basic outline on how to make your own patch. It DOES NOT
  42. show you how to program very advanced things in Quake C because I can't so
  43. therefore can't tell you. It DOES however tell you the basics of Quake C,
  44. what programs are required to compile your code and what the files are and
  45. what they do. Also a basic outline of the parts of a Quake C file.
  46.  
  47. The layout of the file is pretty simple. Examples have a * before them and a
  48. actual files start with +----------------+. Comments in files have a -
  49. before them. Sections are also clearly labelled with ==== and the top and
  50. bottom of the heading.
  51.  
  52. ============================
  53. SECTION [1] Getting started
  54. ============================
  55.  
  56. [1.0] What you need to make your own patch.
  57.  
  58. In order to make your own Quake C patch you'll need the following:
  59. [1] Quake PROGS.DAT source code,
  60. [2] QCC, the compiler for the code
  61. [3] and a bit of common sense.
  62.  
  63. [1.1] Where to get the utilities from.
  64.  
  65. The Quake C code is availible from the Action Games forum on Compuserve in
  66. the Quake area.
  67.  
  68. The compiler is also in the same place. Look for QCC.ZIP. The DOS version of
  69. the compiler is the one I use. Its quicker to work in DOS than in Windows 95.
  70. Make sure you have the compiler which compiles the version code you have.
  71. *EXAMPLE 1.0
  72. If you have Quake C 1.06 make sure QCC compiles Quake C 1.06.
  73.  
  74. ========================================
  75. SECTION [2] How to make your own patch.
  76. ========================================
  77.  
  78. [2.0] To begin with.
  79.  
  80. Quake C is made up of several files which are used to make a file called
  81. PROGS.DAT. This is the file Quake uses in order to get information on
  82. how the games works. The files that make PROGS.DAT is explained in
  83. SECTION 2.1
  84.  
  85. To make things easier make a batch file which loads CWSDPMI.EXE (the compiler
  86. needs DPMI memory) the QCC.EXE. I've called mine GO.BAT
  87.  
  88. +-GO.BAT--------------------------------------------------------------------+
  89. -Load the DPMI memory program first
  90. CWSDPMI.EXE
  91. -Now the compiler
  92. QCC.EXE
  93. +-ENDS-HERE-----------------------------------------------------------------+
  94.  
  95. [2.1] What files are.
  96.  
  97. CWSDPMI.EXE is the DPMI memory program which is required to be loaded
  98. before the compiler. QCC.EXE is the compiler for Quake C.
  99.  
  100. QCC.EXE loads a file called PROGS.SRC. Now this is a list of what files the
  101. compiler has to compile and in what order. Heres the one for Super Quake.
  102. *Example 2.0
  103. +-PROGS.SRC-----------------------------------------------------------------+
  104. progs.dat -This is the file its going to make
  105.           -Below are files it will use to make the above file.
  106. defs.qc
  107. subs.qc
  108. fight.qc
  109. ai.qc
  110. combat.qc
  111. items.qc
  112. eject.qc // shells ejecting from you know what
  113. holo.qc // hologram and electric minion
  114. weapons.qc
  115. throwaxe.qc // yeah well
  116. lightb.qc // Light bomb
  117. world.qc  // world code
  118. client.qc // this computers code
  119. player.qc
  120. jsubs.qc // new, to do with solid monsters
  121. monsters.qc // general monster a.i.
  122. doors.qc // doors, duh
  123. buttons.qc
  124. triggers.qc
  125. plats.qc
  126. misc.qc
  127. // enemy a.i. 
  128. ogre.qc
  129. demon.qc
  130. shambler.qc
  131. knight.qc
  132. soldier.qc
  133. wizard.qc
  134. dog.qc
  135. zombie.qc               // zombie a.i.
  136. boss.qc                 // the boss
  137.  
  138. tarbaby.qc        // registered
  139. hknight.qc        // registered
  140. fish.qc            // registered
  141. shalrath.qc        // registered
  142. enforcer.qc        // registered
  143. oldone.qc        // registered
  144.  
  145. chain.qc                 // grappling hook
  146. compass.qc               // compass, duh
  147. +-ENDS-HERE-----------------------------------------------------------------+
  148.  
  149. In this file I've commented to show what each file is, not every file has
  150. been because its pretty easy to understand.
  151.  
  152. Gaps in the file aren't needed but it makes it easier to read. Some files
  153. have to compiled before others because in later files they are called for.
  154. *Example 2.1
  155. WEAPONS.QC needs the information on Electric minion in order to be able to
  156. fire it. So HOLO.QC, the file which has the information for the electric
  157. minion, is just before WEAPONS.QC.
  158.  
  159. To be able to make a patch like Super Quake, which is a load of patches in
  160. one, you don't need to know any C at all. Its just common sense and basically
  161. just copying code from other peoples patches.
  162.  
  163. In the Super Quake patch the areas are clearly commented so you can easily
  164. understand it.
  165.  
  166. [2.2] QC files.
  167.  
  168. The QC files are Quake C. Thats why they have a QC extension! To edit the
  169. files use a text editor like EDIT, because the code is just text.
  170.  
  171. The QC files are split into areas. Example 2.3 is taken from WEAPONS.QC in
  172. the Super Quake patch.
  173.  
  174. *Example 2.3
  175. +-WEAPONS.QC----------------------------------------------------------------+
  176. void() CheatCommand =
  177. {
  178.     if (deathmatch || coop)
  179.         return;
  180.  
  181.     self.ammo_rockets = 100;
  182.     self.ammo_nails = 200;
  183.     self.ammo_shells = 100;
  184.         self.num_axes = 100; //100 throwing axes
  185.     self.items = self.items | 
  186.         IT_AXE |
  187.                 IT_THROWING_AXE |
  188.         IT_SHOTGUN |
  189.         IT_SUPER_SHOTGUN |
  190.         IT_NAILGUN |
  191.         IT_SUPER_NAILGUN |
  192.         IT_GRENADE_LAUNCHER |
  193.         IT_ROCKET_LAUNCHER |
  194.         IT_KEY1 | IT_KEY2;
  195.  
  196.     self.ammo_cells = 200;
  197.     self.items = self.items | IT_LIGHTNING;
  198. /* Now change your weapon to the rocket launcher */
  199.     self.weapon = IT_ROCKET_LAUNCHER;
  200.     self.impulse = 0;
  201.     W_SetCurrentAmmo ();
  202. };
  203. +-WEAPONS.QC-ENDS-HERE------------------------------------------------------+
  204.  
  205. Each area starts with: void() example =
  206.  
  207. Now between { and } the section is explained over a series or lines. For this
  208. example, which in the game happens to be the IMPULSE 9 cheat, it gives you
  209. the all the weapons, both keys, some ammo and changes your weapons.
  210.  
  211. *Example 2.4
  212. +-WEAPONS.QC----------------------------------------------------------------+
  213. {
  214. if (deathmatch || coop)
  215. return;
  216. +-WEAPONS.QC-ENDS-HERE------------------------------------------------------+
  217. Now this example checks for whether the game is either deathmatch or
  218. co-operative. Now if it, it ignores the command and returns. The { shows it
  219. is the start of the section.
  220.  
  221. *Example 2.5
  222. +-WEAPONS.QC----------------------------------------------------------------+
  223.     self.ammo_rockets = 100;
  224.     self.ammo_nails = 200;
  225.     self.ammo_shells = 100;
  226.     self.ammo_cells = 200;
  227.         self.num_axes = 100; //100 throwing axes
  228.         self.items = self.items | 
  229.         IT_AXE |
  230.                 IT_THROWING_AXE |
  231.         IT_SHOTGUN |
  232.         IT_SUPER_SHOTGUN |
  233.         IT_NAILGUN |
  234.         IT_SUPER_NAILGUN |
  235.         IT_GRENADE_LAUNCHER |
  236.         IT_ROCKET_LAUNCHER |
  237.                 IT_LIGHTNING |
  238.         IT_KEY1 | IT_KEY2;
  239. +-WEAPONS.QC-ENDS-HERE------------------------------------------------------+
  240. This example gives you the ammo, the weapons and the keys. Its fairly self
  241. explanatory. The part self.items = self.items | down to IT_KEY1 | IT_KEY2;
  242. can be written on one line but is easier to read on several lines.
  243.  
  244. Now there is also a ; at the end of each line this is to split the lines up.
  245.  
  246. *Example 2.6
  247. +-WEAPONS.QC----------------------------------------------------------------+
  248. /* Now change your weapon to the rocket launcher */
  249.     self.weapon = IT_ROCKET_LAUNCHER;
  250.     self.impulse = 0;
  251.     W_SetCurrentAmmo ();
  252. };
  253. +-WEAPONS.QC-ENDS-HERE------------------------------------------------------+
  254.  
  255. After giving you the ammo etc.. your weapon is then changed to the rocket
  256. launcher. Then impulse is set to 0, this is related to other parts of the
  257. code so I won't go into it in detail.
  258.                                                                                   IT_KEY1 | IT_KEY2;                IT_KEY1 | IT_KEY2;
  259. Now to show that it is the end of this area there is a ; after the }
  260.  
  261. Also for you to put your own comments in your code you can do two things.
  262.  
  263. The first is /*My comment*/. Now using this method you can go over several
  264. lines. The /* starts it and the */ ends it. Your comment can go in between
  265. the /**/
  266.  
  267. The second is //. This is used for single lines of comment.
  268.  
  269. ====================
  270. SECTION [3] The end.
  271. ====================
  272.  
  273. [3.0] Summary
  274.  
  275. I hope that you know a bit more about Quake C, how it can be compiled and
  276. what goes into it. I would, with other peoples help, like to give more
  277. information about Quake C.
  278.  
  279. [3.1] Acknowledgements
  280.  
  281. Brian Hartley - I made this file to help him.
  282.