Garry’s Mod: Half-Life 2 Campaign
July 28th, 2007
HL2 Campaign is a gametype for Garry’s Mod that allows you to play the Half-Life 2 saga in cooperative mode on a LAN or over the Internet.
- Automatic difficulty configuration based on the number of players.
- Custom auxiliary bar that is not tied to the player’s flashlight.
- Delayed loading so everyone has a chance to finish the level.
- Navigation marker for those who can’t find their way.
- Player information is remembered between maps.
- Support for Episode 1 and 2.
- Vehicle spawning system so there are always enough vehicles.
Requirements
- Half-Life 2
Installation
Extract the zip to the following directory on your hard-drive:
<Steam-directory>/steamapps/<Steam-username>/garrysmod/garrysmod/gamemodes/
Running a Listen Server
Browse to the below directory and edit the sh_config.lua file to your liking.
<Steam-directory>/steamapps/<Steam-username>/garrysmod/garrysmod/gamemodes/half-life_2_campaign/gamemode
Next, start up Garry’s Mod and click Create Multiplayer at the main menu. Select the HL2 map of your choice and then click the Options tab. Set the Default Gamemode option to “half-life-2-campaign”. Set any other options you’d like and then click Start Game.
Running a Dedicated Server
Note: Start with a fresh installation of SRCDS with just Garry’s Mod installed.
Browse to the below directory and edit the sh_config.lua file to your liking. It will be assumed for the rest of these instructions that PLAY_EPISODE_1 and PLAY_EPISODE_2 are both set to 0.
<Steam-directory>/steamapps/<Steam-username>/garrysmod/garrysmod/gamemodes/
Once your done, upload the entire half-life-2-campaign folder to the following location on your server.
<SRCDS directory>/orangebox/garrysmod/gamemodes/
Using GCF Scape extract the following folders to a temporary directory on your computer:
- “maps” and “scenes” folders from half-life 2 content.gcf
- “scripts” folder from source engine.gcf
- “materials” folder from source materials.gcf
- “models” folder from source models.gcf
- “sounds” folder from source sounds.gcf
Next extract the following folders to the same directory on your computer overwriting the existing files.
- “materials” folder from source 2007 materials.gcf
- “models” folder from source 2007 models.gcf
- “sounds” folder from source 2007 sounds.gcf
Then move/upload all the extracted folders to the following directory on your server overwriting any existing files.
<SRCDS directory>/orangebox/hl2/
Your directory tree should now look something like this:
<SRCDS directory>
- hl2
- <Shared Server Models, Materials, Sounds installed by SRCDS>
- orangebox
- bin
- garrysmod
- <GMod Folders>
- hl2
- maps
- materials
- models
- resource
- scenes
- scripts
- sounds
- platform
- <Platform Folders>
- relists
Lastly, you’ll need to set the default gamemode to run when your server starts up. Browse to the following directory and open up the game.cfg file with NotePad.
<SRCDS directory>/orangebox/garrysmod/cfg/
Add the following console command to the cfg file:
sv_defaultgamemode "half-life_2_campaign"
Alternatively, you can leave the default gamemode as sandbox and switch to HL2 Campaign on the fly with this console command:
rcon changegamemode [map] half-life_2_campaign
You can switch back to sandbox anytime with this command:
rcon changegamemode [map] sandbox
You’ll need to restart your server before the above commands/changes will work. Don’t forget to run “scriptenforce_createmanifest” and “sv_scriptenforcerenabled 1? to prevent against Lua cheats/hacks.
Keyboard Shortcuts
[F1] (Show Help) – Toggles the help bar at the top of your screen.
[F2] (Show Team) – Toggles the navigation marker on your HUD.
[F3] (Spare 1) – Spawns a vehicle if allowed.
[F4] (Spare 2) – Removes a vehicle if you have one.
Console Commands
- hl2c_admin_noclip [0, 1] – If set to 1 admins will be allowed to noclip.
- hl2c_admin_physgun [0, 1] – If set to 1 admins will get the physgun when they spawn.
- hl2c_next_map – Goes to the next map.
- hl2c_restart_map – Restarts the map.
FAQ
Can you add [some stupid feature from Sandbox]?
No. This isn’t sandbox, it’s HL2.
Do the citadel levels work in HL2?
For the most part, yes.
Does this work with Episode 1 and 2?
Sort of (see question below).
The episodic games are horribly broken! Why?
Most, if not all, of the problems with Episode 1 and 2 Garry has to fix.
Will you be adding a Lua version of the super gravity gun?
No.
Will you add a spectator mode to players that have completed the level?
No.



