Re: [hlcoders] Making weapons use magazines?

2005-01-20 Thread Beppo
Exactly, make a pointer chain/list, let it sort by amount so that the
'best/fullest' mag is always the first one in the list.
On reload you need to move the old mag back into this list if it wasn't
empty.
This way you can reload one mag after another and each mag holds its own
amount of rounds still left in it.
--
Norbert Bogenrieder aka Beppo Lead Programmer and Project Lead
[EMAIL PROTECTED]   Sentry Studios - Infiltration
[EMAIL PROTECTED]  http://www.sentrystudios.net
http://infiltration.sentrystudios.net

- Original Message -
From: Draco [EMAIL PROTECTED]
To: hlcoders@list.valvesoftware.com
Sent: Wednesday, January 19, 2005 1:16 PM
Subject: Re: [hlcoders] Making weapons use magazines?

Then you will have to create a pointer to a struct like ClipMemory or
something. whenever you reload old clip find its ammo, do not decrease
clip amount.
If you want to be able to select old clips then you could make a
linked list that is accessed by some sort of VGUI inventory screen,
and you could load each one.
Personally, old clips sounds like a crappy idea, but that's just me,
you go right ahead and try it.
**
Draco
Coder for Perfect Dark
http://perfectdark.game-mod.net
___
To unsubscribe, edit your list preferences, or view the list archives,
please visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders

___
To unsubscribe, edit your list preferences, or view the list archives, please 
visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders


Re: [hlcoders] Making weapons use magazines?

2005-01-19 Thread Draco
Then you will have to create a pointer to a struct like ClipMemory or
something. whenever you reload old clip find its ammo, do not decrease
clip amount.
If you want to be able to select old clips then you could make a
linked list that is accessed by some sort of VGUI inventory screen,
and you could load each one.

Personally, old clips sounds like a crappy idea, but that's just me,
you go right ahead and try it.


**
Draco
Coder for Perfect Dark
http://perfectdark.game-mod.net

___
To unsubscribe, edit your list preferences, or view the list archives, please 
visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders



Re: [hlcoders] Making weapons use magazines?

2005-01-18 Thread Draco
What I would do is change the carry ammo in your player to be the
amount of clips in reserve, just give it a smaller number. each ammo
object you touch gives you 1 more of that number, not 30 or whater.
then in your reload, you --decrement the carry ammo variable and set
the m_iClip variable in the gun to whatever max clip is.

Also, if you want to show a clip dropping out(like in the specialists)
precahce the ammo model for that gun and EjectBrass it(or whatever
Source uses to make ejecting shells)

--

**
Draco
Coder for Perfect Dark
http://perfectdark.game-mod.net

___
To unsubscribe, edit your list preferences, or view the list archives, please 
visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders



RE: [hlcoders] Making weapons use magazines?

2005-01-18 Thread Tony \omega\ Sergi
Thats exactly what I did for clips. It's the most simplest way.
Ie: the max ammo the gun can take is say 6 meaning, 6 clips. Then you have
clipsize set somewhere.
When you pick up ammo, it would give 1 or 2, meaning, 1 or 2 reloads. Not 1
or 2 rounds. The hud then already works fine, you'd just need to change the
icons on the hud or whatever. Then it'll show current clip's rounds /
numclips on the hud.

You just have to modify all the ammo pickup stuff, and the way ammo is
packed. Yuou can also reduce bandwidth by changing the send/receive stuff to
use a smaller bitsize for ammo too ;)

