1. Quake 4 InstaGib

In this mod we will replace all weapons with the railgun, and additionally have the railgun do 1000 damage.

Areas Modified: DefinitionFiles
Difficulty: Beginner
Download the mod

1.1. Overview

To implement something like InstaGib, modifying def files is the easiest approach. Def files specify the properties of almost every gameplay element in the game. Specifically, by editing the appropriate def file we'll be able to change the railgun damage, etc.

1.2. Getting Started

First, we'll setup our ModDirectory. A good way to start is to copy over the files we'll be editing. This gives us a good base to work off.

  1. Create a Quake 4\instagib directory. Create this is a sub-directory of your Quake 4 installation. This will be our ModDirectory.

  2. Create sub-directories that will hold our mod's def files

    1. Quake4\instagib\def
    2. Quake4\instagib\def\weapons
  3. Open Quake4\baseq4\pak001.pk4 (see the article on pk4 files for information on how to open them)

  4. Extract the following files from pak001.pk4 and copy them to the mod directory
    • Quake4\instagib\def
      
      pak001.pk4\def\player.def -> Quake4\instagib\def
      pak001.pk4\def\ammo.def -> Quake4\instagib\def
      
      Quake4\instagib\def\weapons
      
      pak001.pk4\def\weapons\gauntlet.def -> Quake4\instagib\def\weapons
      pak001.pk4\def\weapons\dmg.def -> Quake4\instagib\def\weapons
      pak001.pk4\def\weapons\grenadelauncher.def -> Quake4\instagib\def\weapons
      
      pak001.pk4\def\weapons\hyperblaster.def -> Quake4\instagib\def\weapons
      pak001.pk4\def\weapons\lightninggun.def -> Quake4\instagib\def\weapons
      
      pak001.pk4\def\weapons\machinegun.def -> Quake4\instagib\def\weapons
      pak001.pk4\def\weapons\nailgun.def -> Quake4\instagib\def\weapons
      
      pak001.pk4\def\weapons\rocketlauncher.def -> Quake4\instagib\def\weapons
      pak001.pk4\def\weapons\shotgun.def -> Quake4\instagib\def\weapons
      

1.3. Time to mod!

Now that we've got our mod directory setup we can get crackin'. We'll create Quake 4 InstaGib in five steps.

  1. Replace each weapon pickup with railgun weapon pickup This will turn all weapon pickup entities 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.

  2. Replace all ammo pickups with railgun ammo 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.

  3. Make the railgun the player's starting weapon Otherwise, players will still spawn in with machine guns on our rail-only maps

  4. Make the railgun do 1000 damage Ahh the coup-de-grace, gibs-ahoy.

  5. Make the gauntlet do 1000 damage We'll add some close-quarters instagibbing as well.

1.3.1. Replace each weapon pickup with railgun weapon pickup

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 MapFile 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.

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.

This means that any map we run with our mod will only have railguns.

We'll be modifying each weapon pickup's EntityDefinition to have it give the player a railgun regardless of the type of pickup.

The entity def for weapon pickups placed in maps are called weapon_weaponname, and are located in the def files in def\weapons

Use a text editor (such as Notepad) to open up Quake4\instagib\def\weapons\dmg.def. Scroll down to the EntityDefinition named weapon_dmg_mp. (See the note on MultiplayerEntityDefinitions)






1.3.2. Replace all ammo pickups with railgun ammo

Now that we've got all the weapon pickups acting like railguns, we'll do the same thing for ammo pickups.

Quake4\instagib\def\ammo.def

entityDef ammo_machinegun_mp
{
        "inherit"                               "ammo_railgun_mp"
}

entityDef ammo_nailgun_mp
{
        "inherit"                               "ammo_railgun_mp"
}

entityDef ammo_shotgun_mp
{
        "inherit"                               "ammo_railgun_mp"
}

entityDef ammo_hyperblaster_mp
{
        "inherit"                               "ammo_railgun_mp"
}

entityDef ammo_rocketlauncher_mp
{
        "inherit"                               "ammo_railgun_mp"
}

entityDef ammo_grenadelauncher_mp
{
        "inherit"                               "ammo_railgun_mp"
}

entityDef ammo_lightninggun_mp
{       
        "inherit"                               "ammo_railgun_mp"
}

entityDef ammo_dmg_mp
{
        "inherit"                               "ammo_railgun_mp"
}

1.3.3. Make the railgun the player's starting weapon

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.

