nicoell / tm-editor-route

Editor Route Plugin for Trackmania 2020
MIT License
1 stars 0 forks source link

TM2020 Editor Route

Shows visualizations of recorded runs from Test Mode and Track Validation within the Map Editor.

Features

Route Recording and Visualization

Stats, Events, and Spectrum Timeline

Import & Export

Contributing

If you're a developer interested in contributing new features or customizations, please explore the code, get in touch on Discord, and submit a pull request.

This plugin uses a custom preprocessor to add C-Style Macro support. The plugin code is not valid AngelScript code for OpenPlanet and must not be placed in the OpenPlanet plugin folder directly.

We will use the pluginbuilder.exe with the debug command to preprocess the plugin code and copy it to the OpenPlanet plugin folder:

Contributing: How to Use the Debug Command

Before using the debug command, ensure you have the following:

  1. Prebuilt pluginbuilder.exe: The executable should be placed in the root folder of the repository.
  2. Git Repository: Ensure you have cloned the repository and are working from the root directory of the cloned repository.

Steps to Use the Debug Command

  1. Navigate to the Repository Root: Open a command prompt or terminal and navigate to the root directory of the cloned repository.

    cd path/to/your/cloned/repository
  2. Verify info.toml: Ensure the info.toml file exists in the root directory. The pluginbuilder.exe requires the working directory to be the root directory of the repository.

  3. Run the Debug Command: Use the pluginbuilder.exe with the debug command. You need to specify the path where the OpenPlanet plugins are located.

    pluginbuilder.exe debug C:/Users/YourUsername/OpenplanetNext/Plugins

    Replace C:/Users/YourUsername/OpenplanetNext/Plugins with the actual path to your OpenPlanet plugins directory.

  4. Checks Performed by the Debug Command:

    • Verifies that the current working directory contains an info.toml file with the [meta] section and name = "Editor Route".
    • Ensures that the working directory is not the same as the specified OpenPlanet plugins path.
  5. Expected Behavior:

    • Checks if the target directory C:/Users/YourUsername/OpenplanetNext/Plugins/EditorRouteDev directory exists and deletes it if it exists.
    • Copies whitelisted files and folders (src, info.toml, LICENSE, Readme.md) to the target directory.
    • Runs the mcpp C-Preprocessor on the copied src folder, updating the files as necessary for the debug environment.

//#require Comment

To handle dependencies between AngelScript files, use the //#require comment to specify the required files. Paths are relative to the root folder.

Example:

//#require "My/Other/File.as"

This directive ensures that My/Other/File.as is processed before the current file.

Preprocessor Directives

To use builtin OpenPlanet preprocessor directives, use these predefined custom macros:

#define AS_IF #if
#define AS_ELIF #elif
#define AS_ELSE #else
#define AS_ENDIF #endif

Use these macros in your AngelScript files:

AS_IF TMNEXT
  print("I am running on Trackmania (2020)");
AS_ELIF MP4
  print("I am running on Maniaplanet 4");
AS_ELSE
  print("I am running on a different game");
AS_ENDIF