RevealMapREST is a sample mod developed for Farthest Frontier that utilizes a RESTful interface for revealing the map and monitoring game states such as whether the game has been fully initialized. This sample mod is built on top of WickerREST, enabling dynamic interaction with the game through web requests.
While this sample is for Farthest Frontier, the WickerREST works on any Unity game, Mono or IL2CPP, and plugins can be made for each of them.
- Reveal Map Command: Exposes an HTTP command that triggers the map reveal action within Farthest Frontier.
- Game Initialization Monitoring: Allows monitoring the game's initialization state through a dedicated game variable.
- Prerequisites:
- Ensure you have MelonLoader installed in your Unity game.
- Ensure you have WickerREST installed in your Unity game.
- Build Plugin: Download the latest code from this repository and set up your references.
- Installation: This mod requires WickerREST to function. Ensure that WickerREST and the built plugin are installed in your game
/Mods/
folder.
Once installed, the mod will be loaded automatically when you start Farthest Frontier. You can then interact with the mod's features through HTTP requests:
- Interface: Use a browser to navigate to
http://localhost:6103
to reveal the dashboard. - Reveal Map: Send a GET request to
http://localhost:6103/revealMap
to reveal the map. - *Example Command: Provides an example on how to use inputs.
- Check Game Initialization: Access
http://localhost:6103/game-variables
to see the current value of the monitored variables.
This sample project produces a command and a game variable monitor. As of time of writing, the frontend interface looks like this, with this sample plugin loaded.
RevealMapREST serves as an example of how to create your own commands and game variables using WickerREST. Here's a brief guide:
- Annotate a static method with the
[CommandHandler]
attribute, providing the path for the command:[CommandHandler("yourCommand")] public static void YourCommandHttp() { // Implement command action WickerNetwork.Instance.LogResponse("Command executed successfully"); // Send response to the web service }
- Implement the logic within the method. Use Wicker.Server.Instance.SendResponse to send back a response to the caller.
-
Use the [GameVariable] attribute to expose a static property or method as a game variable:
[GameVariable("YourVariable")] public static string YourGameVariable => // Your variable retrieval logic here
Access http://localhost:6103/game-variables
to see the value of your exposed variables.