Update 0.1.5
Update 0.1.5
Status: upcoming release documentation. The public release remains 0.1.4. These new APIs are marked available from 0.1.5. Private development builds may contain them under an earlier version string; this page is not an updater rollout.
NPC scripting
NPC scripting describes the complete server-side API, examples, defaults and limitations:
- Explicit drawn weapon modes, one-shot whole-body facing, catalog animations and preserved patrol routes.
- Optional health, invulnerability, melee damage and continuous player targeting. Spawning or equipping an NPC does not automatically enable aggression.
- Bow, crossbow and seven supported combat spells, finite ammunition/mana, timed preparation/release and opt-in attack requests.
- Combat pursuit: walk, run, configurable speed or hold position independently of patrol speed.
- Distance/cone perception and custom server blockers shared with NPC projectile occlusion. Not complete native-world collision or head tracking.
- Player weapon-mode observation and five new server events.
Existing API extensions
- getNpcData adds weaponMode, animation, health, maxHealth, invulnerable, attackDamage and combatTarget.
- setNpcWeapon keeps equipment separate from drawn state; changing the item holsters it.
- spawnNpc creates passive, invulnerable NPCs by default; scripts explicitly opt into combat.
- createAiNavigationBlocker prisms block sight/projectiles by default. setAiNavigationBlockerBlocksSight allows navigation-only blockers; getAiNavigationBlockerData exposes blocksSight.
- Existing route, pause, movement-goal, appearance and resource cleanup APIs remain usable. See Scripting limits for numeric validation.
Synchronization and presentation
- Crouch/sneak posture replication, including stationary posture and current-state replay on relevance entry/late join; no new Lua function is needed.
- NPC melee action metadata and hit presentation; bow model visibility publication.
- Recovery from ended melee attacks to locomotion for NPCs and remote players. Active strikes/reactions keep ownership; the locomotion repair mechanism no longer treats normal full-body actions as broken locomotion.
- Current NPC equipment, life and ongoing action/projectile state are replicated for relevant viewers and late join. Historical damage/releases are not replayed.
These features require updated clients and server. They do not add autonomous faction AI, NPC-to-NPC targeting, head-only gaze or a complete native-world collision mesh. Runtime visual acceptance remains separate from API availability; no claim of perfect graphics in every gameplay situation is made here.
New server functions
- getPlayerWeaponMode — Reads the currently observed drawn weapon mode of a player.
- getNpcWeaponMode — Reads the authoritative drawn mode of an NPC.
- setNpcWeaponMode — Draws or holsters the NPC weapon/spell.
- setNpcRotation — Sets the NPC whole-body yaw once.
- setNpcLookAt — Faces the NPC toward the current player position once.
- startNpcAnim — Starts a catalog animation on an NPC.
- stopNpcAnim — Stops the NPC scripted animation.
- setNpcHealth — Sets NPC health.
- setNpcMaxHealth — Sets NPC maximum health.
- setNpcAttackDamage — Sets NPC base melee damage.
- setNpcMana — Sets NPC current mana.
- setNpcMaxMana — Sets NPC maximum mana.
- getNpcHealth — Reads authoritative NPC health.
- getNpcMaxHealth — Reads authoritative NPC maximum health.
- getNpcMana — Reads authoritative NPC mana.
- getNpcMaxMana — Reads authoritative NPC maximum mana.
- setNpcInvulnerable — Enables/disables incoming damage protection.
- setNpcCombatTarget — Starts explicit continuous combat against a player, or stops it.
- isNpcSeeingPlayer — Tests distance/cone perception against server sight blockers.
- setAiNavigationBlockerBlocksSight — Sets whether an existing custom navigation blocker also blocks NPC sight and projectiles.
- setNpcSpell — Selects an implemented NPC combat spell and charge level.
- getNpcSpell — Reads the NPC selected spell key.
- setNpcAmmo — Sets one NPC ammunition pool.
- getNpcAmmo — Reads NPC ammunition.
- setNpcCombatConfig — Updates NPC projectile combat configuration atomically.
- getNpcCombatConfig — Reads NPC projectile configuration.
- setNpcCombatMovement — Configures independent combat pursuit walk/run speed or holding position.
- getNpcCombatMovement — Reads current NPC combat pursuit settings.
- getNpcCombatState — Reads NPC projectile-controller status and resources.
- npcAttack — Requests one ranged/magic attack against a player.
New server events
- onPlayerWeaponModeChange — Reports a change of observed player drawn-weapon mode.
- onNpcDamage — Reports authoritative incoming NPC damage after state commit.
- onNpcDeath — Reports an NPC transition to dead.
- onNpcAttack — Reports an NPC attack impact against a player.
- onNpcProjectileState — Reports ranged/spell subsystem state transitions for an NPC.
New NPC appearance functions
- setNpcIdentity — Selects the matched head/identity profile of an NPC.
- getNpcIdentity — Reads the authoritative NPC identity selection.
- getNpcIdentityNames — Lists named identity keys supported by the NPC API.
- setNpcSkinColor — Sets an independent NPC skin-color override.
- getNpcSkinColor — Reads the NPC skin-color override.
- resetNpcSkinColor — Restores inherited NPC skin color.
- setNpcTattoo — Sets an independent NPC tattoo override.
- getNpcTattoo — Reads the NPC tattoo override.
- resetNpcTattoo — Restores inherited NPC tattoo materials.
- getNpcTattooNames — Lists the fixed NPC tattoo preset catalog.