• ⚠️ Mod Release Rules now apply to this board.

    All mods must include a license, source code (for executable mods), and proper attribution.

    Read the full rules here before posting.

Rhai Studio 1.0.0 – write mods inside the game (Oxidizer)

SafeShows

Member
Messages
21
Reaction score
6
screenshot.png


Rhai Studio is an in-game editor for Oxidizer's Rhai mods. Open a mod's script, change it, press Ctrl+S, and the mod reloads within a second while you keep flying. No compiler, no restarting the game.

Features
  • Editor with syntax colors: keywords, strings, numbers, comments, calls and ksa:: game modules each get their own color, with line numbers. Undo, select all, copy and paste work as usual.
  • Hot reload: SAVE (or Ctrl+S) writes the file and Oxidizer reloads the mod right away. Files changed in another editor show up in the open tab too.
  • New mod wizard: type a name and press CREATE. Rhai Studio makes the mod folder with a starter script that opens a window, and it starts running at once.
  • Errors where you need them: a mod that fails to load or stops on an error shows it in red above the editor, with the line number.
  • Live console: a drawer that slides up from the CONSOLE button, with the log as it comes in and a line that runs Rhai against your current game, e.g. ksa::Program::controlled_vehicle().id.
  • Looks like the game: styled after the game's own dialogs.
F9 or Mods > Rhai Studio opens it; the × closes it until you open it again, with your tabs as you left them.

Requirements
Oxidizer 0.7.0 or later, as the StarMap mod (Oxidizer.StarMap) or standalone. Windows, Linux and macOS (Apple Silicon, with the macOS port).

Install
It's on the content index (https://ksamods.gg/mods/rhai_studio), so a mod manager like Borea installs it with standalone Oxidizer. By hand:
  1. Install Oxidizer 0.7.0 or later: see its install steps.
  2. Download rhai_studio-1.0.0.zip and unzip it into Documents/My Games/Kitten Space Agency/mods/, so there's a mods/rhai_studio/ folder.
  3. Start the game, enable the mod when it asks, and press F9.
Mod page: https://ksamods.gg/mods/rhai_studio
Download: https://github.com/SafeShows/oxidizer-rhai-studio/releases/tag/v1.0.0

New to Rhai mods?
Make a mod with the wizard and edit its starter script. What scripts can do (the game as typed modules, ImGui windows, hotkeys, settings, patching game methods) is in Oxidizer's Rhai section.

Source code
https://github.com/SafeShows/oxidizer-rhai-studio
It's a Rust mod and a full example of the Oxidizer API: text fields and tabs, the colored editor drawn over the game's text box, reading the log, and running Rhai from Rust.

License
MIT No Attribution (MIT-0). Use, change and redistribute it freely, no credit required.

Attribution
Built with Oxidizer and its oxidizer_api crate (MIT), plus the toml (MIT/Apache-2.0) and libloading (ISC) crates. Their license texts ship in the zip as THIRD-PARTY-NOTICES.txt.
 
Rhai Studio 1.1.0: autocomplete and an API explorer

Autocomplete: suggestions as you type, each with its signature and a line of docs.
  • The game's API: type ksa::Program::con and it offers controlled_vehicle() -> Vehicle
  • Game object properties and methods after a dot
  • Oxidizer's and Rhai's functions, keywords, and the names your own script defines
  • Up/Down to choose, Tab or Enter to insert
API explorer: the new API button opens a panel with everything a script can call.
  • Search it ("altitude", "controlled", ...)
  • Open a module like ksa::Universe:: to see what's in it
  • Read a function's signature and docs
  • INSERT puts the call into your script, right where your cursor was
Both read the definition files Oxidizer writes, so they always match your game version.

Still needs Oxidizer 0.7.0 or later. Mod managers will offer the update, or download it here:
 

Attachments

  • screenshot.png
    screenshot.png
    221.8 KB · Views: 0
Back
Top