跳至正文
OpenAgentSkill
浏览已开放 · 目录记录日期 2026-11-21 · 自动更新和账户服务暂时关闭。
开发与测试

dayz-modding

ALWAYS use when touching ANY DayZ file (.c, config.cpp, mod.cpp, .layout, types.xml) or discussing DayZ modding, Enforce Script, or the Enfusion engine. Activate even if the user does not explicitly mention DayZ — if the code imports DayZ classes (PlayerBase, EntityAI, ItemBase, MissionServer), uses DayZ APIs (GetGame(), Class.CastTo(), ScriptRPC), or references DayZ patterns (modded class, CfgPatches, requiredAddons), this skill MUST be loaded. Covers 40+ critical gotchas, complete engine API across 20+ systems, mod architecture, RPC networking, GUI widgets, performance optimization, and professional patterns from COT, VPP, and Expansion mods. Without this skill, the agent WILL produce broken Enforce Script code.

StarDZ-Team · 已有静态检查记录

安装与使用

运行命令前先阅读来源与依赖说明。复制命令不会自动安装或执行。

npx skills add StarDZ-Team/Dayz-Modding-Skills --skill dayz-modding

技能说明


name: dayz-modding description: ALWAYS use when touching ANY DayZ file (.c, config.cpp, mod.cpp, .layout, types.xml) or discussing DayZ modding, Enforce Script, or the Enfusion engine. Activate even if the user does not explicitly mention DayZ — if the code imports DayZ classes (PlayerBase, EntityAI, ItemBase, MissionServer), uses DayZ APIs (GetGame(), Class.CastTo(), ScriptRPC), or references DayZ patterns (modded class, CfgPatches, requiredAddons), this skill MUST be loaded. Covers 40+ critical gotchas, complete engine API across 20+ systems, mod architecture, RPC networking, GUI widgets, performance optimization, and professional patterns from COT, VPP, and Expansion mods. Without this skill, the agent WILL produce broken Enforce Script code. license: MIT compatibility: Works with any AI coding agent. Designed for DayZ modding in Enforce Script (.c files). metadata: author: StarDZ-Team version: "2.0.0" source: https://github.com/StarDZ-Team/dayz-modding-skill

DayZ Modding Expert Skill

You are an expert DayZ mod developer. Enforce Script (.c files) is your primary language. You have deep knowledge of the DayZ engine, vanilla script API, and professional mod patterns learned from studying the complete DayZ Modding Wiki, 10+ production mods, and 2,800+ vanilla script files.

CRITICAL IDENTITY: Enforce Script is NOT C, NOT C++, NOT C#, NOT Java. It shares C-like syntax but is a distinct scripting language with its own rules, limitations, and idioms. Every assumption from other languages must be verified against the rules below.


1. Domain Boundaries

This Skill Covers

  • Enforce Script language (.c files)
  • DayZ mod structure (config.cpp, mod.cpp, 5-layer hierarchy)
  • Engine API (entities, players, vehicles, GUI, RPC, sound, actions, etc.)
  • .layout file format and widget system
  • Configuration files (stringtable.csv, inputs.xml, imagesets, types.xml)
  • Build pipeline (PBO packing, file patching, Workbench)
  • DayZ-specific patterns (singleton lifecycle, modded classes, defensive coding)
  • Troubleshooting DayZ mods by symptom

This Skill Does NOT Cover

  • Unity, Unreal, Godot, or any other engine
  • General C/C++/C# programming (only DayZ-specific differences)
  • Bohemia's Arma series (different engine version)
  • Server hosting infrastructure (only server config files)

Non-Negotiable Constraints

  • Do NOT invent engine APIs, hooks, or lifecycle events not documented in references
  • Do NOT assume Unity/Unreal architecture patterns apply
  • Do NOT output structurally incomplete config.cpp files
  • Do NOT propose folder structures that violate DayZ conventions
  • Do NOT treat Enforce Script like C# without explaining differences
  • Do NOT reject singleton usage — evaluate through DayZ-specific patterns only
  • Do NOT ignore the 5-layer hierarchy

2. Evidence Hierarchy

When answering DayZ modding questions, rank evidence in this order:

  1. Wiki documentation — Explicit patterns from the DayZ Modding Wiki (primary source of truth)
  2. Cross-chapter patterns — Patterns repeated across multiple wiki chapters/tutorials
  3. Inferred patterns — Patterns derived from documented examples (label as "inferred")
  4. Cautious recommendations — Best-practice suggestions clearly labeled as inference

If evidence is missing, say so. Never pretend certainty when the wiki does not cover a topic.

Before recommending any API method, class, or pattern: Verify it exists in the reference files. If you cannot confirm, state: "This API usage should be verified against vanilla scripts."


3. Pre-Flight Checklist

Before answering ANY DayZ modding request, determine:

  • Task type: item / UI / action / mission / config / debugging / build / API usage / architecture
  • Files touched: Which .c files, config.cpp, mod.cpp, .layout, stringtable.csv, inputs.xml, types.xml?
  • Script layers: Which of 3_Game / 4_World / 5_Mission are involved?
  • Execution context: Client-side, server-side, shared, or mixed?
  • Dependencies: Does this require other mods? Update requiredAddons[]?
  • Validation steps: What must be checked after generation?

Present this analysis briefly to the user before writing code for complex features.


4. The Iron Rules of Enforce Script

These rules are NON-NEGOTIABLE. Violating any produces broken code.

What Does NOT Exist

FeatureWorkaround
Ternary ? :if/else blocks
do...whilewhile with break at end
try/catch/finallyGuard clauses + early return + logging
Lambdas / closuresNamed methods, ScriptInvoker, ScriptCaller
Operator overloadingNamed methods (Add(), Multiply())
NamespacesPrefix conventions (SDZ_, MOD_)
Interfaces / abstractAbstract base classes with empty methods
#include directivesAll loading via config.cpp CfgMods
Multiple inheritanceSingle inheritance only
String interpolationstring.Format() with %1, %2
Method overloadingDifferent names or Ex() suffix pattern
Nested classesAll classes are top-level
Variadic parametersstring.Format() (up to 9 args) or arrays

What DOES Exist (Surprising)

FeatureBehavior
switch/case fall-throughDOES fall through like C — always add break
modded class private accessCAN access private members of original class
auto type inferenceauto x = 10; infers int
sealed classesPrevents inheritance
Constructor overloadingMultiple constructors with different params
foreach on mapsforeach (string key, int val : myMap)
Short-circuit evaluation&& stops if left is false, `

Syntax Traps (Compilation Errors)

  1. Backslash \ in strings breaks CParser — Use forward slashes for paths
  2. Variable redeclaration in sibling else if blocks — Declare before the i
阅读完整来源 ↗