Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Schemes

A scheme is the behavior selected by an object’s logic configuration. [logic] active names the initial section; the part before @ selects the implementation.

[logic]
active = walker@guard

[walker@guard]
path_walk = guard_walk
path_look = guard_look
on_info = {+alarm_started} walker@alarm

[walker@alarm]
path_walk = alarm_walk
def_state_moving = run

The scheme name is the part before the suffix. For example, walker@guard uses the walker implementation, and sr_idle@wait_for_actor uses the sr_idle implementation.

Digits are ignored while resolving a scheme name, so numbered variants share the same implementation.

Switching sections

Active sections can define switch rules. The engine evaluates rule groups in this fixed order: actor distance, signals, info portions, real-time timers, game-time timers, actor-zone rules, then NPC-zone rules. Within a group, rules follow their order in the section. Numbered variants such as on_info1 add another rule of the same type.

on_info, on_info1, …

Value shape: condlist.

When the condlist picks a target section.

on_signal, on_signal1, …

Value shape: signal | condlist.

When a waypoint or manager sets the named signal.

on_timer, on_timer1, …

Value shape: milliseconds | condlist.

After the section has been active for the given real-time duration.

on_game_timer, on_game_timer1, …

Value shape: seconds | condlist.

After the section has been active for the given game-time duration.

on_actor_inside

Value shape: condlist.

When the actor is inside the current restrictor object.

on_actor_outside

Value shape: condlist.

When the actor is outside the current restrictor object.

on_actor_in_zone

Value shape: zone | condlist.

When the actor is inside the named zone.

on_actor_not_in_zone

Value shape: zone | condlist.

When the actor is outside the named zone.

on_npc_in_zone

Value shape: story_id | zone | condlist.

When the NPC resolved by story id is inside the named zone.

on_npc_not_in_zone

Value shape: story_id | zone | condlist.

When the NPC resolved by story id is outside the named zone.

on_actor_dist_le

Value shape: distance | condlist.

When the object sees the actor and actor distance is less than or equal to the value.

on_actor_dist_le_nvis

Value shape: distance | condlist.

Same distance check, without requiring actor visibility.

on_actor_dist_ge

Value shape: distance | condlist.

When the object sees the actor and actor distance is greater than the value.

on_actor_dist_ge_nvis

Value shape: distance | condlist.

Same distance check, without requiring actor visibility.

A condlist can also set info portions or run effects while selecting the next section:

on_info = {+actor_has_key} ph_door@open %=play_sound(door_unlock)%

An empty target, nil, or the current section does not switch. Timer baselines reset after a successful switch.

Scheme families

XRF ships 55 schemes. Each one has its own page; the sidebar lists them alphabetically.

Stalker

Primary schemes for stalker NPCs: movement, position, animation, and interaction.

SchemePurpose
animpointMove to a registered smart cover point and play an idle animation there.
camperHold a combat position, scan look points, and fire from cover.
companionFollow and assist the actor.
coverMove to a cover point near a smart terrain and look while animating.
patrolCoordinate a group of stalkers moving as one unit around a commander.
remarkPlay a short scripted animation, optionally aimed, with optional sound.
sleeperMove to a sleeping patrol point and sleep or sit.
smartcoverUse a registered smart cover and update the cover target state.
walkerFollow a patrol path while no higher-priority planner state is active.

Monster

Monster movement, territory, animations, and combat.

SchemePurpose
mob_combatGeneric monster combat switch scheme.
mob_deathHandle monster death callbacks and record the killer id.
mob_homeKeep a monster within a home area and radius range.
mob_jumpTurn a monster toward a point and force a jump.
mob_remarkPlay scripted monster animations and optional interaction state.
mob_walkerFollow a patrol path, optionally stopping at look points.

Restrictor

Zone triggers, timers, visual effects, and actor events driven from a restrictor.

SchemePurpose
sr_crow_spawnerSpawn crows at configured patrol paths up to a total limit.
sr_cutsceneTeleport the actor, disable game UI, and play camera effects.
sr_deimosDrive a disorientation effect based on actor movement speed.
sr_idleWait and evaluate switch conditions without running an effect.
sr_lightRegister the restrictor as a light-control zone for stalkers.
sr_monsterStage a monster ambush while the actor is inside the zone.
sr_no_weaponTrack whether the actor is inside a weapons-disabled zone.
sr_particlePlay particle effects, optionally following a path.
sr_postprocessApply a gray/noise postprocess while the actor is inside.
sr_psy_antennaApply psy-zone effects while the actor is inside.
sr_silenceMark the restrictor as a silence zone.
sr_teleportTeleport the actor after entry once a timeout elapses.
sr_timerShow a HUD timer and switch sections when it reaches a value.

Physical

Usable and reactive world objects.

SchemePurpose
ph_buttonPlay a button animation and switch sections when used.
ph_codeOpen a numeric input window and evaluate condlists for entered codes.
ph_doorControl door open/closed and lock state, NPC locking, tips, and sounds.
ph_forceApply a constant force toward a patrol point.
ph_hitApply a scripted hit when the section activates.
ph_idleNeutral physical-object scheme controlling usability and tips.
ph_minigunAim and fire a minigun at a patrol point, the actor, or a story object.
ph_on_deathSwitch sections when the object receives a death callback.
ph_on_hitSwitch sections when the object receives a hit callback.
ph_oscillateApply alternating constant force to a physical object joint.

Helicopter

Scripted flight and weapons.

SchemePurpose
heli_moveMove a helicopter along a patrol path and configure targeting and weapons.

Generic

Behavior attached alongside an active scheme rather than replacing it.

SchemePurpose
abuseReact when the actor abuses an NPC repeatedly.
combatSelect a scripted combat style for stalkers through a condlist.
combat_camperInternal combat helper: hide and watch the last known enemy position.
combat_ignoreControl whether a stalker accepts an enemy while scripted logic runs.
combat_zombiedInternal combat helper: simplified zombied combat actions.
corpse_detectionFind and loot nearby corpses.
dangerReplace the default danger evaluator and track heard hostile sounds.
deathRun configured condlists on death and store the killer id.
gather_itemsControl whether a stalker may use the base item-pickup evaluator.
hearSwitch sections from on_sound rules when a matching sound is heard.
help_woundedHelp nearby wounded friendly stalkers.
hitSwitch sections on a hit callback and record hit metadata.
meetControl greetings, idle animation, and dialog at interaction distance.
post_combat_idleWait briefly after combat before returning to alife behavior.
reach_taskDrive squad members toward their assigned simulation target.
woundedCapture a stalker into a wounded state at health or psy breakpoints.

Patrol names

Several schemes read patrol path fields such as path_walk and path_look. When an object is running under a smart terrain, relative path names are resolved against the smart terrain name. For example, path_walk = guard_walk in smart terrain zat_b40_smart_terrain resolves to zat_b40_smart_terrain_guard_walk.

Use full path names when the path does not belong to the active smart terrain.

Before testing a section

  • Supply every required field for the selected scheme.
  • Keep path_walk and path_look distinct where both are used.
  • Use sr_idle for a state that only waits for switch rules.