Skip to content

Obstacles, locks and navigation links

A new kind of obstacle to climb is one Data Asset, with its own odds. Locks and navigation links are placed by two editor actions, and only something zombies can break needs a graph.

A new kind of obstacle

  1. In Content/ZombieSurvival/DataAssets/Traversal/Childs/, duplicate the closest DA_Traversal_* (class PDA_TraversalDef). The folder holds, among others, DA_Traversal_LowFence, _HighFence, _Chainlink, _Bars, _Window and _Barricade.
  2. Fill the fields below.
  3. Name it in TraversalDef on the class of the obstacle, or on one placed actor in its Details panel.
  4. A fence takes its mesh from FenceMesh on the same actor.
Field What it does
ObstacleKind, HeightMin, HeightMax What it is (low fence, high fence, window or barricade), and the height band it covers.
GestureTag, Duration, SprintDuration, FallDuration The gesture played, its length, its length at a sprint, and the time spent on the ground after a fall.
BaseChance, ChanceInputs The chance before the inputs (100 never fails), then one row per skill, stat, status or item that moves it.
ZombieMalusNear, ZombieMalusFar, ZombieRadiusNear, ZombieRadiusFar The points each living zombie within the two radii takes off.
SprintFallChance The chance of falling when crossing at a sprint. Low fence only.
RefuseTier, ExhaustedStatus, OverloadStatus, ExhaustedText, OverloadedText From which level of exhaustion or overload the climb is refused, and what the survivor is told.
EnduranceCost, TraversalNoiseTag What the crossing costs, and the noise it makes.
MeshObjectType, bSeeThrough For a fence: its collision object type, and whether sight and shots pass.

Fences and windows are still crossed along an arc, because no shipped animation slot has a warp window yet.

Make something climbable

CanVault, VaultSeconds and VaultDistance are Settings on Blueprints/Interactables/BP_Interactable, next to the highlight settings, so every interactable in the pack has them.

  1. Tick CanVault in the Class Defaults of a child of BP_Interactable, or on a single placed actor to stage one spot.
  2. Holding the interact key (E) then climbs it.

A child Blueprint keeps its own copy of an inherited default. A value changed on BP_Interactable does not reach the children that already override it: set it on the child you care about, or on all of them.

Something zombies can break

Any actor that implements Blueprints/Interfaces/BPI_ZombieBreakable is hit by a zombie that is stopped in front of it while going somewhere.

Function What it does
CanBeHitByZombie(Zombie) True while it can still be hit.
HitByZombie(Damage, Zombie) Takes the hit, returns true once broken.
GetHitNoiseTag() The noise of a hit, a row of DA_NoiseSettings_Default.

Nothing changes on the zombie, which calls the interface on the host. The damage is the archetype's ObstacleDamage times the Strength option.

Four classes ship with the interface: BP_Openable (doors and windows), BP_Barricade, BP_Built and BP_Fence (a low fence, broken by crawlers only). Keep the broken state in a replicated variable, as they do, so that every player sees it.

A locked door and its key

  1. Select the doors in the level and right-click: Scripted Actor Actions > Lock With Key, an action of Blueprints/Editor/EUB_KeyPlacer.
  2. Give a LockId (a Name, say H5), the spawn plan, and the SaveId of the container that should hold the key.
  3. In one undoable step the doors get the LockId, and the key goes to the top of that container's Contents.
  4. Set LockChance on a door: 1 for a door that is always locked, between 0 and 1 for one that may be.

Two keys that open the same lock are two stacks with the same KeyId.

The action writes the key into the spawn plan you name. On a partitioned map, a BP_HouseController decides which houses are locked, and a locked house has its key in one of its own containers.

  1. Select the windows and low fences and right-click: Scripted Actor Actions > Place Nav Links, an action of Blueprints/Editor/EUB_NavLinkPlacer.
  2. It places one BP_ZSNavLink through the middle of each opening whose two ends are on the navmesh (OpeningOffset 150, LinkHalfLength 110). The others are counted as skipped.

The links ship switched on. A zombie crosses the opening through them, breaking a closed window first.

Narrow stairs

If the navmesh does not reach a staircase:

  1. Place a NavModifierVolume over it with Nav Mesh Resolution set to High. Do this rather than shrinking the agent.
  2. Rebuild the paths of the map and save it.

The high resolution cell is 9.5 uu and the tile is 988 uu (Config/DefaultEngine.ini, RecastNavMesh). Every cell size must divide the tile size, or the tiles of two resolutions do not join. Changing those settings empties the navmesh saved in every map: rebuild the paths of each map and save it.

Test it

Open Content/ZombieSurvival/Maps/L_World. The North quarter, loaded by default, has doors, windows, a barricade on one window of each house and picket fences.

  • For an obstacle, set your TraversalDef on the fence, press Play and hold E in front of it.
  • For a lock, use a small map of your own, whose containers are in a spawn plan. Run Lock With Key on a door, press Play and try the door: it is locked. Search the container you named with E to find the key.
  • For a navigation link, press Play, stand inside a house and make noise. A zombie outside comes through the window, breaking it first if it is closed.