Openrct2 标志

Openrct2

组织
CodeAtCode
openrct2

Use when developing OpenRCT2 plugins in TypeScript - plugin registration and game actions, window and widget UI, event hooks, park, map, ride and entity access, network API, storage, or ES5 runtime constraints

概览

发布者CodeAtCode
代码仓库oss-ai-skills
技能名称openrct2
星标数
30
复刻数
3
附带文件
4
许可协议GPL-3.0
链接
  • Markdown 格式的指令

    模型按需加载的 SKILL.md 文件,因此只有在请求确实匹配时才会消耗 Token。

  • 兼容任何大语言模型

    AI 技能采用纯 Markdown,而非特定提供商的代码,因此可搭配 GPT、Claude、Gemini、Grok 或本地模型使用。

  • 4 个随附文件

    模型执行任务时可读取的脚本、模板和参考资料。这些文件为只读文件,绝不会被执行。

  • 开源

    由 CodeAtCode 发布于 GitHub。请在安装前查看源内容。

安装

在 TypingMind 中安装 Openrct2 AI 技能,即可搭配任意大语言模型使用;也可以将其放入其他支持读取 SKILL.md 的智能体中。

1

安装到 TypingMind

TypingMind 可直接从 GitHub 文件夹安装技能:读取 SKILL.md,打包资源文件,并将结果保存在本地。

  1. 打开应用,前往“插件 → 技能”。
  2. 选择“从 GitHub 安装”。
  3. 粘贴下方的技能文件夹 URL 并确认。
    https://github.com/CodeAtCode/oss-ai-skills/tree/master/extend/openrct2
  4. 请在每个需要使用该技能的聊天中启用它。
依次选择“插件 → 技能 → 添加技能 → 从 GitHub URL 导入”,然后粘贴文件夹 URL 并点击“继续”。
2

安装到其他智能体

任何支持 Agent Skills 格式的智能体都可以使用此技能,只需将文件夹复制到该智能体的技能目录中。

Claude Code — .claude/skills
git clone --depth 1 https://github.com/CodeAtCode/oss-ai-skills.git /tmp/oss-ai-skills
mkdir -p .claude/skills
cp -r /tmp/oss-ai-skills/extend/openrct2 .claude/skills/openrct2
复制后,请重启 Claude Code,以加载新技能。

在 TypingMind 中使用此技能

在任意 TypingMind 聊天中启用 Openrct2,后续即可交由模型处理。技能的名称和描述会放在系统提示词中,一旦请求匹配,模型就会自动加载完整指令,无需您手动调用,且在实际使用前不会消耗 Token。

一旦请求与技能匹配,模型就会自动加载 Openrct2。

兼容任何 AI 模型

AI 技能是纯 Markdown 指令,而非特定提供商的代码,因此 Openrct2 不局限于最初适配的模型。只需在 TypingMind 中安装一次,即可搭配 GPT-5、Claude、Gemini、Grok、DeepSeek、Mistral、Llama 或您自行运行的本地模型使用,全程使用您自己的 API 密钥。

  • 仅在需要时加载

    系统提示词中仅包含技能名称和描述。首次遇到匹配的请求时才会获取指令,因此未使用的技能不会产生额外费用。

  • 在聊天中切换模型

    技能是指令而非代码,因此切换模型不会导致技能失效,新模型会读取同一个 SKILL.md。

技能指令

这是模型会加载的 SKILL.md 内容。请在安装前阅读,因为技能就是模型将遵循的指令。

Objective: Use this skill to reduce desynced multiplayer actions, ES5-transpilation failures, event-hook leak incidents, and game-action rejection bugs by enforcing action-validation discipline, ES5-compatible patterns, and hook-cleanup rules below.

OpenRCT2 Plugin Development

Develop plugins (scripts) for OpenRCT2 using JavaScript/TypeScript to extend the game with custom windows, game actions, event hooks, and multiplayer features.

Overview

OpenRCT2 plugins run in Duktape (ES5 runtime). Key capabilities:

  • JavaScript/TypeScript - ES5 compatible, use transpilers for ES6+
  • Game Actions - Multiplayer-synchronized state mutations
  • UI Windows - Custom windows with widgets
  • Hooks - Subscribe to game events
  • Network API - TCP sockets for localhost communication
  • Hot Reload - Real-time plugin development

