NBS+ MathPlus Library

<kuid:388413:439002>

Author: Laurinlaki
Kind: library
Build: 4.3
Size: 7.34KB
Uploaded: 2025-09-17
Website: trainz.de
Downloads:
8
-
0
+

NBS+ MathPlus Library

Tired of writing down basic math functions in your script over and over? Just add this to your script-include-table and load it through World.GetLibrary and you have easy access to rounding, advanced power function, approximations of sin/cos/tan and more!
Installation: !!NOTE!! BECAUSE THE QUOTE CHARACTER IS NOT USABLE IN ASSET DESCRIPTIONS, ALL QUOTES HAVE BEEN REPLACED BY TWO PERCENT SIGNS (%%)!
1. Add <kuid:388413:439002> to your script-include-table. Create a new script-include-table if you don't yet have one like:
script-include-table
{
0 <kuid:388413:439002>
}
2. Add <kuid:388413:439002> to your kuid-table. Make sure you name the entry 'mathplus' like:
kuid-table
{
mathplus <kuid:388413:439002>
}
3. add [include %%mathplus.gs%%] to the top of your script file where the other includes are located
4. add [MathPlus MathPlus;] right after the beginning of your class where the other global variables are located
5. finally, add this line to your init method to actually load the MathPlus-Library: [MathPlus = cast<MathPlus>World.GetLibrary(me.GetAsset().LookupKUIDTable(%%mathplus%%));]
6. Congratulations, you can now access functions like [MathPlus.Round(5.62)]!

    NBS+ MathPlus Library
  • config.txt 1.96KB
  • mathplus.gs 3.67KB
  • thumbnail.jpg 5.25KB

User photos

No one has uploaded a photo of this object yet.