Custom Mapping Features - Source2ZE/CS2Fixes GitHub Wiki
This is a list of custom mapping features available on servers running CS2Fixes. It is currently reasonable to expect that all CS2 Zombie Escape servers have support for these standards.
Toggling Respawn (ZE Exclusive)
With our remake of Zombie:Reloaded into CS2 as Zombie:Reborn, and also supported by other CS2 ZE implementations, a new feature has been added that mappers need to use to disable (or re-enable) zombie respawns, typically after a "nuke" at the end of the map. This replaces the old trigger_hurt
based automatic "repeat kill detectors", which were often vulnerable to false positives.
All CS2 Zombie Escape maps with a nuke ending must implement this to ensure gamemode compatibility.
To toggle zombie respawning, create an additional output on whatever entity triggers the nuke targeting zr_toggle_respawn
, using whatever delay is necessary, with one of the following inputs:
Disable
- Disables respawns if enabled, does nothing if already disabledEnable
- Enables respawns if disabled, does nothing if already enabledTrigger
- A simple toggle: Disables respawns if enabled, enables respawns if disabled
Here is an example of using Disable
to immediately disable zombie respawning in Hammer:
It will appear as an invalid output, but it will work on a live server
KeyValue Input
The KeyValue
input is intended as a replacement for Source 1's AddOutput
keyvalue manipulation, which no longer works in Source 2.
Usage example:
OnWhatever
> MyEntity
> KeyValue
> origin 5294 -1743 389
Name | Applies To | Description |
---|---|---|
targetname |
All Entities | Name of an entity |
origin |
All Entities | Origin coordinates of an entity |
angles |
All Entities | Angle coordinates of an entity |
max_health |
All Entities | Max health of an entity |
health |
All Entities | Health of an entity |
movetype |
All Entities | Move type of an entity |
basevelocity |
All Entities | Base velocity of an entity |
absvelocity |
All Entities | Absolute velocity of an entity |
target |
All Entities | Target of an entity |
gravity |
All Entities | Scale entity gravity |
timescale |
All Entities | Changes simulation timescale of some entities like func_movelinear |
friction |
All Entities | Scale entity friction |
speed |
Players | Scales player movement timescale using the same method as player_speedmod , but clients will not predict |
runspeed |
Players | Scales player running speed on the ground, clients will predict but if set <1 it will slowly revert back to 1 |
filtername |
filter_ Entities |
Filter name of a filter entity |
EntityTemplate |
env_entity_maker |
Template of an entity maker, "Point_template To Spawn" in Hammer |
force |
phys_thruster |
Force of a thruster |
Need another keyvalue from CS:GO? Request it! Each keyvalue needs manual (but usually simple) implementation, so we are only supporting things as needed.
IgniteLifetime Input
A direct replacement for Source 1's IgniteLifetime
input, parameter should be seconds of burn duration. Handles the fire particle, burn damage and burn slow. Only works on players.
Default config is that players are slowed to 0.6x speed while taking 1 HP damage every 0.3 seconds. But servers can change these values.
Usage example, igniting a player for 10 seconds:
OnWhatever
> !activator
> IgniteLifetime
> 10
AddScore Input
The AddScore
input is intended as a replacement for Source 1's game_score
entity, it adds a certain amount of score to a players stats in the scoreboard. The parameter value will be added on to whatever score the player already has.
Usage example, adding 100 score to a player:
OnWhatever
> !activator
> AddScore
> 100
SetMessage Input
The SetMessage
input is intended as a replacement for AddOutput message
on an env_hudhint
, it updates the message a hudhint displays when the ShowHudHint
input is used.
Usage example, setting a hudhint message to "My updated message":
OnWhatever
> MyHudHint
> SetMessage
> My updated message
SetModel Input
The SetModel
input is intended as a replacement for the SetModel()
CS:GO VScript function, it changes the model of an existing entity. Be aware that the model must be precached first! On the mapping side, this is often done by creating a dummy prop_dynamic
using the model outside of map bounds.
Usage example, changing a players model to S2ZE's "Isaac Clarke":
OnWhatever
> !activator
> SetModel
> characters/models/s2ze/isaac_clarke/isaac_clarke_nohitbox.vmdl
game_player_equip Entity Fixes
Strip Fix
In default CS2, using the Use Only
& Strip First
spawn flags together won't strip weapons from players like it did on CS:GO. This behaviour is fixed with CS2Fixes.
Make sure to include all weapons a player should have when enabling the strip flag (e.g. knife, kevlar for humans).
TriggerForActivatedPlayer parameter fix
The TriggerForActivatedPlayer
input is supposed to support passing a weapon classname as the parameter, which will override the weapons already defined in the entity. This behaviour is fixed with CS2Fixes.
Usage example:
OnWhatever
> MyPlayerEquip
> TriggerForActivatedPlayer
> weapon_ak47
Weapon Type Strip Custom Flag
The "Only Strip Same Weapon Type" flag from CS:GO was removed in CS2, but we have reimplemented it. When used, weapons will only be stripped from the player if they match the weapon slot of a weapon defined in the game_player_equip
.
Due to game_player_equip
already having other spawnflags defined in FGD, and how S2 Hammer works, this new flag must be added to game/core/base.fgd
to be usable. Search for game_player_equip
in this file and edit its spawnflags definition as so:
spawnflags(flags) =
[
1: "Use Only" : 0
2: "Strip First" : 0
4: "Only Strip Same Weapon Type" : 0
]
In this example, only knife/pistol would be stripped to make way for the new weapons when TriggerFor*
/Use
inputs are fired.
Steam ID Filtering
Note: This feature is not always guaranteed to be available, servers have control for safety reasons
When enabled, all players will have their SteamID64 added to their entity as an attribute. To filter for this, start by creating a filter_activator_attribute_int
entity, and put the ID you want to match into "Attribute Name".
You can then use this filter entity as normal, whether by adding it to "Filter Name" on a trigger, or using the TestActivator
input and listening for corresponding OnPass
/OnFail
outputs.
game_ui Entity Implementation
The game_ui
entity does not exist in Source 2, to accommodate its complexity, we've reimplemented it as a "custom entity". For ease of Hammer/compiler integration without messing around with FGD, we use logic_case
as a proxy. To start, simply put game_ui
in the vscripts
(Entity Scripts) keyvalue.
Inputs
Use the Activate
input to enable the game_ui for the activator player, and similarly Deactivate
to disable.
Usage examples:
OnWhatever
> MyGameUI
> Activate
OnWhatever
> MyGameUI
> Deactivate
Outputs
Using the table below, configure the entity keyvalue & output(s) for each event you want to listen for.
Key | Value | Output | Comment |
---|---|---|---|
Case01 |
PlayerOn |
OnCase01 |
Activated game_ui |
Case02 |
PlayerOff |
OnCase02 |
Deactivated game_ui |
Case11 |
PressedForward |
OnCase11 |
Pressed 'W' |
Case12 |
PressedMoveLeft |
OnCase12 |
Pressed 'A' |
Case13 |
PressedBack |
OnCase13 |
Pressed 'S' |
Case14 |
PressedMoveRight |
OnCase14 |
Pressed 'D' |
Case15 |
PressedAttack |
OnCase15 |
Pressed 'Attack' |
Case16 |
PressedAttack2 |
OnCase16 |
Pressed 'Attack2' |
Case17 |
PressedSpeed |
OnCase17 |
Pressed 'Speed' |
Case18 |
PressedDuck |
OnCase18 |
Pressed 'Duck' |
Case21 |
UnpressedForward |
OnCase21 |
Unpressed 'W' |
Case22 |
UnpressedMoveLeft |
OnCase22 |
Unpressed 'A' |
Case23 |
UnpressedBack |
OnCase23 |
Unpressed 'S' |
Case24 |
UnpressedMoveRight |
OnCase24 |
Unpressed 'D' |
Case25 |
UnpressedAttack |
OnCase25 |
Unpressed 'Attack' |
Case26 |
UnpressedAttack2 |
OnCase26 |
Unpressed 'Attack2' |
Case27 |
UnpressedSpeed |
OnCase27 |
Unpressed 'Speed' |
Case28 |
UnpressedDuck |
OnCase28 |
Unpressed 'Duck' |
Activator will be the player pawn, caller will be the logic_case
/game_ui
.
Spawn Flags
logic_case
has no spawn flags by default, thus if you want to use custom spawn flags, you will need to add the spawnflags
key & value yourself.
Possible values are:
32
: Freeze Players256
: Jump Deactivates
To select multiple flags, simply add the values together, e.g. 32 + 256 = 288
.
point_viewcontrol Entity Implementation
Neither point_viewcontrol
nor point_viewcontrol_multiplayer
exist in Source 2, to allow for custom player camera control, we've reimplemented it as a "custom entity". For ease of Hammer/compiler integration without messing around with FGD, we use logic_relay
as a proxy.
KeyValues
point_viewcontrol
has a few custom keyvalues, vscripts
(Entity Scripts) will already be present, but the rest you should first add like so.
Purpose | Key | Value | Comment |
---|---|---|---|
Custom Classname | vscripts (Entity Scripts) |
point_viewcontrol |
Required, identifies this entity as a point_viewcontrol |
Camera Target | target |
Targetname of entity to follow | Required, this entity is what the players camera follows, can be stationary or parented |
Field Of View | health |
Between 16 -179 |
Only used if "Change FOV" spawnflag is enabled |
Inputs
Input | Comment |
---|---|
EnableCamera |
Changes activator's camera to this point_viewcontrol |
DisableCamera |
Resets activator's camera back to normal |
EnableCameraAll |
Changes all players camera's to this point_viewcontrol |
DisableCameraAll |
Resets all players camera's back to normal |
Spawn Flags
logic_relay
has no spawn flags by default, thus if you want to use custom spawn flags, you will need to add the spawnflags
key & value yourself, refer to the above image.
Possible values are:
32
: Freeze Players (don't use withgame_ui
)64
: Change FOV128
: Disarm Players
To select multiple flags, simply add the values together, e.g. 64 + 128 = 192
.