diff --git a/README.md b/README.md index 60f7056..c370509 100644 --- a/README.md +++ b/README.md @@ -25,7 +25,7 @@ A collection of public, reusable agent skills, cheatsheets, and operational work | **C# / .NET** | [`csharp-dotnet.md`](skills-public/code-languages/csharp-dotnet.md) | `TreatWarningsAsErrors`, nullable enabled, no `.Result`, trimming/single-file publish caveats, SDK shims | | **C / C++** | [`c-cpp.md`](skills-public/code-languages/c-cpp.md) | full warning set + `-Werror`, sanitizers, RAII/Rule of Zero, target-based CMake, FFI ownership | | **Lua** | [`lua.md`](skills-public/code-languages/lua.md) | pin the dialect first, `luac -p` + luacheck as the only gate, locals over globals, `pcall` at the boundary, `#t`/pattern traps, embedded & HavokScript hosts | -| **GSC** | [`gsc.md`](skills-public/code-languages/gsc.md) | no compiler or test harness, `isdefined` on everything external, `endon` before the first wait, per-frame budget, precache at load, level-state side effects | +| **GSC** | [`gsc.md`](skills-public/code-languages/gsc.md) | compile off-engine with `gsc-tool --mode comp`, `isdefined` on everything external, `endon` before the first wait, per-frame budget, precache at load, level-state side effects | Each language file extends `coding-dev.md` rather than repeating it. A project's own `AGENTS.md` / `CLAUDE.md` / `.rules` always overrides both. diff --git a/code-languages/gsc.md b/code-languages/gsc.md index 4f571ed..1fc7fef 100644 --- a/code-languages/gsc.md +++ b/code-languages/gsc.md @@ -4,7 +4,7 @@ description: >- Use this skill when writing, reviewing, or debugging GSC (Game Script / Call of Duty script) or CSC — including entity-vs-level scope, threads and notify/wait semantics, endon/waittill discipline, undefined-value guards, the no-OOP/no-exceptions reality, asset precaching, - per-frame cost, and the fact that GSC has no compiler, linter, or test harness worth the name. + per-frame cost, block scoping, and compiling off-engine with gsc-tool. --- # GSC — Rules & Preferences @@ -13,10 +13,10 @@ Extends [`coding-dev.md`](skills-public/coding-dev.md). Everything there applies GSC is the Call of Duty engine's own scripting language (`.gsc` server-side, `.csc` client-side). It is **not Lua, not JavaScript, and not C** despite resembling all three. It has -no type system, no exceptions, no classes, no closures in most dialects, and — in a modded -install — **no diagnostics beyond the in-game console**. That last fact drives most of what -follows: the language will not tell you that you are wrong, so the code has to be written so -that it cannot be. +no type system, no exceptions, no classes, no closures in most dialects, and no test harness. +It can be compiled off-engine (see §1), which catches syntax and scope errors — but nothing +checks a type, a field that was never set, or a builtin that does not exist in the target title. +So the code still has to be written so that it cannot be wrong. > [!IMPORTANT] > **Establish the dialect before writing anything.** IW3/IW4 (MW/MW2), IW5 (MW3), T5/T6 (Black @@ -27,18 +27,38 @@ that it cannot be. --- -## 1. There Is No Gate — Build One +## 1. The Gate — `gsc-tool`, Then The Game -GSC has no `gsc -Wall`. What exists: +**There is an off-engine GSC compiler: `gsc-tool`.** Reach for it first; it is +easy to assume none exists and verify by loading a map instead. + +```bash +gsc-tool --mode comp --game