help change starting weapons

Post tutorials on how to do certain tasks within game or engine code here.
Post Reply
Hazematman
Posts: 54
Joined: Thu Jul 15, 2010 1:58 am
Location: Canada

help change starting weapons

Post by Hazematman »

Hey just a quick question, which quake C file contains the code that tells you which weapons to start with, or is that coded into the engine?
ceriux
Posts: 2230
Joined: Sat Sep 06, 2008 3:30 pm
Location: Indiana, USA

Post by ceriux »

Code: Select all

oid() SetChangeParms =
{
	if (self.health <= 0)
	{
		SetNewParms ();
		return;
	}

// remove items
	self.items = self.items - (self.items & 
	(IT_KEY1 | IT_KEY2 | IT_INVISIBILITY | IT_INVULNERABILITY | IT_SUIT | IT_QUAD) );
	
// cap super health
	if (self.health > 100)
		self.health = 100;
	if (self.health < 50)
		self.health = 50;
	parm1 = self.items;
	parm2 = self.health;
	parm3 = self.armorvalue;
	if (self.ammo_shells < 25)
		parm4 = 25;
	else
		parm4 = self.ammo_shells;
	parm5 = self.ammo_nails;
	parm6 = self.ammo_rockets;
	parm7 = self.ammo_cells;
	parm8 = self.weapon;
	parm9 = self.armortype * 100;
};

void() SetNewParms =
{
	parm1 = IT_SHOTGUN | IT_AXE;
	parm2 = 100;
	parm3 = 0;
	parm4 = 25;
	parm5 = 0;
	parm6 = 0;
	parm7 = 0;
	parm8 = 1;
	parm9 = 0;
};

void() DecodeLevelParms =
{
	if (serverflags)
	{
		if (world.model == "maps/start.bsp")
			SetNewParms ();		// take away all stuff on starting new episode
	}
	
	self.items = parm1;
	self.health = parm2;
	self.armorvalue = parm3;
	self.ammo_shells = parm4;
	self.ammo_nails = parm5;
	self.ammo_rockets = parm6;
	self.ammo_cells = parm7;
	self.weapon = parm8;
	self.armortype = parm9 * 0.01;
};
leileilol
Posts: 2783
Joined: Fri Oct 15, 2004 3:23 am

Re: help change starting weapons

Post by leileilol »

Hazematman wrote:which quake C file
client.qc

answered!
i should not be here
Hazematman
Posts: 54
Joined: Thu Jul 15, 2010 1:58 am
Location: Canada

Post by Hazematman »

Ok much appreciated for telling me the file. thanks!
Mexicouger
Posts: 514
Joined: Sat May 01, 2010 10:12 pm
Contact:

Post by Mexicouger »

You need to modify this stuff in Client.qc

Code: Select all

void() SetNewParms =
{
	parm1 = IT_SHOTGUN;    // Modify this little piece to             whatever weapon you want
	parm2 = 99;
	parm3 = 0;
	parm4 = 100;
	parm5 = 1;
	parm6 = 0;
	parm7 = 0;
	parm8 = 1;  //This is the actual weapon you start with. 1= IT_SHOTGUN
	parm9 = 0;
	parm10 = 0;
};
To add weapons to start with, in parm1, Do this:

Code: Select all

parm1 = IT_SHOTGUN | IT_AXE | IT_ROCKET_LAUNCHER;
| means or. So you can cycle between any of the weapons you add. Still learning myself :?
Baker
Posts: 3666
Joined: Tue Mar 14, 2006 5:15 am

Re: help change starting weapons

Post by Baker »

Hazematman wrote:Hey just a quick question, which quake C file contains the code that tells you which weapons to start with, or is that coded into the engine?
Hazematman ...

Could you post these questions in the QuakeC section in the future?

Because you aren't posting a tutorial and they really don't go here.

I know you are new, it's no big deal. But still this section is for posting tutorials.
The night is young. How else can I annoy the world before sunsrise? 8) Inquisitive minds want to know ! And if they don't -- well like that ever has stopped me before ..
Hazematman
Posts: 54
Joined: Thu Jul 15, 2010 1:58 am
Location: Canada

Post by Hazematman »

Ok, I did not know that il post my next question in that section. thanks for telling me.
Post Reply