[page=Introduction]
Okay Just click on a chapter/Subject you want to Change
also you are working in the weapon.h the whole tutorial
[page=Weapon Capacities]
open weapons.h and go to line 108
There you will see:
// weapon clip/carry ammo capacities
#define URANIUM_MAX_CARRY 100
#define _9MM_MAX_CARRY 200
#define _357_MAX_CARRY 36
#define BUCKSHOT_MAX_CARRY 125
#define BOLT_MAX_CARRY 50
#define ROCKET_MAX_CARRY 5
#define HANDGRENADE_MAX_CARRY 10
#define SATCHEL_MAX_CARRY 5
#define TRIPMINE_MAX_CARRY 5
#define SNARK_MAX_CARRY 15
#define HORNET_MAX_CARRY 100
#define M203_GRENADE_MAX_CARRY 10
**Remember, This is how much you can carry on you at a time for a reload. lets say you get a glock 7/200 <<< thats the number your changing
[page=Weight Factors(how fast you run with weapon etc)]
Okay, Line 92, search it... in the Weapon.h.
now you should see this...
// weapon weight factors (for auto-switching) (-1 = noswitch)
#define CROWBAR_WEIGHT 0
#define GLOCK_WEIGHT 10
#define PYTHON_WEIGHT 15
#define MP5_WEIGHT 15
#define SHOTGUN_WEIGHT 15
#define CROSSBOW_WEIGHT 10
#define RPG_WEIGHT 20
#define GAUSS_WEIGHT 20
#define EGON_WEIGHT 20
#define HORNETGUN_WEIGHT 10
#define HANDGRENADE_WEIGHT 5
#define SNARK_WEIGHT 5
#define SATCHEL_WEIGHT -10
#define TRIPMINE_WEIGHT -10
Explanation: 0 = Normal Speed of running, the higher it gets the slower the player runs... if you go below zero -10 for say, you run faster then normal... So change it on your accord. 20 is the heaviest in this case.
[page=Ammo in a Clip]
This is abit easy all the Value changes are under each other heres the next one
// the maximum amount of ammo each weapon's clip can hold
#define WEAPON_NOCLIP -1
//#define CROWBAR_MAX_CLIP WEAPON_NOCLIP
#define GLOCK_MAX_CLIP 17
#define PYTHON_MAX_CLIP 6
#define MP5_MAX_CLIP 50
#define MP5_DEFAULT_AMMO 25
#define SHOTGUN_MAX_CLIP 8
#define CROSSBOW_MAX_CLIP 5
#define RPG_MAX_CLIP 1
#define GAUSS_MAX_CLIP WEAPON_NOCLIP
#define EGON_MAX_CLIP WEAPON_NOCLIP
#define HORNETGUN_MAX_CLIP WEAPON_NOCLIP
#define HANDGRENADE_MAX_CLIP WEAPON_NOCLIP
#define SATCHEL_MAX_CLIP WEAPON_NOCLIP
#define TRIPMINE_MAX_CLIP WEAPON_NOCLIP
#define SNARK_MAX_CLIP WEAPON_NOCLIP
Okay well simply Change the Glock to like a 7 so now it has 7 bullets per clip :P so change the number, unless you want it to have no clip there for you would use the Value WEAPON_NOCLIP
[page=Ammo in gun at pickup]
// the default amount of ammo that comes with each gun when it spawns
#define GLOCK_DEFAULT_GIVE 17
#define PYTHON_DEFAULT_GIVE 6
#define MP5_DEFAULT_GIVE 25
#define MP5_DEFAULT_AMMO 25
#define MP5_M203_DEFAULT_GIVE 0
#define SHOTGUN_DEFAULT_GIVE 12
#define CROSSBOW_DEFAULT_GIVE 5
#define RPG_DEFAULT_GIVE 1
#define GAUSS_DEFAULT_GIVE 20
#define EGON_DEFAULT_GIVE 20
#define HANDGRENADE_DEFAULT_GIVE 5
#define SATCHEL_DEFAULT_GIVE 1
#define TRIPMINE_DEFAULT_GIVE 1
#define SNARK_DEFAULT_GIVE 5
#define HIVEHAND_DEFAULT_GIVE 8
okay this is the next line, this just shows or repersents how much ammo is given with the gun when you first pick it up. this can be changed, by simply changing the numbers.
[page=Ammo Box Pick ups]
// The amount of ammo given to a player by an ammo item.
#define AMMO_URANIUMBOX_GIVE 20
#define AMMO_GLOCKCLIP_GIVE GLOCK_MAX_CLIP
#define AMMO_357BOX_GIVE PYTHON_MAX_CLIP
#define AMMO_MP5CLIP_GIVE MP5_MAX_CLIP
#define AMMO_CHAINBOX_GIVE 200
#define AMMO_M203BOX_GIVE 2
#define AMMO_BUCKSHOTBOX_GIVE 12
#define AMMO_CROSSBOWCLIP_GIVE CROSSBOW_MAX_CLIP
#define AMMO_RPGCLIP_GIVE RPG_MAX_CLIP
#define AMMO_URANIUMBOX_GIVE 20
#define AMMO_SNARKBOX_GIVE 5
Okay this is the last one. but it speaks for itself, you pick up bullets or a box of bullets and it adds the amount that you have typed in here
[page=Disabling Weapons you dont want used]
Okay this is a quick explanation how you can stop a weapon from being used. ill use some codes from here and ill disable the RPG ill do them in according chapter order to!
//First line to edit to disable weapon
//default is 5 im changing it to 0
#define ROCKET_MAX_CARRY 0
heres a little punishment for those people who use amx and make the rocket accesible
#define RPG_WEIGHT 90
that i just defined is practically, well not moving
and the last code to change...
#define RPG_MAX_CLIP 1
change to
#define RPG_MAX_CLIP 0
Now your done when they get the weapon it will show up
but they cannot pull it out or use it. and if amx modders get by that. they have to worry about weight issues, you wont be able to walk. but thats something i pulled on my friend, he tried to fix the rpg weight for days, then i told him :D
ANYWAYS HOPE YOU ENJOYED IT its easy as hell a newb could understand this.
(buried)
Hmm... its a good enough tut. HOWEVER you did not specify what game it is (I assume Half-Life 2?) and what editor you are using to make it (Hammer?) and because of that, this is useless.
u r really sily, u ******.
retarded...
hey says if you CAN read for half-life 1
Alright, i will do the man's job.
This is meant for the game Half Life (not 2).
You must use a piece of C++ programming language software which can compile dll files. Therefore, it's not useless, unless you don't have a C++ software (like Dev-C++), or Half Life (which i'm assuming, you have).
And the guy above me said you can't read, but if you wrote that comment, it makes no sense, because anybody who can read, can write, and the opposite, and the negative (who can't read, can't write, but i'm not sure).
Wow Admer thank you,very cool!
You're welcome, mate. But this is an old post of mine, I'd better update it.
Since I cannot edit old posts, I'm gonna have to post one here:
The tutorial is clearly meant for Half-Life 1. You can compile the source code into a DLL using an IDE like Visual Studio (compilers other than MSVC are hardly gonna work IIRC - so don't do Dev-C++, Codeblocks or anything like that).
For any (absolute) beginner who happens to be reading the comments: before compiling, make sure to open the project file or a solution file. If you got SDK 2.3, it's likely a .dsp file which is meant for Visual Studio 6.0. The official HL SDK 2.4 on GitHub is meant for Visual Studio 2010 and there you'll find a .sln file.
Once in the solution file, you can finally try to compile. If all you do is open the weapons.h file alone (not from within the project), it's not gonna compile, lol.
People have also asked *where* weapons.h is at: it's in the Half-Life SDK code. Comments are pretty old so they mention SDK 2.3. But the latest is 2.4, and can be found on GitHub. Have fun. :)
This comment is currently awaiting admin approval, join now to view.
Why do you think there's a big Half-Life 1 logo in front of the title :P
how about adding new weapons then?
i have steam and can't find the "weapon.h" file
(buried)
You need to download the Half Life Source SDK 1.3
source SDK?
i thought this was for the GoldSrc Version?
SBC, the weapon.h file is in the half life sdk. Just google "half life sdk 2.3." You'll also have to get a c++ compiler.
(buried)
this is probly the most easy mod there is on the face of the world..... if you cannot do this mod... you are clearly a dumb*** lol
Need a C++ Compiler? Get "DevC++" (Google it. It is free and it has one of the best c++ environments..... and yes this compiler can open .h files :) and .cpp and many more...... and also very easy to use..... :)
No... in order to add weapons your gonna need some knowledge in DX.... if you need help on that kind of subject, check this page out. This page does not tell you about DX it just basicaly talks about a guy wanted to creat a mod for hl and ppl are telling him what is what...... Halflife2.net
that page is only helpful to find y u need DX :)
Please, do not get the "Dev C++" It does not compile the source code... (and no, I don't mean source as in hl2 or cs:s, source as in the source code "sc" like in SDK) Just download or buy Microsoft Visual C++ ....works like a charm..
And great guide!!!! Helped soo much.....
you could use codeblocks, search for it on the VERC forums
nice, but i can't find weapon.h, the closest thing to it is skill.cfg...
Whoo, Jesus I sounded like an idiot back then, eh?
(No comments on "lol u always sound leik an idiot")
Good tut now that I actually came to need it, by the way.
yes, yes you did.
i have won version of half-life. but i can not find Weapons.h file
.
i know how to change weapon damage in half-life. My glock makes more damage than the shotgun
Let me guess, you edited the skill.cfg file?
this can be done too in skill.cfg but than you can make enemy's bad etc.
i have edited the file with notepad. and what the hell should i do now? where should i put the damn file?
hl1 tut but were is weapons.h located.
You have to download half life sdk first, then go to it, find a folder named Single-Player Source, and then go into a folder called dlls, and find weapons.h
i can't find "Single Player Source" as a folder, i have SDK 2.3 installed...
Do you have the SDK which comes with the source code, or just the SDK with tools?
BTW it's better to get SDK 2.4 on GitHub:
Github.com
i wasnt sure if if it came with either the source code or the tools since i downloaded it from steam, but thanks for the github download.
If you downloaded HL SDK from Steam, then you don't have the source code.
It only comes with some (outdated) tools and some assets.
There is a HL SDK 2.3 on ModDB which has the source code, but the latest is 2.4 which I've linked up there, which is source code only.
You seem to know what to do, i downloaded the github, the HL SDK from steam tools put the github files in the HL SDK then opened it... i am completely lost, i could use some help.
I could help you out on Discord in more detail if you wanna.
But first I'd steer you to TWHL:
Twhl.info
There is no need to download HL SDK from Steam at all BTW. You really really don't need that one.
In order to change weapon stats, you need to build the code. Building the code is done in Visual Studio. You can get Visual Studio 2022 Community Edition (cuz' it's free), and Solokiller's Half-Life SDK, updated for VS2022, because the OG SDK is meant for Visual Studio 2010 at best.
So I can see how to get this to work for normal HL1
But how would I go about doing this for an actually fully made mod?
All Im doing is trying to edit max ammo carry values and nothing more.
hey can someone help me with my coding problem. I have the source code of half-life and I really want to code. but without doing anything to it I compiled it and it had about 200 errors, so it failed. any suggestions
A better compiler.
Hello. as is called the file??? greetings
i now have the c++ compiler but in wich file format should i save it?
Well, the weapon.h is an ".h" file, so you should compile the same thing.
does enyone know how to add custom weapons to half-life?
twhl.info/articulator.php?art=31
I think this is what you're looking for.
Also add http stuff at the beginning.
Anyone who wants to know where the weapon.h is?U have to download hl sdk v2.3.
So i got the sdk i modified what i wanted in weapons.h but now where do I put it do i leave it where it is or put it into half-life's dlls folder
Do I need WON Half-life
where do we put weapons.h when we finish coding?
thanks
What about weapon damage? In particular, increasing the headshot damage some of them can do?
You can modify the damage from the skill file in the folder. This includes hits to various parts of the enemy body, such as head, chest, arms, etc...