stalker-soc-lualisted
Install: claude install-skill webpnk/stalker-soc-skills
# SoC Lua scripting
Read `reference\gotchas.md` before writing non-trivial code - every entry there cost a debugging
session. `reference\patterns.md` has copy-ready snippets (spawn, release, inventory, time skip,
effects, sounds, conditions for logic). The authoritative API list is `unpacked\scripts\lua_help.script`
(grep it for a class or function before assuming it exists).
## Framework templates (`templates\scripts\`, `__PREFIX__` -> your prefix)
Installed into `src\mod\scripts\` by `stalker-soc-project-setup`:
| File | Role |
|---|---|
| `<p>_main.script` | entry points called from `bind_stalker.script`: `on_actor_spawn`, `on_actor_update`, `on_item_take/drop`, `on_take_from_box`; each hook wrapped in `pcall` and reported via `moddev.out` |
| `<p>_story.script` | persistent key/value (`get/set` over actor pstor), info portions (`has/give/take`), stage, `on_new_game` |
| `<p>_hud.script` | `news(string_id, ...)` with automatic splitting (HUD drops lines > ~100 chars), `news_later`, `mark/unmark` PDA map spots |
| `<p>_nav.script` | `point_near(x, z)` -> pos, lv, gv for `alife():create`; `spawn_near` |
| `<p>_props.script` | binder pinning physics of script-spawned static props |
The bind_stalker hooks themselves are patches in `src\tools\overrides.ps1`.
## Rules of thumb
- **Environment:** Lua 5.1 + luabind. No `io`, `os.*` mostly absent, `log()`/`printf` are no-ops.
Output = `moddev.out()` (console trick). Test by running code in the live game with
`game.ps1 cm