Let's take a look at the multiplayer player EntityDefinition, player_marine_mp. It's a big definition, so we'll only show the relevant parts.

Quake4\instagib\def\player.def

entityDef player_marine_mp  
{
        "inherit"                       "player_marine"

        "weapon"                        "weapon_machinegun,weapon_gauntlet"
        "current_weapon"                "1"
...
        "ammo_none"                     "-1"
        "ammo_railgun"                  "0"
        "ammo_machinegun"               "100"
        "ammo_nailgun"                  "0"
        "ammo_blaster"                  "-1"
        "ammo_shotgun"                  "0"
        "ammo_hyperblaster"             "0"
        "ammo_rocketlauncher"           "0"
        "ammo_grenadelauncher"          "0"
...
}

The "weapon" KeyValue 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

Quake4\instagib\def\player.def

entityDef player_marine_mp  
{
...
        "weapon"                        "weapon_railgun,weapon_gauntlet"
        "current_weapon"                "7"
...
}

Make sure you leave the rest of the lines alone - we'll need them to keep everything working with the player.

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.

Quake4\instagib\def\player.def

entityDef player_marine_mp  
{
...
        "ammo_none"                     "-1"
        "ammo_railgun"                  "10"
        "ammo_machinegun"               "0"
        "ammo_nailgun"                  "0"
        "ammo_blaster"                  "-1"
        "ammo_shotgun"                  "0"
        "ammo_hyperblaster"             "0"
        "ammo_rocketlauncher"           "0"
        "ammo_grenadelauncher"          "0"
...
}

That's it for the player.def.

1.3.4. Make the railgun do 1000 damage

So now we have railguns all-around. But it won't quite be InstaGib unless it's one-hit-one-gib. To accomplish this, let's give the railgun a large amount of damage - 1000 should suffice.

HitscanWeapons define their damage in their HitscanDefinition. In this case, the railgun's HitscanDefinition, hitscan_railgun_mp, uses the DamageDefinition damage_railgun. Keeping in mind the rules of MultiplayerEntityDefinitions, we'll want to look at damage_railgun_mp.

Quake4\instagib\def\weapons\railgun.def

entityDef damage_railgun_mp 
{
        "inherit"                                       "damage_railgun"
        "damage"                                        "100"
}

Let's bump that number up!

Quake4\instagib\def\weapons\railgun.def

entityDef damage_railgun_mp 
{
        "inherit"                                       "damage_railgun"
        "damage"                                        "1000"
}

1.3.5. Make the gauntlet do 1000 damage

As a final touch, let's add the gauntlet as a viable close-quarters option in our InstaGib fragfest. We'll modify the gauntlet's DamageDefinition to also do 1000 damage.

Quake4\instagib\def\weapons\gauntlet.def

entityDef damage_gauntlet
{
        "damage"                                        "50"
        "gib"                                           "1"

        "dv_time"                                       "100"
        "dv_scale"                                      ".05"

        "deathPush"                                     "200"
        "deathPushMin"                                  "2000 400"
        "deathPushMax"                                  "4000 500"
        "knockback"                                     "50"
        
        "bleed"                                         "1"
}

Change that sucker to

Quake4\instagib\def\weapons\gauntlet.def

entityDef damage_gauntlet
{
        "damage"                                        "1000"
        "gib"                                           "1"

        "dv_time"                                       "100"
        "dv_scale"                                      ".05"

        "deathPush"                                     "200"
        "deathPushMin"                                  "2000 400"
        "deathPushMax"                                  "4000 500"
        "knockback"                                     "50"
        
        "bleed"                                         "1"
}

That completes the mod.

1.4. Testing

To test your mod, make sure your instagib directory is a subdirectory of your Quake 4 install.

Default install: C:\Program Files\id Software\Quake 4

Instagib should be in: C:\Program Files\id Software\Quake 4\instagib

Navigate to C:\Program Files\id Software\Quake 4 and make a shortcut to Quake4.exe and re-name it InstaGib. Edit the properties of the shortcut and add the following command line arguments to the shortcut.

+set fs_game instagib +set developer 1

You're done! Double click the shortcut to play your mod. See PackagingMods for how to distribute instagib to your friends.

Download the mod (Unzip to Quake 4\ directory)


Questions? E-mail David ddynerman@ravensoft.com

MakeAMod-InstaGib (last edited 2005-11-09 17:26:33 by DavidDynerman)