OKAY....
I hate to keep doing this to you guys, with a ba
JILLION posts on this whole setup mess (Don't worry, Phil, I'll put them all in one post... If they'll fit!), but here's the way that you get your mod going in VC++ 2008 Express Edition.
The EASIEST way, is to go to THIS link:
developer.valvesoftware.com/wiki/My_First_ModNow for an easily digestible tut on getting you mod started!
1. Launch your copy of Microsoft Visual Studio, the code was originally designed to work with 2003 but it's forward-compatible, so it'll work with other/ newer versions.
2. Select File --> Open Solution from the menu (if it isn't, already), then Open the '
Game_HL2-2005.sln' file, located in your MOD's src directory. (THIS IS PROBABLY IN YOUR DOCUMENTS FOLDER, ENTITLED THE SAME AS YOUR MOD IN SOURCE SDK)
3. Select the one that matches your version of Microsoft Visual Studio. Note the "HL2" portion of the file name will correspond to the selection you made in the mod creation step, but not necessarily. (If you selected mod from scratch, "Scratch" will appear there instead. )
4. The best option, since The Source SDK was written under the VC++ 2005 edition, is to select the file, above (you'll probably notice there's a 'Game...-2003' version, as well).
5. When you do that, it'll ask you if you want to save a backup before converting the file. Click 'Yes' and then the next, stupid dialog that's a general disclaimer.
6. You'll see a tab that says, "Conversion Report,' and the URL will be where-ever your MOD is located (Ex.: C:\Users\Ant\Mod_X1\src\UpgradeLog.XML).
Since I'm doing a MOD for HL2DM, we'll just keep using my outputs for reference - yours may vary, depending on what game(s) you're working on.
7. On the left side, under the, 'Solution Explorer', I see the following: Solution 'Game_HL2MP-2005' (2 projects)' and then, below that, 'client_hl2mp' and 'server_hl2mp.'
This tells me that for the gamefile, 'HL2MP-2005', there are two tiers of directories that I can modify in VC++: Client-side code (the information that you're receiving from a server), and Server-side code (what the server is actually sending out TO you.)
An easy way to explain this is think about talking to someone, and trying to explain something that's in your head. The SERVER-side 'code' is the image that you have in your head, translated through your speech. The CLIENT-side 'code' is what the person's getting out of what you're saying.
Hopefully, when asked to draw said image, the 'client' draws the same one that you've got in your head.
This isn't always the case, and - without going TOO far into the logistics of how this kind of stuff works - there-in lay the problem with computers, in general.
Now...
From here, looking at the 'Solution Explorer,' I click on the 'server_hl2mp' icon (since I'm going to be modding for a game that enables/ requires a server, of some kind to run), then the 'HL2MP' folder, then, say, 'Weapons.'
Once you start getting into the heirarchy of the file-system, you'll see a FUCK-load of '.h' and '.cpp' files.
The '.h' files are C++ header files. These are just what they sound like - Header files. These are used as a quick identifier by the system, so it can quickly jump to the... '.cpp' files.
Using our gravgun example, here's what a '.h' fil lookslike:
//========= Copyright © 1996-2005, Valve Corporation, All rights reserved. ============//
//
// Purpose:
//
//=============================================================================//
#ifndef WEAPON_PHYSCANNON_H
#define WEAPON_PHYSCANNON_H
#ifdef _WIN32
#pragma once
#endif
//-----------------------------------------------------------------------------
// Do we have the super-phys gun?
//-----------------------------------------------------------------------------
bool PlayerHasMegaPhysCannon();
// force the physcannon to drop an object (if carried)
void PhysCannonForceDrop( CBaseCombatWeapon *pActiveWeapon, CBaseEntity *pOnlyIfHoldingThis );
void PhysCannonBeginUpgrade( CBaseAnimating *pAnim );
bool PlayerPickupControllerIsHoldingEntity( CBaseEntity *pPickupController, CBaseEntity *pHeldEntity );
float PlayerPickupGetHeldObjectMass( CBaseEntity *pPickupControllerEntity, IPhysicsObject *pHeldObject );
float PhysCannonGetHeldObjectMass( CBaseCombatWeapon *pActiveWeapon, IPhysicsObject *pHeldObject );
CBaseEntity *PhysCannonGetHeldEntity( CBaseCombatWeapon *pActiveWeapon );
#endif // WEAPON_PHYSCANNON_H
Fun shit, huh?
30 lines of code... That's it! Heh... So says I, as I chuckle, to myself.
The '.cpp' files are the real meat of the thing that you're looking to MOD. These house all the nifty facts about whatever it is that your looking at. Example: 'Weapon_physcannon.cpp' (remember that I'm modding for HL2DM) has a WHOLE LOT of lines of code...
Here's just one chunk:
ConVar physcannon_minforce( "physcannon_minforce", "700", FCVAR_REPLICATED | FCVAR_CHEAT );
ConVar physcannon_maxforce( "physcannon_maxforce", "1500", FCVAR_REPLICATED | FCVAR_CHEAT );
ConVar physcannon_maxmass( "physcannon_maxmass", "250", FCVAR_REPLICATED | FCVAR_CHEAT );
ConVar physcannon_tracelength( "physcannon_tracelength", "250", FCVAR_REPLICATED | FCVAR_CHEAT );
ConVar physcannon_chargetime("physcannon_chargetime", "2", FCVAR_REPLICATED | FCVAR_CHEAT );
ConVar physcannon_pullforce( "physcannon_pullforce", "4000", FCVAR_REPLICATED | FCVAR_CHEAT );
ConVar physcannon_cone( "physcannon_cone", "0.97", FCVAR_REPLICATED | FCVAR_CHEAT );
ConVar physcannon_ball_cone( "physcannon_ball_cone", "0.997", FCVAR_REPLICATED | FCVAR_CHEAT );
ConVar player_throwforce( "player_throwforce", "1000", FCVAR_REPLICATED | FCVAR_CHEAT );
That's just a snippet of the 3704 lines of code that go into the '.cpp' file for the gravgun.
Knowing how to alter this kind of code we can accomplish all KINDS of things... Want an automatic .357? RPG-based crossbow bolts? Linear-firing morter-rounds from the SMG?
Yup! You can do it... Well... Let's not get TOO far ahead of ourselves, yet, 'k? We'll just settle and say that 'Yes, it CAN be done.'
If anyone else is actually DOING MODS (No, Zew... Gmod isn't REALLY modding
), feel free to chime in with any helpful bit, ja?