-Original Message-
From: Draco [mailto:[EMAIL PROTECTED]
Sent: January 18, 2005 4:39 AM
To: hlcoders@list.valvesoftware.com
Subject: Re: [hlcoders] Making weapons use magazines?

What I would do is change the carry ammo in your player to be the
amount of clips in reserve, just give it a smaller number. each ammo
object you touch gives you 1 more of that number, not 30 or whater.
then in your reload, you --decrement the carry ammo variable and set
the m_iClip variable in the gun to whatever max clip is.

Also, if you want to show a clip dropping out(like in the specialists)
precahce the ammo model for that gun and EjectBrass it(or whatever
Source uses to make ejecting shells)

--

**
Draco
Coder for Perfect Dark
http://perfectdark.game-mod.net

___
To unsubscribe, edit your list preferences, or view the list archives,
please visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders



--
No virus found in this incoming message.
Checked by AVG Anti-Virus.
Version: 7.0.300 / Virus Database: 265.7.0 - Release Date: 17/01/2005


--
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.300 / Virus Database: 265.7.0 - Release Date: 17/01/2005



___
To unsubscribe, edit your list preferences, or view the list archives, please 
visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders



Re: [hlcoders] Making weapons use magazines?

2005-01-18 Thread SB Childe Roland
Yeah, but this doesn't allow him to reload partially used magazines
later, like he said he wanted to.


On Tue, 18 Jan 2005 18:23:10 -0500, Tony omega Sergi
[EMAIL PROTECTED] wrote:
 That's exactly what I did for clips. It's the most simplest way.
 Ie: the max ammo the gun can take is say 6 meaning, 6 clips. Then you have
 clipsize set somewhere.
 When you pick up ammo, it would give 1 or 2, meaning, 1 or 2 reloads. Not 1
 or 2 rounds. The hud then already works fine, you'd just need to change the
 icons on the hud or whatever. Then it'll show current clip's rounds /
 numclips on the hud.

 You just have to modify all the ammo pickup stuff, and the way ammo is
 packed. Yuou can also reduce bandwidth by changing the send/receive stuff to
 use a smaller bitsize for ammo too ;)


--
=
SB Childe Roland
I will show you fear in a handful of jellybeans.

___
To unsubscribe, edit your list preferences, or view the list archives, please 
visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders



[hlcoders] Making weapons use magazines?

2005-01-17 Thread Neonic
Basically I am trying to make a system where you reload using
magazines.  So instead of showing 30 - 120 ammo down at the bottom I
want it to say 30 - 4 or whatever.  I also wanted to make it to where
if you reload with 4 ammo in the magazine that when you reload, you
recycle the magazines so if you have 4 clips, you shoot 15 bullets,
then reload 4 times, your back to a clip with 15/30 bullets in it.  To
do this I started by making a structure like so:

typedef struct magazine{ int AmmoLeft };

Then I added an instance of that structure ( magazine magazine[4]; )
in the CWeaponMP5 and 2 new ints called CurrentMagazine and
NextMagazine.  Now I have several questions.

One is where do I place the initialization of the amount of ammo in
the clip.  For instance I first put magazine[0].AmmoLeft = 30; in the
CWeaponMP5::Deploy, but then I realized that that would be called
every time I switched from shotgun and then back.

Another Question is what should I use to subtract ammo from my clip,
should I add in the Reload Function a line that says
magazine[CurrentMagazine].AmmoLeft -= pPlayer-m_iShotsFired, or in
primary fire should I add a call that just says
magazine[CurrentMagazine].AmmoLeft--;.

In the reload function there is a call to DefaultReload.  This looks
like it is based strictly on the default ammo, so should i just
comment that out and in CWeaponSDK::Reload just add the code to send
the animation events and such.

Also what file is the code that controls the Ammo display on the hud
modified? hud_numericdisplay.cpp?.

P.S. When I add a DevMsg(test.\n); in the CWeaponMP5::PrimaryAttack,
it always prints out the message twice... why is that?

___
To unsubscribe, edit your list preferences, or view the list archives, please 
visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders



Re: [hlcoders] Making weapons use magazines?

2005-01-17 Thread Justin Harvey

Quoting Neonic [EMAIL PROTECTED]:

 Basically I am trying to make a system where you reload using
 magazines.  So instead of showing 30 - 120 ammo down at the bottom I
 want it to say 30 - 4 or whatever.  I also wanted to make it to where
 if you reload with 4 ammo in the magazine that when you reload, you
 recycle the magazines so if you have 4 clips, you shoot 15 bullets,
 then reload 4 times, your back to a clip with 15/30 bullets in it.  To
 do this I started by making a structure like so:

I think your making it too complicated. How about when you hit reload it
discards any ammo left in the magazine, and then on the hud divide the ammo
reserve by magazine size?

 Also what file is the code that controls the Ammo display on the hud
 modified? hud_numericdisplay.cpp?.

Mod hud_ammo.cpp or whatever it's called not hud_numericdisplay.cpp(which is
used for things like health as well).

 P.S. When I add a DevMsg(test.\n); in the CWeaponMP5::PrimaryAttack,
 it always prints out the message twice... why is that?

It gets called on both client and server.

--
www.neotokyohq.com

___
To unsubscribe, edit your list preferences, or view the list archives, please 
visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders