/ ======================\ / || / How to make your || /| /=====================/ / | ||-------------------/ | | || | | || QUAKE | || | | || | | \=======================\ | \ || \ \ own patches || \ \========================/ \ 1.00 / \------------------------/ by Paul Healey, 101325,1604@COMPUSERVE.COM ========= CONTENTS ========= INTRODUCTION ---------------------------------------------- SECTION 1 Getting started [1.0] What you need to make your own patch. [1.1] Where to get the utilities from. ---------------------------------------------- SECTION 2 How to make your own patch. [2.0] To begin with. [2.1] What files are. ---------------------------------------------- SECTION 3 The end. [3.0] Summary [3.1] Acknowledgements. ---------------------------------------------- ============ INTRODUCTION ============ This readme gives a basic outline on how to make your own patch. It DOES NOT show you how to program very advanced things in Quake C because I can't so therefore can't tell you. It DOES however tell you the basics of Quake C, what programs are required to compile your code and what the files are and what they do. Also a basic outline of the parts of a Quake C file. The layout of the file is pretty simple. Examples have a * before them and a actual files start with +----------------+. Comments in files have a - before them. Sections are also clearly labelled with ==== and the top and bottom of the heading. ============================ SECTION [1] Getting started ============================ [1.0] What you need to make your own patch. In order to make your own Quake C patch you'll need the following: [1] Quake PROGS.DAT source code, [2] QCC, the compiler for the code [3] and a bit of common sense. [1.1] Where to get the utilities from. The Quake C code is availible from the Action Games forum on Compuserve in the Quake area. The compiler is also in the same place. Look for QCC.ZIP. The DOS version of the compiler is the one I use. Its quicker to work in DOS than in Windows 95. Make sure you have the compiler which compiles the version code you have. *EXAMPLE 1.0 If you have Quake C 1.06 make sure QCC compiles Quake C 1.06. ======================================== SECTION [2] How to make your own patch. ======================================== [2.0] To begin with. Quake C is made up of several files which are used to make a file called PROGS.DAT. This is the file Quake uses in order to get information on how the games works. The files that make PROGS.DAT is explained in SECTION 2.1 To make things easier make a batch file which loads CWSDPMI.EXE (the compiler needs DPMI memory) the QCC.EXE. I've called mine GO.BAT +-GO.BAT--------------------------------------------------------------------+ -Load the DPMI memory program first CWSDPMI.EXE -Now the compiler QCC.EXE +-ENDS-HERE-----------------------------------------------------------------+ [2.1] What files are. CWSDPMI.EXE is the DPMI memory program which is required to be loaded before the compiler. QCC.EXE is the compiler for Quake C. QCC.EXE loads a file called PROGS.SRC. Now this is a list of what files the compiler has to compile and in what order. Heres the one for Super Quake. *Example 2.0 +-PROGS.SRC-----------------------------------------------------------------+ progs.dat -This is the file its going to make -Below are files it will use to make the above file. defs.qc subs.qc fight.qc ai.qc combat.qc items.qc eject.qc // shells ejecting from you know what holo.qc // hologram and electric minion weapons.qc throwaxe.qc // yeah well lightb.qc // Light bomb world.qc // world code client.qc // this computers code player.qc jsubs.qc // new, to do with solid monsters monsters.qc // general monster a.i. doors.qc // doors, duh buttons.qc triggers.qc plats.qc misc.qc // enemy a.i. ogre.qc demon.qc shambler.qc knight.qc soldier.qc wizard.qc dog.qc zombie.qc // zombie a.i. boss.qc // the boss tarbaby.qc // registered hknight.qc // registered fish.qc // registered shalrath.qc // registered enforcer.qc // registered oldone.qc // registered chain.qc // grappling hook compass.qc // compass, duh +-ENDS-HERE-----------------------------------------------------------------+ In this file I've commented to show what each file is, not every file has been because its pretty easy to understand. Gaps in the file aren't needed but it makes it easier to read. Some files have to compiled before others because in later files they are called for. *Example 2.1 WEAPONS.QC needs the information on Electric minion in order to be able to fire it. So HOLO.QC, the file which has the information for the electric minion, is just before WEAPONS.QC. To be able to make a patch like Super Quake, which is a load of patches in one, you don't need to know any C at all. Its just common sense and basically just copying code from other peoples patches. In the Super Quake patch the areas are clearly commented so you can easily understand it. [2.2] QC files. The QC files are Quake C. Thats why they have a QC extension! To edit the files use a text editor like EDIT, because the code is just text. The QC files are split into areas. Example 2.3 is taken from WEAPONS.QC in the Super Quake patch. *Example 2.3 +-WEAPONS.QC----------------------------------------------------------------+ void() CheatCommand = { if (deathmatch || coop) return; self.ammo_rockets = 100; self.ammo_nails = 200; self.ammo_shells = 100; self.num_axes = 100; //100 throwing axes self.items = self.items | IT_AXE | IT_THROWING_AXE | IT_SHOTGUN | IT_SUPER_SHOTGUN | IT_NAILGUN | IT_SUPER_NAILGUN | IT_GRENADE_LAUNCHER | IT_ROCKET_LAUNCHER | IT_KEY1 | IT_KEY2; self.ammo_cells = 200; self.items = self.items | IT_LIGHTNING; /* Now change your weapon to the rocket launcher */ self.weapon = IT_ROCKET_LAUNCHER; self.impulse = 0; W_SetCurrentAmmo (); }; +-WEAPONS.QC-ENDS-HERE------------------------------------------------------+ Each area starts with: void() example = Now between { and } the section is explained over a series or lines. For this example, which in the game happens to be the IMPULSE 9 cheat, it gives you the all the weapons, both keys, some ammo and changes your weapons. *Example 2.4 +-WEAPONS.QC----------------------------------------------------------------+ { if (deathmatch || coop) return; +-WEAPONS.QC-ENDS-HERE------------------------------------------------------+ Now this example checks for whether the game is either deathmatch or co-operative. Now if it, it ignores the command and returns. The { shows it is the start of the section. *Example 2.5 +-WEAPONS.QC----------------------------------------------------------------+ self.ammo_rockets = 100; self.ammo_nails = 200; self.ammo_shells = 100; self.ammo_cells = 200; self.num_axes = 100; //100 throwing axes self.items = self.items | IT_AXE | IT_THROWING_AXE | IT_SHOTGUN | IT_SUPER_SHOTGUN | IT_NAILGUN | IT_SUPER_NAILGUN | IT_GRENADE_LAUNCHER | IT_ROCKET_LAUNCHER | IT_LIGHTNING | IT_KEY1 | IT_KEY2; +-WEAPONS.QC-ENDS-HERE------------------------------------------------------+ This example gives you the ammo, the weapons and the keys. Its fairly self explanatory. The part self.items = self.items | down to IT_KEY1 | IT_KEY2; can be written on one line but is easier to read on several lines. Now there is also a ; at the end of each line this is to split the lines up. *Example 2.6 +-WEAPONS.QC----------------------------------------------------------------+ /* Now change your weapon to the rocket launcher */ self.weapon = IT_ROCKET_LAUNCHER; self.impulse = 0; W_SetCurrentAmmo (); }; +-WEAPONS.QC-ENDS-HERE------------------------------------------------------+ After giving you the ammo etc.. your weapon is then changed to the rocket launcher. Then impulse is set to 0, this is related to other parts of the code so I won't go into it in detail. IT_KEY1 | IT_KEY2; IT_KEY1 | IT_KEY2; Now to show that it is the end of this area there is a ; after the } Also for you to put your own comments in your code you can do two things. The first is /*My comment*/. Now using this method you can go over several lines. The /* starts it and the */ ends it. Your comment can go in between the /**/ The second is //. This is used for single lines of comment. ==================== SECTION [3] The end. ==================== [3.0] Summary I hope that you know a bit more about Quake C, how it can be compiled and what goes into it. I would, with other peoples help, like to give more information about Quake C. [3.1] Acknowledgements Brian Hartley - I made this file to help him.