Plugin Directory

Place .js files in the plugin directory:

  • Windows: C:\Users\YourName\Documents\OpenRCT2\plugin\
  • Mac: /Users/YourName/Library/Application Support/OpenRCT2/plugin/
  • Linux: $XDG_CONFIG_HOME/OpenRCT2/plugin/ or $HOME/.config/OpenRCT2/plugin/

Access via game: Red toolbox button → Open custom content folder

Plugin Types

Do do not mutate game state in local plugins because the server rejects direct mutations in multiplayer. Use game actions instead.

javascript
// Local plugin - info windows only
registerPlugin({
    name: 'Local Info Plugin',
    version: '1.0',
    type: 'local',  // Available to all players in multiplayer
    main: function() {
        // Can only use game actions, not direct mutations
        // Good for: info windows, tools, dashboards
    }
});

Remote plugins load only on server and distribute to clients. Mutate game state only in the execute context of custom game actions because that is the only server-side entry point.

javascript
// Remote plugin - server-side state mutation
registerPlugin({
    name: 'Remote Game Plugin',
    version: '1.0',
    type: 'remote',  // Server-side, synced to clients
    main: function() {
        // Can mutate game state in custom game action execute()
    }
});

Intransient plugins stay loaded across park changes and in title screen. Use context.sharedStorage for persistence because park storage clears on park load.

javascript
// Intransient plugin - persistent across parks
registerPlugin({
    name: 'Global Plugin',
    version: '1.0',
    type: 'intransient',  // Never unloaded
    main: function() {
        // Active in title screen and across parks
        // Use context.sharedStorage for persistence
    }
});

Game Actions

Game actions are the recommended way to mutate game state, ensuring multiplayer synchronization.

Validate Game Action Args Before Execute Because the Server Rejects Invalid Actions and Desyncs Multiplayer

Custom game actions must implement both query (validation) and execute (mutation). The query phase runs client-side to check permissions and args; execute runs server-side to mutate state.

javascript
context.registerAction({
    id: 'myplugin.award_cash',
    query: function(args) {
        // Validation - return error object if invalid
        if (args.amount < 0) {
            return { error: 'Amount must be positive' };
        }
        if (args.amount > 100000) {
            return { error: 'Amount too large' };
        }
        // Check permissions in multiplayer
        if (network.mode !== 'none') {
            var player = network.getPlayer(args.playerId);
            if (!player || !player.hasPermission('modify_park')) {
                return { error: 'No permission' };
            }
        }
        return {};  // Success
    },
    execute: function(args) {
        // Actual game state mutation - only runs on server
        park.cash += args.amount;
        return {};  // Success
    }
});

See references/game-actions.md for built-in action type tables and argument schemas.

Best Practices

Check UI Availability Because Headless Servers Lack the UI API

Do check typeof ui !== 'undefined' before using UI APIs because headless servers crash on undefined API access.

Use Game Actions for Mutations Because Direct State Changes Fail in Multiplayer

Do use context.executeAction() for all state mutations because direct property assignments like park.cash = are rejected by the server in multiplayer.

Namespace Your Data Because Unnamespaced Keys Conflict Across Plugins

Do use namespaced keys like MyPlugin.Settings.Enabled instead of Settings.Enabled because multiple plugins writing to the same key will overwrite each other's data.

Handle Errors Because Action Failures Must Be Logged

Do check result.error in every action callback because failed actions silent without error handling make debugging impossible.

Clean Up On Unload Because Event Hooks Leak Memory

Do track all context.setInterval() IDs and call clearInterval() on the plugin.unloaded event because unsubscribed hooks continue running after plugin reload, causing memory leaks and duplicate executions.

ES5 Limitations

OpenRCT2 uses Duktape (ES5). ES6+ features require transpilation. Avoid arrow functions because the ES5 runtime transpilation fails on them.

Not Supported

javascript
// Arrow functions - transpilation fails
var func = () => {};

// Classes - transpilation fails
class MyClass {}

// let/const - transpilation fails
let x = 1;

// Template literals - transpilation fails
`Hello ${name}`

// Spread operator - transpilation fails
[...arr]

// Destructuring - transpilation fails
var { x } = obj;

