Troubleshooting Guide
Home | Troubleshooting Guide
When something goes wrong, start here. This guide is organized by what you see (the symptom), not by system. Find your problem, read the cause, apply the fix.
目录
- Mod Won't Load
- Script Errors
- RPC and Network Issues
- UI Problems
- Build and PBO Issues
- Performance Issues
- Item, Vehicle, and Entity Issues
- Config and Types Issues
- Persistence Issues
- Decision Flowcharts
- Debug Commands Quick Reference
- Log File Locations
- Where to Get Help
1. Mod 无法加载
这些是Mod不出现、不激活或在启动时被游戏拒绝的问题。
| 症状 | 原因 | 修复方法 |
|---|---|---|
| "Addon requires addon X" error at startup | Missing or incorrect requiredAddons[] entry | Add the exact CfgPatches class name of the dependency to your requiredAddons[]. Names are case-sensitive. 参见第 2.2. |
| Mod not visible in launcher | mod.cpp file is missing or has syntax errors | Create or fix mod.cpp in your mod root. It must contain name, author, and dir fields. 参见第 2.3. |
| "Config parse error" on startup | 语法 error in config.cpp | Check for missing semicolons after class closings (};), unclosed braces, or unbalanced quotes. Every class body ends with };, every property ends with ;. |
| No script log entries at all | CfgMods defs block points to wrong path | Verify that your config.cpp CfgMods entry has the correct dir and that the script defs file matches your folder structure. The engine silently ignores wrong paths. |
| Mod loads but nothing happens | Scripts compile but never execute | Check that your mod has an entry point: a modded class MissionServer or MissionGameplay, a registered module, or a plugin. Scripts do not run by themselves. 参见第 7.2. |
| "Cannot register cfg class X" | Duplicate CfgPatches class name | Another mod already uses that class name. Rename your CfgPatches class to something unique with your mod prefix. |
| Mod loads only in singleplayer | Server does not have the mod installed | Ensure the server's -mod= launch parameter includes your mod path, and the PBO is in the server's @YourMod/Addons/ folder. |
| "Addon X is not signed" | Server requires signed addons | Sign your PBOs with your private key and provide the .bikey to the server's keys/ folder. 参见第 4.6. |
2. 脚本错误
这些在脚本日志中显示为 SCRIPT (E): or SCRIPT ERROR: lines.
| 症状 | 原因 | 修复方法 |
|---|---|---|
Null pointer access | Accessing a variable that is null | Add a null check before using the variable: if (myVar) { myVar.DoSomething(); }. This is the most common 运行时错误. |
Cannot convert type 'X' to type 'Y' | Direct cast between incompatible types | Use Class.CastTo() for safe downcasting: Class.CastTo(result, source);. Never assume a cast will succeed. 参见第 1.9. |
Undefined variable 'X' | Typo, wrong scope, or wrong layer | Check spelling first. If the variable is a class from another file, ensure it is defined in the same or lower layer. 3_Game cannot see 4_World types. 参见第 2.1. |
Method 'X' not found | Calling a method that does not exist on that class | Verify the method name and check the 父类. You may need to cast to a more specific type first. Check vanilla scripts at P:\DZ\scripts\ for the correct API. |
Division by zero | Dividing by a variable that equals 0 | Add a guard: if (divisor != 0) result = value / divisor;. This also applies to modulo (%) operations. |
Redeclaration of variable 'X' | Same variable name declared in sibling else if blocks | Declare the variable once before the if/else chain, then assign inside each branch. 参见第 1.12. |
Member already defined | Duplicate variable or method name in a class | Check for copy/paste errors. Each member name 必须是唯一的 within a class hierarchy (including 父类es). |
Cannot create instance of type 'X' | Trying to new an abstract class or an interface | Check that the class is not abstract (no proto methods without bodies). Instantiate a concrete subclass instead. |
Stack overflow | Infinite recursion | A method calls itself without a base case, or a modded class override does not properly guard against re-entry. Add a depth check or fix the recursive call. |
Index out of range | Array access with invalid index | Always check array.Count() or use array.IsValidIndex(idx) before accessing by index. |
String conversion error | Using string.ToInt() or string.ToFloat() on non-numeric text | Validate string content before conversion. There is no try/catch, so you must guard manually. |
Error: Serializer X mismatch | Read/write order does not match in serialization | Ensure OnStoreSave() and OnStoreLoad() write and read the same types in the same order, including version checks. |
| 语法 error with no clear message | Backslash \ or escaped quote \" in string literal | Enforce Script's CParser does not support \\ or \". Use forward slashes for paths ("my/path/file"). For quotes, use single-quote characters. 参见第 1.12. |
JsonFileLoader returns null data | Assigning the return value of JsonLoadFile() | JsonLoadFile() returns void. Pre-allocate the object and pass it by reference: ref MyConfig cfg = new MyConfig(); JsonFileLoader<MyConfig>.JsonLoadFile(path, cfg);. 参见第 6.8. |
Object.IsAlive() does not exist | Calling IsAlive() on base Object | IsAlive() is only on EntityAI. Cast first: EntityAI entity; if (Class.CastTo(entity, obj) && entity.IsAlive()) { ... } |
| No ternary operator support | Using condition ? a : b syntax | Enforce Script has no ternary operator. Use an if/else block instead. 参见第 1.12. |
do...while loop error | Using do { } while(cond) | Enforce Script does not support do...while. Use a while loop with a break condition instead. 参见第 1.12. |
| Multiline method call fails | Splitting a single method call across lines incorrectly | Avoid splitting chained calls with comments or preprocessor directives between lines. Keep method call chains on one line or use intermediate variables. |
3. RPC 和网络问题
远程过程调用和客户端-服务器通信的问题。
| 症状 | 原因 | 修复方法 |
|---|---|---|
| RPC sent but never received | Registration mismatch | Both sender and receiver must register the same RPC ID. Verify the ID matches exactly on both client and server. 参见第 6.9. |
| RPC received but data is corrupted | Read/write parameter mismatch | The sender's Write() calls and receiver's Read() calls must have the same types in the same order. A single mismatch corrupts all subsequent reads. |
| RPC crashes the server | Null entity target or wrong parameter types | Ensure the target entity exists on both sides. Never send null as the RPC target. Validate all read parameters before use. |
| Data not syncing to clients | Missing SetSynchDirty() | After changing any variable registered for synchronization, call SetSynchDirty() on the entity. Without it, 引擎 does not broadcast changes. |
| Works in singleplayer / listen server, fails on dedicated | Different code paths for listen vs. dedicated | On a listen server, both client and server run in the same process, hiding timing and null issues. Always test on a dedicated server. Check GetGame().IsServer() and GetGame().IsMultiplayer() guards. |
| RPC floods and server lag | Sending RPCs 每帧 or in tight loops | Throttle RPC calls with timers or accumulators. Batch multiple small updates into a single RPC. Use Net Sync Variables for data that changes frequently. |
| Client receives RPC meant for all clients | Using RPCSingleParam with wrong target | Use null as the identity parameter to broadcast, or provide a specific PlayerIdentity to send to one client. |
OnRPC() never called | Override is in the wrong class or layer | OnRPC() must be overridden on the entity that receives the RPC. If overriding on PlayerBase, ensure you call super.OnRPC() so other mods still work. |
| Net Sync Variables not updating on client | Missing RegisterNetSyncVariable*() or wrong type | Register each variable in the constructor with the correct method (RegisterNetSyncVariableInt, RegisterNetSyncVariableFloat, RegisterNetSyncVariableBool). Override OnVariablesSynchronized() to react to changes on the client side. |
| RPC works for host but not other players | Using player object reference instead of identity | On dedicated servers, the host player is not special. Ensure you are using PlayerIdentity for targeting and not relying on local player references that only exist on the sender's machine. |
4. UI 问题
GUI布局、控件、菜单和输入的问题。
| 症状 | 原因 | 修复方法 |
|---|---|---|
| Layout loads but nothing is visible | Widget size is zero | Check hexactsize and vexactsize values. Both must be greater than zero. Do not use negative sizes. 参见第 3.3. |
CreateWidgets() returns null | Layout file path is wrong or file is missing | Verify the .layout file path is correct (forward slashes, no typos). The engine returns null silently on bad paths, no error is logged. |
| Widgets exist but cannot be clicked | Another widget is covering the button | Check widget priority (z-order). Higher priority widgets render on top and capture input first. Also check that the button has ButtonWidget as its ScriptClass or is a ButtonWidget type. |
| Game input is stuck / cannot move after closing UI | ChangeGameFocus() calls are imbalanced | Every GetGame().GetInput().ChangeGameFocus(1) must be paired with ChangeGameFocus(-1). Track your focus changes and ensure cleanup happens even if the UI is force-closed. |
Text shows #STR_some_key literally | Stringtable entry is missing or file is not loaded | Add the key to your stringtable.csv. Check that the CSV is in your mod root and has the correct Language,Key,Original header format. 参见第 5.2. |
| Mouse cursor does not appear | ShowUICursor() not called | Call GetGame().GetUIManager().ShowUICursor(true) when opening your UI. Call it with false when closing. |
| UI flickers or renders behind game world | Layout is not attached to correct parent widget | Attach your layout to a proper parent. For fullscreen overlays, use GetGame().GetWorkspace() as the parent. |
| ScrollWidget content does not scroll | Content is not inside a WrapSpacer or child widget | ScrollWidget needs a single child (usually a WrapSpacer or FrameWidget) that is larger than the scroll area. Put your content widgets inside that child. 参见第 3.3. |
| Image or icon not showing | Path uses backslashes or wrong extension | Use forward slashes in image paths. Verify the file exists and is in a recognized format (.paa, .edds). Use ImageWidget for images, not TextWidget. |
| Slider does not respond to input | Missing script handler or wrong widget type | Ensure the slider widget has a ScriptClass assigned and that your handler processes OnChange events. Initialize the slider range in script. |
| UI looks different at other resolutions | Using hardcoded pixel values | Use proportional sizing (halign, valign, hfill, vfill) instead of fixed pixel values. Test at multiple resolutions. 参见第 3.3. |
5. 构建和 PBO 问题
Mod打包、二进制化和部署的问题。
| 症状 | 原因 | 修复方法 |
|---|---|---|
| "Include file not found" during binarize | Config references a file that does not exist | Check that all #include paths in model configs and rvmats are correct. Ensure the P: drive is mounted and source files are accessible. |
| PBO builds successfully but mod crashes on load | config.cpp binarization error | Try building with binarization disabled to isolate the issue. If it works unbinarized, the problem is in a config that the binarizer rejects silently. |
| "Signature check failed" on server connect | PBO is unsigned or signed with wrong key | Re-sign the PBO with your private key using DSSignFile. Ensure the server has the matching .bikey in its keys/ folder. |
| 文件 patching changes not taking effect | Not using the diagnostic executable | 文件 patching only works with DayZDiag_x64.exe, not the retail DayZ_x64.exe. Launch with -filePatching parameter. |
| "Prefix mismatch" warning | PBO prefix does not match config.cpp | Ensure the $PBOPREFIX$ file content matches the addon prefix defined in your config.cpp CfgPatches. |
| Addon Builder fails silently | Path contains special characters or spaces | Move your project to a path without spaces or special characters. Use short folder names. |
| Binarized model looks wrong in-game | LOD or geometry issues in P3D | Check model LODs in Object Builder. Ensure the Fire Geometry and View Geometry LODs are correct. Rebuild the model. |
| Old version of mod loads despite changes | Cached PBO or workshop version overriding | Delete the old PBO. Check that the game is not loading a cached workshop version. Verify the -mod= path points to your development folder, not the workshop folder. |
| Addon Builder reports "no entry" warnings | Config references a property that does not exist | These warnings are usually non-fatal. Check that all CfgVehicles 基类es exist. Missing entries in inherited configs cause cascading warnings. |
| PBO packing includes unwanted files | No .pboignore or filter set | Addon Builder packs everything in the source folder. Use a .pboignore file or explicitly exclude file types (.psd, .blend, .bak) in the builder settings. |
6. 性能问题
服务器或客户端FPS下降、内存问题和操作缓慢。
| 症状 | 原因 | 修复方法 |
|---|---|---|
| Low server FPS (below 20) | Heavy processing in OnUpdate() or per-frame methods | Use a delta-time accumulator to throttle work: only execute logic every N seconds. Move expensive operations to timers or scheduled callbacks. 参见第 7.7. |
| Memory grows over time (内存泄漏) | ref reference cycles preventing garbage collection | When two objects hold ref references to each other, neither is ever freed. Make one side a raw (non-ref) reference. Break cycles in cleanup methods. 参见第 1.8. |
| Slow server startup | Heavy initialization in OnInit | Defer non-critical initialization with GetGame().GetCallQueue(CALL_CATEGORY_SYSTEM).CallLater(). Load configs lazily on first use instead of all at startup. |
| Client FPS drops near specific objects | Complex model with too many polygons or bad LODs | Add proper LOD levels to your model. The engine uses LODs to reduce poly count at distance. Ensure LOD transitions are smooth. |
| Stutter every few seconds | Periodic garbage collection spikes | Reduce object churn. Reuse objects via pooling instead of constantly creating and destroying them. Pre-allocate arrays. |
| Network lag spikes | Too many RPCs or large RPC payloads | Batch small updates into fewer RPCs. Use Net Sync Variables for frequently changing values. Compress data where possible. |
| 日志 file growing very large | Excessive Print() or debug logging | Remove or guard debug Print() calls behind #ifdef DEVELOPER or a debug flag. Large log files can slow disk I/O. |
| High entity count causing server lag | Too many spawned entities in the world | Reduce nominal values in types.xml. Clean up dynamic objects with lifetime management. Limit AI spawn density. |
7. 物品、车辆和实体问题
自定义物品、车辆和世界实体的问题。
| 症状 | 原因 | 修复方法 |
|---|---|---|
| Item will not spawn (admin tools say "cannot create") | scope=0 in config or missing from types.xml | Set scope=2 in your item's CfgVehicles config for items that should be spawnable. Add an entry to your server's types.xml if the item should appear in loot. |
| Item spawns but is invisible | Model path (.p3d) is wrong or missing | Check the model path in your CfgVehicles class. Use forward slashes. Verify the .p3d file exists and is packed in your PBO. |
| Item has no inventory icon | Missing or wrong inventorySlot or icon config | Define the picture path in your config pointing to a valid .paa or .edds icon file. Check rotationFlags for correct icon orientation. |
| Vehicle spawns but will not drive | Missing engine, wheels, or parts | Ensure all required parts are attached. Use OnDebugSpawn() to spawn a fully assembled vehicle for testing. Check that simulation type is correct in config. |
| Item cannot be picked up | Incorrect geometry or wrong inventorySlot | Verify the item has proper Fire Geometry in the model. Check that the itemSize[] is set correctly and the item fits in available inventory slots. |
| Entity immediately deleted after spawn | lifetime is zero in types.xml or scope issue | Set appropriate lifetime value in types.xml. Ensure scope=2 in config. Check server cleanup settings in globals.xml. |
| Custom animal/zombie does not move | AI config missing or broken | Verify AIAgentType in config. Check that the entity has proper NavMesh-compatible geometry. Test with vanilla AI configs first. |
| Attachments do not snap to item | Wrong inventorySlot names | Attachment slot names 必须完全匹配 between the parent item's attachments[] and the child item's inventorySlot[]. Names are case-sensitive. |
| Item damage zones not working | DamageSystem config mismatch with model | Each DamageZone name must match a named selection in the model's Fire Geometry LOD. Check with Object Builder. 参见第 6.1. |
| Custom sound does not play | Sound shader or config path wrong | Verify the sound shader class name in CfgSoundShaders and CfgSoundSets. Check that the .ogg file path is correct and the file is packed in the PBO. |
| Item has wrong weight or size | weight and itemSize[] config values | weight is in grams (integer). itemSize[] defines the inventory grid slots as {width, height}. Check 父类 values if inheriting. |
| Crafting recipe not appearing | Recipe config or condition wrong | Check CfgRecipes registration. Verify both ingredient items have correct canBeSplit, isMeleeWeapon, or other required properties. Test with vanilla recipe configs as reference. |
8. 配置和类型问题
Problems with config.cpp, types.xml, and other configuration files.
| 症状 | 原因 | 修复方法 |
|---|---|---|
| Config values not taking effect | Using binarized config but editing source | Rebuild your PBO after config changes. If using file patching, ensure DayZDiag_x64.exe and -filePatching are active. |
types.xml changes ignored | Editing the wrong types.xml file | The server loads types from mpmissions/your_mission/db/types.xml. Editing a types file elsewhere has no effect. Check the server's active mission folder. |
| "Error loading types" on server start | XML syntax error in types.xml | Validate your XML. Common issues: unclosed tags, missing quotes on attribute values, or & instead of &. Use an XML validator. |
| Items spawn with wrong quantities | quantmin/quantmax values incorrect | Values are percentages (0-100) in types.xml, not absolute counts. -1 means "use default". |
| Loot table not spawning items | nominal is 0 or missing category/usage/tag | Set nominal above 0. Add at least one <usage> and <category> tag so the Central Economy knows where to spawn items. |
| JSON config file not loading | Malformed JSON or wrong path | Validate JSON syntax (no trailing commas, proper quoting). Use $profile: prefix for server profile paths. Check that the file exists with FileExist(). |
cfgGameplay.json changes ignored | 文件 not enabled or wrong location | Place the file in the mission folder. Set enableCustomGameplay to 1 in serverDZ.cfg. Restart the server (not just reload). |
| Class inheritance not working in config | baseClass misspelled or not loaded | The 父类 must exist in the same or earlier addon. Check that requiredAddons[] includes the addon defining the 父类. |
9. 持久化问题
跨服务器重启的数据保存和加载问题。
| 症状 | 原因 | 修复方法 |
|---|---|---|
| Player data lost on restart | Not saving to $profile: directory | Use JsonFileLoader<T>.JsonSaveFile() with a $profile: path. Save on player disconnect (PlayerDisconnected) and periodically during gameplay. |
| Saved file is empty or corrupt | Crash during write, or serialization error | Write to a temporary file first, then rename to the final path. Validate data before saving. Always handle FileExist() checks on load. |
OnStoreSave/OnStoreLoad mismatch | Version changed but no migration | Always write a version number first. On load, read the version and handle old formats: if (version < CURRENT) { /* read old format */ }. |
| Items disappear from storage | lifetime expired in types.xml | Increase lifetime for persistent items. Default is often too short for base-building containers. Check globals.xml cleanupLifetimeRuin value. |
| Custom variables reset on relog | Variables not synced or stored | Register variables for network sync with RegisterNetSyncVariable*(). For persistence, save/load in OnStoreSave()/OnStoreLoad(). |
10. 决策流程图
Step-by-step diagnostic processes for common "it doesn't work" situations.
"My mod doesn't work at all"
- Check the script log for
SCRIPT (E)errors. Fix the first error you find. (Section 2) - Is the mod listed in the launcher? If not, check that
mod.cppexists and is valid. (Section 1) - Does the log mention your CfgPatches class? If not, check
config.cppsyntax,requiredAddons[], and the-mod=launch parameter. - Do scripts compile? Look for 编译错误s in the RPT. Fix any syntax errors. (Section 2)
- Is there an entry point? You need a
modded class MissionServer/MissionGameplay, a registered module, or a plugin. Scripts without an entry point never run. - Still nothing? Add
Print("MY_MOD: Init reached");at your entry point to confirm execution.
"Works offline but not on a dedicated server"
- Is the mod installed on the server? Check that
-mod=includes your mod path and the PBO is in@YourMod/Addons/. - Client-only code on server?
GetGame().GetPlayer()returnsnullduring server init. AddGetGame().IsServer()/GetGame().IsClient()guards. - RPCs working? Add
Print()on both send and receive sides. Check that RPC IDs match and target entity exists on both sides. (Section 3) - Data syncing? Verify
SetSynchDirty()is called after changes. Check read/write parameter order matches. - Timing issues? Listen servers hide race conditions because client and server share a process. Dedicated servers expose these. Add null checks and readiness guards.
"My UI is broken"
- Does
CreateWidgets()return null? The layout path is wrong or the file is missing. Check forward slashes, verify the.layoutis packed in the PBO. - Widgets exist but invisible? Check sizes (must be > 0, no negative values). Check
Show(true)is called. Check text/widget alpha is not 0. - Visible but not clickable? Check widget
priority(z-order). VerifyScriptClassis assigned. Confirm the handler is set. - Input stuck after closing UI?
ChangeGameFocus()calls are imbalanced. EveryChangeGameFocus(1)needs a matchingChangeGameFocus(-1). Check cleanup runs even on force-close.
11. 调试命令快速参考
在DayZDiag调试控制台或管理工具中使用这些命令。
| 操作 | 命令 |
|---|---|
| Spawn item on ground | GetGame().CreateObject("AKM", GetGame().GetPlayer().GetPosition()); |
| Spawn vehicle (assembled) | EntityAI car = EntityAI.Cast(GetGame().CreateObject("OffroadHatchback", GetGame().GetPlayer().GetPosition())); if (car) car.OnDebugSpawn(); |
| Spawn zombie | GetGame().CreateObject("ZmbM_Normal_00", GetGame().GetPlayer().GetPosition()); |
| Teleport to coords | GetGame().GetPlayer().SetPosition("6543 0 2114".ToVector()); |
| Heal fully | GetGame().GetPlayer().SetHealth("", "", 5000); |
| Full blood | GetGame().GetPlayer().SetHealth("", "Blood", 5000); |
| Stop unconscious | GetGame().GetPlayer().SetHealth("", "Shock", 0); |
| Set noon | GetGame().GetWorld().SetDate(2024, 9, 15, 12, 0); |
| Set night | GetGame().GetWorld().SetDate(2024, 9, 15, 2, 0); |
| Clear weather | GetGame().GetWeather().GetOvercast().Set(0,0,0); GetGame().GetWeather().GetRain().Set(0,0,0); |
| Heavy rain | GetGame().GetWeather().GetOvercast().Set(1,0,0); GetGame().GetWeather().GetRain().Set(1,0,0); |
| Print position | Print(GetGame().GetPlayer().GetPosition()); |
| Check server/client | Print("IsServer: " + GetGame().IsServer().ToString()); |
| Print FPS | Print("FPS: " + (1.0 / GetGame().GetDeltaT()).ToString()); |
Common Chernarus locations: Elektro "10570 0 2354", Cherno "6649 0 2594", NWAF "4494 0 10365", Tisy "1693 0 13575", Berezino "12121 0 9216"
启动参数
| 参数 | 用途 |
|---|---|
-filePatching | Load unpacked files (requires DayZDiag) |
-scriptDebug=true | Enable script debug features |
-doLogs | Enable detailed logging |
-adminLog | Enable admin log on server |
-freezeCheck | Detect and log script freezes |
-noSound | Disable sound (faster testing) |
-noPause | Server does not pause when empty |
-profiles=<path> | Custom profile/log directory |
-connect=<ip> | Auto-connect to server on launch |
-port=<port> | Server port (default 2302) |
-mod=@Mod1;@Mod2 | Load mods (semicolon-separated) |
-serverMod=@Mod | Server-only mods (not sent to clients) |
12. 日志文件位置
知道在哪里查找就成功了一半。
客户端日志
| 日志 | 位置 | 包含 |
|---|---|---|
| Script log | %localappdata%\DayZ\ (most recent .RPT file) | Script errors, warnings, Print() output |
| Crash dumps | %localappdata%\DayZ\ (.mdmp files) | Crash analysis data |
| Workbench log | Workbench IDE output panel | Compile errors during development |
服务器日志
| 日志 | 位置 | 包含 |
|---|---|---|
| Script log | <server_root>\profiles\ (most recent .RPT file) | Script errors, server-side Print() |
| Admin log | <server_root>\profiles\ (.ADM file) | Player connections, kills, chat |
| Crash dumps | <server_root>\profiles\ (.mdmp files) | Server crash data |
| Custom logs | <server_root>\profiles\ | Any logs written with FileHandle |
有效阅读日志
- Search for
SCRIPT (E)to find script errors - Search for
SCRIPT ERRORto find fatal script problems - Search for your mod name or class names to filter relevant entries
- Errors often cascade -- fix the first error in the log, not the last
- Timestamp each log read: the most recent
.RPTfile has the latest session
13. 获取帮助
当本指南无法解决你的问题时,以下是最佳资源。
社区资源
| 资源 | URL | 最适合 |
|---|---|---|
| DayZ Modding Discord | discord.gg/dayzmods | Real-time help from experienced modders |
| Bohemia Interactive Forums | forums.bohemia.net/forums/forum/231-dayz-modding/ | Official forums, announcements |
| DayZ Feedback Tracker | feedback.bistudio.com/tag/dayz/ | Official bug reports |
| DayZ Workshop | Steam Workshop (DayZ) | Browse published mods for reference |
| Bohemia Wiki | community.bistudio.com/wiki/DayZ:Modding_Basics | Official modding basics |
参考源代码
研究这些Mod,从有经验的Modder那里学习模式:
| Mod | 可学内容 |
|---|---|
| Community Framework (CF) | 模块 lifecycle, RPC management, logging, managed pointers |
| DayZ Expansion | Large-scale mod architecture, market system, vehicles, parties |
| Community Online Tools (COT) | Admin tools, permissions, UI patterns, player management |
| VPP Admin Tools | Server administration, permissions, ESP, teleportation |
| Dabs Framework | MVC pattern, data binding, UI component framework |
| BuilderItems | Simple item mod structure (good starting example) |
| BaseBuildingPlus | Building system, placement mechanics, persistence |
原版脚本参考
所有引擎类和方法的权威参考:
- Mount P: drive via DayZ Tools
- Navigate to
P:\DZ\scripts\ - Organized by layer:
3_Game/,4_World/,5_Mission/ - Use your editor's search to find any vanilla class, method, or enum
求助前的快速检查清单
在社区论坛或Discord发帖之前,请收集以下信息:
- 你期望的结果
- 实际发生了什么 (exact error messages, behavior)
- 脚本日志摘录 (the relevant
SCRIPT (E)lines, not the entire log) - 你的代码 (the relevant section, not the entire mod)
- 你已经尝试过的方法 (saves everyone time)
- DayZ版本和Mod列表 (compatibility matters)
- 客户端还是服务器 (specify which side has the problem)
症状快速索引
在上面的章节中找不到你的问题?试试这个字母索引。
| 症状 (what you see) | Go to |
|---|---|
| Addon Builder fails | Section 5 |
| Array index out of range | Section 2 |
| Buttons not clickable | Section 4 |
| Cannot convert type | Section 2 |
| Cannot create instance | Section 2 |
| Config parse error | Section 1 |
| Cursor missing | Section 4 |
| Division by zero | Section 2 |
| Data lost on restart | Section 9 |
| Entity deleted after spawn | Section 7 |
| 文件 patching not working | Section 5 |
| FPS drops | Section 6 |
| Game input stuck | Section 4 |
| Image not showing | Section 4 |
| Item invisible | Section 7 |
| Item won't spawn | Section 7 |
| JSON not loading | Section 8 |
| Layout returns null | Section 4 |
| Loot not spawning | Section 8 |
| Member already defined | Section 2 |
| Memory leak | Section 6 |
| Method not found | Section 2 |
| Mod not in launcher | Section 1 |
| Null pointer access | Section 2 |
| Player data lost | Section 9 |
| PBO signature failed | Section 5 |
| Prefix mismatch | Section 5 |
| RPC not received | Section 3 |
| Scroll not working | Section 4 |
| Save file corrupt | Section 9 |
| Server crash on startup | Section 2 |
| Slider not responding | Section 4 |
| Stack overflow | Section 2 |
| Text shows STR key | Section 4 |
| Types.xml ignored | Section 8 |
| Undefined variable | Section 2 |
| 变量 redeclaration | Section 2 |
| Vehicle won't drive | Section 7 |
| Widget invisible | Section 4 |
| Works offline fails online | Section 3 |
问题仍未解决? Check the FAQ for additional answers, the Cheat Sheet for syntax reference, or ask in the DayZ Modding Discord.
