SlashCo
SlashCo
The main library containing almost everything related to the gamemode.
Methods
Aborts the current round due to a technical issue.
Notifies all players, logs the reason with a stack trace, and schedules a return to the lobby.
If the round has already been aborted, additional calls do not create another round-over timer.
Notifies all players, logs the reason with a stack trace, and schedules a return to the lobby.
If the round has already been aborted, additional calls do not create another round-over timer.
Registers or overrides a dangerlevel.
Adds or updates a fog entry in the global fog data and networks the change to all clients.
If an identical fog entry already exists, no update is sent.
If an identical fog entry already exists, no update is sent.
SlashCo.AddLateSurvivor( Player ply )
Adds a player to the current round's list of survivors if they are not already present.
SlashCo.AddOffering( OFFERING offering )
Registers or overrides a offering
Adds to the given slasher's anger value, clamped between 0 and 100.
This is intentionally server-only to avoid desync.
This is intentionally server-only to avoid desync.
Registers or overrides a slasher class.
SlashCo.AllowSpectatorsToPing( boolean allowed )
Sets whether spectators are allowed to place pings.
Read back using SlashCo.CanSpectatorsPing.
Read back using SlashCo.CanSpectatorsPing.
SlashCo.ApplySlasherToPlayer( Player ply )
Applies the slasher previously assigned to the player via SlashCo.SelectSlasher, by setting their Slasher networked string.
Does nothing if no slasher was assigned to the player for the current round.
Does nothing if no slasher was assigned to the player for the current round.
table SlashCo.AssembleWeightedTable( table<Entity> elements, function conditions = SlashCo.DefaultConditions )
Assembles a weighted table for use by the spawning functions.
Each element that passes the supplied conditions is added using its Weight value,
or a default weight of 10 when no weight is specified.
Each element that passes the supplied conditions is added using its Weight value,
or a default weight of 10 when no weight is specified.
Forces a player to become a Slasher for the upcoming round while in the lobby.
Accepts a plain SteamID or a SteamID64. If picking has already finished, the player is immediately asked to pick their Slasher.
Accepts a plain SteamID or a SteamID64. If picking has already finished, the player is immediately asked to pick their Slasher.
SlashCo.AwaitExpectedPlayers()
This is used internally - although you're able to use it you probably shouldn't.
Once all expected players are present it either starts a new Slasher selection or starts the round, depending on whether a Slasher still needs to be picked.
Does nothing while in the lobby, while less than 2 players are expected, or once SlashCo.CurRound.AntiLoopSpawn is set.
Tries to ban the given Slasher
Draws a full screen blur effect using the pp/blurscreen material.
Intended to be called from within a panel's Paint function; when a panel is given, the blur is offset to counteract that panel's local coordinate system.
Intended to be called from within a panel's Paint function; when a panel is given, the blur is offset to counteract that panel's local coordinate system.
Broadcasts an announcement
SlashCo.BroadcastCurrentRoundData( boolean readyGame )
The function may be changed in the future to solve it's inefficient networking
Broadcasts the current Round Survivors, Slashers and offerings to everyone.
Additionally broadcasts the SlasherData... which is just the same as above?
Additionally broadcasts the SlasherData... which is just the same as above?
SlashCo.BroadcastGlobalData( Player ply )
This is used internally - although you're able to use it you probably shouldn't.
This is used internally - although you're able to use it you probably shouldn't.
SlashCo.BustDoor( Player slasher, Entity target, number or Vector force, function callback, any noRecursive )
Opens and then breaks every door entity sharing target's name within 100 units, replacing them with physical sc_broken_door props that get pushed away by force.
The callback is invoked with false if target is invalid, if no matching door was found, or if slasher became invalid while the doors were breaking.
The callback is invoked with false if target is invalid, if no matching door was found, or if slasher became invalid while the doors were breaking.
Requests that the server purchase a perk for the local player.
Does nothing if the player already owns the perk.
The server validates the perk, its price, and the player's level before purchasing it.
Can only be processed while in the lobby.
Does nothing if the player already owns the perk.
The server validates the perk, its price, and the player's level before purchasing it.
Can only be processed while in the lobby.
Checks if the player is a Survivor with the "Healthy" perk active.
Checks whether a player is allowed to equip a perk.
The perk must exist, the player must meet its level requirement, and the player must own it.
The perk must also not conflict with any currently active perk.
Returns a failure reason and, for conflicts, the conflicting perk definition.
The perk must exist, the player must meet its level requirement, and the player must own it.
The perk must also not conflict with any currently active perk.
Returns a failure reason and, for conflicts, the conflicting perk definition.
Returns whether a player on plyTeam is allowed to see a ping placed by a player on pingTeam.
Spectators can see every ping. Survivors can additionally see pings made by spectators. Otherwise a ping is only visible to players on the same team.
This is shared between client and server to avoid mismatches caused by either side seeing a different team setup.
Spectators can see every ping. Survivors can additionally see pings made by spectators. Otherwise a ping is only visible to players on the same team.
This is shared between client and server to avoid mismatches caused by either side seeing a different team setup.
boolean SlashCo.CanSpectatorsPing( )
Returns the value set by SlashCo.AllowSpectatorsToPing.
Changes the current map.
This function does nothing while g_SlashCoDebug is enabled.
This function does nothing while g_SlashCoDebug is enabled.
Equips the given item into the specified slot (forced to the secondary slot if the item is marked as secondary), calling its ITEM.OnPickUp callback and the previous item's ITEM.OnSwitchFrom callback.
Plays an equip sound unless noSound is true. Passing "none" as id clears the slot instead.
Plays an equip sound unless noSound is true. Passing "none" as id clears the slot instead.
Prints a translated message to the local chat, following the rules of chat.AddText.
String values are passed through SlashCo.Language before being printed. To pass a translation key that needs formatting arguments, use a table: {key, ...}.
String values are passed through SlashCo.Language before being printed. To pass a translation key that needs formatting arguments, use a table: {key, ...}.
SlashCo.ClearDatabase()
This is used internally - although you're able to use it you probably shouldn't.
This function does nothing when executed on the client
Returns a copy of the given Color allowing you to safely modify it.
Spawns a document at the specified position and angle.
Returns nil if the document entity could not be created.
Returns nil if the document entity could not be created.
SlashCo.CreateDocumentsDB()
This is used internally - although you're able to use it you probably shouldn't.
Notifies all connected players in chat when the table has to be created. Called automatically on startup.
Spawns a gas can at the specified position and angle.
Returns nil if the gas can entity could not be created.
Returns nil if the gas can entity could not be created.
Spawns the helicopter at the specified position and angle.
Returns nil if the helicopter entity could not be created.
Returns nil if the helicopter entity could not be created.
Spawns an item or other entity at the specified position and angle.
If an owner is supplied and is valid, the created entity is assigned to that owner.
Returns nil if the entity could not be created.
If an owner is supplied and is valid, the created entity is assigned to that owner.
Returns nil if the entity could not be created.
Spawns an item stash at the specified position and angle.
Spawns the offering table at the specified position and angle.
Spawns a radio at the specified position and angle.
number or Vector or Angle SlashCo.Dampen( number speed, number or Vector or Angle from, number or Vector or Angle to )
Framerate-independent smoothing helper.
Interpolates from from towards to, moving faster the higher speed is. Meant to be called every frame/think with the previous result passed back in as from.
Interpolates from from towards to, moving faster the higher speed is. Meant to be called every frame/think with the previous result passed back in as from.
SlashCo.DangerLevel()
A table containing all defined DangerLevel
Use SlashCo.AddDangerLevel to register a new dangerlevel
You should never modify it directly!
Use SlashCo.AddDangerLevel to register a new dangerlevel
You should never modify it directly!
Prints msg to the server console, prefixed with [SlashCo - Debug].
Unlike some other debug helpers in the codebase, this always prints and is not gated behind any ConVar or debug flag.
Unlike some other debug helpers in the codebase, this always prints and is not gated behind any ConVar or debug flag.
Default set of conditions for weighted spawn tables.
An entity passes if it is valid, is not disabled, and does not already have a spawned entity.
An entity passes if it is valid, is not disabled, and does not already have a spawned entity.
Default spawn condition for forced spawn entities.
Requires the entity to pass SlashCo.DefaultConditions
and have its Forced property enabled.
Requires the entity to pass SlashCo.DefaultConditions
and have its Forced property enabled.
Default spawn condition for non-forced spawn entities.
Requires the entity to pass SlashCo.DefaultConditions
and not have its Forced property enabled.
Requires the entity to pass SlashCo.DefaultConditions
and not have its Forced property enabled.
SlashCo.DisableAlarmLights()
Reverses SlashCo.EnableAlarmLights: turns off all registered alarm cagelights, turns the non-alarm lights back on, disables every player's dynamic flashlight, and sets GameData.IsBlackout back to false.
SlashCo.DisableGlobalFog()
Disables the Global Fog
SlashCo.DisablePerk( string perkID )
Requests that the server disable an active perk for the local player.
Does nothing if the player does not currently have the perk active.
Can only be processed while in the lobby.
Does nothing if the player does not currently have the perk active.
Can only be processed while in the lobby.
SlashCo.DisableSoundScapes()
Disables all env_soundscape entities on the map.
SlashCo.DrawHalo( table<Entity> ents, string or Color color, number passes = 1, boolean noZ = true )
Draws halos around the specified entities.
This function may only be called while SlashCo halo drawing is active.
Invalid, invisible, or dormant entities are removed from the entity list before the halos are drawn.
This function may only be called while SlashCo halo drawing is active.
Invalid, invisible, or dormant entities are removed from the entity list before the halos are drawn.
Drops both of a survivor's item slots by calling SlashCo.DropItem twice.
Clears all of the player's active effects first unless noEffect is true.
Clears all of the player's active effects first unless noEffect is true.
Drops the survivor's currently held item (the secondary slot takes priority unless it's empty or flagged via ignoreField) as a physical entity in the world.
Runs the item's ITEM.PreDrop/ITEM.PreDropSecondary, ITEM.OnDrop, ITEM.OnSwitchFrom and ITEM.ItemDropped callbacks along the way; dropping can be cancelled by ITEM.PreDrop/ITEM.PreDropSecondary.
Does nothing in the lobby, for non-survivors, or while the player is frozen.
Runs the item's ITEM.PreDrop/ITEM.PreDropSecondary, ITEM.OnDrop, ITEM.OnSwitchFrom and ITEM.ItemDropped callbacks along the way; dropping can be cancelled by ITEM.PreDrop/ITEM.PreDropSecondary.
Does nothing in the lobby, for non-survivors, or while the player is frozen.
SlashCo.EnableAlarmLights( boolean noEffect )
Triggers a map-wide blackout: turns on all registered alarm cagelights (and their linked light entities), and turns off any lights configured via GameData.NonAlarmLightsName.
Unless noEffect is true, also fades every player's screen to black and plays a blackout sound. Sets GameData.IsBlackout to true.
Unless noEffect is true, also fades every player's screen to black and plays a blackout sound. Sets GameData.IsBlackout to true.
SlashCo.EnableGlobalFog()
Enables the Global Fog
SlashCo.EnablePerk( string perkID )
Requests that the server enable a perk for the local player.
The player must own the perk and satisfy all requirements checked by SlashCo.CanEquipPerk
Can only be processed while in the lobby.
The player must own the perk and satisfy all requirements checked by SlashCo.CanEquipPerk
Can only be processed while in the lobby.
SlashCo.EnableSoundScapes()
Enables all env_soundscape entities on the map.
SlashCo.EndOfferingVote( Player ply )
This is used internally - although you're able to use it you probably shouldn't.
SlashCo.EndRound()
This is used internally - although you're able to use it you probably shouldn't.
After a short delay it removes the round entities, resets the round data and moves the server back to the lobby via SlashCo.GoToLobby.
Does nothing if g_SlashCoDebug is set or if the round has already been ended.
This is used internally - although you're able to use it you probably shouldn't.
The code related to this function is unfinished!
SlashCo.EscapeVoicePrompt()
Plays an escape voice prompt from one or more survivors
When multiple survivors are present, survivors sufficiently separated from each other may each play a voice prompt
When multiple survivors are present, survivors sufficiently separated from each other may each play a voice prompt
Converts a total experience amount into a level.
Each level requires SlashCo.LevelPowMultiplier times more experience than the previous one, starting at SlashCo.FirstLevelBase.
Each level requires SlashCo.LevelPowMultiplier times more experience than the previous one, starting at SlashCo.FirstLevelBase.
SlashCo.FailOptionalObjectives()
Sets every optional objective that hasn't been completed yet to SlashCo.ObjStatus.FAILED and marks optional objectives as no longer completable for the round.
Populates a table with the complete fog information applicable to a player.
The table is initialized with the global fog color and default values before player, team, or global fog settings are applied.
Scaled world color values are calculated after the applicable fog settings are merged.
The table is initialized with the global fog color and default values before player, team, or global fog settings are applied.
Scaled world color values are calculated after the applicable fog settings are merged.
Finds the first registered item whose given field matches a value.
Shortcut for SlashCo.FindWorkshopID that looks up a map's .bsp file under maps/.
table SlashCo.FindPlayersInRange( Vector origin, number radius, number specificTeam = nil, Entity or table ignoreEntity = nil )
Finds all players in a given radius and checks if their visible from the origin by doing a trace.
SlashCo.FindSlashCoAddons()
This is used internally - although you're able to use it you probably shouldn't.
Also detects the main gamemode's own workshop ID and mount state. Runs the SlashCo:RegisterAddons hook at the end, so other addons can register themselves manually via SlashCo.RegisterAddon.
Called automatically on load and whenever SlashCo.GameContentChanged runs.
Shortcut for SlashCo.FindWorkshopID that looks up a slasher's lua file under lua/.
Finds a suitable spawn point for a player based on their team.
Survivors and spectators use survivor spawn entities, slashers use slasher spawn entities, and players in the lobby use info_player_start entities.
If all spawn points are occupied, the oldest previously used spawn point is selected.
Survivors and spectators use survivor spawn entities, slashers use slasher spawn entities, and players in the lobby use info_player_start entities.
If all spawn points are occupied, the oldest previously used spawn point is selected.
Searches through every addon returned by engine.GetAddons for one that contains the given file.
Flashes the game window to notify the user that something has happened in-game.
SlashCo.ForceNewSlasherSelection()
This is used internally - although you're able to use it you probably shouldn't.
If a Slasher is already stored in the database the round is force-started instead, otherwise the connected players are asked whether they want to become the Slasher.
Aborts the round if fewer than 2 players are connected.
SlashCo.GameContentChanged()
This is used internally - although you're able to use it you probably shouldn't.
Called automatically whenever GM:GameContentChanged runs.
SlashCo.GasCansPerGenerator( number amount )
Sets how many gas cans are needed to fully fuel a single generator.
Due to a bug, this actually writes to the same networked value as SlashCo.SetGasCansToSpawn instead of the one read by SlashCo.GetGasCansPerGenerator, so calling it has no effect on SlashCo.GetGasCansPerGenerator's return value.
Returns all active perks equipped by a player.
Active perks are identified by a ! prefix in the player's owned perk string.
Active perks are identified by a ! prefix in the player's owned perk string.
Returns the table of currently registered SlashCo workshop addons.
Keys are the addon's workshop ID (or a negative placeholder ID for legacy addons found in the local addons/ folder), values are the addon's title.
Keys are the addon's workshop ID (or a negative placeholder ID for legacy addons found in the local addons/ folder), values are the addon's title.
Returns a table containing all banned slashers
Returns the color used to display a slasher class in UI.
Returns the "unknown" color if class is SlashCo.SlasherClass.Unknown, otherwise the regular "known" color.
Returns the "unknown" color if class is SlashCo.SlasherClass.Unknown, otherwise the regular "known" color.
Returns the duration a consumable's effect should last for the given player, based on their active perks.
Doubles the duration if the "Glutton" perk is active.
Doubles the duration if the "Glutton" perk is active.
Returns the highest-priority fog multiplier currently applicable to a player.
Spectators use the fog settings of the player they are spectating.
If a spectator is not spectating a valid player, a multiplier of 100 is returned.
When infoTbl is provided, applicable fog information is merged into it while searching.
Spectators use the fog settings of the player they are spectating.
If a spectator is not spectating a valid player, a multiplier of 100 is returned.
When infoTbl is provided, applicable fog information is merged into it while searching.
Returns the color associated with a SlashCo.DangerLevel, used to display it in UI.
Returns the sound path associated with a SlashCo.DangerLevel, played on the round end screen.
Returns the default BUTTON_CODE for the given keyboard bind, as defined in SlashCo.KeyboardBinds, ignoring any bindings the player has changed.
Returns the local player's stored rating for the given document, or 0 if it hasn't been collected.
Returns a registered document by its name.
Returns a registered effect by its name.
Returns the healing multiplier that food items should apply for the given player, based on their active perks.
The "Healthy" perk adds 0.5, the "Glutton" perk subtracts 0.5, and the result is never lower than 0.
The "Healthy" perk adds 0.5, the "Glutton" perk subtracts 0.5, and the result is never lower than 0.
number SlashCo.GetGasCansPerGenerator( )
Returns how many gas cans are needed to fully fuel a single generator.
Nothing in the codebase currently sets the value read by this function, so it always returns the default (4) unless another addon networks it manually.
number SlashCo.GetGasCansToSpawn( )
Returns the value set by SlashCo.SetGasCansToSpawn.
A negative value (the default) means no override is set, and SlashCo.SpawnGasCans instead calculates the amount automatically from SlashCo.GetGeneratorsToSpawn and SlashCo.GetGasCansPerGenerator.
A negative value (the default) means no override is set, and SlashCo.SpawnGasCans instead calculates the amount automatically from SlashCo.GetGeneratorsToSpawn and SlashCo.GetGasCansPerGenerator.
number SlashCo.GetGeneratorsNeeded( )
Returns the value set by SlashCo.SetGeneratorsNeeded.
number SlashCo.GetGeneratorsToSpawn( )
Returns the value set by SlashCo.SetGeneratorsToSpawn.
Returns the color set by SlashCo.SetGlobalFogColor.
Passing a Vector as object does not work correctly due to a bug - the color is always written into object.r/g/b fields as if object were a Color.
number SlashCo.GetGlobalSlasherAnger( )
Returns the average anger value across all players on the slasher team.
number SlashCo.GetHighestSlasherAnger( )
Returns the highest anger value out of all players on the slasher team.
Finds the name of a registered item by its entity class.
Returns a registered item by its name.
Looks up the given Bind and returns the BUTTON_CODE
Gets the currently bound button for the bind and translates it using input.GetKeyName and makes the result uppercase.
Useful for UI when wanting to display the key for an action.
Useful for UI when wanting to display the key for an action.
Returns the SlashCo.ReadyState of the given player
number SlashCo.GetMapSize( )
Returns the current map's size multiplier, set by SlashCo.SetMapSize based on the map's world bounds.
Used to scale distances such as slasher spawn/range checks depending on how big the map is.
Used to scale distances such as slasher spawn/range checks depending on how big the map is.
Returns the color used to display a slasher's name in UI.
Returns the "unknown" color if name is "Unknown", otherwise the regular "known" color.
Returns the "unknown" color if name is "Unknown", otherwise the regular "known" color.
Returns all perks owned by a player.
Active perks are included and have their leading ! removed from the returned IDs.
Active perks are included and have their leading ! removed from the returned IDs.
Returns all registered perks.
Only entries containing an ID field are included in the returned sequential table.
Only entries containing an ID field are included in the returned sequential table.
number SlashCo.GetPlayerPingDelay( )
Returns the current value of the slashco_playerpingdelay convar.
Returns a random registered slasher name, optionally restricted by danger level and/or slasher class.
Slashers that aren't selectable, and Leuonard, are never picked.
Slashers that aren't selectable, and Leuonard, are never picked.
number SlashCo.GetRoundStartTime( )
Returns the time the round started at using CurTime
number SlashCo.GetRoundTime( )
Returns how many seconds have passed since the round started, based on SlashCo.GetRoundStartTime.
Returns the current anger value of the given slasher.
Returns the registered SLASHER table for the given slasher name.
Returns the registered SLASHER table for the given slasher ID.
table<Entity> SlashCo.GetSpectatableSet( )
Returns all players and dead bodies that can currently be spectated.
Survivors and dead bodies are always included.
Slashers are included only if their CannotBeSpectated slasher value is not enabled.
Survivors and dead bodies are always included.
Slashers are included only if their CannotBeSpectated slasher value is not enabled.
Returns a random number within the total weight of a weighted table.
SlashCo.GoToLobby()
This is used internally - although you're able to use it you probably shouldn't.
Returns whether the local player has collected the given document.
SlashCo.HelicopterFinalLeave()
This is used internally - although you're able to use it you probably shouldn't.
SlashCo.HelicopterGoAboveLand( Entity ent )
This is used internally - although you're able to use it you probably shouldn't.
SlashCo.HelicopterLand( Vector pos )
This is used internally - although you're able to use it you probably shouldn't.
On Hard difficulty, the helicopter may eventually abandon the survivors after a random delay
SlashCo.HelicopterLeaveForIntro()
This is used internally - although you're able to use it you probably shouldn't.
The helicopter is quieted and removed once it reaches its spawn position
SlashCo.HelicopterRadioVoice( SlashCo.HelicopterVoices type )
This is used internally - although you're able to use it you probably shouldn't.
SlashCo.HelicopterTakeOff()
This is used internally - although you're able to use it you probably shouldn't.
SlashCo.HelicopterTakeOffIntro()
This is used internally - although you're able to use it you probably shouldn't.
SlashCo.InitMapMesh()
This is used internally - although you're able to use it you probably shouldn't.
This function is responsible for setting SlashCo.MaxVec, SlashCo.MinVec, SlashCo.MapSizeExact & SlashCo.MapSize
Checks whether a player has a perk currently equipped.
Active perks are stored with a ! prefix.
Active perks are stored with a ! prefix.
Returns whether the door is open or not
boolean SlashCo.IsGlobalFogDisabled( )
Returns whether the global fog was disabled using SlashCo.DisableGlobalFog.
See the Fog system for what disabling it does.
See the Fog system for what disabling it does.
Looks up the current BUTTON_CODE for the given bind and compares it against the given button
Returns true if the given player started the current offering
boolean SlashCo.IsLobbyStarting( )
Returns whether the lobby was marked as starting using SlashCo.MarkLobbyStarting.
While true, spectators are bound to the helicopter's camera and suicide is disallowed.
While true, spectators are bound to the helicopter's camera and suicide is disallowed.
boolean SlashCo.IsPositionLegalForSlashers( Vector pos, boolean noSurvivorCheck, number distFactor = 1 )
Returns whether a position is far enough away from all survivors to be considered a legal spot for a slasher to use, for example when picking a teleport or ability position.
The required distance scales with SlashCo.GetMapSize.
The required distance scales with SlashCo.GetMapSize.
boolean SlashCo.IsQuickEscape( )
Returns whether the survivors would currently count as having made a quick escape, i.e. the round time (see SlashCo.GetRoundTime) hasn't reached SlashCo.QuickEscapeTime (600 seconds by default) yet.
Checks if the given Slasher is banned
boolean SlashCo.IsSlowEscape( )
Returns whether the survivors would currently count as having made a slow escape, i.e. the round time (see SlashCo.GetRoundTime) has exceeded SlashCo.SlowEscapeTime (1200 seconds by default).
Checks whether the given entity is a valid SlashCo door, i.e. it is valid and its class is prop_door_rotating or func_door_rotating (see SlashCo.ValidDoors).
Attempts to let a survivor pick up the item entity with the given itemindex.
Fails silently if the target slot is occupied, the player recently dropped an item, a slot switch is already in progress, the SlashCoItemPickUp hook blocks it, the entity is flagged DONTPICKUP, or an item ITEM.PrePickUp/ITEM.PrePickUpPrimary/ITEM.PrePickUpSecondary callback blocks it.
On success, equips the item via SlashCo.ChangeSurvivorItem and removes the world entity.
Fails silently if the target slot is occupied, the player recently dropped an item, a slot switch is already in progress, the SlashCoItemPickUp hook blocks it, the entity is flagged DONTPICKUP, or an item ITEM.PrePickUp/ITEM.PrePickUpPrimary/ITEM.PrePickUpSecondary callback blocks it.
On success, equips the item via SlashCo.ChangeSurvivorItem and removes the world entity.
Tries to make the given slasher jumpscare and kill a target survivor.
Fails silently if the slasher can't currently kill, is on kill delay, the target isn't a valid survivor, or the target is out of the slasher's SLASHER.KillDistance (unless they're already being jumpscared).
On success it freezes both entities, plays the slasher's kill sound, and after SLASHER.JumpscareDuration seconds deals fatal damage to the target and calls the slasher's SLASHER.OnKillPlayer function via Player:SlasherFunction.
Fails silently if the slasher can't currently kill, is on kill delay, the target isn't a valid survivor, or the target is out of the slasher's SLASHER.KillDistance (unless they're already being jumpscared).
On success it freezes both entities, plays the slasher's kill sound, and after SLASHER.JumpscareDuration seconds deals fatal damage to the target and calls the slasher's SLASHER.OnKillPlayer function via Player:SlasherFunction.
This is used internally - although you're able to use it you probably shouldn't.
This will be changed in the next update. Builds a string with all valid bindings to store it somewhere
Returns the localized string associated with the given key.
Additional arguments are passed to string.format when provided.
String arguments are recursively passed through SlashCo.Language before formatting.
Additional arguments are passed to string.format when provided.
String arguments are recursively passed through SlashCo.Language before formatting.
SlashCo.LegacySetup()
This is used internally - although you're able to use it you probably shouldn't.
Legacy configuration data is converted into the corresponding modern spawn entities.
Returns the amount of perk points a player should have at the given level, based on SlashCo.StartPP and SlashCo.PPsPerLevel.
SlashCo.LoadCurRoundData()
This is used internally - although you're able to use it you probably shouldn't.
Assigns the loaded Slashers via SlashCo.SelectSlasher and, if the Nightmare offering is active, turns every Survivor into a Slasher instead.
Falls back to SlashCo.SinglePlayerSetup in singleplayer, or calls SlashCo.EndRound if the saved data could not be found.
SlashCo.LoadDocuments()
This is used internally - although you're able to use it you probably shouldn't.
Called automatically on startup and whenever game content changes.
SlashCo.LoadFileFromAddons( string fileName )
Includes a lua file from every folder that matches a wildcard in the given path, e.g. "content//init.lua" includes init.lua from every subfolder of content/.
Every matching file is also added as a client file via AddCSLuaFile before being included.
Every matching file is also added as a client file via AddCSLuaFile before being included.
SlashCo.LoadGamemodeFile( string fileName )
Includes a gamemode lua file.
Currently just a thin wrapper around include, kept separate so gamemode files can later be loaded directly from a workshop-mounted addon instead of the local filesystem.
Currently just a thin wrapper around include, kept separate so gamemode files can later be loaded directly from a workshop-mounted addon instead of the local filesystem.
SlashCo.LoadItemPatches()
This is used internally - although you're able to use it you probably shouldn't.
Called automatically on startup and whenever game content changes.
SlashCo.LoadItems()
This is used internally - although you're able to use it you probably shouldn't.
Called automatically on startup and whenever game content changes.
SlashCo.LoadKeyboardBinds()
This is used internally - although you're able to use it you probably shouldn't.
SlashCo.LoadLanguage()
This is used internally - although you're able to use it you probably shouldn't.
This will load & fill SlashCo.LangTable & if missing, set SlashCo.LangTableFallback
It first always loads the gamemode file slashco/lang/[lang].lua and then loads any addon languages by searching slashco/lang/*/[lang].lua using SlashCo.LoadFileFromAddons
And if SlashCo.CurrentLang is outdated (indicating a language change), it will trigger SlashCo:LanguageChanged
SlashCo.LoadMapConfigs( boolean initialCheck = nil )
This is used internally - although you're able to use it you probably shouldn't.
SlashCo.LoadPerks()
This is used internally - although you're able to use it you probably shouldn't.
SlashCo.LoadSlasherPatches()
This is used internally - although you're able to use it you probably shouldn't.
These patch files are intended to modify the code of existing slashers after they've been registered.
Called once automatically when the file is loaded, and again whenever the addon content changes.
SlashCo.LoadSlashers()
This is used internally - although you're able to use it you probably shouldn't.
Called once automatically when the file is loaded, and again whenever the addon content changes.
number SlashCo.LobbyBanter( )
This is used internally - although you're able to use it you probably shouldn't.
Survivors are assigned to the individual conversation parts and the voice lines are played with their appropriate timing
Returns a delay representing the total duration of the conversation
SlashCo.LobbyBriefingTransition()
This is used internally - although you're able to use it you probably shouldn't.
SlashCo.LobbyBroadcastInfo()
This is used internally - although you're able to use it you probably shouldn't.
SlashCo.LobbyEvelatorTransition()
This is used internally - although you're able to use it you probably shouldn't.
SlashCo.LobbyFinish()
This is used internally - although you're able to use it you probably shouldn't.
Moves the helicopter target position further away over time and, after 15 seconds, plays the game intro, starts the leave timer and disables the lobby background music.
Does nothing if the lobby has already finished.
SlashCo.LobbyLeave()
This is used internally - although you're able to use it you probably shouldn't.
SlashCo.LobbyOpenItems()
This is used internally - although you're able to use it you probably shouldn't.
SlashCo.LobbyPlayerBriefing()
This is used internally - although you're able to use it you probably shouldn't.
SlashCo.LobbyRoundData()
This is used internally - although you're able to use it you probably shouldn't.
SlashCo.LobbyRoundSetup()
This is used internally - although you're able to use it you probably shouldn't.
Advances the lobby to SlashCo.LobbyData.LOBBYSTATE 1, opens the elevator shutter doors, forces any not-ready player into the Survivor ready state, resets the Slasher/Survivor selection info, and then runs the difficulty, Offering and team assignment logic that picks the Slashers and Survivors for the upcoming round.
This is used internally - although you're able to use it you probably shouldn't.
Plays a special line instead if the Nightmare Offering is active. Does nothing if the player has no last used item stash.
Vector SlashCo.LocalizedTraceHullLocator( Entity ent, number minRange, number range = minRange, number offset = 0 )
Get a position near an entity that it can be near.
Internally just calls SlashCo.LocalizedTraceHullLocator
Internally just calls SlashCo.LocalizedTraceHullLocator
Vector SlashCo.LocalizedTraceHullLocatorAdvanced( Entity ent, number minRange, number range = minRange, number offset = 0 )
We advise against using this. It may be changed or removed in a future update.
Use the new version SlashCo.LocalizedTraceHullLocator
Alias of SlashCo.LocalizedTraceHullLocator
SlashCo.MapSize()
How big the map is- the larger the value the larger the map
If you need this value on the client use SlashCo.GetMapSize You should never modify it yourself!
If you need this value on the client use SlashCo.GetMapSize You should never modify it yourself!
SlashCo.MapSizeExact()
The map's size as an unrounded number, calculated by SlashCo.InitMapMesh as SlashCo.MaxVec:Distance(SlashCo.MinVec) / 8500.
Falls back to 2.5 if the map bounds couldn't be determined at all.
Rounded up (via math.ceil) into SlashCo.MapSize, which is what most code should use instead. You should never modify it yourself!
Falls back to 2.5 if the map bounds couldn't be determined at all.
Rounded up (via math.ceil) into SlashCo.MapSize, which is what most code should use instead. You should never modify it yourself!
SlashCo.MarkLobbyStarting()
Marks the lobby as starting. Read back using SlashCo.IsLobbyStarting.
While set, spectators are bound to the helicopter's camera and suicide is disallowed.
While set, spectators are bound to the helicopter's camera and suicide is disallowed.
SlashCo.MaxVec()
The map's maximum world-space corner.
Computed by SlashCo.InitMapMesh from the world's brush surfaces (ignoring nodraw/sky/water surfaces), or from game.GetWorld():GetModelBounds() if the world has no brush surfaces at all. You should never modify it yourself!
Computed by SlashCo.InitMapMesh from the world's brush surfaces (ignoring nodraw/sky/water surfaces), or from game.GetWorld():GetModelBounds() if the world has no brush surfaces at all. You should never modify it yourself!
SlashCo.MinVec()
The map's minimum world-space corner.
Computed by SlashCo.InitMapMesh from the world's brush surfaces (ignoring nodraw/sky/water surfaces), or from game.GetWorld():GetModelBounds() if the world has no brush surfaces at all. You should never modify it yourself!
Computed by SlashCo.InitMapMesh from the world's brush surfaces (ignoring nodraw/sky/water surfaces), or from game.GetWorld():GetModelBounds() if the world has no brush surfaces at all. You should never modify it yourself!
This is used internally - although you're able to use it you probably shouldn't.
This is expensive and should only be done when needed
This is used internally - although you're able to use it you probably shouldn't.
SlashCo.OfferingVoteFail()
Cancels the currently running Offering vote, resetting the voted/selected Offering and clearing the list of Offerors.
Notifies all players that the vote did not succeed.
Notifies all players that the vote did not succeed.
SlashCo.OfferingVoteFinished( number rarity )
This is used internally - although you're able to use it you probably shouldn't.
SlashCo.OfferingVoteSuccess( number id )
Applies the winning Offering vote for the lobby, running the SlashCo:UnselectOffering hook for the previous Offering (if any) and the SlashCo:SelectOffering hook for the new one.
Ends the vote for every player. Does nothing if the given Offering is already the active one.
Ends the vote for every player. Does nothing if the given Offering is already the active one.
This is used internally - although you're able to use it you probably shouldn't.
Additional survivors can increase the number of generators and required documents.
Generator values are only modified when the map has not explicitly overridden them.
SlashCo.OnSlasherSpawned( Player ply )
Initializes a slasher's internal state right after they spawn: resets their chase/kill timers, applies SLASHER.OnBalanceForPlayers to their SLASHER table, sets their prowl speed and anger, and calls the slasher's SLASHER.OnSpawn function via Player:SlasherFunction.
SlashCo.OpenKeyboardUI()
Opens (or re-opens) the keybinds menu, listing every entry in SlashCo.KeyboardBinds and letting the player rebind each one by clicking it and pressing a new key.
Bindings are saved via SlashCo.SaveKeyboardBinds once the menu is closed.
Bindings are saved via SlashCo.SaveKeyboardBinds once the menu is closed.
SlashCo.OpenPlayermodelSelector()
Opens a UI panel that lets the player pick one of the available Survivor playermodels.
Selecting a model sets the slashco_cl_playermodel ConVar accordingly.
Selecting a model sets the slashco_cl_playermodel ConVar accordingly.
This is used internally - although you're able to use it you probably shouldn't.
This will be changed in the next update. Parses the given string into a table with all key bindings
This is used internally - although you're able to use it you probably shouldn't.
Does nothing outside of the lobby.
SlashCo.PlayGlobalSound( string soundPath, number soundLevel, Entity ent, number vol, boolean permanent )
We advise against using this. It may be changed or removed in a future update.
This function is soon to be replaced by the SlashCo.AudioSystem
Plays a global sound
SlashCo.PrecacheItem( string itemName )
Precaches a registered item's model, view model, holstered world model and world model (whichever are set), and calls the item's own ITEM.Precache function if it has one.
Looks up the item definition from SlashCoItems by name.
Looks up the item definition from SlashCoItems by name.
SlashCo.PrecacheModel( string modelName )
Precaches a model via util.PrecacheModel and remembers it in an internal table so it isn't precached again, e.g. after an autorefresh.
SlashCo.PrecacheSlasher( string slasherName )
Precaches a registered slasher's model, chase music and kill sound (whichever are set), and calls the slasher's own SLASHER.Precache function if it has one.
Looks up the slasher definition from SlashCoSlashers by name.
Looks up the slasher definition from SlashCoSlashers by name.
SlashCo.PrecacheSound( string soundName )
Precaches a sound and remembers it in an internal table so it isn't precached again, e.g. after an autorefresh.
The current implementation internally calls util.PrecacheModel instead of util.PrecacheSound - this looks like a bug in the existing code.
SlashCo.PrepareSlasherForSpawning()
This is used internally - although you're able to use it you probably shouldn't.
The delay is the smallest value between the difficulty-based delay and any slasher's SLASHER.SpawnDelay value.
SlashCo.QuietHeli()
Quiets the current SlashCo helicopter if it is valid
Tests directions around an entity to find an unobstructed angle
If an unobstructed direction is found, its angle is returned immediately
If all tested directions are blocked, the angle with the greatest traced distance is returned
If an unobstructed direction is found, its angle is returned immediately
If all tested directions are blocked, the angle with the greatest traced distance is returned
Vector SlashCo.RandomPosLocator( )
Return a random position that something can spawn at
It's useless to use this function on a boolean / when using net.WriteBool as this will only add overhead.
Unless you want to preserve nil values. Helper networking function that only writes a value if it isn't nil
The sender code must use SlashCo.WriteOptional
You can find a example on SlashCo.WriteOptional
Unless you want to preserve nil values. Helper networking function that only writes a value if it isn't nil
The sender code must use SlashCo.WriteOptional
You can find a example on SlashCo.WriteOptional
We advise against using this. It may be changed or removed in a future update.
This function will be replaced by SlashCo.AudioSystem
Loads and plays a sound using the specified sound file.
Sounds are cached globally so that subsequent calls using the same file can reuse the existing sound object.
Sounds are cached globally so that subsequent calls using the same file can reuse the existing sound object.
Refunds the points a Survivor spent on their items, used when that Survivor gets turned into a Slasher instead.
Reads the items from the saved round database, refunds their price and removes the Survivor's saved item entry. Does nothing if the player has no saved items or a total refund of 0.
Must only be used in-round, not while in the lobby.
Reads the items from the saved round database, refunds their price and removes the Survivor's saved item entry. Does nothing if the player has no saved items or a total refund of 0.
Must only be used in-round, not while in the lobby.
Registers a mounted workshop addon as a SlashCo addon by its workshop ID, adding it to SlashCo.GetAddons and, Server-side, queuing it for client download via resource.AddWorkshop.
This normally isn't required, as any addon containing a lua/slashco folder is auto-detected by SlashCo.FindSlashCoAddons. Addons that don't match that check can call this from the SlashCo:RegisterAddons hook instead.
This normally isn't required, as any addon containing a lua/slashco folder is auto-detected by SlashCo.FindSlashCoAddons. Addons that don't match that check can call this from the SlashCo:RegisterAddons hook instead.
SlashCo.RegisterDocument( Document table )
Registers a document table, keyed by its Name, and groups it under its Type.
If Type is "Slasher" and no Document.Slasher field is set, it defaults to the document's Name.
Must be called before document loading finishes; calling it afterwards throws an error.
If Type is "Slasher" and no Document.Slasher field is set, it defaults to the document's Name.
Must be called before document loading finishes; calling it afterwards throws an error.
Registers an effect table so it can be applied to players and looked up by name.
Must be called before item loading finishes; calling it afterwards throws an error.
Must be called before item loading finishes; calling it afterwards throws an error.
Registers an item table so it can be equipped, dropped and looked up by name.
Must be called before item loading finishes; calling it afterwards throws an error.
Must be called before item loading finishes; calling it afterwards throws an error.
Registers a perk and associates it with its team.
Registration is rejected after perks have finished loading.
Default values are applied for the perk's level and price.
Conflict IDs are also converted into lookup keys within the PERK.Conflicts table.
Registration is rejected after perks have finished loading.
Default values are applied for the perk's level and price.
Conflict IDs are also converted into lookup keys within the PERK.Conflicts table.
Registers a SLASHER table as a playable slasher, assigning it a unique ID.
Can only be called while slashers are being loaded, calling it afterwards raises an error.
Can only be called while slashers are being loaded, calling it afterwards raises an error.
SlashCo.RemoveAllCurRoundEnts()
This is used internally - although you're able to use it you probably shouldn't.
This removes generators, attached fueling cans, gas cans, tracked round items, batteries, and entities associated with exposure spawns.
Removes a fog entry and networks the removal to all clients.
If no matching fog entry exists, nothing is done.
If no matching fog entry exists, nothing is done.
SlashCo.RemoveHelicopter()
Removes the current SlashCo helicopter if it is valid
Clears the given item slot without spawning a dropped entity, calling the item's ITEM.OnSwitchFrom callback after a short delay.
SlashCo.RemoveObjective( string name )
Removes the tracked objective with the given name.
Doesn't network the change, call SlashCo.SendObjectives afterwards to update clients.
Doesn't network the change, call SlashCo.SendObjectives afterwards to update clients.
SlashCo.ResetCurRoundData()
This is used internally - although you're able to use it you probably shouldn't.
SlashCo.ResetLobby()
This is used internally - although you're able to use it you probably shouldn't.
Used when a prepared game is interrupted, for example when players leave before the round could start.
SlashCo.ResetLobbyData()
This is used internally - although you're able to use it you probably shouldn't.
SlashCo.RoundBeginTimer( boolean instant )
This is used internally - although you're able to use it you probably shouldn't.
SlashCo.RoundOverScreen( SlashCo.RoundState state )
This is used internally - although you're able to use it you probably shouldn't.
SlashCo.SaveKeyboardBinds()
This is used internally - although you're able to use it you probably shouldn't.
Assigns a slasher ID to a player's SteamID64 for the current round, before they've actually spawned as a slasher.
Also precaches the slasher via SlashCo.PrecacheSlasher.
Also precaches the slasher via SlashCo.PrecacheSlasher.
Entity or table, number SlashCo.SelectSpawns( table elements, number amount, function conditionsForced = SlashCo.DefaultConditionsForced, function conditionsNonForced = SlashCo.DefaultConditionsNonForced, boolean forceTable = false )
Selects a number of spawns from a sequential table, prioritizing forced spawn entities.
Forced entries are selected first, followed by non-forced entries if additional selections are required.
Forced entries are selected first, followed by non-forced entries if additional selections are required.
Entity or table<Entity>, number SlashCo.SelectSpawnsNoForce( table<Entity> elements, number amount = 1, function conditions = SlashCo.DefaultConditions, boolean forceTable = false )
Selects a number of spawns from a sequential table using weighted random selection.
Selected entries are removed from consideration so the same entry cannot be selected twice.
When amount is 1, a single element is returned unless forceTable is enabled.
When amount is greater than 1, a table of selected elements and the number of missed entries are returned.
Selected entries are removed from consideration so the same entry cannot be selected twice.
When amount is 1, a single element is returned unless forceTable is enabled.
When amount is greater than 1, a table of selected elements and the number of missed entries are returned.
SlashCo.SendObjectives()
Networks the current objectives (name, status and progress counts) to every Survivor and Spectator.
On the server it networks any amount of values to the specified client, or broadcasts them to all clients when no player is specified
On the client it networks any amount of values to the server
On the client it networks any amount of values to the server
Networks any amount of values to all clients except the specified player.
SlashCo.SetGasCansToSpawn( number amount )
Overrides the total number of gas cans to spawn for the round.
A negative value (the default) makes SlashCo.SpawnGasCans calculate the amount automatically instead, see SlashCo.GetGasCansToSpawn.
A negative value (the default) makes SlashCo.SpawnGasCans calculate the amount automatically instead, see SlashCo.GetGasCansToSpawn.
SlashCo.SetGeneratorsNeeded( number amount )
Sets how many generators need to be fully fueled for survivors to be able to escape.
Read back using SlashCo.GetGeneratorsNeeded.
Read back using SlashCo.GetGeneratorsNeeded.
SlashCo.SetGeneratorsToSpawn( number amount )
Sets how many generators are spawned on the map for the round.
Read back using SlashCo.GetGeneratorsToSpawn.
Read back using SlashCo.GetGeneratorsToSpawn.
Sets the global fog color, used by the Fog system. Read back using SlashCo.GetGlobalFogColor.
On map start this is initialized from the env_fog_controller entity's fog color, if one exists on the map.
On map start this is initialized from the env_fog_controller entity's fog color, if one exists on the map.
SlashCo.SetHelicopterPositions()
This is used internally - although you're able to use it you probably shouldn't.
The vertical position is lowered by 70 units to better align with the Hammer models.
Aborts the round if either required helicopter entity is missing.
Sets a light style and broadcasts an update to all clients so that their light map is updated.
Sets the SlashCo.ReadyState of the given player
SlashCo.SetMapSize( number size )
Sets the current map's size multiplier. Read back using SlashCo.GetMapSize.
Called serverside after the exact map size has been calculated from the map's world bounds.
Called serverside after the exact map size has been calculated from the map's world bounds.
SlashCo.SetRoundStartTime( number time = CurTime() )
Sets the time the round started using CurTime
Entity SlashCo.SettingsEntity( )
Returns the map's settings entity.
The result is cached after the first successful lookup.
The result is cached after the first successful lookup.
SlashCo.SetupExpectedPlayersFailsafe()
This is used internally - although you're able to use it you probably shouldn't.
Also listens for disconnecting players so they can be marked as disconnected inside SlashCo.CurRound.ExpectedPlayers.
SlashCo.SetupLanOverrides()
This is used internally - although you're able to use it you probably shouldn't.
Called when a game is hosted with sv_lan 1 to setup proper -multirun support for development and testing
but now we have to ensure that they won't use the same steamid's.
Right now we change these function and we add the userid to allow for multiple multirun instances to work without colliding with each other.
- PLAYER:SteamID()
- PLAYER:SteamID64()
- PLAYER:OwnerSteamID64()
- PLAYER:UniqueID()
SlashCo.SetupPlayers()
This is used internally - although you're able to use it you probably shouldn't.
Handles Nightmare offering behavior, memorized slashers, late joining survivors, spectators, and Covenant selection.
Previously stored survivor items are restored after all survivors have spawned.
SlashCo.SinglePlayerSetup()
This is used internally - although you're able to use it you probably shouldn't.
Adds the local player as an expected player and a Survivor as soon as they spawn.
SlashCo.SlasherClass()
A table containing all defined Slasher classes
Use SlashCo.AddSlasherClass to register a new class
You should never modify it directly!
Use SlashCo.AddSlasherClass to register a new class
You should never modify it directly!
Activates a list of spawn points.
Each entry with a SpawnEnt method is spawned.
An optional callback can be used to modify an entity before it is spawned.
Each entry with a SpawnEnt method is spawned.
An optional callback can be used to modify an entity before it is spawned.
SlashCo.SpawnDocuments()
This is used internally - although you're able to use it you probably shouldn't.
The number of documents is based on the required document count plus the map size.
If no document spawn entities are available, document spawning is marked as failed.
SlashCo.SpawnGasCans()
This is used internally - although you're able to use it you probably shouldn't.
The number of gas cans is affected by the map size, difficulty, offerings,
slasher modifiers, survivor modifiers, and head-start cans.
Forced gas can counts override the calculated count.
SlashCo.SpawnGenerators()
This is used internally - although you're able to use it you probably shouldn't.
Forced generator spawn points receive priority.
Each selected generator also receives a randomly selected battery spawn.
Aborts the round if no generator spawn entities are available.
SlashCo.SpawnItems()
This is used internally - although you're able to use it you probably shouldn't.
World props configured to replace items are converted into their corresponding items.
Slasher-specific items, the beacon, and randomly selected items are then spawned.
Used for debugging: forces a player to become and spawn as the given slasher immediately.
If the round hasn't started spawning slashers yet, the player is instead just marked to spawn as that slasher via SlashCo.SelectSlasher.
The slasher name is matched case-insensitively against both the registered name and the slasher's Name field.
If the round hasn't started spawning slashers yet, the player is instead just marked to spawn as that slasher via SlashCo.SelectSlasher.
The slasher name is matched case-insensitively against both the registered name and the slasher's Name field.
SlashCo.SpawnSlasher()
This is used internally - although you're able to use it you probably shouldn't.
Does nothing if the slasher has already been spawned.
Converts a sequential SQL result table into a keyed Lua table.
The value of the specified column is used as the key for each row.
The value of the specified column is used as the key for each row.
Starts chase mode for the given slasher.
Unless forceChase is used, this looks for a survivor in the slasher's eye trace or view cone within their SLASHER.ChaseRange, and does nothing if none is found or chasing is disabled for them.
If the slasher is already chasing, this calls SlashCo.StopChase instead.
On success it sets InSlasherChaseMode, switches to SLASHER.ChaseSpeed, plays the chase music, adds the SlasherChase fog, and schedules an automatic SlashCo.StopChase after the chase duration.
Unless forceChase is used, this looks for a survivor in the slasher's eye trace or view cone within their SLASHER.ChaseRange, and does nothing if none is found or chasing is disabled for them.
If the slasher is already chasing, this calls SlashCo.StopChase instead.
On success it sets InSlasherChaseMode, switches to SLASHER.ChaseSpeed, plays the chase music, adds the SlasherChase fog, and schedules an automatic SlashCo.StopChase after the chase duration.
SlashCo.StartGameIntro()
This is used internally - although you're able to use it you probably shouldn't.
SlashCo.StartRound( boolean noSetup = false )
This is used internally - although you're able to use it you probably shouldn't.
Prepares the round entities and players, disables soundscapes, fades players out, and begins the main round initialization after a short delay.
Does nothing when the game is currently in the lobby.
SlashCo.State()
This value is currently NOT syncronized between Server and Clients!
This will be fixed in the next update. The currently active state value.
This will be fixed in the next update. The currently active state value.
Ends the given slasher's chase mode: resets their speed to SLASHER.ProwlSpeed, stops the chase music, starts their chase cooldown, and clears SurvivorChased on any survivor that was being chased by them.
If no other slasher is currently chasing, the SlasherChase fog is also removed.
If no other slasher is currently chasing, the SlasherChase fog is also removed.
Summons the rescue helicopter for the current round
If the helicopter has already been summoned, this returns true
If the helicopter has already been summoned, this returns true
SlashCo.SurvivorWinFinish()
This is used internally - although you're able to use it you probably shouldn't.
Vector SlashCo.TraceHullLocator( )
We advise against using this. It may be changed or removed in a future update.
Use the new version SlashCo.RandomPosLocator
Alias of SlashCo.RandomPosLocator
Looks up the given Bind and returns the name.
SlashCo.TriggerBlackout()
Spawns a sc_blackout_trollge entity inside the lobby, removing any existing one first.
Does nothing outside of the lobby. Part of an unfinished Blackout lobby event.
Does nothing outside of the lobby. Part of an unfinished Blackout lobby event.
Tries to unban the given Slasher
SlashCo.UpdateHelicopterSeek( Vector pos )
Updates the target position that the helicopter is seeking
SlashCo.UpdateObjective( string name, SlashCo.ObjStatus status, number count, boolean dontOverrideComplete )
Adds the objective name to the tracked objectives if it isn't tracked yet, or updates its status/progress otherwise.
When status is SlashCo.ObjStatus.PROGRESS and the objective has a count, count (default 1) is added to its progress, capping at the total and auto-completing it once reached.
Fires SlashCo:OnObjectiveComplete when the objective newly becomes complete.
Doesn't network the change, call SlashCo.SendObjectives afterwards to update clients.
When status is SlashCo.ObjStatus.PROGRESS and the objective has a count, count (default 1) is added to its progress, capping at the total and auto-completing it once reached.
Fires SlashCo:OnObjectiveComplete when the objective newly becomes complete.
Doesn't network the change, call SlashCo.SendObjectives afterwards to update clients.
Uses the survivor's currently held item (the secondary slot takes priority over the primary one) by calling its ITEM.OnUse callback.
The item is removed afterwards unless ITEM.OnUse returns a truthy value, in which case an "item unusable" sound plays instead.
Does nothing in the lobby, for non-survivors, or while the player is frozen.
The item is removed afterwards unless ITEM.OnUse returns a truthy value, in which case an "item unusable" sound plays instead.
Does nothing in the lobby, for non-survivors, or while the player is frozen.
It's useless to use this function on a boolean / when using net.WriteBool as this will only add overhead.
Unless you want to preserve nil values. Helper networking function that only writes a value if it isn't nil
The receiver code must use SlashCo.ReadOptional
Unless you want to preserve nil values. Helper networking function that only writes a value if it isn't nil
The receiver code must use SlashCo.ReadOptional