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.
| Scheme | Purpose |
|---|---|
animpoint | Move to a registered smart cover point and play an idle animation there. |
camper | Hold a combat position, scan look points, and fire from cover. |
companion | Follow and assist the actor. |
cover | Move to a cover point near a smart terrain and look while animating. |
patrol | Coordinate a group of stalkers moving as one unit around a commander. |
remark | Play a short scripted animation, optionally aimed, with optional sound. |
sleeper | Move to a sleeping patrol point and sleep or sit. |
smartcover | Use a registered smart cover and update the cover target state. |
walker | Follow a patrol path while no higher-priority planner state is active. |
Monster
Monster movement, territory, animations, and combat.
| Scheme | Purpose |
|---|---|
mob_combat | Generic monster combat switch scheme. |
mob_death | Handle monster death callbacks and record the killer id. |
mob_home | Keep a monster within a home area and radius range. |
mob_jump | Turn a monster toward a point and force a jump. |
mob_remark | Play scripted monster animations and optional interaction state. |
mob_walker | Follow a patrol path, optionally stopping at look points. |
Restrictor
Zone triggers, timers, visual effects, and actor events driven from a restrictor.
| Scheme | Purpose |
|---|---|
sr_crow_spawner | Spawn crows at configured patrol paths up to a total limit. |
sr_cutscene | Teleport the actor, disable game UI, and play camera effects. |
sr_deimos | Drive a disorientation effect based on actor movement speed. |
sr_idle | Wait and evaluate switch conditions without running an effect. |
sr_light | Register the restrictor as a light-control zone for stalkers. |
sr_monster | Stage a monster ambush while the actor is inside the zone. |
sr_no_weapon | Track whether the actor is inside a weapons-disabled zone. |
sr_particle | Play particle effects, optionally following a path. |
sr_postprocess | Apply a gray/noise postprocess while the actor is inside. |
sr_psy_antenna | Apply psy-zone effects while the actor is inside. |
sr_silence | Mark the restrictor as a silence zone. |
sr_teleport | Teleport the actor after entry once a timeout elapses. |
sr_timer | Show a HUD timer and switch sections when it reaches a value. |
Physical
Usable and reactive world objects.
| Scheme | Purpose |
|---|---|
ph_button | Play a button animation and switch sections when used. |
ph_code | Open a numeric input window and evaluate condlists for entered codes. |
ph_door | Control door open/closed and lock state, NPC locking, tips, and sounds. |
ph_force | Apply a constant force toward a patrol point. |
ph_hit | Apply a scripted hit when the section activates. |
ph_idle | Neutral physical-object scheme controlling usability and tips. |
ph_minigun | Aim and fire a minigun at a patrol point, the actor, or a story object. |
ph_on_death | Switch sections when the object receives a death callback. |
ph_on_hit | Switch sections when the object receives a hit callback. |
ph_oscillate | Apply alternating constant force to a physical object joint. |
Helicopter
Scripted flight and weapons.
| Scheme | Purpose |
|---|---|
heli_move | Move a helicopter along a patrol path and configure targeting and weapons. |
Generic
Behavior attached alongside an active scheme rather than replacing it.
| Scheme | Purpose |
|---|---|
abuse | React when the actor abuses an NPC repeatedly. |
combat | Select a scripted combat style for stalkers through a condlist. |
combat_camper | Internal combat helper: hide and watch the last known enemy position. |
combat_ignore | Control whether a stalker accepts an enemy while scripted logic runs. |
combat_zombied | Internal combat helper: simplified zombied combat actions. |
corpse_detection | Find and loot nearby corpses. |
danger | Replace the default danger evaluator and track heard hostile sounds. |
death | Run configured condlists on death and store the killer id. |
gather_items | Control whether a stalker may use the base item-pickup evaluator. |
hear | Switch sections from on_sound rules when a matching sound is heard. |
help_wounded | Help nearby wounded friendly stalkers. |
hit | Switch sections on a hit callback and record hit metadata. |
meet | Control greetings, idle animation, and dialog at interaction distance. |
post_combat_idle | Wait briefly after combat before returning to alife behavior. |
reach_task | Drive squad members toward their assigned simulation target. |
wounded | Capture 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_walkandpath_lookdistinct where both are used. - Use
sr_idlefor a state that only waits for switch rules.