se-dev-mod
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseSE Dev Mod Skill
SE Dev Mod 开发技能
Mod development for Space Engineers version 1.
⚠️ CRITICAL: Commands run in a UNIX shell. Use bash syntax. On Windows this is BusyBox; on Linux use the native shell.
Examples:
- ✅
test -f file.txt && echo exists - ✅
ls -la | head -10 - ❌ - This will NOT work
if exist file.txt (echo exists)
Actions:
- prepare: Run the one-time preparation (on Windows,
Prepare.baton Linux)prepare.sh - bash: Run UNIX shell commands via busybox
- search: Search mod code using
search_mods.py
适用于《太空工程师》1.x版本的Mod开发。
⚠️ 重要提示:命令在UNIX Shell中运行,请使用bash语法。Windows系统下使用BusyBox;Linux系统下使用原生Shell。
示例:
- ✅
test -f file.txt && echo exists - ✅
ls -la | head -10 - ❌ - 此命令无法运行
if exist file.txt (echo exists)
操作:
- prepare:执行一次性准备操作(Windows系统用,Linux系统用
Prepare.bat)prepare.sh - bash:通过busybox执行UNIX Shell命令
- search:使用搜索Mod代码
search_mods.py
Routing Decision
路由决策
Check these patterns in order - first match wins:
| Priority | Pattern | Example | Route |
|---|---|---|---|
| 1 | Empty or bare invocation | | Show this help |
| 2 | Prepare keywords | | prepare |
| 3 | Bash/shell keywords | | bash |
| 4 | Search keywords | | search |
按顺序检查以下模式,匹配到第一个即生效:
| 优先级 | 模式 | 示例 | 路由 |
|---|---|---|---|
| 1 | 空调用或仅调用技能名 | | 显示本帮助文档 |
| 2 | 包含Prepare相关关键词 | | prepare |
| 3 | 包含Bash/Shell相关关键词 | | bash |
| 4 | 包含搜索相关关键词 | | search |
Getting Started
快速开始
⚠️ CRITICAL: Before running ANY commands, read CommandExecution.md to avoid common mistakes that cause command failures.
If the file is missing in this folder, you MUST run the one-time preparation steps first. See the prepare action.
Prepare.DONE⚠️ 重要提示:在执行任何命令前,请阅读CommandExecution.md,避免导致命令执行失败的常见错误。
如果当前文件夹中缺少文件,您必须先执行一次性准备步骤。请查看prepare操作文档。
Prepare.DONEEssential Documentation
核心文档
- CommandExecution.md - ⚠️ READ THIS FIRST - Windows command execution details; on Linux keep bash syntax and use
prepare.sh
- CommandExecution.md - ⚠️ 请首先阅读本文档 - Windows系统命令执行细节;Linux系统请保持bash语法并使用
prepare.sh
Mod Development
Mod开发
Use only names matching the Mod API whitelist: ModApiWhitelist.txt
The whitelist was exported from game version using MDK2's .
1.208.015Mdk.ExtractorMods are released on the Steam Workshop or Mod.IO, mostly on the former.
Mods are compiled by the game on world loading with a Mod API whitelist enforced,
which is supposed to guarantee safety and security. Mods may still crash the game with an exception.
Use the skill to search the game's decompiled code. You may need this to
understand how the game's internals work and how to interface with it properly. Stick to
game code searches corresponding to names on the Mod API whitelist for efficiency.
se-dev-game-code仅使用符合Mod API白名单的名称:ModApiWhitelist.txt
该白名单是使用MDK2的从游戏版本导出的。
Mdk.Extractor1.208.015Mod发布在Steam创意工坊或Mod.IO平台,其中大部分发布在前者。
游戏会在加载世界时编译Mod,并强制执行Mod API白名单,这旨在保证安全性。但Mod仍可能因异常导致游戏崩溃。
使用技能搜索游戏的反编译代码。您可能需要通过此方式了解游戏内部机制,以及如何正确与游戏交互。为提高效率,请仅搜索与Mod API白名单中名称对应的游戏代码。
se-dev-game-codeFolder Structure
文件夹结构
- — junction/symlink to the per-user persistent mod data folder (
Data/on Windows,%USERPROFILE%\.se-dev\modon Linux). Persistent skill data lives here:~/.se-dev/mod- — quick inventory of all installed mods (workshop_id, path, has_scripts, ...).
Data/mods.json - — per-mod aggregate sha1 used by the indexer for change detection.
Data/mod_hashes.json - — full Tree-sitter C# index (one CSV per category, plus hierarchy trees).
Data/CodeIndex/
- — junction/symlink to the game's local-mod folder (
LocalMods/on Windows, the Proton appdata equivalent on Linux).%AppData%\SpaceEngineers\Mods - Steam Workshop content is read in-place from the Steam folder; it is not copied or symlinked
into the skill. The workshop folder is resolved from (env var) or the Steam registry entry for app id 244850.
SE_GAME_ROOT
- — 指向每个用户的持久化Mod数据文件夹的连接/符号链接(Windows系统为
Data/,Linux系统为%USERPROFILE%\.se-dev\mod)。持久化技能数据存储于此:~/.se-dev/mod- — 所有已安装Mod的快速清单(workshop_id、路径、是否包含脚本等)。
Data/mods.json - — 每个Mod的聚合sha1哈希值,供索引器用于检测变更。
Data/mod_hashes.json - — 完整的Tree-sitter C#索引(每个分类对应一个CSV文件,外加层次树)。
Data/CodeIndex/
- — 指向游戏本地Mod文件夹的连接/符号链接(Windows系统为
LocalMods/,Linux系统为Proton对应的应用数据文件夹)。%AppData%\SpaceEngineers\Mods - Steam创意工坊内容直接从Steam文件夹读取;不会被复制或创建符号链接到本技能中。创意工坊文件夹由环境变量或Steam中应用ID 244850的注册表项解析而来。
SE_GAME_ROOT
References
参考资料
- Mod Template repo Mod template repository to start a new mod project which will include scripts. See ModTemplate.md
- Mod API for script mods Structured Mod API documentation
- Mod API documentation by Keen Software House May be outdated
- Mod Development Kit (MDK2) Mod development tooling mostly for VS2022
- Mod模板仓库 用于启动包含脚本的新Mod项目的模板仓库。请查看ModTemplate.md
- 脚本Mod的Mod API 结构化的Mod API文档
- Keen Software House官方Mod API文档 可能已过时
- Mod开发工具包(MDK2) 主要适用于VS2022的Mod开发工具
Mod Code Search
Mod代码搜索
Search the source code of Steam and local mods for examples and patterns:
bash
undefined搜索Steam和本地Mod的源代码,查找示例与模式:
bash
undefinedSearch for patterns
搜索模式
uv run search_mods.py class declaration MyBlock
uv run search_mods.py method usage Update
uv run search_mods.py class children MyGameLogicComponent
uv run search_mods.py class declaration MyBlock
uv run search_mods.py method usage Update
uv run search_mods.py class children MyGameLogicComponent
Count results before viewing (useful for large result sets)
在查看结果前先计数(适用于大型结果集)
uv run search_mods.py class usage Init --count
uv run search_mods.py class usage Init --count
Limit number of results
限制结果数量
uv run search_mods.py class usage Init --limit 10
Before searching, ensure the index exists. If `Data/CodeIndex/` is missing, run:
```bash
uv run list_mods.py # quick inventory (always cheap)
uv run index_mods.py # full code index (incremental: only changed mods reparsed)Re-indexing after new subscriptions: When you subscribe to new mods on Steam Workshop,
load them in a world once (so the game downloads them), then re-run the two commands above
(or just ). The indexer hashes each mod's .cs files and only reparses mods
whose hash changed since the previous run, so reruns are fast.
Prepare.batSee search action for complete documentation.
uv run search_mods.py class usage Init --limit 10
搜索前请确保索引已存在。如果`Data/CodeIndex/`不存在,请执行:
```bash
uv run list_mods.py # 快速生成清单(操作轻便)
uv run index_mods.py # 完整代码索引(增量式:仅重新解析变更的Mod)订阅新Mod后重新索引: 当您在Steam创意工坊订阅新Mod后,先在游戏世界中加载一次(确保游戏完成下载),然后重新运行上述两个命令(或直接运行)。索引器会对每个Mod的.cs文件计算哈希值,仅重新解析自上次运行以来哈希值发生变化的Mod,因此重新运行速度较快。
Prepare.bat完整文档请查看search操作文档。
Action References
操作参考
Follow the detailed instructions in:
- prepare action - One-time preparation
- bash action - Running UNIX shell commands via busybox
- search action - Search mod code for examples
请遵循以下详细说明:
- prepare操作文档 - 一次性准备操作
- bash操作文档 - 通过busybox执行UNIX Shell命令
- search操作文档 - 搜索Mod代码示例
Remarks
备注
The original source of this skill: https://github.com/viktor-ferenczi/se-dev-skills