<li><aclass="backlink"title="Click to do a full-text search for this title"href="/quake4/MakeAMod-InstaGib?action=fullsearch&value=linkto%3A%22MakeAMod-InstaGib%22&context=180">MakeAMod-InstaGib</a></li>
<spanclass="anchor"id="line-4"></span><pclass="line874">In this mod we will replace all weapons with the railgun, and additionally have the railgun do 1000 damage. <spanclass="anchor"id="line-5"></span><spanclass="anchor"id="line-6"></span><pclass="line867"><strong>Areas Modified:</strong><ahref="/quake4/DefinitionFiles">DefinitionFiles</a><spanclass="anchor"id="line-7"></span><br/>
<spanclass="anchor"id="line-10"></span><aclass="attachment"href="/quake4/MakeAMod-InstaGib?action=AttachFile&do=get&target=q4-instagib.zip"title="attachment:q4-instagib.zip">Download the mod</a><spanclass="anchor"id="line-11"></span><spanclass="anchor"id="line-12"></span><pclass="line867">
<spanclass="anchor"id="line-13"></span><pclass="line862">To implement something like Insta<ttclass="backtick"></tt>Gib, modifying <ahref="/quake4/DefinitionFile">def files</a> is the easiest approach. <ahref="/quake4/DefinitionFile">Def files</a> specify the properties of almost every gameplay element in the game. Specifically, by editing the appropriate <ahref="/quake4/DefinitionFile">def file</a> we'll be able to change the railgun damage, etc. <spanclass="anchor"id="line-14"></span><spanclass="anchor"id="line-15"></span><pclass="line867">
<spanclass="anchor"id="line-16"></span><pclass="line862">First, we'll setup our <ahref="/quake4/ModDirectory">ModDirectory</a>. A good way to start is to copy over the files we'll be editing. This gives us a good base to work off. <spanclass="anchor"id="line-17"></span><spanclass="anchor"id="line-18"></span><oltype="1"><li><pclass="line862">Create a Quake 4\instagib directory. <strong>Create this is a sub-directory of your Quake 4 installation.</strong> This will be our <ahref="/quake4/ModDirectory">ModDirectory</a>. <spanclass="anchor"id="line-19"></span></li><li><pclass="line862">Create sub-directories that will hold our mod's <ahref="/quake4/DefinitionFile">def files</a><spanclass="anchor"id="line-20"></span><oltype="a"><li>Quake4\instagib\def <spanclass="anchor"id="line-21"></span></li><li>Quake4\instagib\def\weapons <spanclass="anchor"id="line-22"></span></li></ol></li><li><pclass="line862">Open Quake4\baseq4\pak001.pk4 (see the article on <ahref="/quake4/PK4File">pk4 files</a> for information on how to open them) <spanclass="anchor"id="line-23"></span></li><li>Extract the following files from pak001.pk4 and copy them to the mod directory <spanclass="anchor"id="line-24"></span><ul><listyle="list-style-type:none"><spanclass="anchor"id="line-25"></span><pre>Quake4\instagib\def
<h2id="head-bf5912639e24dfdf4fab68a4244a7ef4931d25e5">1.3. Time to mod!</h2>
<spanclass="anchor"id="line-47"></span><pclass="line862">Now that we've got our mod directory setup we can get crackin'. We'll create Quake 4 Insta<ttclass="backtick"></tt>Gib in five steps. <spanclass="anchor"id="line-48"></span><spanclass="anchor"id="line-49"></span><oltype="1"><li><pclass="line891"><strong>Replace each weapon pickup with railgun weapon pickup</strong> This will turn all weapon pickup <aclass="nonexistent"href="/quake4/Entity">entities</a> into the railgun pickup. That way, no matter what map we play our mod on, the only weapon you'll be able to pickup is the railgun. <spanclass="anchor"id="line-50"></span></li><li><pclass="line891"><strong>Replace all ammo pickups with railgun ammo</strong> Since we've made the railgun the only weapon you can pickup, we'll want to change any ammo pickups to give you railgun ammo. <spanclass="anchor"id="line-51"></span></li><li><pclass="line891"><strong>Make the railgun the player's starting weapon</strong> Otherwise, players will still spawn in with machine guns on our rail-only maps <spanclass="anchor"id="line-52"></span></li><li><pclass="line891"><strong>Make the railgun do 1000 damage</strong> Ahh the coup-de-grace, gibs-ahoy. <spanclass="anchor"id="line-53"></span></li><li><pclass="line891"><strong>Make the gauntlet do 1000 damage</strong> We'll add some close-quarters instagibbing as well. <spanclass="anchor"id="line-54"></span><spanclass="anchor"id="line-55"></span></li></ol><pclass="line867">
<h3id="head-578a2b79417aaff14339d4f41e49a301fcf5a650">1.3.1. Replace each weapon pickup with railgun weapon pickup</h3>
<spanclass="anchor"id="line-56"></span><spanclass="anchor"id="line-57"></span><pclass="line862">Since we want to replace all weapons with the railgun, we need to make sure that players won't be able to pickup any other weapons. One way to do this would be to edit each <aclass="nonexistent"href="/quake4/MapFile">MapFile</a> and replace all weapons with the railgun weapon pickup. This isn't the best way of going about this - we would have to edit a ton of maps, and our mod wouldn't work on any new maps people might make. <spanclass="anchor"id="line-58"></span><spanclass="anchor"id="line-59"></span><pclass="line874">What we'll do instead is replace all weapon pickups with the railgun weapon pickup. That is, we'll change the behavior of the shotgun pickup, rocket launcher pickup, etc to give you the railgun instead of whatever weapon these pickups were giving before. <spanclass="anchor"id="line-60"></span><spanclass="anchor"id="line-61"></span><pclass="line874">This means that any map we run with our mod will only have railguns. <spanclass="anchor"id="line-62"></span><spanclass="anchor"id="line-63"></span><pclass="line862">We'll be modifying each weapon pickup's <ahref="/quake4/EntityDefinition">EntityDefinition</a> to have it give the player a railgun regardless of the type of pickup. <spanclass="anchor"id="line-64"></span><spanclass="anchor"id="line-65"></span><pclass="line867"><em>The <ahref="/quake4/EntityDefinition">entity def</a> for weapon pickups placed in maps are called weapon_weaponname, and are located in the <ahref="/quake4/DefinitionFile">def files</a> in def\weapons</em><spanclass="anchor"id="line-66"></span><spanclass="anchor"id="line-67"></span><pclass="line862">Use a text editor (such as Notepad) to open up <strong>Quake4\instagib\def\weapons\dmg.def</strong>. Scroll down to the <ahref="/quake4/EntityDefinition">EntityDefinition</a> named weapon_dmg_mp. (See the note on <ahref="/quake4/MultiplayerEntityDefinitions">MultiplayerEntityDefinitions</a>) <spanclass="anchor"id="line-68"></span><ul><listyle="list-style-type:none"><spanclass="anchor"id="line-69"></span><pre>entityDef weapon_dmg_mp
<spanclass="anchor"id="line-90"></span></pre><spanclass="anchor"id="line-91"></span><pclass="line862">This <ahref="/quake4/EntityDefinition">EntityDefinition</a> describes the multiplayer version of the Dark Matter Gun weapon pickup. When you run over a weapon_dmg entity placed in a map (see the note on <ahref="/quake4/MultiplayerEntityDefinitions">MultiplayerEntityDefinitions</a>), the <ahref="/quake4/GameCode">GameCode</a> gives you a weapon based on the information in this <ahref="/quake4/EntityDefinition">EntityDefinition</a>. <spanclass="anchor"id="line-92"></span></li></ul><pclass="line867"><br/>
<spanclass="anchor"id="line-93"></span><ul><listyle="list-style-type:none"><pclass="line862">You'll notice the use of the <em>inherit</em> keyword. This copies over the single-player Dark Matter Gun values which saves us from having to redefine parts of the <ahref="/quake4/EntityDefinition">EntityDefinition</a> that are the same in single player and multiplayer. Instead, we <em>inherit</em> the single-player as a base, then override whichever values we want to change for multiplayer. <spanclass="anchor"id="line-94"></span></li></ul><pclass="line867"><br/>
<spanclass="anchor"id="line-95"></span><ul><listyle="list-style-type:none"><pclass="line862">The part of the <ahref="/quake4/EntityDefinition">EntityDefinition</a> that the <ahref="/quake4/GameCode">GameCode</a> uses to give you a weapon is the "weaponclass" key found in weapon_dmg. We could change this from rvWeaponDarkMatterGun to rvWeaponRailgun, but this wouldn't immediately work. In addition to the "weaponclass" the <ahref="/quake4/EntityDefinition">EntityDefinition</a> specifes a ton of other information needed to make the weapon work (i.e. muzzle kickback, starting ammo, reload time, etc). If we just replaced the "weaponclass" you would get a Railgun with the handling characteristics of the DMG. <spanclass="anchor"id="line-96"></span></li></ul><pclass="line867"><br/>
<spanclass="anchor"id="line-97"></span><ul><listyle="list-style-type:none"><pclass="line862">Another way we could turn the DMG into the railgun is by copy and pasting all the weapon_railgun fields into the weapon_dmg <ahref="/quake4/EntityDefinition">EntityDefinition</a>. This would work, but doing this for all the weapons is a large amount of work. Furthermore, if we ever want to change something about the railgun, we'd have to make sure to change it in each weapon. <spanclass="anchor"id="line-98"></span></li></ul><pclass="line867"><br/>
<spanclass="anchor"id="line-99"></span><ul><listyle="list-style-type:none"><pclass="line862">By now you probably see where I'm going with this. Remember the <em>inherit</em> functionality? The easiest way to turn the DMG into a railgun is just to have the weapon_dmg <ahref="/quake4/EntityDefinition">EntityDefinition</a> inherit from the weapon_railgun <ahref="/quake4/EntityDefinition">EntityDefinition</a>. So go ahead and change the weapon_dmg_mp to <spanclass="anchor"id="line-100"></span><spanclass="anchor"id="line-101"></span><pre>entityDef weapon_dmg_mp
<spanclass="anchor"id="line-105"></span></pre><spanclass="anchor"id="line-106"></span>This will change any weapon_dmg entities that have been placed on any map to give you the railgun when you pick it up. We'll repeat the same step for the other weapons. <spanclass="anchor"id="line-107"></span></li></ul><pclass="line867"><br/>
<h3id="head-b5473aa17ee477c71fcaffdd1aac3b1aba2f0147">1.3.2. Replace all ammo pickups with railgun ammo</h3>
<spanclass="anchor"id="line-152"></span><spanclass="anchor"id="line-153"></span><pclass="line874">Now that we've got all the weapon pickups acting like railguns, we'll do the same thing for ammo pickups. <spanclass="anchor"id="line-154"></span><spanclass="anchor"id="line-155"></span><pclass="line867"><strong>Quake4\instagib\def\ammo.def</strong><spanclass="anchor"id="line-156"></span><spanclass="anchor"id="line-157"></span><pre>entityDef ammo_machinegun_mp
<h3id="head-af14555ebdd125e77bb291affb6dc4994bf35615">1.3.3. Make the railgun the player's starting weapon</h3>
<spanclass="anchor"id="line-213"></span><spanclass="anchor"id="line-214"></span><pclass="line874">Now that we've got the map weapon and ammo pickups converted to railguns, we need to make sure the player spawns in with a rail. Otherwise new players will find themselves with a dinky machinegun going up against 1000 damage rails. <spanclass="anchor"id="line-215"></span><spanclass="anchor"id="line-216"></span><pclass="line862">Let's take a look at the multiplayer player <ahref="/quake4/EntityDefinition">EntityDefinition</a>, player_marine_mp. It's a big definition, so we'll only show the relevant parts. <spanclass="anchor"id="line-217"></span><spanclass="anchor"id="line-218"></span><pclass="line867"><strong>Quake4\instagib\def\player.def</strong><spanclass="anchor"id="line-219"></span><spanclass="anchor"id="line-220"></span><pre>entityDef player_marine_mp
<spanclass="anchor"id="line-238"></span></pre><spanclass="anchor"id="line-239"></span><pclass="line862">The "weapon" <aclass="nonexistent"href="/quake4/KeyValue">KeyValue</a> determines the starting weapon(s) for the player. The "current_weapon" key determines the initial selected weapon. Go ahead and replace the "weapon" and "current_weapon" lines with <spanclass="anchor"id="line-240"></span><spanclass="anchor"id="line-241"></span><pclass="line867"><strong>Quake4\instagib\def\player.def</strong><spanclass="anchor"id="line-242"></span><spanclass="anchor"id="line-243"></span><pre>entityDef player_marine_mp
<spanclass="anchor"id="line-250"></span></pre><spanclass="anchor"id="line-251"></span><pclass="line874">Make sure you leave the rest of the lines alone - we'll need them to keep everything working with the player. <spanclass="anchor"id="line-252"></span><spanclass="anchor"id="line-253"></span><pclass="line874">Now we'll need to tweak the starting ammo values in the player.def. Remove the starting machine gun ammunition, and give the player 10 rail rounds to start with. <spanclass="anchor"id="line-254"></span><spanclass="anchor"id="line-255"></span><pclass="line867"><strong>Quake4\instagib\def\player.def</strong><spanclass="anchor"id="line-256"></span><spanclass="anchor"id="line-257"></span><pre>entityDef player_marine_mp
<spanclass="anchor"id="line-271"></span></pre><spanclass="anchor"id="line-272"></span><spanclass="anchor"id="line-273"></span><pclass="line874">That's it for the player.def. <spanclass="anchor"id="line-274"></span><spanclass="anchor"id="line-275"></span><pclass="line867">
<h3id="head-005ca5f74d8bce890d581ce2a56eb3577e6514d8">1.3.4. Make the railgun do 1000 damage</h3>
<spanclass="anchor"id="line-276"></span><spanclass="anchor"id="line-277"></span><pclass="line862">So now we have railguns all-around. But it won't quite be Insta<ttclass="backtick"></tt>Gib unless it's one-hit-one-gib. To accomplish this, let's give the railgun a large amount of damage - 1000 should suffice. <spanclass="anchor"id="line-278"></span><spanclass="anchor"id="line-279"></span><pclass="line867"><ahref="/quake4/HitscanWeapons">HitscanWeapons</a> define their damage in their <ahref="/quake4/HitscanDefinition">HitscanDefinition</a>. In this case, the railgun's <ahref="/quake4/HitscanDefinition">HitscanDefinition</a>, hitscan_railgun_mp, uses the <ahref="/quake4/DamageDefinition">DamageDefinition</a> damage_railgun. Keeping in mind the rules of <ahref="/quake4/MultiplayerEntityDefinitions">MultiplayerEntityDefinitions</a>, we'll want to look at damage_railgun_mp. <spanclass="anchor"id="line-280"></span><spanclass="anchor"id="line-281"></span><pclass="line867"><strong>Quake4\instagib\def\weapons\railgun.def</strong><spanclass="anchor"id="line-282"></span><spanclass="anchor"id="line-283"></span><pre>entityDef damage_railgun_mp
<spanclass="anchor"id="line-288"></span></pre><spanclass="anchor"id="line-289"></span><spanclass="anchor"id="line-290"></span><pclass="line867"><em><strong>Let's bump that number up!</em></strong><spanclass="anchor"id="line-291"></span><spanclass="anchor"id="line-292"></span><pclass="line867"><strong>Quake4\instagib\def\weapons\railgun.def</strong><spanclass="anchor"id="line-293"></span><spanclass="anchor"id="line-294"></span><pre>entityDef damage_railgun_mp
<h3id="head-4fd91fdec9d96490faa8e759833d2452f933607d">1.3.5. Make the gauntlet do 1000 damage</h3>
<spanclass="anchor"id="line-302"></span><spanclass="anchor"id="line-303"></span><pclass="line862">As a final touch, let's add the gauntlet as a viable close-quarters option in our Insta<ttclass="backtick"></tt>Gib fragfest. We'll modify the gauntlet's <ahref="/quake4/DamageDefinition">DamageDefinition</a> to also do 1000 damage. <spanclass="anchor"id="line-304"></span><spanclass="anchor"id="line-305"></span><pclass="line867"><strong>Quake4\instagib\def\weapons\gauntlet.def</strong><spanclass="anchor"id="line-306"></span><spanclass="anchor"id="line-307"></span><pre>entityDef damage_gauntlet
<spanclass="anchor"id="line-322"></span></pre><spanclass="anchor"id="line-323"></span><spanclass="anchor"id="line-324"></span><pclass="line874">Change that sucker to <spanclass="anchor"id="line-325"></span><spanclass="anchor"id="line-326"></span><pclass="line867"><strong>Quake4\instagib\def\weapons\gauntlet.def</strong><spanclass="anchor"id="line-327"></span><spanclass="anchor"id="line-328"></span><pre>entityDef damage_gauntlet
<spanclass="anchor"id="line-343"></span></pre><spanclass="anchor"id="line-344"></span><spanclass="anchor"id="line-345"></span><pclass="line874">That completes the mod. <spanclass="anchor"id="line-346"></span><spanclass="anchor"id="line-347"></span><pclass="line867">
<spanclass="anchor"id="line-348"></span><spanclass="anchor"id="line-349"></span><pclass="line862">To test your mod, make sure your <em>instagib</em> directory is a subdirectory of your Quake 4 install. <spanclass="anchor"id="line-350"></span><spanclass="anchor"id="line-351"></span><pclass="line867"><spanclass="anchor"id="line-352"></span><pre>Default install: C:\Program Files\id Software\Quake 4
<spanclass="anchor"id="line-353"></span>
<spanclass="anchor"id="line-354"></span>Instagib should be in: C:\Program Files\id Software\Quake 4\instagib
<spanclass="anchor"id="line-355"></span></pre><spanclass="anchor"id="line-356"></span><spanclass="anchor"id="line-357"></span><pclass="line862">Navigate to C:\Program Files\id Software\Quake 4 and make a shortcut to Quake4.exe and re-name it <em>Insta<ttclass="backtick"></tt>Gib</em>. Edit the properties of the shortcut and add the following command line arguments to the shortcut. <spanclass="anchor"id="line-358"></span><spanclass="anchor"id="line-359"></span><pclass="line867"><spanclass="anchor"id="line-360"></span><pre>+set fs_game instagib +set developer 1
<spanclass="anchor"id="line-361"></span></pre><spanclass="anchor"id="line-362"></span><spanclass="anchor"id="line-363"></span><pclass="line862">You're done! Double click the shortcut to play your mod. See <ahref="/quake4/PackagingMods">PackagingMods</a> for how to distribute instagib to your friends. <spanclass="anchor"id="line-364"></span><spanclass="anchor"id="line-365"></span><pclass="line867"><aclass="attachment"href="/quake4/MakeAMod-InstaGib?action=AttachFile&do=get&target=q4-instagib.zip"title="attachment:q4-instagib.zip">Download the mod (Unzip to Quake 4\ directory)</a><spanclass="anchor"id="line-366"></span><hrclass="hr1"/><pclass="line874"><spanclass="anchor"id="line-367"></span>Questions? E-mail David <aclass="mailto"href="mailto:ddynerman@ravensoft.com">ddynerman@ravensoft.com</a><spanclass="anchor"id="line-368"></span><spanclass="anchor"id="bottom"></span></div><pid="pageinfo"class="info"lang="en"dir="ltr">MakeAMod-InstaGib (last edited 2005-11-09 17:26:33 by <spantitle="DavidDynerman @ 67.129.250.254[67.129.250.254]"><aclass="nonexistent"href="/quake4/DavidDynerman"title="DavidDynerman @ 67.129.250.254[67.129.250.254]">DavidDynerman</a></span>)</p>
<li><ahref="http://moinmoin.wikiwikiweb.de/">MoinMoin Powered</a></li><li><ahref="http://www.python.org/">Python Powered</a></li><li><ahref="http://validator.w3.org/check?uri=referer">Valid HTML 4.01</a></li>