v1.21 is out!
- Improved spectator code.
v1.22 is out!
- Added friend indicator to scoreboard.
Thx you i use this mod for comlete the game!
v1.23 is out!
- Tweaked method for reducing crowbar damage.
Hi,I need help with this.I have got this mod working but few things that I cannot get to work.I was trying to play on my listen server everything seemed fine except for 2 things.
-1 Npcs did not attack me,cp,s they just stood there with guns and neither did helicopters drop bombbs.
-2 I am not able to pick up boxes or anything using the “e” button as in HL2
Could you please contact me over steam add me:Onet01
Thanks
1. This happens if you start on the trainstation maps and skip to any other map if you do not play all the way through.
2. The pickup with “E” functionality is not present in Garry’s Mod.
Hey their,
I’m having differents problems with the mod, as:
* Spawn without any weapons.
* Can’t use anything (Like going into a vehicle, opening a door, pushing a button).
* No damage from npc, they also. don’t attack me if I’m right…
Running a fresh installation of Garry’s Mod with little/no addons and the gamemode works fine for me.
To be honest, i’m using a standalone garry’s mod release. ^^
v1.24 is out!
- Players now properly no-collide with one another.
v1.25 is out!
- Improved naming convention, removed obsolete code.
- Updated crowbar damage scale to more accurately match Half-Life 2.
Damn,this is too good,you did not even make me update my server that you update your gamemode,great,however i cannot find where i can set the player weapon under the configs.
I ask you this because i’ve installed a lua super gravity gun and a handheld medikit,and i want to give the super ggun only in the citadel levels.
Custom weapons are not supported.
I do not know what is wrong, I followed this guide, and all the materials and levels work. But when someone beats a level, the server crashes. As I said before i have no idea what is wrong. This is also a server I am renting so maybe the files of the gamemode are messed up or something. Can someone help?
Also, the menu commmands, F1 and F2 do not work, or the console commands.
Update the server,maybe some file is corrupted,or maybe an addon is causing these crashes.
With my brand new server i have no problem.
More than likely it was an addon or outdated server that was causing it to crash.
Is it possible to put this mod with it? http://www.facepunch.com/showthread.php?t=739507
No,that mod sucks,this is not supposed to being hl2 realistic,THIS is very good.
http://www.facepunch.com/showthread.php?t=740251
However the fast attacks can be removed.
Maybe I’ll add that at some point, but I don’t really have time to do much with any of my gamemodes other than fixes.
When i start it, it says Can not changlevel de_trainstation invalid .bsp (or something like that)
Do you have Half-Life 2 purchased and installed on your Steam account?
Idont care how “good” synergy is, im installing this on my server right now!
Arent the players supposed to no-collide each other, because they dont for me and it makes it very hard to finish levels as the person in front just freezes and you cant get past them to finish yourself. Why is this?
It worked for about a week the no-collide,then a gmod update broke it
Can you add a how-to guide to set up the episodic content?
Or are they just too bugged to be played at all?
I am also having the problem with players who finished the map, are blocking the way for everyone else.
And a few levels are with no guns at all.
Otherwise I enjoyed this
Episodic content is really bugged.
v1.26 is out!
- Fixed entity damage error.
- Fixed players colliding with other players who have completed the level.
- Fixed regression where player information was no longer saved between levels.
- Fixed regression where checkpoint OnTouchRun functions no longer ran (enabling vehicles or other things when reached).
- Players no longer collide with friendly/godlike NPC’s.
- Vehicles now spawn facing to the right and a tad closer to you.
Is the bug with the server crashing after the part when the gun is put on the airboat fixed? coz that was really annoying
Pretty sure it is.
Yep, it is, ive tested it. only problem there is if the origional airboat isnt there from the start of the level, the gun doesnt appear, but thats a bug in the game, and not your fault i dont think
Can you add a menu for administrator that can give weapons we want and ammo too.
Nope.
All I have to say is use Console example sv_cheats 1 then impulse 101. One small problem would be is that acheivements will be deactivated apart from that it will work
Or is there anyway to leave we respawn after death without wait and restart map ? ( Because your mod is now faster than synergy but must add an cvar leave players respawn after death).
Thanks
P.S: if it’s possible can you tell me where i can modify this in the script ?
The gamemode was designed to force players to work together and make it challenging. Allowing players to respawn after death would break this design. I may look into a system similar to L4D where you have to find players locked away somewhere but that is a whole other system I don’t have time to program right now.
Is intro.bsp going to work normally?
For what game?
half-life 2
It should.
I had the 1.12 version for a while, then I discovered that there was a update (late, I know)
It was great with all the checkpoints and such, but:
* The console won’t stop spamming me with Warning, usermessages things.
* Admins do not get their physgun (with the cvar set to 1)
* Showhelp no longer works, F1 and F2 does nothing, while F3 and F4 shows You cannot spawn a vehicle etc..
* I see no HUD anymore, where did it go with the sprint meter?
Looking into the source (init.lua):
CreateConVar(“hl2c_admin_physgun”, ADMIN_NOCLIP, FCVAR_NOTIFY)
CreateConVar(“hl2c_admin_noclip”, ADMIN_PHYSGUN, FCVAR_NOTIFY)
Aren’t these wrong?, it makes no sense why they are written like that
They were wrong, I switched it, and I don’t know how to get rid of these messages my local console spams out in the gamemode:
Warning: Unhandled usermessage ‘UpdateEnergy’
Warning: Unhandled usermessage ‘UpdateEnergy’
Warning: Unhandled usermessage ‘UpdateEnergy’
Warning: Unhandled usermessage ‘UpdateEnergy’
Warning: Unhandled usermessage ‘UpdateEnergy’
also says so for ShowHelp etc.
Are you running any additional mods?
Could you make a function that enables/disables respawning?
Hi AMT. Do the flames in Ravenholm work yet? Coz thats quite an important bug
Hey AMT, I need to ask you a question. When the map starts, it seems like there are no scenes in the map, nothing works, no sound, most scenes are not acted out just plain, my friend followed the instructions here and tried redoing everything but nothing works. Any way to fix this?
If you mean the the combine just stand and don’t shoot, then I know how to fix. Start the server on the trainstation map, THEN change map to the one you want. If not, a lot of them just stand there