auto_stories

s&box MCP Knowledgebase

Documentation, API references, code examples and community knowledge for s&box development.

library_books 595 entries menu_book 352 Documentation code 133 API Reference terminal 100 Code Example groups 10 Community
Results for "npc" 25 results closeClear
terminalCode Example
May 4, 2026

Sandbox: NPC system — Schedule, Task, and Layer architecture

NPC System — Schedule, Task, and Layer Architecture The Sandbox NPC system uses a layered architecture: Layers handle continuous behaviours (navigation, senses,…

codeAPI Reference
May 12, 2026

s&box BaseNpcLayer: NPC behavior layer base

Abstract base class for NPC behavior layers. Layers provide specific services (navigation, senses, speech) for tasks to use. Properties Methods Usage Inherit fr…

menu_bookDocumentation
May 12, 2026

s&box NpcConVars: Global NPC AI settings

NpcConVars Static Class NpcConVars is a static class that defines console variables controlling global NPC AI behavior in s&box. These ConVars can be set via co…

codeAPI Reference
May 12, 2026

s&box SpeechLayer: NPC speech and subtitles

NPC behavior layer that manages speech state, plays sound files, and renders subtitle text above the NPC's head. Properties Methods Behavior Resolves a random s…

codeAPI Reference
May 12, 2026

s&box ScheduleBase: NPC schedule base class

Abstract base class for NPC schedules. A schedule executes a sequence of tasks with cancellation support. Properties Methods Behavior Executes tasks sequentiall…

codeAPI Reference
May 12, 2026

s&box CombatNpc: Combat NPC

CombatNpc Class API Reference CombatNpc is a combat NPC that searches for players, advances on them, fires in bursts, and repositions. When friendly, follows pl…

codeAPI Reference
May 12, 2026

s&box TaskBase: NPC task base class

Abstract base class for NPC tasks. Tasks are executed as part of a Schedule and return a TaskStatus to indicate their state. Properties Methods TaskStatus Enum …

codeAPI Reference
May 12, 2026

s&box ScientistNpc: Fear-based NPC

ScientistNpc Class API Reference ScientistNpc is an NPC with a fear system that flees when damaged. When not afraid, wanders or inspects nearby props. Implement…

codeAPI Reference
May 12, 2026

s&box NavigationLayer: NPC navigation

NPC behavior layer that handles navigation using NavMeshAgent. Provides movement commands and status tracking. Properties Methods Behavior Uses NavMeshAgent for…

codeAPI Reference
May 12, 2026

s&box RollermineNpc: Physics-driven NPC

RollermineNpc Class API Reference RollermineNpc is a physics-driven NPC that chases players, leaps at them, and bounces off dealing damage on contact. Implement…

codeAPI Reference
May 12, 2026

s&box SensesLayer: NPC environmental scanning

NPC behavior layer that handles awareness and environmental scanning. Caches visible/audible objects by tag for efficient querying. Properties Methods Behavior …

groupsCommunity
May 4, 2026

Sandbox: Full codebase architecture — systems, player components, weapons, tools, NPCs

Sandbox Codebase Architecture Overview The Facepunch Sandbox game is a large reference implementation. Here's a map of the major systems and how they connect. C…

terminalCode Example
May 3, 2026

NPC Ragdoll Creation with Clothing Preservation

NPC Ragdoll Creation with Clothing Pattern for creating ragdolls from NPCs including clothing preservation and bone merging. Key APIs **** — copies model, mater…

codeAPI Reference
May 12, 2026

s&box TaskStatus: NPC task status enum

TaskStatus Enum API Reference TaskStatus is an enum returned by task execution in the NPC system to indicate the current state of a task. Type Signature Values …

terminalCode Example
May 18, 2026

Randomized Clothing for NPC Citizens using Dresser.Randomize() on Prefabs

Overview This demonstrates how to create NPC citizen prefabs with randomized clothing using the built-in component. Each time the prefab spawns or is enabled, i…

terminalCode Example
May 5, 2026

ModelPhysics — ragdolls and per-bone physics simulation

ModelPhysics — Ragdolls and Per-Bone Physics drives physics simulation per bone on a skinned model. Use it for ragdolls, destructible characters, and physics-dr…

codeAPI Reference
May 12, 2026

s&box IKillSource: Kill feed attacker interface

IKillSource Interface API Reference IKillSource is an interface for Components that can appear as an attacker in the kill feed. Implement on Player, Npc, explos…

codeAPI Reference
May 12, 2026

s&box BaseCarryable.IEvent: World model events

BaseCarryable.IEvent Interface API Reference BaseCarryable.IEvent is an interface for receiving world model lifecycle events on carryable objects (weapons, item…

menu_bookDocumentation
May 4, 2026

Scene.Trace: Raycasting, Shape Sweeps, Tag Filters, SceneTraceResult Fields, and FindInPhysics

Scene.Trace: Raycasting and Shape Sweeps in s&box is the entry point for all physics traces in s&box. It returns a builder that uses a fluent API. Basic Usage F…

menu_bookDocumentation
May 4, 2026

DamageInfo: The Standard Damage Payload — Properties, Usage, and Custom Types

DamageInfo: The Standard Damage Payload is a class (not a struct) used to pass damage information between game systems. It is intentionally a class so games can…