Navigation

 Weapon Defining Feature Type: Coding Tutorials     Added: 05/01  
  Author: Corven 

Weapon defining in Quake3 is a lot like Quake2.

Code to be Deleted or Commented out
Code to be Added or Changed

Look in bg_misc.c and find the part of the file that looks like this, start at the top and work down, past health, past armour then you'll get to the weapons, we'll use the shotgun as an example.

/*QUAKED weapon_shotgun (.3 .3 1) (-16 -16 -16) (16 16 16) suspended
*/
{
"weapon_shotgun",
"sound/misc/w_pkup.wav",
{ "models/weapons2/shotgun/shotgun.md3",
0, 0, 0},
/* icon */ "icons/iconw_shotgun",
/* pickup */ "Shotgun",
10,
IT_WEAPON,
WP_SHOTGUN,
/* precache */ "",
/* sounds */ ""
},

Ok, here is where the shotgun is defined. Now I will explain what each part means.

/*QUAKED weapon_shotgun (.3 .3 1) (-16 -16 -16) (16 16 16) suspended -- Just the name of the weapon
*/
{
"weapon_shotgun", -- What the map editors call the weapon when you place it in a map
"sound/misc/w_pkup.wav", -- Sound used when you pick up the weapon
{ "models/weapons2/shotgun/shotgun.md3", -- Model used for the pickup state of the weapon
0, 0, 0}, these are additional models required
/* icon */ "icons/iconw_shotgun", -- The icon on the screen that shows up when you have this weapon selected
/* pickup */ "Shotgun", -- This is what the gun is called when you switch to it or pick it up.
10, -- How much ammo you get when you pick it up
IT_WEAPON, -- Item definition
WP_SHOTGUN, -- What weapon name is actually used for the weapon
/* precache */ "", -- additional sounds required
/* sounds */ ""
},

Comments »



  Page 1

  Comments ( 0 )


  Features Index

  Home

Copyright © 2001 MGON International AB - Privacy statement