Simple Weapon Naming

Inside3D
 • Front Page
 • Articles
 • Downloads
 • Forums
 • Hosting
 • Help Wanted
 • Interviews
 • Reviews
 • Staff

 
Allied Sites
 - AI Cafe
 - Bot Epidemic
 - Dark Places
 - Flat Earth
 - FrikBot
 - Ghoulish Art
 - Kilbert3D
 - Quake Info Pool
 - QSG: Quake Standards
 - Rusted Fork
 - Stroggs Gone Mad
 - More...
 
Quake
 - Getting Started
 - QuakeC Specs v1.0
 - QuakeC Tutorials
 - Quake Mod Index
 
Quake II
 - Getting Started
 - dll Sourcecode
 - Coding Tutorials
 
.dll Central
 - Getting Started
 - Learning
 - dll Primer
 - dll in C
 - dll in Delphi
 - Compilers
 
Jedi Knight
 - Getting Started
 - COG Specs
 - Sound Specs
 - Tutorials
 
Level Editing
 - Tutorials/Tips
 
 
Telefragged!!!
Created By: Marius
eMail: lordshoel@yahoo.com
Difficulty Scale: Easy


Ever played normal Quake nad not know what weapon your selecting? Want to have a button to tell you what weapon you have? If you do follow this really simple tutorial and in notime you'll have weapon names on selection...

Step 1.

This is a very simple tutorial. Lets get started by opening up Weapons.qc and scrolling down to the W_ChangeWeapon function. Found it? If you have paste the below code just above that function.

/*
===============
WeaponName - Prints Weapon Name
===============
*/
void() WeaponName =
{
      local string weapname;

      if (self.weapon == IT_AXE)weapname = "Double-Handed Axe";
      else if (self.weapon == IT_SHOTGUN)weapname = "Shotgun";
      else if (self.weapon == IT_SUPER_SHOTGUN)weapname = "Double Barrel Shotgun";
      else if (self.weapon == IT_NAILGUN)weapname = "Nailgun";
      else if (self.weapon == IT_SUPER_NAILGUN)weapname = "Super Nailgun";
      else if (self.weapon == IT_GRENADE_LAUNCHER)weapname = "Grenade Launcher";
      else if (self.weapon == IT_ROCKET_LAUNCHER)weapname = "Rocket Launcher";
      else if (self.weapon == IT_LIGHTNING)weapname = "Thunderbolt";

      sprint (self, weapname);
      sprint (self, "\n");
        
};

Step 2.

Once you've done that scroll down to the last line of W_ChangeWeapon. It should look like this:

//
// set weapon, set ammo
//
	self.weapon = fl;		
	W_SetCurrentAmmo ();
Now replace that code with the following code over that:

//
// set weapon, set ammo
//
	self.weapon = fl;		
	W_SetCurrentAmmo ();
	WeaponName ();			//Prints Weapon Name

Step 3.

Now scroll down to the ImpulseCommands function and above QuadCheat paste:

		if (self.impulse == 15)WeaponName ();	//Prints Current Weapon

Step 4.

Thats it! Save and Compile. Its an easy and simple tutorial that may come in handy. The best bit is it compatible with most mods so if you wish to include it go ahead, its only 4 steps and its completed. Have fun and happy gamig.






The Inside3D content and design is copyrighted by the Inside3D team, and may not be re-produced or copied without proper consent. All rights reserved. Any work credited to any author not part of InsideQC is copyrighted by that author. If you have any feedback, suggestions or flames please send it in to the author. Inside3D is hosted by telefragged and the design was originated by project-9.