### Openplanet Installation Guide Source: https://openplanet.dev/docs/tutorials/installation Provides step-by-step instructions for installing Openplanet, including locating the game directory, handling potential antivirus warnings, and troubleshooting display issues. ```English Download the latest version of Openplanet and run the installer. Locate your game installation path (e.g., Trackmania.exe, ManiaPlanet.exe, or TrackManiaTurbo.exe). Ensure Openplanet is installed in the same directory as the game. If encountering antivirus warnings, Openplanet is safe; consider unblocking the installer via file properties if necessary. If a SmartScreen error appears, click 'More info' -> 'Run anyway'. After installation, start the game; the Openplanet menu should be accessible via 'Press F3'. ``` -------------------------------- ### Openplanet Plugin Development - Getting Started Source: https://openplanet.dev/docs/tutorials/installation An overview of the initial steps and essential files for developing plugins for Openplanet, including the info.toml configuration file. ```English Start plugin development by understanding the basic structure. Key files include: info.toml (for metadata), callback functions (for event handling), and settings (for user configurations). Explore script imports and preprocessor directives for advanced functionality. ``` -------------------------------- ### Install Openplanet by Extraction Source: https://openplanet.dev/docs/help/linux An alternative installation method for Openplanet using 7zip to extract setup files directly into the game directory. This is an advanced method and may vary in success. ```bash 7z x OpenplanetNext_1.27.5.exe -o~/.steam/steam/steamapps/common/Trackmania/ ``` -------------------------------- ### Troubleshooting: Game Doesn't Start Source: https://openplanet.dev/docs/help Addresses the common issue where the game fails to start when Openplanet is installed. It emphasizes the necessity of installing the latest 64-bit Visual Studio C++ runtime, even if assumed to be present. For Trackmania Turbo, the 32-bit version is required. A system restart after installation is also recommended. ```English ## The game doesn't start You're likely missing the latest 64 bit version of the Visual Studio C++ runtime. **Do not skip this!** Don't assume you already have this installed on your system! If Openplanet doesn't work, this is very likely the cause. Download it from here - you can find the runtime elsewhere online but downloading from this link ensures that you don't accidentally install a different unsupported version. Note that if you're trying to get Openplanet for **TrackMania Turbo** to work, you'll need to install the 32 bit version of the runtime, which you can download here. After following the installer's instructions, you might have to restart your PC before it'll work. ``` -------------------------------- ### Openplanet Plugin Installation Error Example Source: https://openplanet.dev/docs/help Illustrates a common error message seen in Openplanet logs when plugins cannot be installed, typically due to the plugin's zip file not being found. This often points to user permission issues. ```Log ScriptEngine PluginManager Unable to load plugin 'UltimateMedals' because the zip file doesn't exist! ``` -------------------------------- ### Installing Plugins with Openplanet Source: https://openplanet.dev/docs/tutorials/installing-plugins Instructions on how to install plugins using Openplanet's built-in Plugin Manager or through manual installation. It details the process for both .op and .as file types and how to reload scripts. ```English ## Plugin Manager Since Openplanet 1.19 a plugin manager is available, which allows you to install plugins from within the game. To access it, open the overlay (using the `F3` key) and open it via `Plugin Manager -> Open manager`. Within the plugin manager, you can freely install and uninstall plugins available on the website. In order to install or remove a plugin, click on its `Info` button in the plugin gallery and select the Install / Uninstall button there. Plugins you've installed manually before are almost always automatically detected by the manager. Once a plugin you have installed is updated on the website, you will be notified about it in Openplanet and from the menu you can select to update the plugins. **Note:** The plugin manager only supports modern `.op`-Plugins, not the previously used script files. ## Manual installation ### Locating the user folder You can either find this manually by going to `C:/Users/Username/OpenplanetNext` (the folder may be called `Openplanet4` or `OpenplanetTurbo` depending on which game you're using Openplanet on), or you can use the Openplanet overlay to locate the folder for you: ### Installing plugins There are 2 types of plugins: those distributed as `.op` files and those distributed as `.as` files (or `.as` and `.sig` in a zip). #### Installing `.op` plugins Inside of your user folder, you'll find a `Plugins` folder. All `.op` files should go in here. #### Installing `.as` plugins Inside of your user folder, you'll have a `Scripts` folder. This is where all `.as` scripts should be placed, as well as any `.sig` files that can optionally accompany the scripts. ## Reloading scripts You can now (re)start the game, or you can use the "Reload script engine" option in the overlay to load your newly installed plugins: You can also load unloaded plugins manually through the same menu: ``` -------------------------------- ### Openplanet Troubleshooting Guide Source: https://openplanet.dev/docs/tutorials/installing-plugins A guide to troubleshooting common issues encountered with Openplanet plugins, including signature errors, permission problems, and version compatibility. ```English ### "No signature available for script" This error means you're either playing offline, do not have the Club edition of the game, or there is no `.sig` file found next to the relevant script. If the plugin you downloaded did not come with a signature file, you can ask the developer of the plugin to get it signed by sending Miss#8888 a message on Discord. ### "Invalid signature for script" This error means that the `.sig` file for the script is invalid. This can happen if you updated the script but you forgot to also update the `.sig` file. This can also happen if the plugin developer has shipped an invalid signature with the plugin. In that case, contact the developer of the plugin. ### "Insufficient permissions" This means you need to upgrade your subscription of Trackmania. Some plugins might be signed for the paid Standard edition of the game, but not for the free Starter edition. You can read more about the limitations here, which also includes links to where you can purchase the upgraded editions of the game. ### "Script is not compatible with this version of the game" This means that the plugin is developed for a different version of the game. Look for an updated version or ask the plugin developer for help. ``` -------------------------------- ### Linux Compatibility: Wine and Proton Setup Source: https://openplanet.dev/docs/help/linux Instructions for running Openplanet on Linux using Wine and Proton. Details how to configure DLL overrides in winecfg or Lutris, and how to set launch options for Steam Proton. Also includes steps for installing VC redistributables. ```bash # Change the AppID 228760 (TM2 Canyon) if needed export WINEPREFIX=~/.steam/steam/steamapps/compatdata/228760/pfx # Change the Proton version 5.0 if needed export WINEPATH="~/.steam/steam/steamapps/common/Proton 5.0/dist/bin/wine64" wine ~/Downloads/VC_redist.x64.exe ``` ```text WINEDLLOVERRIDES="dinput8=n,b" %command% ``` -------------------------------- ### Troubleshooting: Openplanet Not Starting/Accessible Source: https://openplanet.dev/docs/help Details common reasons why Openplanet might not start or be accessible after the game launches. It covers checking Ubisoft Connect's online status, using the 'Fn' key for function keys on laptops, ensuring the correct Visual Studio C++ runtime is installed, restarting the PC, and verifying Openplanet's installation directory, especially for Epic Games installations. ```English ## The game works but Openplanet doesn't start/can't be accessed Almost all issues are caused by the following things - check these first: 1. Did you start the game in offline mode? Openplanet requires the game to connect to Ubisoft's servers during the startup to check your access level and permissions. This might change in the future, but for now make sure Ubisoft Connect is not in offline mode, and the login procedure in the game's startup flow is successful. 2. Are you on a laptop and `F3` doesn't seem to do anything? Try pressing `Fn` and `F3` at the same time - laptops often have different primary actions bound to the function keys, so this might already be what you're looking for. 3. Otherwise, the usual suspect is because you're missing the latest 64 bit version of the Visual Studio C++ runtime. **Do not skip this!** Don't assume you already have this installed on your system! If Openplanet doesn't work, this is very likely the cause. Download it from here - you can find the runtime elsewhere online but downloading from this link ensures that you don't accidentally install a different unsupported version. 4. Restart your computer, especially right after installing the Visual Studio C++ runtime in the previous step. 5. Openplanet needs to be installed in the same directory as the game you're actually running. You can double-check where the used Trackmania instance is located: Once Trackmania is started, open the task manager, right-click `Trackmania.exe` and select to open its file location. Specifically if you've installed Trackmania (2020) through **Epic Games** (but also sometimes when only using Ubisoft Connect), there's a chance it installed the game twice (once in Epic, once in Ubisoft Connect). In the rare case that none of those apply to you, there can be a variety of other causes for issues, but the most common ones are: * Using an older unsupported version of Windows, such as Windows 7 or older. (Consider upgrading, as Microsoft dropped support for Windows 7!) * Interfering third-party applications, such as **anti-virus, firewall software or overlays** such as ReShade, MSI Afterburner, Overwolf, Geforce Experience, NVIDIA App, Medal TV, etc. - you can try turning off some of these interfering programs on your computer before starting Trackmania, which might solve the problem. * A corrupt installation of Openplanet. ``` -------------------------------- ### UI::Begin Function (Overload 2) Source: https://openplanet.dev/docs/api/UI/Begin Begins an imgui window. This overload takes a title string, a boolean reference to track the window's open state, and optional flags. ```APIDOC Function Signature: bool UI::Begin(const string&in title, bool&out open, int flags = UI::WindowFlags::NoCollapse) Description: Begins an imgui window. Parameters: title: string - The title of the imgui window. open: bool&out - A reference to a boolean that will be set to true if the window is open, false otherwise. flags: int - Optional flags to control window behavior (defaults to UI::WindowFlags::NoCollapse). Returns: bool - True if the window is visible, false otherwise. ``` -------------------------------- ### Openplanet UI::Begin Function Source: https://openplanet.dev/docs/api/UI/Begin Provides documentation for the UI::Begin function in Openplanet, which is used to start an ImGui window. It details the function signature, parameters, and return types for two variations of the function. ```APIDOC UI::Begin: Function: bool UI::Begin(const string&in title, int flags = UI::WindowFlags::NoCollapse) Description: Begins an imgui window. Parameters: title (string): The title of the window. flags (int): Flags to control window behavior (default: UI::WindowFlags::NoCollapse). Returns: bool Function: bool UI::Begin(const string&in title, bool&out open, int flags = UI::WindowFlags::NoCollapse) Description: Begins an imgui window. Parameters: title (string): The title of the window. open (bool&out): A boolean reference to control the window's open state. flags (int): Flags to control window behavior (default: UI::WindowFlags::NoCollapse). Returns: bool ``` -------------------------------- ### Net::HttpGet Function Source: https://openplanet.dev/docs/api/Net Creates an HTTP GET request to the given URL and automatically starts the request. Returns an HttpRequest object. ```APIDOC HttpRequest@ Net::HttpGet(const string&in url) ``` -------------------------------- ### Get Main Application Instance Source: https://openplanet.dev/docs/tutorials/speeding-up-the-menu-music Retrieves the main application instance, which is a parent class to the game's core class. This is the starting point for accessing various game functionalities. ```C++ void Main() { auto app = GetApp(); } ``` -------------------------------- ### Openplanet UI ListClipper Begin Method Source: https://openplanet.dev/docs/api/UI/ListClipper/Begin Documentation for the Begin method within the UI::ListClipper class in Openplanet. This method initializes a list clipper with a specified number of items and item height. ```APIDOC UI::ListClipper::Begin ## Method in ListClipper ``` void Begin(int items_count, float items_height = -1.0f) ``` `int` `items_count`: The total number of items in the list. `float` `items_height`: The height of each item. Defaults to -1.0f, which may indicate automatic calculation. ``` -------------------------------- ### Fids::GetGame Source: https://openplanet.dev/docs/api/Fids Gets a fid from the Game drive. This function provides a file identifier for files residing in the main game installation directory. The `path` argument specifies the relative path to the game file. ```AngelScript CSystemFidFile@ Fids::GetGame(const string&in path) ``` ```APIDOC Parameters: path: The path to the game file. Returns: CSystemFidFile@: A file identifier object for the specified game file. ``` -------------------------------- ### IO::CreateFolder API Reference Source: https://openplanet.dev/docs/api/IO/CreateFolder Detailed API documentation for the `IO::CreateFolder` function, including its purpose, parameters, and return type. ```APIDOC IO::CreateFolder: Signature: void IO::CreateFolder(const string&in path, bool recursive = true) Description: Creates a folder at the given location. Parameters: path: string (The path where the folder should be created) recursive: bool (Whether to create parent directories if they don't exist. Defaults to true) Return Type: void ``` -------------------------------- ### Fids::GetGameFolder Source: https://openplanet.dev/docs/api/Fids Gets a fid container from the Game drive. This function provides a folder identifier for a directory within the main game installation directory. The `path` argument specifies the relative path to the game folder. ```AngelScript CSystemFidsFolder@ Fids::GetGameFolder(const string&in path) ``` ```APIDOC Parameters: path: The path to the game folder. Returns: CSystemFidsFolder@: A folder identifier object for the specified game folder. ``` -------------------------------- ### Packaging Openplanet Plugin Source: https://openplanet.dev/docs/tutorials/writing-plugins Explains how to package Openplanet plugin files into a single distributable file. This involves creating a .zip archive of all plugin files and renaming it to a .op extension. The tutorial emphasizes using .zip format and avoiding passwords or RAR archives. ```English 1. Create a .zip archive of all plugin files (e.g., using 7-zip). 2. Ensure the archive is a standard .zip file (RAR is not supported). 3. Do not use a password for the archive. 4. Rename the .zip file to have a .op extension (e.g., 'TestPlugin.op'). 5. Place the .op file in the Openplanet 'Plugins' folder. ``` -------------------------------- ### Openplanet API Reference Source: https://openplanet.dev/docs/tutorials/installing-plugins References for various APIs supported by Openplanet, including Openplanet, Trackmania, Maniaplanet, Turbo, and Web Services. ```APIDOC API Reference * Openplanet API * Trackmania API * Maniaplanet API * Turbo API * Web Services API ``` -------------------------------- ### Draw Chained Quadratic Bézier Curves Source: https://openplanet.dev/docs/tutorials/nanovg-introduction Illustrates how to draw a series of connected quadratic Bézier curves to create more complex shapes. This example shows multiple calls to nvg::QuadTo, chaining the end point of one curve to the start of the next. ```C++ void Render() { nvg::BeginPath(); nvg::MoveTo(vec2(100, 100)); nvg::QuadTo(vec2(150, 400), vec2(300, 300)); nvg::QuadTo(vec2(450, 200), vec2(300, 400)); nvg::QuadTo(vec2(150, 600), vec2(600, 600)); nvg::QuadTo(vec2(800, 600), vec2(600, 300)); nvg::StrokeColor(vec4(1, 0.5, 0, 0.5)); nvg::StrokeWidth(5.5); nvg::Stroke(); nvg::ClosePath(); } ``` -------------------------------- ### Draw a single quadratic Bézier curve Source: https://openplanet.dev/docs/tutorials/nanovg-introduction Demonstrates drawing a single quadratic Bézier curve using `nvg::QuadTo`. The curve starts from a `nvg::MoveTo` position, uses a specified control point, and ends at a given point. The example sets stroke color and width before rendering. ```C++ void Render() { nvg::BeginPath(); // start point: (100, 100) nvg::MoveTo(vec2(100, 100)); // control point: (200, 400), end point: (300, 100) nvg::QuadTo(vec2(200, 400), vec2(300, 100)); nvg::StrokeColor(vec4(1, 0.5, 0, 0.5)); nvg::StrokeWidth(5.5); nvg::Stroke(); nvg::ClosePath(); } ``` -------------------------------- ### Draw Single Cubic Bézier Curve with NanoVG C++ Source: https://openplanet.dev/docs/tutorials/nanovg-introduction Demonstrates drawing a single cubic Bézier curve using `nvg::BezierTo`. It takes two control points and an end point to define the curve, starting from a previously set `MoveTo` position. The example sets stroke color and width before rendering. ```C++ void Render() { nvg::BeginPath(); nvg::MoveTo(vec2(100, 100)); nvg::BezierTo(vec2(150, 400), vec2(450, 200), vec2(300, 400)); nvg::StrokeColor(vec4(0, 0.5, 1, 0.5)); nvg::StrokeWidth(5.5); nvg::Stroke(); nvg::ClosePath(); } ``` -------------------------------- ### Basic Angelscript Plugin Entry Point Source: https://openplanet.dev/docs/tutorials/writing-plugins A simple Angelscript code snippet that serves as the main entry point for an Openplanet plugin. It prints 'Hello world!' to the Openplanet log when the plugin is loaded. ```Angelscript void Main() { print("Hello world!"); } ``` -------------------------------- ### Plugin Development: Settings Source: https://openplanet.dev/docs/reference/icons Details how to implement and manage plugin settings, allowing users to configure plugin behavior. ```APIDOC Settings: - Mechanism for users to configure plugin options. - Typically stored in a configuration file or managed through a UI. - Example: Allowing users to toggle features or set values. ``` -------------------------------- ### Get User Game Folder Path (IO::FromUserGameFolder) Source: https://openplanet.dev/docs/api/IO Retrieves the absolute path for a file within the game's user folder. This is what the game considers the user folder, for example `C:\Users\Username\Documents\Trackmania`. Note that it is possible for this function to return only the given filename without any absolute path, in case the game doesn't have the necessary info, but this is expected to happen very rarely. Returns `string`. ```APIDOC string IO::FromUserGameFolder(const string&in filename) ``` -------------------------------- ### UI::BeginTooltip API Documentation Source: https://openplanet.dev/docs/api/UI/BeginTooltip Detailed API documentation for the `UI::BeginTooltip` function, explaining its purpose and usage within the Openplanet UI framework. ```APIDOC UI::BeginTooltip Function: void UI::BeginTooltip() Description: Begins a tooltip dialog. ``` -------------------------------- ### NanoVG Gradient Examples Source: https://openplanet.dev/docs/tutorials/nanovg-introduction Demonstrates the creation and application of BoxGradient, LinearGradient, and RadialGradient in NanoVG. These examples show how to define gradient parameters and fill shapes with them. ```C++ void Render() { nvg::BeginPath(); nvg::Rect(100, 100, 300, 500); nvg::FillPaint(nvg::BoxGradient(100, 200, 300, 300, 150, 100, vec4(1,0,0,1), vec4(1, 1, 0, 1))); nvg::Fill(); nvg::ClosePath(); nvg::BeginPath(); nvg::Rect(500, 100, 300, 500); nvg::FillPaint(nvg::LinearGradient(vec2(500, 100), vec2(500, 600), vec4(1, 0, 0, 1), vec4(1, 1, 0, 1))); nvg::Fill(); nvg::ClosePath(); nvg::BeginPath(); nvg::Rect(900, 100, 300, 500); nvg::FillPaint(nvg::RadialGradient(vec2(1050, 350), 100, 200, vec4(1, 0, 0, 1), vec4(1, 1, 0, 1))); nvg::Fill(); nvg::ClosePath(); } ``` -------------------------------- ### Meta::PluginIndex Class Source: https://openplanet.dev/docs/api/Meta An index of plugin information that can be sorted by its dependency tree. ```Openp class Meta::PluginIndex ``` -------------------------------- ### Openplanet API Get Function Source: https://openplanet.dev/docs/api/Dev/Get Provides the signature for the generic Get function in the Openplanet API, used for retrieving data from a node with a specified offset. ```APIDOC Dev::Get T Get(const ?&in nod, uint offset) Parameters: nod: The node to retrieve data from. offset: The offset within the node. Returns: T: The retrieved data of type T. ``` -------------------------------- ### Testing Openplanet Plugin Source: https://openplanet.dev/docs/tutorials/writing-plugins Instructions on how to test a newly created Openplanet plugin. This involves starting Trackmania, opening the Openplanet overlay (F3), and loading the plugin from the Developer menu. Successful loading is confirmed by checking the log for specific messages. ```English 1. Start Trackmania. 2. Open the Openplanet overlay (press F3). 3. Navigate to the Developer menu. 4. Select and load the 'Test Plugin'. 5. Check the log for confirmation messages: - "Plugin loaded" - Custom log message from the plugin. ``` -------------------------------- ### Start HttpRequest Execution Source: https://openplanet.dev/docs/api/Net/HttpRequest Initiates the execution of the HTTP request. This method has no effect if the request has already been started. It returns an awaitable object, indicating an asynchronous operation. ```APIDOC awaitable@ Start() ``` -------------------------------- ### Basic Angelscript Plugin Entry Point Source: https://openplanet.dev/docs/tutorials/writing-scripts A simple Angelscript code snippet that serves as the main entry point for an Openplanet plugin. It prints 'Hello world!' to the Openplanet log when the plugin is loaded. ```Angelscript void Main() { print("Hello world!"); } ``` -------------------------------- ### UI::ShowOverlay API Method Source: https://openplanet.dev/docs/api/UI Makes the Openplanet overlay visible. ```APIDOC void UI::ShowOverlay() Description: Shows the overlay. ``` -------------------------------- ### UI Scrolling Functions Source: https://openplanet.dev/docs/api/UI Functions to get and set the scrolling behavior of UI elements. Includes getting maximum scroll amounts and adjusting the view to make specific elements visible. ```cpp float UI::GetScrollMaxY() // Get maximum horizontal scrolling amount. // Returns `float` ``` ```cpp void UI::SetScrollHereX(float center_x_ratio = 0.5f) // Get maximum vertical scrolling amount. // Returns `float` ``` ```cpp void UI::SetScrollHereY(float center_y_ratio = 0.5f) // Adjust scrolling amount to make current cursor position visible. center_x_ratio=0.0: left, 0.5: center, 1.0: right. When using to make a "default / current item" visible, consider using SetItemDefaultFocus() instead. ``` ```cpp void UI::SetScrollFromPosX(float local_x, float center_x_ratio = 0.5f) // Adjust scrolling amount to make current cursor position visible. center_y_ratio=0.0: top, 0.5: center, 1.0: bottom. When using to make a "default / current item" visible, consider using SetItemDefaultFocus() instead. ``` ```cpp void UI::SetScrollFromPosY(float local_y, float center_y_ratio = 0.5f) // Adjust scrolling amount to make given position visible. Generally GetCursorStartPos() + offset to compute a valid position. ``` -------------------------------- ### Start New Coroutine Source: https://openplanet.dev/docs/api/global Starts a new yieldable coroutine from a given function, optionally providing userdata. The function signature must match the expected type (e.g., void Func(int64)). ```C++ awaitable@ startnew(CoroutineFuncUserdataInt64@ func, const int64 userdata) Starts a new yieldable coroutine from the given function which also provides a userdata signed integer. Function should be a declaration of 'void Func(int64)'. Returns `awaitable@` ``` ```C++ awaitable@ startnew(CoroutineFuncUserdataUint64@ func, const uint64 userdata) Starts a new yieldable coroutine from the given function which also provides a userdata unsigned integer. Function should be a declaration of 'void Func(uint64)'. Returns `awaitable@` ``` ```C++ awaitable@ startnew(CoroutineFuncUserdataDouble@ func, const double userdata) Starts a new yieldable coroutine from the given function which also provides a userdata floating point number. Function should be a declaration of 'void Func(double)'. Returns `awaitable@` ``` ```C++ awaitable@ startnew(CoroutineFuncUserdataBool@ func, const bool userdata) Starts a new yieldable coroutine from the given function which also provides a userdata boolean. Function should be a declaration of 'void Func(bool)'. Returns `awaitable@` ``` ```C++ awaitable@ startnew(CoroutineFuncUserdataString@ func, const string&in userdata) Starts a new yieldable coroutine from the given function which also provides a userdata string. Function should be a declaration of 'void Func(const string &in)'. Returns `awaitable@` ``` -------------------------------- ### Meta::PluginIndexItem Constructors Source: https://openplanet.dev/docs/api/Meta/PluginIndexItem/$beh0 Provides the default and copy constructors for the `PluginIndexItem` class, part of the `Meta` API in Openplanet. These constructors are used for initializing instances of this class. ```C++ PluginIndexItem() ``` ```C++ PluginIndexItem(const Meta::PluginIndexItem&in) ``` -------------------------------- ### OpenPlanet UI Text and Frame Metrics Source: https://openplanet.dev/docs/api/UI Functions to retrieve metrics related to text and UI frames. Includes functions for aligning text, getting text line height, and getting frame heights. ```C++ void UI::AlignTextToFramePadding() // Vertically align upcoming text baseline to frame padding so that it will align properly to regularly framed items (call if you have text on a line before a framed item). float UI::GetTextLineHeight() // Gets the line height of text. Typically the font size. // Returns `float` float UI::GetTextLineHeightWithSpacing() // Gets the line height of text plus the distance between 2 consecutive lines of text. // Returns `float` float UI::GetFrameHeight() // Gets the frame height. // Returns `float` float UI::GetFrameHeightWithSpacing() // Gets the frame height plus the distance in pixels between 2 consecutive lines of framed widgets. // Returns `float` ``` -------------------------------- ### Angelscript Classes Source: https://openplanet.dev/docs/tutorials/angelscript-overview Demonstrates the definition and instantiation of a simple class in Angelscript, including a method call. ```Angelscript class Foo { void DoSomething() { print("Something!"); } } void Main() { Foo f; f.DoSomething(); } ```