---
name: se-dev-weaponcore
description: >-
Use this skill when writing, editing, balancing, linting or debugging Space Engineers WeaponCore
(CoreSystems) weapons: CoreParts weapon, ammo, armor, upgrade and support definitions (the C# part files,
MasterConfig, Structure.cs), turrets and their subparts, targeting and point defence, guided missiles
and drones, damage and area effects, server overrides, and mods, plugins or PB scripts that call the
WeaponCore API. Covers all 841 definition fields extracted from source with defaults, how definitions
load and override each other, quirks verified against WeaponCore source, where the CoreParts comments and
the WeaponCore wiki are wrong, and a CoreParts audit script. Use it whenever a task mentions WeaponCore, WC,
CoreParts, CoreSystems, a weapon or ammo definition, turrets, targeting or PD, even without naming WeaponCore.
license: MIT
compatibility: Python 3.10 or later; local clones of WeaponCore, CoreParts and the WeaponCore wiki for the cache rebuild.
---
# WeaponCore and CoreParts (Space Engineers 1)
A CoreParts mod is C# that fills one `ContainerDefinition` and sends it to WeaponCore (Ash-LikeSnow/WeaponCore, the "CoreSystems" mod), which matches fields by `ProtoMember` **number**, never by name. The Steam Workshop build (item 3154371364) comes from the BDCarrillo/WeaponCore fork; its definitions and API match master.
**The WeaponCore source is the only source of truth.** The CoreParts example comments and the WeaponCore wiki are often wrong (units, defaults, retired fields, renumbered enums). **[HARD]** = read in source, with a `file:line` citation; **[SOFT]** = field report or inference, recheck after an update.
**Files.** `<skill>` is this skill's folder (often `~/.agents/skills/se-dev-weaponcore` or `~/.claude/skills/se-dev-weaponcore`). Read only what the task needs: `python <skill>/scripts/how.py <words>` prints the sections whose headings hold those words.
## Workflow
1. **Before WeaponCore work**, run `python <skill>/scripts/check_wc_sync.py`. Exit 1 means upstream moved: run `scripts/Update-WcSkill.ps1`, then recheck the quirks and docs-vs-source rows it names.
2. **Look up every field you set** with `python <skill>/scripts/query_wc_fields.py <name>` (`--type HardwareDef`, `--search orbit`, `--api GetMaxWeaponRange`). It prints type, number, default, template value, description and where WeaponCore reads it. A **Documented as** note means the comments or wiki mislead.
3. **Read the quirks part for your area** before tuning targeting, PD, turrets, guided ammo or damage.
4. **Change one thing at a time** and lint with `python <skill>/scripts/audit_coreparts.py --path <mod>/Data/Scripts/CoreParts --min WARN` before loading the world.
5. **In game**, WeaponCore's debug report (Ctrl+R at a weapon) and its logs under `%AppData%\SpaceEngineers\Storage\<Workshop ID>.sbm_*` show load errors, priority overrides ("was overriden for ...") and per-weapon state. For a definition that "does nothing", check the log for its `PartName`, then MasterConfig, then priority, then `Structure.cs` numbering.
## Defaults that bite
- **Loading:** a second `PartDefinitions(...)` call replaces the first; a definition missing from MasterConfig never loads; a stale `Structure.cs` fails silently. Copy `script/` from the CoreParts version that matches the WeaponCore build.
- **Units:** `RotateRate`/`ElevateRate` are radians per tick (0.03 ≈ 103°/s); angle limits are degrees; times are ticks.
- **Zero means a fallback:** `AimingTolerance` 0 = 180°; `DurabilityMod` 0 = 0.25 (large) / 0.05 (small) damage taken; `InventoryFillAmount` 0 = 75%; `MaxTargetDistance` 0 = the ammo's `MaxTrajectory`; `Characters` 0 = full damage; `FallOff.MinMultipler` 0 = no falloff.
- **Prediction:** `Advanced` behaves exactly like `Accurate`.
- **Point defence:** `LockedSmartOnly` is inverted; use `DisableSupportingPD = true`. A fixed weapon fires at missiles on its own only with Smart or Drone ammo.
- **Damage:** large-grid weapons deal 25% to small grids only when both grid scales are below 0; there is no 4× buff.
- **API:** `ToggleWeaponFire` is ignored in "Auto (AI Controlled)" shoot mode; save script-fired weapons on Mouse Control.
<!-- ‹guest · 2026-12-05› -->
## Reference files
| File | Read it when |
| :--- | :--- |
| `references/definition_model.md` | Starting or reorganising a mod: how definitions travel (mod message 7771), MasterConfig, which definition wins (`DefinitionPriority`, `PartName`, vanilla subtypes), server overrides. |
| `references/definition_fields.md` | Looking up fields by section (generated): an index of 13 parts in `references/definition_fields/`, plus where the CoreParts template's `Structure.cs` differs from WeaponCore. |
| `references/quirks.md` | Before tuning anything: index of verified pitfalls in four parts (loading and units; targeting, PD and aiming; firing, damage and drones; terminal, API, multiplayer, fixed-upstream history and unconfirmed reports). |
| `references/docs-vs-source.md` | Before trusting a CoreParts comment or a wiki page: per-field verdicts, the aim prediction trace, behaviour neither doc covers, and a generated coverage count. |
| `references/api.md` | Calling WeaponCore from a mod, Torch plugin or PB script: loading, readiness, networking. |
| `references/api_methods.md` | Every public API method with signature and line (generated). |
**MES encounters** with WeaponCore weapons (800 m range clamp, shoot mode for NPC fixed guns, flare detection, weapon randomizer): the `se-dev-mes` skill, its `third_party_integrations.md` §1 and `wc_shootmode.py`.
## Scripts
Run them with Python 3.10+ from any folder; they read only, except the cache rebuild. Source clones default to `~/.se-dev/weaponcore/{WeaponCore,CoreParts,WeaponCore.wiki}` (override with `WEAPONCORE_SRC`, `COREPARTS_SRC`, `WEAPONCORE_WIKI` or `--weaponcore`/`--coreparts`/`--wiki`). Each script's docstring gives its call.
| Script | Purpose |
| :--- | :--- |
| `scripts/how.py` | Print the skill's sections by heading words |
| `scripts/query_wc_fields.py` | Field and API lookup with read sites |
| `scripts/audit_coreparts.py` | Lint a CoreParts folder: numbering, MasterConfig, shifted enums, missing fragment ammo, duplicate names, `LockedSmartOnly`, rotation units, drone `TargetLossDegree`, hit-particle culling |
| `scripts/check_wc_sync.py` | Cache vs local clones and upstream (`--fetch` clones or pulls, and fetches the Workshop fork) |
| `scripts/build_wc_cache.py` | Rebuild the cache and generated references (`--check` for CI) |
| `scripts/Update-WcSkill.ps1` | Fetch, rebuild, audit smoke test, unit tests, `tools/check_skill.py` |
این نسخه با نشانهگذاری اختصاصی حساب شما نمایش داده میشود. برای نصب سریع، به تب نصب و راهاندازی بروید.