ワンクリックで
dayz-enfusion-script
Write, extend, and debug DayZ server/client mods in Enforce Script (the Enfusion engine C-like scripting language).
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
メニュー
Write, extend, and debug DayZ server/client mods in Enforce Script (the Enfusion engine C-like scripting language).
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
SOC 職業分類に基づく
| name | dayz-enfusion-script |
| description | Write, extend, and debug DayZ server/client mods in Enforce Script (the Enfusion engine C-like scripting language). |
Always consult community.bistudio.com DayZ Modding and the Enforce Script Language Reference for authoritative API docs.
Enforce Script is a statically-typed, C-like scripting language embedded in the Bohemia Interactive Enfusion engine. It drives all gameplay logic in DayZ: items, players, AI, missions, GUI, economy, and RPC networking. Mods are distributed as .pbo archives compiled from .c script files layered on top of vanilla scripts.
Trigger this skill when the user asks to:
.layout XML files for in-game GUI panels and HUDsMinimal mod structure:
MyMod/
config.cpp <- PBO manifest + CfgPatches
Scripts/
4_World/
MyMod_Item.c <- your class
config.cpp
class CfgPatches
{
class MyMod
{
units[] = {};
weapons[] = {};
requiredVersion = 0.1;
requiredAddons[] = { "DZ_Data" };
};
};
Minimal modded class
// Scripts/4_World/MyMod_Item.c
modded class Apple
{
override void OnConsume(PlayerBase player)
{
super.OnConsume(player); // ALWAYS call super
Print("[MyMod] Apple consumed by: " + player.GetIdentity().GetName());
}
}
if/else instead of x ? a : bauto != type inference — auto means autoptr (reference-counted ownership alias for ref)ScriptCaller for single callbacks, ScriptInvoker for multicast eventsint, float, bool, string default to 0 / 0.0 / false / ""; only class instances can be nullmodded class — the ONLY extension mechanism; produces one merged class. Always call super.* in overridessuper.* is mandatory — skipping it silently breaks every other mod in the chainOnStoreSave and OnStoreLoad must write/read fields in identical order; mismatch destroys savesstring.Format("Value: %1", val) with 1-indexed %N placeholders (not %s/%d)Scripts load in layer order. Classes defined in lower layers are available to higher ones.
| Folder | Layer | Purpose |
|---|---|---|
Scripts/1_Core/ | 1 | Engine primitives, proto definitions |
Scripts/2_GameLib/ | 2 | Base game library, input, menus |
Scripts/3_Game/ | 3 | Core gameplay (items, players, RPC enums) |
Scripts/4_World/ | 4 | World entities — most mod code lives here |
Scripts/5_Mission/ | 5 | Mission logic (server init, spawn tables) |
A modded class PlayerBase must live in Scripts/4_World/; a modded class MissionServer in Scripts/5_Mission/.
RegisterNetSyncVariable* + SetSynchDirty()OnRPC() overridesModStorage persistence, and attribute-based actionsUse the references for API lookups. Check patterns when implementing a common mechanic. Examples show complete working files.
references/player_api.md and references/game_api.md are the most frequently needed starting points.
Core API documentation split by topic:
types_collections.md - Primitive types, string methods, array/map/set API, vector math, Math classplayer_api.md - PlayerBase stats, vitals, agents, modifiers, inventory, NetSync, RPC helpersitem_api.md - ItemBase quantity/health/flags, action registration, spawning, config.cpp propertiesgame_api.md - GetGame(), GetWorld(), GetMission(), CreateObject, CallLater, loggingerpc_defines.md - Vanilla eRPCs/eAgents/eModifiers tables, custom ID range conventionfile_paths.md - $profile/$saves path tokens, FileExist, MakeDirectory, JsonFileLoader, FileModegui_layout.md - Layout file format (WidgetClassNameClass syntax, RGBA colors, coords, all widget types, colums property, ItemPreviewWidget/PlayerPreviewWidget API)Guides for integrating with external frameworks and vanilla systems:
community_framework.md - CF module system, ModStorage persistence, event bus, inter-mod eventsdabs_framework.md - Attribute-based action system, CF_ModAttribute, MVC layout, settings APIvanilla_plugins.md - PluginBase lifecycle, GetPlugin(), service-locator mod isolation patterncentral_economy.md - CE XML format, runtime CE with SpawnObject/DeleteObject, cfgeconomycore.xmlinput_bindings.md - inputs.xml, UAInput API, GetUApi(), context guards, client-only input rulesCommon implementation patterns for recurring mechanics:
netsync.md - RegisterNetSyncVariable*, SetSynchDirty, OnVariablesSynchronized, bitfield packingpersistence.md - OnStoreSave/OnStoreLoad, version header, write-order rules, CF_ModStorage alternativerpc.md - ScriptRPC, RPCSingleParam, OnRPC switch template, client-to-server validation rulesmodded_class.md - super.* rules, field injection, mod load order, compatibility patternssingleton.md - Static s_Instance, lazy init, GetInstance(), JSON config with nested sub-objectslanguage_workarounds.md - No ternary, no auto type inference, no lambdas, no exceptions, no overloadingComplete working script files demonstrating full implementations:
01_custom_item.c - Custom item with NetSync bool flag and versioned OnStoreSave/OnStoreLoad02_custom_action_singleuse.c - Single-use ActionBase with CanPerformAction guard and server execution03_continuous_action.c - Hold-to-complete action with progress bar, interrupt handling, cooldown04_rpc_patterns.c - All three RPC APIs: RPCSingleParam, GetGame().RPC, ScriptRPC multi-field05_mission_server.c - MissionServer overrides: PlayerConnect, PlayerDisconnect, OnUpdate tick06_json_config.c - JsonFileLoader singleton config with nested sub-config and admin UID list07_agent_modifier.c - Full SymptomBase + ModifierBase disease stack with agent threshold trigger08_gui_menu.c - UIScriptedMenu with TextListboxWidget rows, EditBox filter, button handlers09_scheduler_timer.c - CallLater, Timer, OnScheduledTick patterns with frame-skip guard10_modded_playerbase.c - Comprehensive PlayerBase mod combining NetSync, RPC, persistence, actions11_hud_plain_text.layout - HUD overlay with TextWidgets (float RGBA colors, pixel coords); companion modded Hud Update() script12_menu_interactions.layout - Dialog with EditBoxWidgetClass filter, 2-column TextListboxWidgetClass, ButtonWidgetClass13_item_preview.layout - Item inspect panel with ItemPreviewWidgetClass for live 3D model; rotate via SetModelOrientation