Lua API

doukutsu-rs includes a multiplayer-aware and event-based Lua API that lets you customize the behavior of Cave Story in many ways, allowing you to create stunning single and multi-player experiences. It's designed to be engine-agnostic as possible, for ease of implementation in other projects.

The API documentation is generated from TypeScript declarations and is available here.

Scripts

  • boot.lua - runs in global context (so every loaded script inherits the global properties set in it). It is executed at game startup before the window is created and is a place where you can override certain settings such as window size and name, data paths and etc. Due to it's nature, it doesn't get reloaded when you use the Reload Scripts debugger option. This is not sandboxed, so you need to be careful on what you expose in it to other scripts. However it lets you load bytecode-based scripts and native extensions which is a very powerful feature (you can e.g., implement Discord rich presence that way) but also may crash the engine if used improperly.

  • scripts/*.lua - sandboxed user scripts, note that their loading order isn't guaranteed and they run in separate contexts.

Settings

There are various internal engine-specific settings that can be changed in doukutsu-rs, but many of them are considered out of scope of the common modding API. You can use doukutsu.setSetting(name, value) to modify those settings.

Setting types

List of settings

Last updated