// find/includes - transpilation fails
arr.find(x => x > 0);
arr.includes(5);

ES5 Alternatives

javascript
// Function expressions - works
var func = function() {};

// Constructor functions - works
function MyClass() {}

// var - works
var x = 1;

// String concatenation - works
'Hello ' + name

// Array methods - works
arr.filter(function(x) { return x > 0; })[0];
arr.indexOf(5) !== -1;

Distribution

Publishing

  1. GitHub Releases - Recommended, attach compiled .js
  2. openrct2plugins.org - Community plugin repository

Versioning

javascript
registerPlugin({
    name: 'My Plugin',
    version: '1.2.3',  // Semantic versioning
    minApiVersion: 34,  // Minimum OpenRCT2 API version
    targetApiVersion: 34,  // Target API for behavior
});

Deep Dives

Load these reference files on demand for detailed API information:

  • Window and Widget UI - Window creation, widgets (ListView, GroupBox, tabs), events → references/ui.md
  • Hooks and Map Access - Event subscriptions, park info, map tiles, rides, entities → references/hooks-map.md
  • Network, Storage, Hot Reload, Debugging - TCP sockets, storage APIs, development workflow → references/network-storage.md
  • Game Actions Reference - Built-in action types, argument schemas, custom action patterns → references/game-actions.md

References

附带文件

技能加载后,模型会按需读取这些文件。它们仅作为可读文件提供,绝不会被执行。

常见问题

Openrct2 AI 技能有什么作用?

Use when developing OpenRCT2 plugins in TypeScript - plugin registration and game actions, window and widget UI, event hooks, park, map, ride and entity access, network API, storage, or ES5 runtime constraints

为什么在 TypingMind 中使用 Openrct2?

因为您只需安装一次,就能搭配任何模型使用。Openrct2 采用纯 Markdown 格式,而非特定提供商专用的代码,因此同一技能可用于 GPT-5、Claude、Gemini、Grok 或本地模型,甚至可以在聊天中途切换模型,而不会影响技能正常使用。TypingMind 使用您自己的 API 密钥,因此您直接向提供商付费,而不是按席位订阅;您的技能和聊天记录也都保留在您自己的存储空间中。

如何在 TypingMind 中安装 Openrct2?

在 TypingMind 中打开“插件 → 技能 → 从 GitHub 安装”,然后粘贴 https://github.com/CodeAtCode/oss-ai-skills/tree/master/extend/openrct2。TypingMind 会读取其中的 SKILL.md,打包相关文件,并将其安装为技能,供您在各个聊天中按需启用。

哪些 AI 模型可以使用 Openrct2?

您在 TypingMind 中连接的任何模型都可以。AI 技能采用纯 Markdown 指令,而非特定提供商专用的代码,因此 GPT、Claude、Gemini、Grok 和本地模型都能在请求匹配时加载此技能。

Openrct2 可以搭配多少个 AI 模型使用?

数量不限。只要模型支持技能,您就可以搭配 Openrct2 使用,包括 GPT、Claude、Gemini、Grok、DeepSeek、Mistral、Llama 等,都可在 TypingMind 中使用您自己的 API 密钥接入。

Openrct2 AI 技能免费吗?

是的。该技能源自 CodeAtCode 在 GitHub 上以 GPL-3.0 许可证发布的项目。您只需向自己的 AI 提供商支付所用 Token 的费用。

什么是 AI 技能?

AI 技能是一组可复用的指令,用于教会 AI 模型完成某项特定任务。它遵循开放的 Agent Skills 格式:包含名称和描述的 SKILL.md 文件,以及模型可能需要的脚本、模板或参考文件。模型仅在您的请求与技能匹配时才会读取这些指令,因此已安装的技能在使用前不会产生任何费用。

AI 技能与插件或 MCP 服务器有何不同?

插件或 MCP 服务器为模型提供可调用的新工具,也就是在某处运行并返回结果的代码。AI 技能则为模型提供知识和流程:如何处理任务、遵循哪些步骤,以及怎样的输出才算优质。技能采用纯 Markdown 格式,因此不需要服务器、API 密钥或运行时环境,并且适用于任何模型。

查看全部

立即创建您自己的 AI 工作区

订阅我们的电子简报,获取新功能和后续赠奖活动的通知 👇