3
0
Fork
You've already forked Demo-Plugin
0
No description
  • Rust 100%
2024年07月29日 19:15:19 +01:00
src Initial Commit 2024年07月29日 19:15:19 +01:00
.editorconfig Initial Commit 2024年07月29日 19:15:19 +01:00
.gitignore Initial Commit 2024年07月29日 19:15:19 +01:00
.rustfmt.toml Initial Commit 2024年07月29日 19:15:19 +01:00
.taplo.toml Initial Commit 2024年07月29日 19:15:19 +01:00
Cargo.lock Initial Commit 2024年07月29日 19:15:19 +01:00
Cargo.toml Initial Commit 2024年07月29日 19:15:19 +01:00
config.toml Initial Commit 2024年07月29日 19:15:19 +01:00
README.md Initial Commit 2024年07月29日 19:15:19 +01:00

Demo Plugin

This is a demo plugin that should get you up and running with making plugins for the Exanima Modding Toolkit.

It will download the latest release of EMF (Exanima Modding Framework) from the Releases page.

If you don't want to use the latest release of EMF, grab the emf.dll.lib, either from the releases page, or compile it yourself. Copy emf.dll.lib to ./target/debug/deps/emf.dll.lib and ./target/release/deps/emf.dll.lib. If the folders don't exist, you can create them yourself.

To start with, run cargo build to make sure everything is working. If it isn't, go to Setup.

Setup

Installing dependencies

Visit rustup.rs and click rustup-init.exe to download it. Then run the exe.

When prompted, install the required build tools. This will probably open the Visual Studio installer. Make sure you install whatever the defaults are.

Open a terminal (ideally powershell) and run rustup update and then rustup toolchain install nightly

Configuring your plugin

Now that rust is installed, you'll want to edit ./config.toml in this project. Make sure to give it a unique identifier for your plugin. We recommend using "reverse domain notation", e.g. dev.megu.demo-plugin. If you don't have a domain, just use com.your-name.your-plugin-name. You can change the other options to fit your plugin.

Now edit ./Cargo.toml. For now, just change the name. It must be in the style of your-plugin-name-here. Don't use capital letters.

Now go into ./src/lib.rs. The first thing you need to do is look for the line that contains:

#[plugin(id = "dev.megu.demo-plugin")]

Edit this line to match the ID you set in ./config.toml.

Writing your plugin

Before doing this, make sure you run cargo build and make sure it compiles. The dll should be created at ./target/debug/your_plugin_name.dll

You can now edit ./src/lib.rs to suit your needs. For more examples, check the Toolkit Examples

Using your plugin

Run cargo build (or if you're making a release, cargo build --release). The created dll will be at ./target/debug/your_plugin_name.dll (or ./target/release/your_plugin_name.dll if in release mode).

Make sure the value of executable in ./config.toml matches the name of the dll created. e.g. executable = "your_plugin_name.dll".

Go to wherever your Exanima is installed and create a folder called mods. Inside there, create a folder with your-plugin-name. It should be something like C:/Program Files (x86)/Steam/steamapps/common/Exanima/mods/demo-plugin.

Copy the ./config.toml into this folder, as well as the dll you created into this folder.

Running Exanima with your mod

If you have the Toolkit repo downloaded and the EXANIMA_EXE environment variable set, then just run cargo run.

Otherwise, download the latest Release and open or extract the zip file and place the contents into the game directory, in the same folder as Exanima.exe, and then just double click emtk.exe.

Exanima should load with your mod. You can press F2 to toggle the in-game overlay which will let you change the setting of your plugin.