Inside3D!
     

help change starting weapons

 
Post new topic   Reply to topic    Inside3d Forums Forum Index -> Programming Tutorials
View previous topic :: View next topic  
Author Message
Hazematman



Joined: 15 Jul 2010
Posts: 31

PostPosted: Thu Jul 15, 2010 6:04 pm    Post subject: help change starting weapons Reply with quote

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?
Back to top
View user's profile Send private message
ceriux



Joined: 06 Sep 2008
Posts: 968
Location: Florida, USA

PostPosted: Thu Jul 15, 2010 6:10 pm    Post subject: Reply with quote

Code:
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;
};

_________________
QuakeDB - Quake ModDB Group
Back to top
View user's profile Send private message Yahoo Messenger
leileilol



Joined: 15 Oct 2004
Posts: 1321

PostPosted: Thu Jul 15, 2010 6:18 pm    Post subject: Re: help change starting weapons Reply with quote

Hazematman wrote:
which quake C file


client.qc

answered!
_________________
Back to top
View user's profile Send private message
Hazematman



Joined: 15 Jul 2010
Posts: 31

PostPosted: Thu Jul 15, 2010 6:19 pm    Post subject: Reply with quote

Ok much appreciated for telling me the file. thanks!
Back to top
View user's profile Send private message
Mexicouger



Joined: 01 May 2010
Posts: 129

PostPosted: Thu Jul 15, 2010 10:58 pm    Post subject: Reply with quote

You need to modify this stuff in Client.qc

Code:
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:
parm1 = IT_SHOTGUN | IT_AXE | IT_ROCKET_LAUNCHER;


| means or. So you can cycle between any of the weapons you add. Still learning myself Confused
_________________
Gosh... debby ryan Is hot. I swear I will mary her...

My project Prime for psp:

http://www.moddb.com/games/primepsp1

We have a website, But are getting a new one.
Back to top
View user's profile Send private message Yahoo Messenger MSN Messenger
Baker



Joined: 14 Mar 2006
Posts: 1538

PostPosted: Fri Jul 16, 2010 12:53 am    Post subject: Re: help change starting weapons Reply with quote

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.
_________________
Tomorrow Never Dies. I feel this Tomorrow knocking on the door ...
Back to top
View user's profile Send private message
Hazematman



Joined: 15 Jul 2010
Posts: 31

PostPosted: Fri Jul 16, 2010 12:55 am    Post subject: Reply with quote

Ok, I did not know that il post my next question in that section. thanks for telling me.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Inside3d Forums Forum Index -> Programming Tutorials All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2004 phpBB Group