How do I change the Max Ammo capacity? Created 9 years ago2015-01-08 22:34:34 UTC by CalicoCanvas CalicoCanvas

Created 9 years ago2015-01-08 22:34:34 UTC by CalicoCanvas CalicoCanvas

Posted 9 years ago2015-01-08 22:34:34 UTC Post #323158
Like, For Example, The Gluon Gun has 100 maximum ammo. I want to change that to 600. But, how?
Posted 9 years ago2015-01-08 23:36:38 UTC Post #323159
Well, that's almost certainly a coding job, in case that's a problem. Someone else around here can give more details, I'm sure.
Jessie JessieTrans Rights <3
Posted 9 years ago2015-01-09 19:21:23 UTC Post #323168
IIRC aren't the max ammos for each weapon defined in weapons.h?
Suparsonik SuparsonikI'm going off the edge to meet my maker.
Posted 9 years ago2015-01-15 05:40:39 UTC Post #323297
The Egon/Gluon Gun shares the same ammo (cells) and ammo capacity with the
Gauss Gun, so you have 2 options here; separate the ammo capacities for
each weapon or make one simple change and bump up the capacity for both.

Option 1 (change capacity for both):
Open weapons.h and change this line:
#define URANIUM_MAX_CARRY 100
to
#define URANIUM_MAX_CARRY 600
OR

Option 2 (change capacity for Egon alone):
Open weapons.h and find this line:
#define URANIUM_MAX_CARRY 100
Below it add this line:
#define EGON_MAX_CARRY 600
Now open egon.cpp and change this line in GetItemInfo():
p->iMaxAmmo1 = URANIUM_MAX_CARRY;
to
p->iMaxAmmo1 = EGON_MAX_CARRY;
Save your changes and recompile the Half-Life DLL and you're set.

EDIT (JAN-15-2015)

Ok, I just doublechecked and you will need to do some client-side coding
as well. The ammo count message that the server sends to the clients only
allow ammo counts that clamp to one byte (254 actually, Thanks VALVe).
You will need to modify the AmmoX user message in player.cpp
to take a short instead of a byte and modify the corresponding message
handler in ammo.cpp to read a short in the client DLL folder.
You must be logged in to post a response.