Skip to content
Rich Lane edited this page Oct 14, 2023 · 10 revisions

You can use any editor with Oort. After creating a Rust file in Vim/VSCode/etc, right click in the Oort editor and hit "Link to a file on disk". On Chrome, this will pop up an open dialog where you can select the file. On Firefox, it will create a target for you to drag-and-drop the file onto. After this the game will re-read the file from disk every second and the built-in editor will be read-only. You can end this by selecting "Unlink from a file on disk".

Optional: Create a Rust crate

To get optimal rust-analyzer diagnostics you can create a real crate. Example:

cargo new --lib myai
cd myai
cargo add oort_api

Then replace the code in src/lib.rs with the starter code for the scenario you're working on.

Optional: Bundle multiple files

While the web UI only supports a single file in the editor, there's a tool that can be used to combine multiple files together. This can let you work with smaller, more manageable files, and share code between AIs.

After cloning the repo, run:

cargo oort-bundler --watch -o bundled.rs path/to/a.rs path/to/b.rs

This will watch the given files for changes and write to bundled.rs. You can then use the "Link to file on disk" option in Oort on bundled.rs.