adding weapons to a half-life 2 mod
Post on 03-Jan-2016
43 Views
Preview:
DESCRIPTION
TRANSCRIPT
Adding Weapons to a Half-Life 2 Mod.
3 Scopes of Chocolate Tutorial
Will not coverModelingCoding
Will coverTaking weapon code and model and putting
them into the game.
Dude, where’s my Weapon?
To put a weapon into the Mod, you will need one first.
Create a new Single Player Mod. In the SDK click on the button. Hit Next. Select the bullet. Hit Next. Put the Mod anywhere you can remember in 2
minutes, and name the mod anything you like. Compile the Single Player Mod.
We will be taking a weapon out of the single player game and putting it into your Mod.
Takes Two to Tango
Each weapon has a series of animated models for each action it can do (Reload, fire, Ect.), and a .qc (text file) that links them together and allows to the code to use it.
The ones we will use are located at:
(You do not need to go here, or do anything on this slide, feel free to forget everything on it.)
Yonik!
The model files now have to be added to our own Mod. Open up a command prompt and type in cmd Navigate to the “sourceSDK” folder in the steam
directory.
Clato Naoto Victo?
Then type in this very long command:bin\studiomdl -game “D:\Steam\SteamApps\SourceMods\[moddirectory]" “D:\
Steam\SteamApps\[username]\sourcesdk_content\hl2\modelsrc\weapons\v_pistol\v_pistol.qc
(that’s all one line in the command prompt using your own directory information)
Script Kittens
Script files contain basic variables dealing with objects in your mod, like guns, cars, and sounds.
They are not needed but make so that you don’t need to recompile your mod after small behavior changes.
(forget this page too)
Let There Be Bullets …and Sound. In your (compiled) Single player(SP) mod, go to
the folder called Scripts. Copy the file called weapon_pistol.txt into your real
mods Script folder.
Back in the SP mod Scrip folder, open the called game_sounds_weapons.txt Search for weapon_pistol.txt Copy all 8 methods in this file to your mods
game_sounds_weapons.txt file. You can’t just copy the game_sounds_weapons.txt
file over
And here I thought I was an art major
Now the weapon must be put into code Download the file pistol.zip off of my website:
www.coe.uncc.edu/~rwhiting/weapon.zip This file hold the coding for the weapon itself. Create a file in your own mods (source) directory to hold
this file. Name it hl2r, and unzip it in the src\game_shared folder.
20/20 Visual
Open your mods project in Visual by clicking on the in the src folder of your mods (source) directory.
Open the Solution Explorer (View-> solution Exploer)
In the Client Tab, right click on the folder and click Add->New Folder. Call it HL2R.
Do the same thing under the Server Tab. Right click on the new HL2R folder in the client
Tab, and click . Navigate to the HL2R folder and add both files you put in there.
Do the same for the server tab.
Time to wake up! Click on Build-> solution
Then wait for the output to give you no errors because you did everything right.
Fin.
Special Thanks to:MSpaintHL2Coding.com (example pistol code)
top related