State
On console, server owners can't create real safe zones at traders, spawn hubs or community areas. PC servers get this from mods (Expansion SafeZones, PVEZ, server-side scripts). Console servers can only edit mission files, and none of those files can stop players taking damage inside an area. Right now we enforce safe zones with rules and bans, which doesn't scale and is not effective and causes alot of pain for players when killed in the safezone.
I talked this over with Mark on stream and he liked the idea, so I'm filing it here with some concrete ways to build it per his request later in the stream. He advised to make a feedback tracker post.
Request: a mission-folder JSON config that defines areas where players take no incoming damage. It would be set up the same way we already set up underground triggers, contaminated areas and restricted areas.
Possible implementation paths:
Option 1: a new trigger type modeled on cfgundergroundtriggers.json
Use the same Position / Orientation / Size box format the underground triggers already use.
Put it in a new file (e.g. cfgsafezonetriggers.json) or add a new field to the existing trigger entries.
There's precedent for this. Underground trigger areas already change gameplay rules: cfggameplay.json's disallowedTypesInUnderground blocks building inside them.
Option 2: a new EffectArea type in cfgEffectArea.json (easiest to configure)
cfgEffectArea already takes a Type and a TriggerType for each area, plus a position and radius.
A new pair such as SafeArea_Static / SafeZoneTrigger, with no particles and no PPE, would reuse the loader that's already there.
Option 3: extend Player Restricted Areas (PRA, 1.26)
PRA already loads box and polygon areas from mission JSON and syncs them to clients.
A flag like "Mode": "SafeZone" would allow polygon-shaped safe zones. Most trader layouts don't fit a circle.
Suggested per-zone settings:
AreaName
BlockPlayerDamage: PvP
BlockInfectedDamage
BlockAnimalDamage
BlockExplosionDamage
BlockVehicleDamage: vehicle collisions
BlockOutgoingDamage: players inside can't hurt players outside, so nobody can shoot out of the zone
ProtectGear: clothing and items in inventory
ProtectVehicles: vehicles parked inside
ExitProtectionSeconds: a grace timer after leaving the zone
CombatCooldownSeconds: no protection if the player dealt or took damage in the last X seconds, so nobody can run into the zone mid-fight
NotifyOnEnterExit plus custom message text
How it could work server-side:
When a player enters the trigger, the server flags them.
In the damage pipeline (e.g. EEOnDamageCalculated, before damage is applied), the server drops the hit if the victim or attacker is flagged, according to the zone's settings.
It also stops the side effects of a hit: bleeding, shock, fractures. Script-based safe zones on PC have reported players still bleeding while damage is turned off.
Why it matters: console makes up a big share of community servers, and safe trader areas are one of the features console players ask for most. Every option above builds on systems you've already shipped.
I run BluZ™ (16,000+ members, Xbox and PlayStation servers on Nitrado) and I'm happy to test this on live servers.
Implementation terms and code names
Mission config systems the post builds on
cfgundergroundtriggers.json: each trigger has Position, Orientation, Size, EyeAccommodation, Breadcrumbs and InterpolationSpeed.
Underground debug tools: DayZDiag_x64 has a diag menu option, Script > Triggers > Show Triggers, that displays active triggers and the areas they cover. A safe-zone trigger could reuse this debug view.
disallowedTypesInUnderground (cfggameplay.json): "Prevents construction of these items types (including inherited ones) in the underground areas."
The only damage toggles in cfggameplay are global: disableBaseDamage and disableContainerDamage. There are no per-area damage settings, which is the gap this request fills.
cfgEffectArea.json fields: Type is the class name of the EffectArea subclass to spawn (ContaminatedArea_Static), and TriggerType is the trigger class name (ContaminatedTrigger).
Effect areas aren't saved between restarts: they're created at mission start and aren't persistent, so they can be added or removed between restarts with no wipe required. That's useful to mention.
PRA files: coordinate files go in the "pra" section of cfggameplay, added in 1.26.
Script class and function names
CfgPlayerRestrictedAreaHandler / PlayerRestrictedAreaInstance: these have IsPointInPlayerRestrictedArea(vector point, out PlayerRestrictedAreaInstance hitArea), IsCylinderInAreaBox(...), IsPointInAreaPolygon(...). The box and polygon checks already exist.
CylinderTrigger and OnEnterServerEvent / OnLeaveServerEvent: these are the trigger entry and exit events. One known bug: OnLeaveServerEvent fires incorrectly when a player gets into a vehicle inside a CylinderTrigger. A safe zone that drops protection when someone gets into a car would be exploitable, so it's worth mentioning if a dev brings up Option 2.
TriggerShape enum: BOX and SPHERE, defined in ScriptedEntity.c.
EEHitBy: void EEHitBy(TotalDamageResult damageResult, int damageType, EntityAI source, int component, string dmgZone, string ammo, vector modelPos, float speedCoef)
EEOnDamageCalculated: logs show it running before EEHitBy and reporting the damage type, source entity, damage zone and ammo, which makes it the natural place to cancel a hit. I couldn't find public docs for what its return value does, so in the post I hedged it with "e.g."
SetAllowDamage / GetAllowDamage: proto native void SetAllowDamage(bool val);
DamageType enum: CLOSE_COMBAT, FIRE_ARM, EXPLOSION, STUN, CUSTOM. These map directly to the per-zone Block* settings.
Pitfalls that support asking for an engine-level fix
Damage off doesn't stop bleeding: a user of a server-side safezone script said it works minus the bleed effect no damage but still bleed/cut.
PVEZ (the PC mod) heals after the hit: its dev said the mod doesn't actually reflect the damage (it's not possible due to modding limitations), the target gets the damage anyway, and the mod just heals the target after the damage is done.
SetAllowDamage has had problems before: an older tracker report found that SetAllowDamage() in Object class does not appear to have any effect.
Similar console requests already on the tracker
T158082: "Add more customizability to console server owners". You could link it as related.
Possible implementation paths:
Option 1: a new trigger type modeled on cfgundergroundtriggers.json
Use the same Position / Orientation / Size box format the underground triggers already use.
Put it in a new file (e.g. cfgsafezonetriggers.json) or add a new field to the existing trigger entries.
There's precedent for this. Underground trigger areas already change gameplay rules: cfggameplay.json's disallowedTypesInUnderground blocks building inside them.
Option 2: a new EffectArea type in cfgEffectArea.json (easiest to configure)
cfgEffectArea already takes a Type and a TriggerType for each area, plus a position and radius.
A new pair such as SafeArea_Static / SafeZoneTrigger, with no particles and no PPE, would reuse the loader that's already there.
Option 3: extend Player Restricted Areas (PRA, 1.26)
PRA already loads box and polygon areas from mission JSON and syncs them to clients.
A flag like "Mode": "SafeZone" would allow polygon-shaped safe zones. Most trader layouts don't fit a circle.
Option 2: a new EffectArea type in cfgEffectArea.json (easiest to configure)
cfgEffectArea already takes a Type and a TriggerType for each area, plus a position and radius.
A new pair such as SafeArea_Static / SafeZoneTrigger, with no particles and no PPE, would reuse the loader that's already there.
Suggested per-zone settings:
AreaName
BlockPlayerDamage: PvP
BlockInfectedDamage
BlockAnimalDamage
BlockExplosionDamage
BlockVehicleDamage: vehicle collisions
BlockOutgoingDamage: players inside can't hurt players outside, so nobody can shoot out of the zone
ProtectGear: clothing and items in inventory
ProtectVehicles: vehicles parked inside
ExitProtectionSeconds: a grace timer after leaving the zone (maybe?)
CombatCooldownSeconds: no protection if the player dealt or took damage in the last X seconds, so nobody can run into the zone mid-fight (maybe?)
NotifyOnEnterExit plus custom message text (would require faster logging like PC)
Activity
You are not signed in. Please sign in to see more details and to reply.
State