Co-Operative Base (Mod): Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
m (Added another fix)
m (clean up, added deadend tag)
 
(145 intermediate revisions by 9 users not shown)
Line 1: Line 1:
= OrangeBox Co-Operative Base =
{{Dead end|date=January 2024}}
'''Formerly known as Shadow Source.'''
 
= Description =
 
 
Source Engine Co-Operative Base Modification (SecobMod) is a modification containing useful code fixes for co-operative games. Please see the Features list for more details.


'''FINAL VERSION released on 27th June 2010 - See Features list for new content.'''


= Description =
There are currently two versions of this modification available, The current one for Source SDK 2013 the older one for Source Engine 2007/2009 which can be found
[https://developer.valvesoftware.com/w/index.php?title=Co-Operative_Base_%28Mod%29&oldid=177223 here.]
 
This page deals solely with the latest version (the Source SDK 2013 multiplayer version).
 
 
**Please be aware that no support is given with this modification. Occasionally I check the steam forums and reply to threads I see as I can, but in most cases you are on your own - this is why this wiki page has been so heavily detailed
 
 
If you release a modification which uses SecobMod or code from it, please remember to add those listed in the Credits section of this page to your own credits.
 


OrangeBox Co-Operative Base is a patch file containing useful code fixes for the Source SDK Base 2007 (OrangeBox) for use in multiplayer modifications/total conversions requiring things such as working online AI.
Currently the minimum requirements are solely that you have the Source SDK Base 2013 Multiplayer installed, though you may find the content restrictive is what you have available to you, as a result of this you may wish to mount other Valve games so that you can use their content (maps, models, sounds, materials etc) but please note that coded items from games that are not Half-Life 2 based will not work.


There are some minimum system specifications required for using OBCO (OrangeBox Co-Operative) and these are as follows:


* Half-Life 2 or Half-Life 2: Episode 1.
These must use the new .vpk file format to work, at the time of writing the following have been tested and are found to work with various degrees of success:
* Source SDK Base 2007 (free download).
* Half-Life 2: Deathmatch, which can be found at one of the three following locations:


* Half-Life 2.
* Half-Life 2: Episode 1.
* Half-Life 2: Episode 2.
* Portal 1
* Portal 2
* Team Fortress 2
* Counter-Strike Source


http://www.steampowered.com/ati_offer1a/ (ATI users).


http://www.steampowered.com/nvidia/ (nVidia users).
To keep this wiki page easily viewed, many items are now implemented into scroll boxes, so that the more important aspects of the page can be kept whole.


http://store.steampowered.com/app/320/ (Everyone else).
= Installation. =


With the switchover of Valves' Source SDK hosting onto a GitHub repository it is now much easier to get hold of the code for SecobMod than it was with the previous Seco7 version.


Additionally you can use content from any of the following games (as long as you own them):
Firstly you should follow the instructions for the Source SDK as found on [https://developer.valvesoftware.com/wiki/Source_SDK_2013 here.]


*Half-Life 2: Episode 2
However where it would have you going to the official Valve SDK repository you will want to point your browser or GitHub client to [https://github.com/whoozzem/SecobMod/ this repository] instead.
*Portal


Make sure that you store your code in a folder path WITHOUT any spaces in it as it can cause problems compiling especially if you wish to debug your code!


{{warning|The currently compiled version mounts all the games above. Edit GameInfo.txt and InstalledSourceGames.txt to remove any games from mounting which you do not own (as they will crash the exe).}}
As you can see in Valves' instructions you have the choice of using github for your project and forking off the code (creating your own unique copy of the SecobMod code to edit as you see fit and with the added bonus of being able to merge updates to the base SecobMod and Source SDK code as they are released should you want them, or by downloading a zip file containing all the SecobMod files at the latest commit to the GitHub repository.


If you have already started on your project and wish to combine it into a SecobMod base then I would recommend getting a copy/forking a copy of SecobMod and using a program such as [http://winmerge.org/downloads/ winmerge] to merge in your changes due to the amount of changes SecobMod has made to many of the base Source SDK files.


Untested (but should work):


*Half-Life 2: Lost Coast
== Setting up the compiled game folder. ==
*Counter-Strike Source
*Team Fortress 2
*Content from Valve supported Modifications (must have their own unique AppID).


== Features ==
Now that you have obtained the latest SecobMod and extracted the zip file (if you didn't fork the code in GitHub) then you will want to copy SecobMod's folder located at:


Developers can easily enable and disable individual features to suit their needs.


Here is a list of the '''features available to mod developers:'''
MP>Game>mod_hl2mp


* NEW in the FINAL Version:
to:
** Portal Gun, player only.
** Super Gravity Gun (some graphic effects missing - most of the code done by .Kave).
** Restart level on critical ally/object/time limit failing.
** View Cameras now take control of all players on a server (Gordon's KO Wakeup scene, etc).
** Save/Restore transitions now work even if you disable playerclasses from the code.
** Each player class player now has their own unique filter name, meaning only a certain playerclass can trigger an event (for example). Thanks Alters for the fix!
** Called it a day on development. It's all in the hands of the community now.


Steam>steamapps>sourcemods


* AI Patch Modifications:
** Enable/Disable an enhanced version of Winston's AI Multiplayer patch.
** Valve Game Mounting:
** Dynamically mount various official Valve games to get the most for your mod.
** or use Static Mounts when you're sure you don't need Dynamic mounting.  


At this point you could rename the mod_hl2mp folder in your sourcemods folder to that of your game name.


* Episode 2 Support:
== Setting up the Project files. ==
** Including support for Alyx Darkness Mode


Once you have the code setup you can quickly get the source code project files up and running with all the required code files added/removed for compiling by going into your:


* Player Abilities:
mp>game>mod_hl2mp
** Non-HEV wearers can still be allowed to sprint, have the geiger counter, etc. This is on a per-item basis, so players could have the geiger, but no sprint if you wanted.
** Players can pick up objects with their hands. 


folder and open client_hl2mp-2005.vcxproj and server_hl2mp-2005.vcxproj in a text editor and changing all references to:


* Player Class System With:
c:\github\SecobMod...etc to reflect where you have stored your code files.
** Four (or more, or less) Player Classes.
** Per Player Class Object Pickup Strengths.
** Customise Class Health/Maximum Health Values.
** Customise Class Armour/Maximum Armour Values.
** Customise Class Walk/Sprint/Normal movement speeds.
** Customise Class Jump Heights.
** Each Class Can Have Its Own HUD Layout/Colour scheme.
** Define how many players can be in each Player Class.  


Once this is complete you should then copy the files as outlined below:


* Teamplay Support:
** Fixes for enemy NPCs and teamplay games.


client_hl2mp.vcxproj to the mp>src>Game>Client folder.


* Weapon Enhancements:
-and-
** Development teams can now enable Iron Sight.
** A known HL2DM shotgun fast-switch bug - fixed thanks to Community input!.


server_hl2mp.vcxproj mp>src>Game>Server folder.


* NPC Abilities:
and overwriting the files that were created while following the github instructions on the other Valve wiki page.
** Striders can be set to always impale players who get too close.
** Barnacles can now be set to swallow players.


== Debugging the code ==


* Vehicles:
You will of course wish to debug any problems, errors, crashes and such that you get while play testing your game. [https://developer.valvesoftware.com/wiki/Installing_and_Debugging_the_Source_Code This wiki page] describes the process of setting up the project for debugging.
** The multiplayer camera judder is no more!
** Thirdperson model in-vehicle animations can now be used.
** Old-Style passenger seats can now be used to provide extra seats in vehicles.
** Jeeps and Jalopys' can now have their headlights switched on.


== Adding and Removing Game Features ==


* Cool Stuff:
SecobMod was designed so that you can easily disable and enable its features, so that you can customise it in whatever which way you want it.
** Firstperson ragdoll views on player deaths.
** Camera bob on player movement (incl. strafe).
** Use Counter-Strike: Sources' ladders code instead of the Half-Life 2 ladders.


As such all features are stored with a file in the Src>Game>Shared>Secobmod folder, called secobmod_shareddefs.h


* Game Settings:
On opening this file you will find every feature clearly defined, and information concerning what each feature does.
** Friendly Fire (Replaces players can collide from v1.5).
** Dynamic Respawn Code. Don't spawn back at the start of the map anymore, respawn back where you left off in your killing spree.
** Multiplayer Level Transitions. On ALL players entering the transition area the server is forced to changelevel to the next map (percentage can be changed).
** Save/Restore. A basic working transition system which saves/restores your loadouts.
** Valve approved cheating. Now even if sv_cheats 1 is enabled, players can't cheat unless you define it as acceptable in the code.
** Map briefings. Provide storylines on a per-map basis.
** Map specific model overrides. Changes all players to a specified player model on a particular map (set by the mapper). Check out our defector map for an in-game example!


== Credits ==
To enable a feature, remove the // from the beginning of the word define, to disable a feature add the // in front of its' define.


* The Development Team:
As an aside if you'd like to try out nightvision in game, it is binded to the 'N' key and as it stands it is currently only enabled for the heavy class (but you have the power to change this if you'd like!).
** Ariae -- Composer.
** Chief -- Modeller/Reluctant Coder.
** MontyPython -- Foley Artist.
** Sneaky[ToB] -- Coder.
** SpamSlayer -- Voice Artist/Coder.


The file has one last important role, and that is that by defining all changes, this makes searching for all references to a specific feature in the entire codebase very easy. This allows easier transition of code between engine releases or should you wish to use code from SecobMod you can easily find it to implement in other Source SDK Multiplayer games.


* Occasional Team Members:
** Apocrypha Roxy -- Voice Actress
** MasterThief3 -- Voice Artist


{{note| -- }}Important information about all the code can be found in the same folder, but in the file titled secobmod_information.h- }}


* And thanks to the following non-OBCO team members:
== Teams ==
** Winston
** Tony Sergi
** Biohazard_90
** Sub-Zero
** DutchMega
** The Last 7 Hours Spanish Mod
** Skidz
** Alters
** .Kave
** KuRouZu
** Jorg
** z33ky
** JordanN
** TheRJMan
** HalfWit2


== Getting the Current Release ==
Setting up teams in Secobmod is very easy, you can enforce teamplay using the secobmod's definition, however for a full team play implemenation you will want to follow [https://developer.valvesoftware.com/wiki/Creating_Teams this wiki page] (take a note of the warnings about SDK 2013).


Our ModDB page download:
In the old 2007/9 SDK release there was a problem with team members being unable to do any damage to either teams AI. The code function which had this problem was removed from the 2013 SDK and I have not added it back in. If you have issues with teamplay and the AI then you may need to grab this code from the older seco7 code.


[http://www.moddb.com/company/the-development-team/downloads/orangebox-co-operative-base-modification ModDB]
In my basic testing of teams the game does now work as it should without this code, but I leave this in as a small warning for those wishing to have a teamplay based co-operative game.


== Setting up the Hammer Map Editor ==


You will need [http://www.7-zip.org 7zip] 9.13 or greater or an archive program capable of extracting .7z files.
SecobMod has a few custom entities that mappers can use, should they wish to.


So that you can use these in your the Hammer editor, you'll need to edit and add a few files (as will any other mappers on your modifications team).


Locate the ..\SteamApps\common\Source SDK Base 2013 Multiplayer\bin\ GameConfig.txt file


For advanced users, vektorx4 created the following Mercurial .patch file.
And add the following to it, edit as appropriate with your modifications name and steam folder paths.


[http://www.fileden.com/files/2007/10/28/1547530/sdk_to_obcoop_hg_patch.zip Link]
<div style="max-height:30em;overflow:auto;"><source lang=xml>
"SecobMod"
{
"GameDir" "..\Steam\SteamApps\SourceMods\mod_hl2mp"
"hammer"
{
"TextureFormat" "5"
"MapFormat" "4"
"DefaultTextureScale" "0.250000"
"DefaultLightmapScale" "16"
"DefaultSolidEntity" "func_detail"
"DefaultPointEntity" "info_player_start"
"GameExe" "..\Steam\Steam\SteamApps\common\Source SDK Base 2013 Multiplayer\hl2.exe"
"MapDir" "..\Steam\steamapps\SourceMods\mod_hl2mp\mapsrc"
"CordonTexture" "tools\toolsskybox"
"MaterialExcludeCount" "0"
"BSP" "..\Steam\SteamApps\common\Source SDK Base 2013 Multiplayer\bin\vbsp.exe"
"Vis" "..\Steam\SteamApps\common\Source SDK Base 2013 Multiplayer\bin\vvis.exe"
"Light" "..\Steam\SteamApps\common\Source SDK Base 2013 Multiplayer\bin\vrad.exe"
"BSPDir" "..\Steam\Steamapps\SourceMods\mod_hl2mp\maps"
"GameData0" "..\Steam\SteamApps\common\Source SDK Base 2013 Multiplayer\bin\secobmod.fgd"
}
}
</source></div>


= Patch File =
Next, you'll want to create a blank/empty file called secobmod.fgd using a text editor, and place it in the ..\SteamApps\common\Source SDK Base 2013 Multiplayer\bin folder.


Extract out the patch file (SDK_to_OBCO_Final_Patch.exe)from the .7z file to somewhere handy (such as your Desktop).
<div style="max-height:30em;overflow:auto;"><source lang=xml>
//-------------------------------------------------------------------------
//
// Game data for SecobMod.
//
//-------------------------------------------------------------------------


Run the patch tool, at the point of folder selection make sure to select the 'Src' folder of your exported SDK Base 2007 code.
@include "base.fgd"
@include "halflife2.fgd"
@include "hl2mp.fgd"
@include "portal.fgd"
//Add any other includes here such as css, tf2 etc etc.


Once it's done - you've patched your source code.
@PointClass base(PlayerClass, Angles) studio("models/editor/playerstart.mdl") = info_player_assaulter :
"This entity indicates the position and facing direction at which the player will spawn during a player classes map. Any number of "+
"info_player_assaulter entities may be placed in a map."
[
]


Easy, huh?
@PointClass base(PlayerClass, Angles) studio("models/editor/playerstart.mdl") = info_player_supporter :
"This entity indicates the position and facing direction at which the player will spawn during a player classes map. Any number of "+
"info_player_supporter entities may be placed in a map."
[
]


== obcoop_shareddefs.h ==


To allow flexibility for mod makers, every change that was made to the SDK can be enabled or disabled by the mod team.
@PointClass base(PlayerClass, Angles) studio("models/editor/playerstart.mdl") = info_player_medic :
"This entity indicates the position and facing direction at which the player will spawn during a player classes map. Any number of "+
"info_player_medic entities may be placed in a map."
[
]


= Known Bugs =
@PointClass base(PlayerClass, Angles) studio("models/editor/playerstart.mdl") = info_player_heavy :
"This entity indicates the position and facing direction at which the player will spawn during a player classes map. Any number of "+
"info_player_heavy entities may be placed in a map."
[
]


*Super Gravity Gun - ::DoMega functions not implemented and ::Do functions missing some single player additions (these ::Do functions enable the fancy effects you can see are missing)
@PointClass base(Targetname, Angles) studio( "models/combine_turrets/floor_turret.mdl" ) = npc_turret_floor : "Combine Floor Turret"
*weapon_hl2mpbase.cpp, line 133 - Null pointer crash with the Super Gravity Gun enabled. However, it has only happened on the <code>d3_breen_01</code> map.
[
*Weapon strip/dissolve zones (as used to make the Super Gravity Gun in HL2/EP1) don't work properly, nor do they work for all players.
spawnflags(Flags) =
*Armour not working on non-playerclass save/restore transitions.
[
*Pre-Criminal mode remains active after map changes leading to invulnerable players.
32 : "Autostart" : 0
*Null pointer crashes, fixed with workarounds but possibly not the best fixes out there.
64 : "Start Inactive" : 0
*Chat bubbles angle towards the player's view, so they can appear embedded in walls etc. Fix on forums didn't work.
128 : "Fast Retire" : 0
*Jalopy driver eyes are much too low, you can barely see where you're driving. [[Coop#Low_eye_position_when_driving_the_Jalopy|Fix available.]]
256 : "Out of Ammo" : 0
*Passengers in the obco passenger seat take no damage from AI hitting the car the seat is parented to.
512 : "Citizen modified (Friendly)" : 0
*Reset of level on mission failure - failure to preserve objects only shows for server host. Messages such as critical ally lost show to all players.
1024 : "Portal Turret" : 0
*AI bend their legs when going up in lifts (elevators), but are fine going down.
]
*Portal gun - players only (no entities, physics props, projectiles, etc - Kleiner's lab's mini-port can do physics props). Co-Op, portals all linked to each weapon. No fancy cameras like real portal gun.
*The portals' bounding boxes for the players to touch them to portal through are solid, and thus cause the player damage if they are hit at too high a velocity. Because of this, they lose velocity each time they enter a portal when falling through from ceiling to floor, and thus don't pick up the momentum associated with Portal. The code for velocity through portals does function, except for this bug causing it to appear not to be working - when it actually is.
*If there are two players in a server, and both are killed in a portal, they will constantly kill each other in a respawn/telefrag loop.
*Leaving tilted vehicles causes players to appear tilted as well. This affects only their player model, their actual views are normal.
*Swimming T-poses player models. [[Fix_Missing_Player_Animations|Fix available.]]
*No player animations for the bugbait weapon, and the squeeze animation only plays once. Fix: the cpp file is only compiled by the server project, it needs to be added to the client project as well (further code modification is required to compile it successfully).
*The normal Gravity Gun is able to punt the HL2 jeep and Jalopy with an unusually large amount of force.
*The Super Gravity Gun is unable to pick up ragdolls of dead enemies.
*The Super Gravity Gun fails to pick up falling debris in <code>ep1_citadel_02b</code>, leading to inability to complete the map. [[Coop#Inability_to_grab_falling_debris_on_ep1_citadel_02b|Fix available.]]
*Inability to identify players by looking at them. [[Coop#Inability_to_identify_players_by_looking_at_them|Fix available.]]
*Blood splashes being emitted when shooting other players despite no damage actually being dealt (only applicable ''without'' <code>OBCO_FRIENDLY_FIRE_ENABLED</code> being defined).
*Players do not have ragdolls when killed with shotguns if <code>OBCO_BARNACLES_CAN_SWALLOW_PLAYERS</code> is defined. [[Coop#Players_do_not_have_ragdolls_when_killed_with_shotguns|Fix available.]]
*Certain allied npcs such as <code>npc_monk</code> can be picked up with the Super Gravity Gun without dying, causing unnecessary server-side ragdolls to be spawned.
*Certain campaign maps fail to transition to subsequent ones (e.g. <code>ep1_citadel_02b</code>). [[Coop#Certain_campaign_maps_fail_to_transition_to_subsequent_ones|Fix available.]]


= Code Fixes =
SkinNumber(integer) : "Skin Number" : 0 : "Which skin to use for this turret. Set to 0 to select randomly."


=== Double ragdolls on death ===
// Inputs
If you're getting issues with double ragdolls spawning on death (one client-side and one server-side), open up <code>game/server/basecombatcharacter.cpp</code> and change the line:
input Toggle(void) : "Toggle - If open, close. If closed, open."
<nowiki>
input Enable(void) : "Enable the turret."
// if ( m_bForceServerRagdoll == true || ( CHL2MPRules()->MegaPhyscannonActive() == true ) && !IsPlayer() && Classify() != CLASS_PLAYER_ALLY_VITAL && Classify() != CLASS_PLAYER_ALLY )</nowiki>
input Disable(void) : "Disable the turret."
to
input DepleteAmmo(void) : "Depletes all the ammo from a turret, causing it to dry-fire."
<nowiki>
input RestoreAmmo(void) : "Restores ammo to a turret, allowing it to fire live rounds again."
if ( m_bForceServerRagdoll == true || ( HL2MPRules()->MegaPhyscannonActive() == true ) && !IsPlayer() && Classify() != CLASS_PLAYER_ALLY_VITAL && Classify() != CLASS_PLAYER_ALLY )</nowiki>
input SelfDestruct(void) : "Causes the turret to warn and then explode."
(basically removing the 'C' in front of 'CHL2MPRules()->MegaPhyscannonActive()' and re-enabling that line)


=== Crash in vstdlib.dll on mod exit ===
// Outputs
This crash is caused by an unnecessary line in one of the OBCO_SAVERESTORE blocks. To fix it, open <code>game/server/gameinterface.cpp</code> and search for this block:
output OnDeploy(void) : "Turret is becoming active and dangerous."
<nowiki>
output OnRetire(void) : "Turret is becoming inactive and harmless."
//TDT - Clear the transition file.
output OnTipped(void) : "Turret has been tipped over and is inactive."
#ifdef OBCO_SAVERESTORE
output OnPhysGunPickup(void) : "Picked up with physgun"
FileHandle_t hFile = g_pFullFileSystem->Open( "cfg/transition.cfg", "w" );
output OnPhysGunDrop(void) : "Released by physgun"
]


CUtlBuffer buf( 0, 0, CUtlBuffer::TEXT_BUFFER );
//-------------------------------------------------------------------------
g_pFullFileSystem->WriteFile( "cfg/transition.cfg", "MOD", buf );
//
g_pFullFileSystem->Close( hFile );
// Vehicles.
return;
//
#endif //OBCO_SAVERESTORE</nowiki>
//-------------------------------------------------------------------------
Now, delete the line <code>return;</code> so that it becomes:
@BaseClass base(Targetname, Origin, Global, prop_static_base) = BaseVehicle
<nowiki>
[
//TDT - Clear the transition file.
vehiclescript(string) : "Vehicle Script File" : "scripts/vehicles/jeep_test.txt"
#ifdef OBCO_SAVERESTORE
actionScale(float) : "Scale of action input / framerate" : "1"
FileHandle_t hFile = g_pFullFileSystem->Open( "cfg/transition.cfg", "w" );


CUtlBuffer buf( 0, 0, CUtlBuffer::TEXT_BUFFER );
// Inputs
g_pFullFileSystem->WriteFile( "cfg/transition.cfg", "MOD", buf );
input Action(float) : "Set the speed of the action animation"
g_pFullFileSystem->Close( hFile );
#endif //OBCO_SAVERESTORE</nowiki>
Recompile the code and the crash will be gone.


=== Low eye position when driving the Jalopy ===
input TurnOn(void) : "Turn on: Start engine & enable throttle"
This issue actually affects the HL2 jeep as well, but isn't as noticable. Open <code>game/client/c_prop_vehicle.cpp</code> and search for
input TurnOff(void) : "Turn off: Stop engine, disable throttle, engage brakes."
<nowiki>
m_ViewSmoothingData.bDampenEyePosition = false;</nowiki>
Change it to
<nowiki>
m_ViewSmoothingData.bDampenEyePosition = true;</nowiki>
It's actually already fixed at this point, but players with high latencies will now notice stuttering of the vehicle. To fix that (at the cost of the forward/backward view dampening), for these two files:
<nowiki>game/client/c_vehicle_jeep.cpp (affects both the HL2 jeep and the Jalopy)
game/client/hl2/c_vehicle_airboat.cpp (if you want to fix it for the airboat as well)</nowiki>
'''comment''' out this line:
<nowiki>
DampenForwardMotion( vecVehicleEyePos, vecVehicleEyeAngles, flFrameTime );</nowiki>
If you wish to see the stuttering to evaluate whether you want to sacrifice this, perform the first step above (changing the <code>false</code> to <code>true</code>), then compile and load up the game, flip on <code>sv_cheats</code> and spawn a vehicle and modify the convar <code>net_fakelag <latency to simulate></code>. At higher latencies, the stutter will be more noticable.


=== Inability to grab falling debris on ep1_citadel_02b ===
input Lock(void) : "Prevent the player from entering or exiting the vehicle."
Open <code>game/shared/hl2mp/weapon_physcannon.cpp</code> and change:
input Unlock(void) : "Re-allow the player to enter or exit the vehicle."
<nowiki>
]
#ifdef OBCO_ALLOW_SUPER_GRAVITY_GUN
if ( !IsMegaPhysCannon() )
{
if ( pTarget->VPhysicsIsFlesh( ) )
return false;
return CBasePlayer::CanPickupObject( pTarget, physcannon_maxmass.GetFloat(), 0 );
}


if ( pTarget->IsNPC() && pTarget->MyNPCPointer()->CanBecomeRagdoll() )
return true;


if ( dynamic_cast<CRagdollProp*>(pTarget) )
@BaseClass base(BaseVehicle) = BaseDriveableVehicle
return true;
[
VehicleLocked(choices) : "Start locked" : 0 =
[
0 : "No"
1 : "Yes"
]


return CBasePlayer::CanPickupObject( pTarget, physcannon_maxmass.GetFloat(), 0 );
// Outputs
output PlayerOn(void) : "Player entered the vehicle"
output PlayerOff(void) : "Player exited the vehicle"
output PressedAttack(void) : "Player Pressed attack key"
output PressedAttack2(void) : "Player Pressed attack2 key"


#else
output AttackAxis(string) : "State of attack button [0,1]"
return CBasePlayer::CanPickupObject( pTarget, physcannon_maxmass.GetFloat(), 0 );
output Attack2Axis(string) : "State of attack2 button [0,1]"
#endif //OBCO_ALLOW_SUPER_GRAVITY_GUN
// Inputs
#else
input HandBrakeOn(void) : "Turns the handbrake on"
return false;
input HandBrakeOff(void): "Releases the handbrake"
#endif</nowiki>
]
to
<nowiki>
#ifdef OBCO_ALLOW_SUPER_GRAVITY_GUN
if ( !IsMegaPhysCannon() )
{
if ( pTarget->VPhysicsIsFlesh( ) )
return false;
return CBasePlayer::CanPickupObject( pTarget, physcannon_maxmass.GetFloat(), 0 );
}


if ( pTarget->IsNPC() && pTarget->MyNPCPointer()->CanBecomeRagdoll() )
@PointClass base(BaseVehicle) studioprop() = prop_vehicle :
return true;
"Studiomodel vehicle that can be driven via inputs."
[
// Inputs
input Steer(float) : "Steer the vehicle +/-1"
input Throttle(float) : "Throttle +/-1"


if ( dynamic_cast<CRagdollProp*>(pTarget) )
spawnflags(flags) =
return true;
[
1 : "Always Think (Run physics every frame)" : 0
]
]


// massLimit should be 0 since we would've already called it with physcannon_maxmass.GetFloat() above if it weren't a MegaPhysCannon
return CBasePlayer::CanPickupObject( pTarget, 0, 0 );
#else
return CBasePlayer::CanPickupObject( pTarget, physcannon_maxmass.GetFloat(), 0 );
#endif //OBCO_ALLOW_SUPER_GRAVITY_GUN
#else
return false;
#endif</nowiki>


=== Inability to identify players by looking at them ===
@PointClass base(BaseDriveableVehicle) studioprop() = prop_vehicle_driveable :
Include the file <code>game/client/hl2mp_hud_target_id.cpp</code> in the <code>Client HL2MP</code> project, under <code>Source Files/HL2MP/UI</code>.
"Generic driveable studiomodel vehicle."
[
]
@PointClass base(BaseDriveableVehicle) studioprop() = prop_vehicle_jeep : "Driveable studiomodel jeep."
[
]
@PointClass base(BaseDriveableVehicle) studioprop() = prop_vehicle_hl2buggy : "Jeep for episode 2 mods."
[
model(studio) : "World model" : "models/buggy.mdl"
vehiclescript(string) : "Vehicle Script File" : "scripts/vehicles/jeep_test.txt"
]
@PointClass base(BaseDriveableVehicle) studioprop() = prop_vehicle_jalopy : "Jeep for episode 2 mods."
[
model(studio) : "World model" : "models/vehicle.mdl"
vehiclescript(string) : "Vehicle Script File" : "scripts/vehicles/jalopy.txt"
]


=== Players do not have ragdolls when killed with shotguns ===
@PointClass base(BaseDriveableVehicle, Parentname) studioprop() = prop_vehicle_passengerseat :
This bug is caused because of the changes made to remove a player's ragdoll when they are killed by a barnacle, which inflicts damage of type <code>DMG_LASTGENERICFLAG</code> in addition to others. However, the player's code set up to detect it is inaccurate, causing incorrect removal of the ragdoll when the player is killed by a shotgun blast (<code>shareddefs.h</code> defines <code>DMG_LASTGENERICFLAG</code> as being equivalent to <code>DMG_BUCKSHOT</code>).
"Our method of multiplayer passenger vehicles."
{{Note|This bug only appears when <code>OBCO_BARNACLES_CAN_SWALLOW_PLAYERS</code> is defined.}}
[
Open <code>game/server/hl2mp/hl2mp_player.cpp</code> and change:
model(studio) : "World model" : "models/ss_passenger_cube.mdl"
<nowiki>
#ifdef OBCO_BARNACLES_CAN_SWALLOW_PLAYERS
if ( info.GetDamageType() & DMG_LASTGENERICFLAG )
{
if ( m_hRagdoll )
{
UTIL_RemoveImmediate( m_hRagdoll );
}
}
#endif</nowiki>
to
<nowiki>
#ifdef OBCO_BARNACLES_CAN_SWALLOW_PLAYERS
if ( (info.GetDamageType() & (DMG_ALWAYSGIB|DMG_LASTGENERICFLAG|DMG_CRUSH)) == (DMG_ALWAYSGIB|DMG_LASTGENERICFLAG|DMG_CRUSH) )
{
if ( m_hRagdoll )
{
UTIL_RemoveImmediate( m_hRagdoll );
}
}
#endif</nowiki>


=== Certain campaign maps fail to transition to subsequent ones ===
vehiclescript(string) : "Vehicle Script File" : "scripts/vehicles/prisoner_pod.txt"
This bug is caused due to a line in <code>game/server/triggers.cpp</code>. Replace:
<nowiki>
input Open(void) : "Plays the pod's open animation and unlocks the pod for entry or exit."
#ifdef OBCO_MULTIPLAYER_LEVEL_TRANSITIONS
input Close(void) : "Plays the pod's close animation and locks the pod for entry or exit."
CBasePlayer *pPlayer = (pActivator && pActivator->IsPlayer()) ? ToBasePlayer( pActivator ) : NULL; //TDT - Multiplayer Level Transitions: Get all the players who activate our multiplayer transition.
input EnterVehicle(void) : "Forces the activator (or player) into the pod."
if ( !pPlayer )
input EnterVehicleImmediate(void) : "Forces the activator (or player) into the pod without enter/exit animations."
return;</nowiki>
input ExitVehicle(void) : "Boots the prisoner out of the pod."
with
<nowiki>
output OnOpen(void) : "Fired when the pod is open enough to enter."
#ifdef OBCO_MULTIPLAYER_LEVEL_TRANSITIONS
output OnClose(void) : "Fired when the pod too closed to enter."
CBasePlayer *pPlayer = (pActivator && pActivator->IsPlayer()) ? ToBasePlayer( pActivator ) : UTIL_GetLocalPlayer(); //TDT - Multiplayer Level Transitions: Get all the players who activate our multiplayer transition.
]
if ( !pPlayer )
return;</nowiki>
Using <code>ep1_citadel_02b</code> as an example, the map should transition to the following one when Alyx enters the chamber and triggers the doors to close. But due to the earlier code, Alyx triggering the sequence (which happens 99% of the time, since she doesn't lead the way, and because the mapchange is only triggered when a particular math_counter entity hits two) results in the following <code>if ( !pPlayer )</code> conditional statement aborting the mapchange, stalling everything.
{{Note|This change will cause mapchanges on such maps to occur as soon as the conditions are met (typically with Alyx and one player being in the trigger's volume), even if no other players have entered the trigger.}}


= Compiled Version =
//----------------------------------//
//       //
// Switch Model Targets     //
//  Sets all players to set model  //
// //
//----------------------------------//
@PointClass base(Targetname, Angles, EnableDisable) iconsprite("sprites/icons/switchmodel.vmt") = info_switchmodel : "SecobMod Co-Operative Set Model"
[
]


The information below is important for understanding how the modification operates, even if all you will be using is the patch file. You may find it more useful to use the Compiled mod folder as your mods folder and edit it as required, then you're assured that all the files are there and everything is setup correctly (unless you mess something up).
//-------------------------------------------------------------------------
//
// Solid Classes
//
//-------------------------------------------------------------------------


The compiled version has a handy to use installer (OBCO_Final_Compiled_Release.exe found in the .7z archive) to make life easier for everyone using it.
@SolidClass = func_ladder :
"Ladder. Players will be able to freely along this brush, as if it was a ladder. If you are using a model prop " +
"for the visual representation of the ladder in the map, apply the toolsinvisibleladder material to the " +
"func_ladder brush."
[
]
</source></div>


== GameInfo.txt ==
Now launch Hammer and from the selection list choose SecobMod.


'''This file is extremely important''', it can't be stressed enough because without it being properly setup most of the content will fail to work (if not crash hl2.exe) if using Static Mounting, and not load important sounds, animations, etc if Dynamic Mounting.
If you are going to be using the stock vehicles and the secobmod passenger seat, you will find the prefabs folder a useful addition to your hammer editor. So copy the secobmod_prefabs folder from your game folder to your: ..\Steam\SteamApps\common\Source SDK Base 2013 Multiplayer\bin\Prefabs folder.


GameInfo.txt is also where you define such things as your developers team name, website and the icon to display in Steam, as well as the game's title.
= Important Map Settings. =


The most important section, and the section that we're going to describe here are the 'Search Paths'.
If you are using the player class system, then there are a few changes you will have to make to the map so that it doesn't crash on trying to spawn the player.


Make a hollow room/cube large enough to fit several players in outside of the main map area, and texture it in a purely black colour. Add in some standard player starts into it, and then put the real (per-class) player starts where you want them inside the playable space of the map.


Search paths are the modifications way of mounting the GCFs which come with each Half-Life 2 game. In the current compiled version the search paths in our gameinfo.txt looks like this:
This will now mean your game won't crash on your player trying to spawn, usually you can get away with just one standard player start and a room large enough for one person as people will spawn inside one another till they pick their class and spawn at their correct class location, but for safety it may be best to make it a large cube with several player starts as stated above.


<nowiki>
    SearchPaths
    {
        Game |all_source_engine_paths|ep2
Game |all_source_engine_paths|episodic
Game |all_source_engine_paths|hl2mp
Game |all_source_engine_paths|hl2
    }</nowiki>


Notice how we do not have Portal in the search paths. This is because Portal should never be defined here (Unless you use Static Mounting, in which case it should be put '''BELOW''' hl2).
Also, there is a custom actor you can allow mappers to use called setmodel, this if placed in a game will allow players to set the model for all players, you can see how this works by opening the defector example map. In this maps case it spawns all players as metrocops.


If you create a map and notice animations or scripted sequences failing to load, this is usually a sign of Static Mounting being used, or of some specific game content being used in an incorrect Dynamic Content map type. An example is the Alyx "Dr Freeman, I Presume" scene in <code>d1_trainstation_04</code>, this sort of concussion scene will *NOT* work if your map type were <code>ss_ep1_</code> or <code>ss_ep2_</code> and would not work in Static Mounting if Half-Life 2 wasn't mounted last in the list.
= Important Settings Files. =


This leads us nicely on to the:
These are all used in the compiled folder of your modification.


== InstalledSourceGames.txt ==


Additional code in cdll_client_init.cpp and gameinterface.cpp has added the ability to mount additional GCF files. This is always enabled whether you are using Static or Dynamic content mounting.
== GameInfo.txt ==


The InstalledSourceGames.txt file (previously AddMount.txt in older mod versions) helps the game find models, textures and maps that it wouldn't otherwise do through the gameinfo.txt's searchpaths. The gameinfo.txt searchpaths allow mounting sounds and particles which the AddMount.txt fails to do.
GameInfo.txt is also where you define such things as your developers team name, website and the icon to display in Steam, as well as the game's title.


Only games listed within the text file will be displayed, and as such in most cases you will either wish to delete the code from the .cpp files, or blank out the contents of the file.
The most important section are the 'Search Paths'.


Notice how the order partially mimics the GameInfo.txt search paths, except that we put Half-life 2: Deathmatch at the top and we '''ALWAYS''' - if being used - put Portal as the '''LAST''' thing (bottom of) the file.
Search paths are the modifications way of mounting the VPKs which come with each modern Valve game.


<nowiki>
A backup of the gameinfo.txt file can be found within the secobmod_information.h file.
"Half-Life 2: Deathmatch"
{
  "SearchPath"  "hl2mp"
  "AppID"        "-320"
}


"Half-Life 2"
== resource/mod_hl2mp_english.txt ==
{
  "SearchPath"  "hl2"
  "AppID"        "-220"
}


"Half-Life 2: Episode 1"
This is found in the resource folder and is the modification's language definition file. Here you can find settings such as the titles for Chapters, the messages displayed on a vital ally being killed (for example) and other things such as server connection messages etc.
{
  "SearchPath"  "episodic"
  "AppID"        "-380"
}


"Half-Life 2: Episode 2"
{
  "SearchPath"  "ep2"
  "AppID"        "-420"
}


"Portal: The cake is a lie!"
You should name this file to that of your own game/modifications' title, (GameorModName_english.txt).
{
  "SearchPath"  "portal"
  "AppID"        "-400"
}</nowiki>


== cfg/skill.cfg ==
== cfg/skill.cfg ==


The skill.cfg file is important as it allows you to define such things as NPC health, NPC damage (to others such as the player), number of rockets a Strider may withstand and even how much charge a Vortigaunt can give to the players suit. It is worth reading through the file and editing it to suit your needs as it does define a lot of features of modifications. It can be found in the cfg folder.
The skill.cfg file is important as it allows you to define such things as NPC health, NPC damage (to others such as the player), number of rockets a Strider may withstand and even how much charge a Vortigaunt can give to the players suit. It is worth reading through the file and editing it to suit your needs as it does define a lot of features of modifications. It can be found in the cfg folder.
== resource/obcoop_english.txt ==
This is the modification's language definition file. Here you can find settings such as the titles for Chapters, the messages displayed on a vital ally being killed (for example) and other things such as server connection messages etc. It's found in the resource folder.


== scripts/ChapterBackgrounds.txt ==
== scripts/ChapterBackgrounds.txt ==


This file defines which of your modifications maps are background maps to display on the main menu. If you choose to use background maps with your modification, be sure to enable the <code>OBCO_BG_MOTD_FIX</code> definition in the <code>obcoop_shareddefs.h</code> so as not to display the motd on the main menu.
This file defines which of your modifications maps are background maps to display on the main menu. If you choose to use background maps with your modification, be sure to enable the <code>secobmod__BG_MOTD_FIX</code> definition in the <code>secobmod_shareddefs.h</code> so as not to display the motd on the main menu.


== cfg/valve.rc ==
== cfg/valve.rc ==


This file defines whether background maps are displayed on the main menu. It's found in the cfg folder.
This file defines whether background maps are displayed on the main menu. It's found in the cfg folder.
== resource/ui/Classmenu.res ==
This is the file which tells the game where to place the Join buttons etc for the Player Class System. I'm mentioning this in passing as in your own modification if you use the default <code>Classmenu.res</code> which comes with the SDK, all you'll see is a window with a Cancel button.


== resource/ClientScheme.res ==
== resource/ClientScheme.res ==


This is the HUD colour file. Seperate versions can be used per player class as needed. Currently all classes are set to use the one same file.  
This is the HUD colour file. Seperate versions can be used per player class as needed (the code is implemented). Currently all classes are set to use the same file.


== maps/map_briefings ==
== maps/map_briefings ==
Line 454: Line 393:
This is a folder inside the <code>maps</code> folder. Each map that requires a briefing has a text file for that specific map. This loads in a similar fashion to the MOTD panel. It allows a quick map storyline for people loading the map. See our example maps in-game to see this concept in action.
This is a folder inside the <code>maps</code> folder. Each map that requires a briefing has a text file for that specific map. This loads in a similar fashion to the MOTD panel. It allows a quick map storyline for people loading the map. See our example maps in-game to see this concept in action.


== media/StartupVids.txt ==


Create this for custom Startup Videos, or if you create a blank version of this file then there will be no startup videos at all in your mod.
= Dedicated Server Guide =
 
Please see [https://developer.valvesoftware.com/wiki/SteamCMD this guide] for setting up a Source SDK dedicated server.
 
= Features =
 
<div style="max-height:30em;overflow:auto;"><source lang=xml>
 
Developers can easily enable and disable individual features to suit their needs.
 
This is a cut down list, for full information as to the features please see the secobmod_shareddefs.h file).
 
** Portal Gun, enable testing in the shared defs file to enable its useage. give weapon_portalgun and companioncube.
** Super Gravity Gun (some graphic effects missing - most of the code done by .Kave).
** Restart level on critical ally/object/time limit failing.
** View Cameras now take control of all players on a server (Gordon's KO Wakeup scene, etc).
** Save/Restore transitions now work even if you disable playerclasses from the code.
** Each player class player now has their own unique filter name, meaning only a certain playerclass
can trigger an event (for example). Thanks Alters for the fix!
** Called it a day on development. It's all in the hands of the community now.
 
 
* AI Patch Modifications:
** Enable/Disable an enhanced version of Winston's AI Multiplayer patch.
** Valve Game Mounting through use of the gameinfo.txt search paths.
 
 
* Episode 2 Support:
** Including support for Alyx Darkness Mode
 
 
* Player Abilities:
** Non-HEV wearers can still be allowed to sprint, have the geiger counter, etc. This is on a
per-item basis, so players could have the geiger, but no sprint if you wanted.
** Players can pick up objects with their hands. 
** NightVision (currently only enabled for the Heavy class, use the 'N' key to enable it).
 
 
* Player Class System With:
** Four (or more, or less) Player Classes.
** Per Player Class Object Pickup Strengths.
** Customise Class Health/Maximum Health Values.
** Customise Class Armour/Maximum Armour Values.
** Customise Class Walk/Sprint/Normal movement speeds.
** Customise Class Jump Heights.
** Each Class Can Have Its Own HUD Layout/Colour scheme.
** Define how many players can be in each Player Class.
 
 
* Weapon Enhancements:
** Development teams can now enable Iron Sight.
** A known HL2DM shotgun fast-switch bug - fixed thanks to Community input!.
 
 
* NPC Abilities:
** Striders can be set to always impale players who get too close.
** Barnacles can now be set to swallow players.
 
 
* Vehicles:
** The multiplayer camera judder is no more!
** Thirdperson model in-vehicle animations can now be used.
** Old-Style passenger seats can now be used to provide extra seats in vehicles.
** Jeeps and Jalopys' can now have their headlights switched on.
 
 
* Cool Stuff:
** Firstperson ragdoll views on player deaths.
** Camera bob on player movement (incl. strafe).
** Use Counter-Strike: Sources' ladders code instead of the Half-Life 2 ladders.
 
 
* Game Settings:
** Friendly Fire (Replaces players can collide from v1.5).
** Dynamic Respawn Code. Don't spawn back at the start of the map anymore, respawn back
where you left off in your killing spree.
** Multiplayer Level Transitions. On ALL players entering the transition area the server
is forced to changelevel to the next map (percentage can be changed).
** Save/Restore. A basic working transition system which saves/restores your loadouts.
** Valve approved cheating. Now even if sv_cheats 1 is enabled, players can't cheat unless
you define it as acceptable in the code.
** Map briefings. Provide storylines on a per-map basis.
** Map specific model overrides. Changes all players to a specified player model on a
particular map (set by the mapper). Check out our defector map for an in-game example!
</source></div>
 
= Credits =
 
** ChiefWhosm/Whoozzem
** Spamslayer
** MontyPython
** Sneaky
** Ariae
** Everyone else who used to be in 4WH.
** - and -
** Winston
** Tony Sergi
** Biohazard_90
** Sub-Zero
** DutchMega
** The Last 7 Hours Spanish Mod
** Makkon
** Skidz
** Alters
** .Kave
** KuRouZu
** Jorg
** z33ky
** JordanN
** Toox
** TheRJMan
** SilverPower
** Vektorx4
** Sirmastercombat
** Sandern
** HalfWit2
** Anyone else forgotten
 
= Known Bugs =
 
<div style="max-height:30em;overflow:auto;"><source lang=xml>
 
* HIGH - Restore code of the save/restore code is currently set to use a static folder/file path. This is probably easily fixed.
* MEDIUM - Because we are relying on search path mounting, currently some scenes (meaning actions, gestures and some sounds) do not play. There are more that work than those few that don't at least.
* MEDIUM - Armour not working on non-playerclass save/restore transitions. This should work according to the code!
* MEDIUM - Leaving tilted vehicles causes players to appear tilted as well. This affects only their player
model, their actual views are normal.
 
* MEDIUM - Weapon strip/dissolve zones (as used to make the Super Gravity Gun in HL2/EP1) don't work.
 
The above is Caused by the game not recognizing the hl2mp gravity gun and just deleting it,
then the test zone (d3_citadel_03) sticks waiting on the script to finish.
 
* LOW - Gravity Gun - Particles show without alphas/blobs, this is probably missing particle files and can probably be easily fixed. It's possible to mount HL2:DeathMatch vpk's to fix this but this breaks the AI animations from working.
* LOW - Super Gravity Gun - Some particle effects are missing, but the gun itself works as in singleplayer.
* LOW - Blood splashes being emitted when shooting other players despite no damage actually being dealt
(only applicable when "SecobMod__FRIENDLY_FIRE_ENABLED" is disabled).
 
* LOW - Chat bubbles angle towards the player's view, so they can appear embedded in walls etc, however there is also now a bug where the code is fine but the model fails to render. I'm wondering if it is spawning at the map rather than player origin or something strange.
* LOW - AI bend their legs when going up in lifts (elevators), and hover slightly in the air going down.
</source></div>
 
= Bug Fixes. =


== OrangeBox_Co-Operative Information ==
* Feel free to fork the github code and push back changes to the base code for all to enjoy, or post them here to be added to the code once spotted.


This folder contains information for mappers (including things such as an FGD file and useful prefabs) and also information for Dedicated Server hosts.
[[Category:Modding]]

Latest revision as of 08:50, 21 January 2024

Dead End - Icon.png
This article has no Wikipedia icon links to other VDC articles. Please help improve this article by adding links Wikipedia icon that are relevant to the context within the existing text.
January 2024

Description

Source Engine Co-Operative Base Modification (SecobMod) is a modification containing useful code fixes for co-operative games. Please see the Features list for more details.


There are currently two versions of this modification available, The current one for Source SDK 2013 the older one for Source Engine 2007/2009 which can be found here.

This page deals solely with the latest version (the Source SDK 2013 multiplayer version).


    • Please be aware that no support is given with this modification. Occasionally I check the steam forums and reply to threads I see as I can, but in most cases you are on your own - this is why this wiki page has been so heavily detailed


If you release a modification which uses SecobMod or code from it, please remember to add those listed in the Credits section of this page to your own credits.


Currently the minimum requirements are solely that you have the Source SDK Base 2013 Multiplayer installed, though you may find the content restrictive is what you have available to you, as a result of this you may wish to mount other Valve games so that you can use their content (maps, models, sounds, materials etc) but please note that coded items from games that are not Half-Life 2 based will not work.


These must use the new .vpk file format to work, at the time of writing the following have been tested and are found to work with various degrees of success:

  • Half-Life 2.
  • Half-Life 2: Episode 1.
  • Half-Life 2: Episode 2.
  • Portal 1
  • Portal 2
  • Team Fortress 2
  • Counter-Strike Source


To keep this wiki page easily viewed, many items are now implemented into scroll boxes, so that the more important aspects of the page can be kept whole.

Installation.

With the switchover of Valves' Source SDK hosting onto a GitHub repository it is now much easier to get hold of the code for SecobMod than it was with the previous Seco7 version.

Firstly you should follow the instructions for the Source SDK as found on here.

However where it would have you going to the official Valve SDK repository you will want to point your browser or GitHub client to this repository instead.

Make sure that you store your code in a folder path WITHOUT any spaces in it as it can cause problems compiling especially if you wish to debug your code!

As you can see in Valves' instructions you have the choice of using github for your project and forking off the code (creating your own unique copy of the SecobMod code to edit as you see fit and with the added bonus of being able to merge updates to the base SecobMod and Source SDK code as they are released should you want them, or by downloading a zip file containing all the SecobMod files at the latest commit to the GitHub repository.

If you have already started on your project and wish to combine it into a SecobMod base then I would recommend getting a copy/forking a copy of SecobMod and using a program such as winmerge to merge in your changes due to the amount of changes SecobMod has made to many of the base Source SDK files.


Setting up the compiled game folder.

Now that you have obtained the latest SecobMod and extracted the zip file (if you didn't fork the code in GitHub) then you will want to copy SecobMod's folder located at:


MP>Game>mod_hl2mp

to:

Steam>steamapps>sourcemods


At this point you could rename the mod_hl2mp folder in your sourcemods folder to that of your game name.

Setting up the Project files.

Once you have the code setup you can quickly get the source code project files up and running with all the required code files added/removed for compiling by going into your:

mp>game>mod_hl2mp

folder and open client_hl2mp-2005.vcxproj and server_hl2mp-2005.vcxproj in a text editor and changing all references to:

c:\github\SecobMod...etc to reflect where you have stored your code files.

Once this is complete you should then copy the files as outlined below:


client_hl2mp.vcxproj to the mp>src>Game>Client folder.

-and-

server_hl2mp.vcxproj mp>src>Game>Server folder.

and overwriting the files that were created while following the github instructions on the other Valve wiki page.

Debugging the code

You will of course wish to debug any problems, errors, crashes and such that you get while play testing your game. This wiki page describes the process of setting up the project for debugging.

Adding and Removing Game Features

SecobMod was designed so that you can easily disable and enable its features, so that you can customise it in whatever which way you want it.

As such all features are stored with a file in the Src>Game>Shared>Secobmod folder, called secobmod_shareddefs.h

On opening this file you will find every feature clearly defined, and information concerning what each feature does.

To enable a feature, remove the // from the beginning of the word define, to disable a feature add the // in front of its' define.

As an aside if you'd like to try out nightvision in game, it is binded to the 'N' key and as it stands it is currently only enabled for the heavy class (but you have the power to change this if you'd like!).

The file has one last important role, and that is that by defining all changes, this makes searching for all references to a specific feature in the entire codebase very easy. This allows easier transition of code between engine releases or should you wish to use code from SecobMod you can easily find it to implement in other Source SDK Multiplayer games.


Note.pngNote: --

Important information about all the code can be found in the same folder, but in the file titled secobmod_information.h- }}

Teams

Setting up teams in Secobmod is very easy, you can enforce teamplay using the secobmod's definition, however for a full team play implemenation you will want to follow this wiki page (take a note of the warnings about SDK 2013).

In the old 2007/9 SDK release there was a problem with team members being unable to do any damage to either teams AI. The code function which had this problem was removed from the 2013 SDK and I have not added it back in. If you have issues with teamplay and the AI then you may need to grab this code from the older seco7 code.

In my basic testing of teams the game does now work as it should without this code, but I leave this in as a small warning for those wishing to have a teamplay based co-operative game.

Setting up the Hammer Map Editor

SecobMod has a few custom entities that mappers can use, should they wish to.

So that you can use these in your the Hammer editor, you'll need to edit and add a few files (as will any other mappers on your modifications team).

Locate the ..\SteamApps\common\Source SDK Base 2013 Multiplayer\bin\ GameConfig.txt file

And add the following to it, edit as appropriate with your modifications name and steam folder paths.

		"SecobMod"
		{
			"GameDir"		"..\Steam\SteamApps\SourceMods\mod_hl2mp"
			"hammer"
			{
				"TextureFormat"		"5"
				"MapFormat"		"4"
				"DefaultTextureScale"		"0.250000"
				"DefaultLightmapScale"		"16"
				"DefaultSolidEntity"		"func_detail"
				"DefaultPointEntity"		"info_player_start"
				"GameExe"		"..\Steam\Steam\SteamApps\common\Source SDK Base 2013 Multiplayer\hl2.exe"
				"MapDir"		"..\Steam\steamapps\SourceMods\mod_hl2mp\mapsrc"
				"CordonTexture"		"tools\toolsskybox"
				"MaterialExcludeCount"		"0"
				"BSP"		"..\Steam\SteamApps\common\Source SDK Base 2013 Multiplayer\bin\vbsp.exe"
				"Vis"		"..\Steam\SteamApps\common\Source SDK Base 2013 Multiplayer\bin\vvis.exe"
				"Light"		"..\Steam\SteamApps\common\Source SDK Base 2013 Multiplayer\bin\vrad.exe"
				"BSPDir"		"..\Steam\Steamapps\SourceMods\mod_hl2mp\maps"
				"GameData0"		"..\Steam\SteamApps\common\Source SDK Base 2013 Multiplayer\bin\secobmod.fgd"
			}
		}

Next, you'll want to create a blank/empty file called secobmod.fgd using a text editor, and place it in the ..\SteamApps\common\Source SDK Base 2013 Multiplayer\bin folder.

//-------------------------------------------------------------------------
//
// Game data for SecobMod.
//
//-------------------------------------------------------------------------

@include "base.fgd"
@include "halflife2.fgd"
@include "hl2mp.fgd"
@include "portal.fgd"
//Add any other includes here such as css, tf2 etc etc.

@PointClass base(PlayerClass, Angles) studio("models/editor/playerstart.mdl") = info_player_assaulter :
	"This entity indicates the position and facing direction at which the player will spawn during a player classes map. Any number of "+
	"info_player_assaulter entities may be placed in a map."
[
]

@PointClass base(PlayerClass, Angles) studio("models/editor/playerstart.mdl") = info_player_supporter :
	"This entity indicates the position and facing direction at which the player will spawn during a player classes map. Any number of "+
	"info_player_supporter entities may be placed in a map."
[
]


@PointClass base(PlayerClass, Angles) studio("models/editor/playerstart.mdl") = info_player_medic :
	"This entity indicates the position and facing direction at which the player will spawn during a player classes map. Any number of "+
	"info_player_medic entities may be placed in a map."
[
]

@PointClass base(PlayerClass, Angles) studio("models/editor/playerstart.mdl") = info_player_heavy :
	"This entity indicates the position and facing direction at which the player will spawn during a player classes map. Any number of "+
	"info_player_heavy entities may be placed in a map."
[
]

@PointClass base(Targetname, Angles) studio( "models/combine_turrets/floor_turret.mdl" ) = npc_turret_floor : "Combine Floor Turret"
[
		spawnflags(Flags) = 
	[
		32 : "Autostart" : 0
		64 : "Start Inactive" : 0
		128 : "Fast Retire" : 0
		256 : "Out of Ammo" : 0
		512 : "Citizen modified (Friendly)" : 0
		1024 : "Portal Turret" : 0
	]

	SkinNumber(integer) : "Skin Number" : 0 : "Which skin to use for this turret. Set to 0 to select randomly."

	// Inputs
	input Toggle(void) : "Toggle - If open, close. If closed, open."
	input Enable(void) : "Enable the turret."
	input Disable(void) : "Disable the turret."
	input DepleteAmmo(void) : "Depletes all the ammo from a turret, causing it to dry-fire."
	input RestoreAmmo(void) : "Restores ammo to a turret, allowing it to fire live rounds again."
	input SelfDestruct(void) : "Causes the turret to warn and then explode."

	// Outputs
	output OnDeploy(void) : "Turret is becoming active and dangerous."
	output OnRetire(void) : "Turret is becoming inactive and harmless."
	output OnTipped(void) : "Turret has been tipped over and is inactive."
	output OnPhysGunPickup(void) : "Picked up with physgun"
	output OnPhysGunDrop(void) : "Released by physgun"
]

//-------------------------------------------------------------------------
//
// Vehicles.
//
//-------------------------------------------------------------------------
@BaseClass base(Targetname, Origin, Global, prop_static_base) = BaseVehicle
[
	vehiclescript(string) : "Vehicle Script File" : "scripts/vehicles/jeep_test.txt"
	actionScale(float) : "Scale of action input / framerate" : "1"

	// Inputs
	input Action(float) : "Set the speed of the action animation"

	input TurnOn(void) : "Turn on: Start engine & enable throttle"
	input TurnOff(void) : "Turn off: Stop engine, disable throttle, engage brakes."

	input Lock(void) : "Prevent the player from entering or exiting the vehicle."
	input Unlock(void) : "Re-allow the player to enter or exit the vehicle."
]


@BaseClass base(BaseVehicle) = BaseDriveableVehicle
[
	VehicleLocked(choices) : "Start locked" : 0 =
	[
		0 : "No"
		1 : "Yes"
	]	

	// Outputs
	output PlayerOn(void) : "Player entered the vehicle"
	output PlayerOff(void) : "Player exited the vehicle"
	
	output PressedAttack(void) : "Player Pressed attack key"
	output PressedAttack2(void) : "Player Pressed attack2 key"

	output AttackAxis(string) : "State of attack button [0,1]"
	output Attack2Axis(string) : "State of attack2 button [0,1]"
	
	// Inputs
	input HandBrakeOn(void) : "Turns the handbrake on"
	input HandBrakeOff(void): "Releases the handbrake"
]

@PointClass base(BaseVehicle) studioprop() = prop_vehicle :
	"Studiomodel vehicle that can be driven via inputs."
[
	// Inputs
	input Steer(float) : "Steer the vehicle +/-1"
	input Throttle(float) : "Throttle +/-1"

	spawnflags(flags) =
	[
		1 : "Always Think (Run physics every frame)" : 0
	]
]


@PointClass base(BaseDriveableVehicle) studioprop() = prop_vehicle_driveable :
	"Generic driveable studiomodel vehicle."
[
]
@PointClass base(BaseDriveableVehicle) studioprop() = prop_vehicle_jeep : "Driveable studiomodel jeep."
[
]
@PointClass base(BaseDriveableVehicle) studioprop() = prop_vehicle_hl2buggy : "Jeep for episode 2 mods."
[
model(studio) : "World model" : "models/buggy.mdl"
vehiclescript(string) : "Vehicle Script File" : "scripts/vehicles/jeep_test.txt"
]
@PointClass base(BaseDriveableVehicle) studioprop() = prop_vehicle_jalopy : "Jeep for episode 2 mods."
[
model(studio) : "World model" : "models/vehicle.mdl"
vehiclescript(string) : "Vehicle Script File" : "scripts/vehicles/jalopy.txt"
]

@PointClass base(BaseDriveableVehicle, Parentname) studioprop() = prop_vehicle_passengerseat :
	"Our method of multiplayer passenger vehicles."
[
model(studio) : "World model" : "models/ss_passenger_cube.mdl"

	vehiclescript(string) : "Vehicle Script File" : "scripts/vehicles/prisoner_pod.txt"
	
	input Open(void) : "Plays the pod's open animation and unlocks the pod for entry or exit."
	input Close(void) : "Plays the pod's close animation and locks the pod for entry or exit."
	input EnterVehicle(void) : "Forces the activator (or player) into the pod."
	input EnterVehicleImmediate(void) : "Forces the activator (or player) into the pod without enter/exit animations."
	input ExitVehicle(void) : "Boots the prisoner out of the pod."
	
	output OnOpen(void) : "Fired when the pod is open enough to enter."
	output OnClose(void) : "Fired when the pod too closed to enter."
]

//----------------------------------//
//							   	    //
// 		Switch Model Targets	    //
//  Sets all players to set model   //
//									//
//----------------------------------//
@PointClass base(Targetname, Angles, EnableDisable) iconsprite("sprites/icons/switchmodel.vmt") = info_switchmodel : "SecobMod Co-Operative Set Model"
[
]

//-------------------------------------------------------------------------
//
// Solid Classes
//
//-------------------------------------------------------------------------

@SolidClass = func_ladder : 
	"Ladder. Players will be able to freely along this brush, as if it was a ladder. If you are using a model prop " +
	"for the visual representation of the ladder in the map, apply the toolsinvisibleladder material to the " +
	"func_ladder brush."
[
]

Now launch Hammer and from the selection list choose SecobMod.

If you are going to be using the stock vehicles and the secobmod passenger seat, you will find the prefabs folder a useful addition to your hammer editor. So copy the secobmod_prefabs folder from your game folder to your: ..\Steam\SteamApps\common\Source SDK Base 2013 Multiplayer\bin\Prefabs folder.

Important Map Settings.

If you are using the player class system, then there are a few changes you will have to make to the map so that it doesn't crash on trying to spawn the player.

Make a hollow room/cube large enough to fit several players in outside of the main map area, and texture it in a purely black colour. Add in some standard player starts into it, and then put the real (per-class) player starts where you want them inside the playable space of the map.

This will now mean your game won't crash on your player trying to spawn, usually you can get away with just one standard player start and a room large enough for one person as people will spawn inside one another till they pick their class and spawn at their correct class location, but for safety it may be best to make it a large cube with several player starts as stated above.


Also, there is a custom actor you can allow mappers to use called setmodel, this if placed in a game will allow players to set the model for all players, you can see how this works by opening the defector example map. In this maps case it spawns all players as metrocops.

Important Settings Files.

These are all used in the compiled folder of your modification.


GameInfo.txt

GameInfo.txt is also where you define such things as your developers team name, website and the icon to display in Steam, as well as the game's title.

The most important section are the 'Search Paths'.

Search paths are the modifications way of mounting the VPKs which come with each modern Valve game.

A backup of the gameinfo.txt file can be found within the secobmod_information.h file.

resource/mod_hl2mp_english.txt

This is found in the resource folder and is the modification's language definition file. Here you can find settings such as the titles for Chapters, the messages displayed on a vital ally being killed (for example) and other things such as server connection messages etc.


You should name this file to that of your own game/modifications' title, (GameorModName_english.txt).

cfg/skill.cfg

The skill.cfg file is important as it allows you to define such things as NPC health, NPC damage (to others such as the player), number of rockets a Strider may withstand and even how much charge a Vortigaunt can give to the players suit. It is worth reading through the file and editing it to suit your needs as it does define a lot of features of modifications. It can be found in the cfg folder.

scripts/ChapterBackgrounds.txt

This file defines which of your modifications maps are background maps to display on the main menu. If you choose to use background maps with your modification, be sure to enable the secobmod__BG_MOTD_FIX definition in the secobmod_shareddefs.h so as not to display the motd on the main menu.

cfg/valve.rc

This file defines whether background maps are displayed on the main menu. It's found in the cfg folder.

resource/ClientScheme.res

This is the HUD colour file. Seperate versions can be used per player class as needed (the code is implemented). Currently all classes are set to use the same file.

maps/map_briefings

This is a folder inside the maps folder. Each map that requires a briefing has a text file for that specific map. This loads in a similar fashion to the MOTD panel. It allows a quick map storyline for people loading the map. See our example maps in-game to see this concept in action.


Dedicated Server Guide

Please see this guide for setting up a Source SDK dedicated server.

Features

Developers can easily enable and disable individual features to suit their needs.

This is a cut down list, for full information as to the features please see the secobmod_shareddefs.h file).

** Portal Gun, enable testing in the shared defs file to enable its useage. give weapon_portalgun and companioncube.
** Super Gravity Gun (some graphic effects missing - most of the code done by .Kave).
** Restart level on critical ally/object/time limit failing.
** View Cameras now take control of all players on a server (Gordon's KO Wakeup scene, etc).
** Save/Restore transitions now work even if you disable playerclasses from the code.
** Each player class player now has their own unique filter name, meaning only a certain playerclass
 can trigger an event (for example). Thanks Alters for the fix!
** Called it a day on development. It's all in the hands of the community now.


* AI Patch Modifications:
** Enable/Disable an enhanced version of Winston's AI Multiplayer patch.
** Valve Game Mounting through use of the gameinfo.txt search paths.		


* Episode 2 Support:
** Including support for Alyx Darkness Mode


* Player Abilities:
** Non-HEV wearers can still be allowed to sprint, have the geiger counter, etc. This is on a
 per-item basis, so players could have the geiger, but no sprint if you wanted.
** Players can pick up objects with their hands.  
** NightVision (currently only enabled for the Heavy class, use the 'N' key to enable it).


* Player Class System With:
** Four (or more, or less) Player Classes.
** Per Player Class Object Pickup Strengths.
** Customise Class Health/Maximum Health Values.
** Customise Class Armour/Maximum Armour Values.
** Customise Class Walk/Sprint/Normal movement speeds.
** Customise Class Jump Heights.
** Each Class Can Have Its Own HUD Layout/Colour scheme.
** Define how many players can be in each Player Class.


* Weapon Enhancements:
** Development teams can now enable Iron Sight.
** A known HL2DM shotgun fast-switch bug - fixed thanks to Community input!.


* NPC Abilities:
** Striders can be set to always impale players who get too close.
** Barnacles can now be set to swallow players.


* Vehicles:
** The multiplayer camera judder is no more!
** Thirdperson model in-vehicle animations can now be used.
** Old-Style passenger seats can now be used to provide extra seats in vehicles.
** Jeeps and Jalopys' can now have their headlights switched on.


* Cool Stuff:
** Firstperson ragdoll views on player deaths.
** Camera bob on player movement (incl. strafe).
** Use Counter-Strike: Sources' ladders code instead of the Half-Life 2 ladders.


* Game Settings:
** Friendly Fire (Replaces players can collide from v1.5).
** Dynamic Respawn Code. Don't spawn back at the start of the map anymore, respawn back 
where you left off in your killing spree.
** Multiplayer Level Transitions. On ALL players entering the transition area the server 
is forced to changelevel to the next map (percentage can be changed).
** Save/Restore. A basic working transition system which saves/restores your loadouts.
** Valve approved cheating. Now even if sv_cheats 1 is enabled, players can't cheat unless 
you define it as acceptable in the code.
** Map briefings. Provide storylines on a per-map basis.
** Map specific model overrides. Changes all players to a specified player model on a 
particular map (set by the mapper). Check out our defector map for an in-game example!

Credits

    • ChiefWhosm/Whoozzem
    • Spamslayer
    • MontyPython
    • Sneaky
    • Ariae
    • Everyone else who used to be in 4WH.
    • - and -
    • Winston
    • Tony Sergi
    • Biohazard_90
    • Sub-Zero
    • DutchMega
    • The Last 7 Hours Spanish Mod
    • Makkon
    • Skidz
    • Alters
    • .Kave
    • KuRouZu
    • Jorg
    • z33ky
    • JordanN
    • Toox
    • TheRJMan
    • SilverPower
    • Vektorx4
    • Sirmastercombat
    • Sandern
    • HalfWit2
    • Anyone else forgotten

Known Bugs

* HIGH - Restore code of the save/restore code is currently set to use a static folder/file path. This is probably easily fixed.
* MEDIUM - Because we are relying on search path mounting, currently some scenes (meaning actions, gestures and some sounds) do not play. There are more that work than those few that don't at least.
* MEDIUM - Armour not working on non-playerclass save/restore transitions. This should work according to the code!
* MEDIUM - Leaving tilted vehicles causes players to appear tilted as well. This affects only their player
 model, their actual views are normal.

* MEDIUM - Weapon strip/dissolve zones (as used to make the Super Gravity Gun in HL2/EP1) don't work.

The above is Caused by the game not recognizing the hl2mp gravity gun and just deleting it,
then the test zone (d3_citadel_03) sticks waiting on the script to finish.

* LOW - Gravity Gun - Particles show without alphas/blobs, this is probably missing particle files and can probably be easily fixed. It's possible to mount HL2:DeathMatch vpk's to fix this but this breaks the AI animations from working.
* LOW - Super Gravity Gun - Some particle effects are missing, but the gun itself works as in singleplayer.
* LOW - Blood splashes being emitted when shooting other players despite no damage actually being dealt
 (only applicable when "SecobMod__FRIENDLY_FIRE_ENABLED" is disabled).

* LOW - Chat bubbles angle towards the player's view, so they can appear embedded in walls etc, however there is also now a bug where the code is fine but the model fails to render. I'm wondering if it is spawning at the map rather than player origin or something strange.
* LOW - AI bend their legs when going up in lifts (elevators), and hover slightly in the air going down.

Bug Fixes.

  • Feel free to fork the github code and push back changes to the base code for all to enjoy, or post them here to be added to the code once spotted.