The preprocessor
Openplanet's Angelscript compiler comes with a preprocessor (based on ccpp). You can use this to selectively omit specific lines of code from the actual script compilation. For example:
#if TMNEXT
print("I am running on Trackmania (2020)");
#elif MP4
print("I am running on Maniaplanet 4");
#else
print("I am running on a different game");
#endif
Available defines
The following is a list of all available preprocessor defines, including ones that are generally not available publicly:
Define | Defined when.. |
---|---|
UNITED |
The current game is Trackmania United |
MP3 |
The current game is Maniaplanet 3 |
TURBO |
The current game is Trackmania Turbo |
MP4 |
The current game is Maniaplanet 4 (this includes both 4.0 and 4.1) |
MP40 |
The current game is Maniaplanet 4.0 |
MP41 |
The current game is Maniaplanet 4.1 |
TMNEXT |
The current game is Trackmania (2020) |
LOGS |
The current game is a Logs-configured build (for example, Nadeo development builds or the "logs" executables) |
HAS_DEV |
The current game is a Nadeo development build |
SERVER |
The current game is a dedicated server build |
MANIA64 |
The current game is a 64-bit build |
MANIA32 |
The current game is a 32-bit build |
WINDOWS |
The current OS is Windows |
LINUX |
The current OS is Linux |
DEVELOPER |
The current Openplanet build is a debug build |