-
Notifications
You must be signed in to change notification settings - Fork 22
Features & Configuration
SourceCoop makes an effort to only alter gameplay on maps that it knows are cooperative, while keeping others near stock.
Some crash-fixes and patches are always applied as long as the plugin is running, regardless of mode.
- Re-enabled single-player functionality (prop pickup, sprinting, suit sounds, weapons, ...)
- Entity adaptations for multiplayer
- Custom mapchange handling supporting campaigns
- Expansive map oriented configuration setup with equipment, entity fixes, checkpoints and so on
- Map start and mapchange timers
- Delayed map intros
- Survival mode with revives
- Player persistence
- Pickup item instancing
- Coop menu
- Modular addons, each providing unique functionality
- Smaller tweaks for improved overall experience
Syntax: sc_ft <FEATURE> <1/0>
These on/off switches are usually configured per map in edt configs. Server configuration is optional and could negatively affect some maps.
A collection of these commands can simply be put in server.cfg, which will load on each map-change and override the map's default configuration.
FIRSTPERSON_DEATHCAMRe-Enables first person death camera.
HEV_SOUNDSRe-Enables HEV sounds
INSTANCE_ITEMSInstances pickup items and weapons for each player. They disappear once picked up, and 'respawn' along with the player.
INSTANCE_ITEMS_NORESETIf enabled, won't 'respawn' picked up items after death.
KEEP_EQUIPMENTMakes players spawn with previously picked up equipment (suit, weapons). Global for all players.
DISABLE_CANISTER_DROPSDisables the drops when players die in multiplayer.
NOBLOCKPrevents player-player collisions (needs mp_teamplay 1 for smoothness). Disables tele-fragging.
SHOW_WELCOME_MESSAGEShows players a greeting message with basic plugin info.
AUTODETECT_MAP_ENDDetects commonly used commands for ending singleplayer maps from point_clientcommand and point_servercommand entities and changes the map. At first, checks if sourcecoop_homemap is set (see below), then checks if nextmap is set. If none are set, the map is not changed. Recommended to keep enabled.
CHANGELEVEL_FXShow visual effects (spawn particles) at level change locations.
TRANSFER_PLAYER_STATEEnables player persistence through level changes. Currently, players will carry over their equipment, hp and suit charge for the first spawn point (checkpoint) in the map. Afterwards, the default map equipment is used.
SP_WEAPONSEnables singleplayer variants of weapons (Crossbow, 357, Gauss).
Intended to be modified by servers in server.cfg.
sourcecoop_respawntimeSets player respawn time in seconds.
Min: 0.1 Default: 2.0
sourcecoop_teamSets which team to use when mp_teamplay is 1. Valid values are "marines", "scientist", or a valid team number. Any other values will not enforce teams.
Default: scientist
sourcecoop_disable_teamselectWhether to skip the team select screen and spawn in instantly.
Default: 1
sourcecoop_start_wait_periodThe max number of seconds to wait since first player spawned in to start the map.
Default: 15.0
sourcecoop_start_wait_mode
0 = The timer is not skipped (exceptions are maps without an intro_type or delayed outputs set).
1 = The timer is skipped when all players enter the game.
2 = The timer is skipped when player count matches the previous map's player count.
Default: 2
sourcecoop_end_wait_periodThe max number of seconds to wait since first player triggered a changelevel. The timer speed increases each time a new player finishes the level.
Default: 60.0
sourcecoop_end_wait_factorControls how much the number of finished players increases the changelevel timer speed. 1.0 means full, 0 means none (timer will run full length).
Default: 1.0
sourcecoop_end_wait_display_modeSets which method to show changelevel countdown. 0 is panel, 1 is hud text.
Default: 1
sourcecoop_validate_steamidsValidate players steam id's? Increases security at the cost of some functionality breakage when Steam goes down. At the time of writing this includes survival mode and equipment persistence.
Default: 0
sourcecoop_homemapThe map to return to after finishing a campaign/map.
Default:
sourcecoop_survival_modeSets survival mode. 0 = off. 1 will respawn players if all are dead, 2 will restart the map.
Default: 0
sourcecoop_survival_respawnWhether to respawn dead players at checkpoints.
Default: 1
sourcecoop_survival_spawn_timeoutNumber of seconds after the map starts (after initial timer) to allow spawning in, or -1 for no time limit. Do not use too low values so players have some time to join in.
Default: -1
sourcecoop_default_configDefault edt file, relative to game folder. This file is copied when starting a map with missing config as<sourcecoop_default_config_dest>/<mapname>.edt. Useful for rapid development, or to enforce sourcecoop on all maps on the server.
Default:
sourcecoop_default_config_destDestination folder for sourcecoop_default_config, relative to game folder. Must be one of edt scan paths!
Default: maps
sc_killfeedControls the display of the kill feed (0: disabled,1: chat,2: hud). If set to2, then the plugin will spawn in fake clients to display on the kill feed.
Default: 2
sc_killfeed_player_killsControls display of player kills on the kill feed (0: hide,1: players,2: entities).
Default: 2
sc_killfeed_entity_killsControls display of entity kills on the kill feed (0: hide,1: players,2: entities).
Default: 2
sc_killfeed_suicidesControls display of suicides on the kill feed (0: hide,1: players,2: entities).
Default: 2
sourcecoop_debugSets debug log destinations. Only available if plugin has been compiled with debugging enabled.
Default: 0
sourcecoop_debug_partsSelects additional information included in debug logs. Only available if plugin has been compiled with debugging enabled.
Default: 6
All game resources used by the plugins (materials, sounds, particles) and related properties are externalized to this config file:
addons/sourcemod/gamedata/srccoop_config.games.txt
Keep in mind this file will be overwritten when updating.
As it is a SourceMod gamedata file, a standard mechanism exist to prevent overwriting. All you need to do is create a custom subfolder and copy your modified config in.
| Key | Plugin | Type | Description |
|---|---|---|---|
| SND_BRINGALL | core | string | Sound played when teleported by a bring-all checkpoint |
| SND_BRINGALL_VOL | core | float | Volume |
| SND_PORTAL | core | string | Sound played when walking into a checkpoint portal |
| SND_PORTAL_VOL | core | float | Volume |
| PORTAL_PARTICLE | core | string | Particle effect name used by checkpoint portals |
| PORTAL_TOUCH_SIZE | core | float | The collision box size for checkpoint portals |
| FROZEN_FADE_COLOR | core | RGBA | Color of "freeze" intro screen fade |
| FROZEN_FADE_DUR_IN | core | int | Fade in duration in milliseconds |
| FROZEN_FADE_DUR_OUT | core | int | Fade out duration in milliseconds |
| SND_TICK | core | string | Tick sound played by intro timer |
| SND_TICK_VOL | core | float | Volume |
| SND_3 | core | string | Sound played when intro timer reaches 3 seconds |
| SND_2 | core | string | Sound played when intro timer reaches 2 seconds |
| SND_1 | core | string | Sound played when intro timer reaches 1 second |
| SND_CHANGELEVEL | core | string | Sound played when changelevel timer starts |
| SND_CHANGELEVEL_VOL | core | float | Volume |
| SND_CHANGELEVEL_TICK | core | string | Tick sound played by changelevel timer |
| SND_CHANGELEVEL_TICK_VOL | core | float | Volume |
| CHANGELEVEL_EFFECT_MODEL | core | string | Material used for changelevel effect particles |
| CHANGELEVEL_EFFECT_AMOUNT | core | int | Number of changelevel particles spawned |
| CHANGELEVEL_EFFECT_SPEED | core | float | Movement speed of changelevel particles |
| CHANGELEVEL_EFFECT_PERIOD | core | float | Repeat period of changelevel particles |
| KILLSOUNDS_SND | killsounds | string | Sound effect used kill confirm sound |
| KILLSOUNDS_SND_VOL | killsounds | float | Volume |
| REVIVE_SND_START | revive | string | Sound for start of revive |
| REVIVE_SND_DENY | revive | string | Sound for revive denied |
| REVIVE_SND_RESPAWN | revive | string | Sound played after reviving |
| REVIVE_SND_RESPAWN_PITCH | revive | int | Pitch |
| REVIVE_SNDLEVEL | revive | int | Travel distance of revive sounds |
| REVIVE_BAR_COLOR | revive | RGBA | Revive bar color |
| REVIVE_BAR_MODEL | revive | string | Revive bar material |
| REVIVE_RAGDOLL_PARTICLE | revive | string | Particle effect name spawned in dead players |
These are selected at compile time. Each game may have a different set of enabled features / patches.
SourceCoop ships with the majority enabled, where applicable.
You can compile SourceCoop, customizing your own build if needed.
| Define | Description |
|---|---|
| INTRO_TIMER_HUDTEXT | For games other than Black Mesa that don't have a built-in 'waiting for players' display. Displays timer via hud-text. |
| ENTPATCH_CUSTOM_NPC_MODELS | Enables mappers to use custom NPC models |
| ENTPATCH_UPDATE_ENEMY_MEMORY | Fixes UpdateEnemyMemory input when targeting a player |
| ENTPATCH_SNIPER | Fixes Sniper NPC server and client crash |
| ENTPATCH_TRIGGER_CHANGELEVEL | Integrates trigger_changelevel fix/enhancements |
| ENTPATCH_TRIGGER_AUTOSAVE | Allow spawning trigger_autosave in MP so they can be used for checkpoints |
| ENTPATCH_POINT_TELEPORT | Multiplayer support for point_teleport |
| ENTPATCH_POINT_VIEWCONTROL | Multiplayer support for point_viewcontrol |
| ENTPATCH_PLAYER_SPEEDMOD | Multiplayer support for player_speedmod |
| ENTPATCH_POINT_CLIENTCOMMAND | Multiplayer support for point_clientcommand |
| ENTPATCH_POINT_SERVERCOMMAND_CHANGELEVEL | Integrates point_servercommand induced mapchanges |
| ENTPATCH_ENV_ZOOM | Multiplayer support for env_zoom |
| ENTPATCH_ENV_CREDITS | Fixes env_credits |
| ENTPATCH_ENV_INTROCREDITS | Fixes env_introcredits (Black Mesa only) |
| ENTPATCH_ENV_SPRITE | Fixes m_flGlowProxySize out of bounds console spam |
| ENTPATCH_AI_SCRIPT_CONDITIONS | Fixes ai_script_conditions |
| ENTPATCH_LAGCOMP_POSE_PARAMS | Fixes faulty lag compensation resetting npc's pose parameters on shots (Black Mesa only) |
| ENTPATCH_FUNC_ROTATING | Fixes func_rotating entity's "Bad SetLocalAngles" error |
| ENTPATCH_PLAYER_LOADSAVED | Multiplayer support for player_loadsaved (kill + screenfade) |
| ENTPATCH_LOGIC_AUTOSAVE_SURVIVAL_RESPAWN | Allows adapting logic_autosave for survival respawns |
| ENTPATCH_GAME_END | Integrates game_end induced mapchanges |
| ENTPATCH_NPC_DIALOGUE | Various fixes for NPC speech (Scripted scenes, response system, ..) |
| ENTPATCH_REMOVE_BONE_FOLLOWERS | Deletes selected NPC's (Gargantua) bone followers to increase multiplayer server perf |
| ENTPATCH_WEAPON_MODELS | Fixes NPCs not being able to shoot with anything but the shotgun |
| ENTPATCH_PLAYER_ALLY | Fixes friendly NPCs not triggering 'player ally only' triggers |
| ENTPATCH_GOALENTITY_RESOLVENAMES | Fixes ai_goal_* for multiplayer |
| ENTPATCH_GOAL_LEAD | Fixes ai_goal_lead for multiplayer |
| ENTPATCH_SETPLAYERAVOIDSTATE | Fixes NPCs not pushing players away from their scripted path, resulting in stuckage |
| ENTPATCH_NPC_SLEEP | Multiplayer support for NPC sleep states |
| ENTPATCH_NPC_THINK_LOCALPLAYER | General fix for variety of NPC functionality and crashes. (Pre-selects the local player entity on NPC think on best effort basis.) Requires GAMEPATCH_UTIL_GETLOCALPLAYER. |
| ENTPATCH_BM_XENTURRET | Swaps XenTurret models with removed clientside particles + adds it as a downloadable |
| ENTPATCH_BM_ICHTHYOSAUR | Fixes Ichtyosair NPC crash |
| ENTPATCH_BM_GARGANTUA | Fixes Gargantua's ChasePlayer/ChaseEnd inputs. Switches to SOLID_BBOX for collisions (workaround for removed bone followers) |
| ENTPATCH_BM_PUFFBALLFUNGUS | Fixes npc_puffballfungus TakeDamage crash |
| ENTPATCH_BM_TRIPMINE_COLORS | Fixes map-placed tripmines not having the proper color with mp_teamplay 1 |
| ENTPATCH_BM_LAV | Fixes client crash seen in bm_c2a5g related to LAV npc |
| ENTPATCH_BM_TRIPMINE_COLORS | Fixes wrong tripmine laser colors when teamplay is enabled |
| ENTPATCH_BM_PROP_CHARGERS | Multiplayer support for prop_radiation_charger and prop_hev_charger (Xen recharge crystals) |
| ENTPATCH_BM_MISC_MARIONETTIST | misc_marionettist multiplayer support |
| ENTPATCH_BM_MUSIC_TRACK | music_track multiplayer support |
| ENTPATCH_BM_SNARK_NEST | Prevents the snark nest from cyclically bursting (This is needed because item respawn time is set to 0 by instancing) |
| ENTPATCH_BM_SP_WEAPONS | Single-player functionality patches for weapons (Crossbow, 357, Gauss) |
| ENTPATCH_BM_DISSOLVE | Prevents the dissolve function from removing player entities |
| ENTPATCH_FUNC_TRACKAUTOCHANGE | Prevents track from being blocked by players and forced to go back down |
| ENTPATCH_FUNC_TRACKTRAIN | Prevents trains from being blocked by players |
| ENTPATCH_NPC_RUNTASK | General fix for variety of NPC functionality and crashes. Requires GAMEPATCH_UTIL_GETLOCALPLAYER. |
| PLAYERPATCH_SUIT_SOUNDS | Fixes suit (HEV) sounds |
| PLAYERPATCH_PICKUP_FORCEPLAYERTODROPTHISOBJECT | Fixes a crash on Pickup_ForcePlayerToDropThisObject |
| PLAYERPATCH_SERVERSIDE_RAGDOLLS | Forces server-side player ragdolls |
| PLAYERPATCH_RESTORE_MP_FORCERESPAWN | Restores mp_forcerespawn functionality, allowing the player to stay dead (for revives) |
| PLAYERPATCH_OVERRIDE_DEATH_OBSMODE | Force "chase" death camera. This blocks death/freezecam mode, problematic for serverside ragdolls. |
| PLAYERPATCH_FINDLADDER | Fixes mounting ladders with many players nearby |
| GAMEPATCH_UTIL_GETLOCALPLAYER | Overrides UTIL_GetLocalPlayer. Required for many AI crash-fixes. |
| GAMEPATCH_IS_MULTIPLAYER | Overrides CMultiplayRules::IsMultiplayer. Required for player fixes and spawning items with physics. |
| GAMEPATCH_PREDICTED_EFFECTS | Fixes missing NPC damage effects (and possibly some others) |
| GAMEPATCH_BLOCK_RESTOREWORLD | Blocks gamerules resetting the world on round start |
| GAMEPATCH_BLOCK_RESPAWNPLAYERS | Blocks gamerules respawning players on round start |
| GAMEPATCH_BLOCK_ANNOUNCER | Blocks default game announcer |
| GAMEPATCH_ALLOW_FLASHLIGHT | Re-Enables flashlight, so it can be toggled with mp_flashlight convar |
| GAMEPATCH_TEAMSELECT_UI | For games that have team-select UI, enables convar sourcecoop_disable_teamselect |
| GAMEPATCH_BM_GRAVITY | Prevents BM MP gamerules from overriding sv_gravity |
sc_ft - Command for toggling plugin features on/off.
sc_dump (Server console only) Command for dumping map entities to a file as they were loaded from the .bsp file.
sc_save <filename> - Exports all player's equipment and state to a file. If a player is not alive, their equipment at the start of the map is saved instead.
sc_load <filename> - Imports saved data from file and attempts to equip each player (if they were present when the data was saved).
sc_clear - Clear persisted equipment and equip players with the map defaults. Does not remove saved files.
sc_mkconfigs - Creates default SourceCoop configs for maps found in the maps directory, which are missing one.
Note: Please disable "SlowScriptTimeout" in SourceMod core.cfg beforehand as this could run for long time! (Restart required after editing)
- Format:
sc_mkconfigs <MAPFILTER> [CONFIRM]- MAPFILTER:
- Filters the map names to include
- Use * for all
- Supports wildcards with * such as coop_*
- CONFIRM:
- [0 = dry run, 1 = live run]
- MAPFILTER:
sc_importconfigs - Imports other formats of map configs into SourceCoop configs.
Note: Please disable "SlowScriptTimeout" in SourceMod core.cfg beforehand as this could run for long time! (Restart required after editing)
- Format:
sc_importconfigs <TYPE> <MAPFILTER> <UPDATE> <CREATE> [CONFIRM]- TYPE:
- The type of configs to import
- stripper = Stripper:source
- MAPFILTER:
- Filters the map names to import
- Use * for all
- Supports wildcards with * such as coop_*
- UPDATE:
- 1 = allow updating SourceCoop configs that already exist
- 0 = skips existing configs
- CREATE:
- 1 = attempts to create default SourceCoop config for a map if it's missing
- 0 = prints a warning and skips if missing
- CONFIRM:
- 0 = dry run
- 1 = live run
- TYPE:
/coopmenu Displays the coop menu.
Since not everyone may enjoy all the extra functionality this project provides, or wants to use their own solutions, we've split some functionality into separate, modular plugins.
Enables thirdperson via !thirdperson chat command, thirdperson command or coop menu. Beware that for this to work, it enables cheats on the client, but not the server, so it should be relatively safe for coop setting. It also has a enable convar called sourcecoop_thirdperson_enabled.
Using thirdperson will break some weapon effects due to client-side prediction glitch.
-Placeholder-
As the name indicates, provides specific voting functionality via coop menu and player commands. The vote-map list is automatically built from available .edt config files. The list can be manually reloaded with sc_reload_maps or can be set to reload on mapchange with sourcecoop_voting_autoreload 1 (this however prolongs mapchanges due to file scanning)
/skipintro Starts a skip intro vote
/restartmap Starts a restart map vote
/changemap Shows a menu for changing maps
/survival Starts a survival vote
sc_reload_maps Reloads all entries in the votemap menu from storage
sourcecoop_voting_autoreload default: 1, Sets whether to reload all votemap menu entries on mapchange, which can prolong map loading times.
sourcecoop_voting_skipintro default: 1, Allow skip intro voting?
sourcecoop_voting_restartmap default: 1, Allow restart map voting?
sourcecoop_voting_changemap default: 1, Allow change map voting?
sourcecoop_voting_survival default: 2, Allow survival mode voting? Use one of values from sourcecoop_survival_mode to select the mode to vote for.
Plays a confirmation sound after killing a NPC.
Killsounds can be individually toggled in coop menu, which is saved in cookies. The default can be set by convar sourcecoop_ks_default.
sourcecoop_ks_default default: "0", Sets the default setting of the killsounds player preference.
Provides NPC difficulty scaling (damage dealt and damage received)
difficulty Display current difficulty
sourcecoop_difficulty Sets the difficulty - from 0 (base difficulty) and up.
sourcecoop_difficulty_auto Sets automatic difficulty mode. -1 disables. 0 balances difficulty between min and max convars. Values above 0 set the difficulty increment per player, ignoring the min and max cvars.
sourcecoop_difficulty_auto_min When automatic difficulty mode is set to 0, this is the difficulty at 1 player.
sourcecoop_difficulty_auto_max When automatic difficulty mode is set to 0, this is the difficulty at max players.
sourcecoop_difficulty_announce Toggles announcing changes in difficulty.
sourcecoop_difficulty_ignoredmgto List of classnames where player->npc damage is exempt from difficulty scaling. Separated by semicolon.
sourcecoop_difficulty_ignoredmgfrom List of classnames where npc->player damage is exempt from difficulty scaling. Separated by semicolon.
Enables revive by pressing <USE> while looking at player ragdoll. Adds effects to ragdolls to improve visibility.
sc_revive Force respawn player.
sourcecoop_revive_time default: "4.0", Sets time that you have to hold E to revive.
sourcecoop_revive_score default: "1", Sets score to give for reviving a player.
sourcecoop_revive_messages default: "0", Shows messages such as You have started reviving x.
sourcecoop_revive_ragdoll_effects_timer default: "4.0", Delay for applying ragdoll highlighting effects. -1 to disable all ragdoll effects.
sourcecoop_revive_ragdoll_particle default: "1", Whether to spawn a particle inside player ragdolls to improve their visibility.
sourcecoop_revive_ragdoll_blink default: "1", Whether to blink player ragdolls to improve their visibility.
sourcecoop_revive_in_classic_mode default: "1", Whether to allow reviving in non-survival mode.
Kicks players who are missing workshop maps with a custom message. Can be disabled per map in edt. Overrides net_maxfilesize to very large value. Does not currently work if fastdl is enabled.
sourcecoop_workshop_message The message to display to players missing workshop maps. Supported placeholders: {BSPNAME}
Displays an overlay during the initial team select screen - by default the included SourceCoop logo.
sourcecoop_logo_material default "sourcecoop/landing_screen", .vmt and .vtf files under this name are automatically downloaded to players.
Adds death screen fade and an accurate first person death camera moving with your actual server-side ragdoll (created by the main plugin). What you see / where you are is in sync with how other players see you!
If player toggle is enabled, FPD can be individually toggled in coop menu, which is saved in cookies. The default uses current state of the "FIRSTPERSON_DEATHCAM" feature.
sourcecoop_fpd_fade_ms default "1500", Duration in milliseconds to fade first-person death screen to black. 0 to disable.
sourcecoop_fpd_player_toggle default "1", Enable players to choose death camera option regardless of server/map settings.
Provides unstuck command by teleporting players to the active checkpoint.
/stuck
/unstuck
sourcecoop_next_stuck default "60.0", Prevents using stuck for this many seconds after using.
Adds a toggle for the ringing sound effect from explosions.
Earbleed can be individually toggled in coop menu, which is saved in cookies. The default can be set by convar sourcecoop_earbleed_default.
sourcecoop_earbleed_default default: "0", Sets the default setting of the earbleed player preference.