- C++ ( you don't need this, it will help if you know it )
- valve script
This tutorial will teach you how to add a new type of Ammo for your custom weapons. This will basicly be useful
for modders who don't want to use the Ammo type 'SMG1' all the time. When you add a new type of Ammo you can
set it to what you want. For example...
note: this will work on most other weapon scripts as well
the weapon_smg1.txt is the easyest to explain this tutorial on.
About line 16- 19 you should find this line of script.
Change that to
Therefore not wasting the SMG1 ammo type on all of your guns.
== The C++ Part ==
So lets learn how to do this.
first open up your project sln file. (You should get this when you create a mod)
Then goto hl2_gamerules.cpp located in the server
Goto line 119 an you should be on "ConVar sk_plr_dmg_gun1"
Just below that add
This is baiscly telling the game/mod that weapon1 is a type of ammo that we want to use.
After that goto line 1697 in the samefile, Just below the line that says
This is basicly defining the script that you put in youmod/cfg/skill.cfg
Now to make the ammo come up when you type "impulse 101" into the console.
Goto player.cpp then goto line 5446
Add this line of code in after that " // Give the player everything!
Where my code says "90" put in the amount of bullets that you want the player to have everytime
they put in impulse 101
And that is it. Compile your project and your weapon_smg1.txt will have a diffrent type of ammo.
Then you can make you own weapons and put your new type of ammo in.
To make more types of ammo, just rename
and so on.
Thanks for reading
- valve script