Hello! Yesterday, I was making a HL2 Mod, called Sandbox. I wanted to check 2013 source code of HL2, and I found interesting detail: HL2 has HL2 Beta weapons, and they have fully working code! We are going to talk about this today (without screenshots
)
Also, you need to download Visual Studio 2013. I'll use Express edition
So, first of all, we need 2013 source code. You can easily find it in Google, but i'll leave it here:
https://github.com/ValveSoftware/source-sdk-2013Okay, we have the code. Unzip the sp/src folder somewhere.
Now we have Single Player code. We need to compile Solution, to make something, so we will use
createallprojects.bat, which will compile solution for us
So, we got our sweets. Open it, and change configuration from Debug to Release.
There is one small thing. Solution don't use HL2 Beta weapons, so add it! For e.g, I will use Sniper Rifle.
1. Search for "Server (HL2)"
2. Open Source Files folder
3. Right click on "HL2 DLL", Add/Existing Item
4. Go to game/server/hl2 and search for weapon_sniperrifle.cpp
Hooray! We now have Sniper Rifle in, but, actually, it will compile code without sniper rifle. We need to edit C_weapon__stubs_hl2.
1. Click on Search Solution Explorer
2. Type "C_weapon__stubs_hl2.cpp"
3. Open it
4. After Citizen Suitcase, print this "STUB_WEAPON_CLASS(weapon_sniperrifle, WeaponSniperRifle, C_BaseHLCombatWeapon);"
Now, you can compile the code, search for client and server.dll, and drop it into your bin folder
This is not end
. Some weapons doesn't have script file. All you need to do, is just search it in hl2 beta. That's all! You can convert model from beta to retail, copy materials and sounds.
The last steps: Open your mod/hl2, go to, for e.g d1_canals_01, and type in console "give weapon_sniperrifle". Good luck!
This is my first post, and my English might suck. Sorry for my problems, if there are problems