New TNI SDK Available - TRS22 SP6

pw3r

N3V Games Programmer
An updated TNI SDK is now available for current TRS22 SP6 builds, and can be downloaded here:

https://dl1.n3vgames.com/misc/TNI/TNI_SDK_135013.zip

The following updates are included:

TNI Physics Script API Enhancement
s
Trainz scripts can make calls directly into physics plugins, using the Vehicle.LibraryCallPhysicsPlugin() script function. The function calls will be added to the command stream passed to ProcessPhysicsCommands(). See the wiki for more information.
Similarly, physics plugins can post script messages directly to vehicles using a new outgoing TNIP_ScriptPostMessage command.
TNIGameObjectID
A new TNIGameObjectID object type is added, to allow identification of Trainz game objects such as trains, script libraries, etc. Matching functions are also provided for TNIPhysicsVehicle.​

TNIPhysicsCore
The source code for the core physics plugin has been updated to match the current SP6 code. This includes multiple bug fixes and improvements that have been made since the last SDK release.


TNI Developer Registration:
Note that you must be a registered TNI Developer to use the SDK, or load unsigned plugin DLLs.

Writing a plugin requires C or C++ knowledge and appropriate development software. To register your interest in becoming a TNI Developer, complete this registration form.


Have Questions?
If you have any questions, comments or bug reports, please post them on this forum thread.
You can also take part in TNI discussions on our Discord Channel.

Terry Palmer
Programmer
N3V Games
 
An updated TNI SDK is now available for current TRS22 SP6 builds, and can be downloaded here:

https://dl1.n3vgames.com/misc/TNI/TNI_SDK_135013.zip

The following updates are included:

TNI Physics Script API Enhancement
s
Trainz scripts can make calls directly into physics plugins, using the Vehicle.LibraryCallPhysicsPlugin() script function. The function calls will be added to the command stream passed to ProcessPhysicsCommands(). See the wiki for more information.
Similarly, physics plugins can post script messages directly to vehicles using a new outgoing TNIP_ScriptPostMessage command.
TNIGameObjectID
A new TNIGameObjectID object type is added, to allow identification of Trainz game objects such as trains, script libraries, etc. Matching functions are also provided for TNIPhysicsVehicle.​

TNIPhysicsCore
The source code for the core physics plugin has been updated to match the current SP6 code. This includes multiple bug fixes and improvements that have been made since the last SDK release.


TNI Developer Registration:
Note that you must be a registered TNI Developer to use the SDK, or load unsigned plugin DLLs.

Writing a plugin requires C or C++ knowledge and appropriate development software. To register your interest in becoming a TNI Developer, complete this registration form.


Have Questions?
If you have any questions, comments or bug reports, please post them on this forum thread.
You can also take part in TNI discussions on our Discord Channel.

Terry Palmer
Programmer
N3V Games
thank you
 
What are the benefits of this, or disadvantage over not using this? I am asking since all I do is running trains and don't do much otherwise. What am I missing out on compared to someone using it?
 
What are the benefits of this, or disadvantage over not using this? I am asking since all I do is running trains and don't do much otherwise. What am I missing out on compared to someone using it?
The SDK kit is for developers that want to make plugins for Trainz. If you're a normal user it doesn't have any benefit to you.
 
Last edited:
I transferred my plugin to the new SDK and had a quick test of these new features:
  • Vehicle.LibraryCallPhysicsPlugin()
  • TNIP_ScriptPostMessage
  • TNIPhysicsGetVehicleCustomSetting()
They are working as expected.
 
Thank you very much!

Downloaded and installed.
Tested the sample including the Project file on MS VisualStudio 2026.

Got:
"
Error MSB8020 The build tools for Visual Studio 2019 (Platform Toolset = 'v142') cannot be found. To build using the v142 build tools, please install Visual Studio 2019 build tools. Alternatively, you may upgrade to the current Visual Studio tools by selecting the Project menu or right-click the solution, and then selecting "Retarget solution". TNISample C:\Program Files\Microsoft Visual Studio\18\Community\MSBuild\Microsoft\VC\v180\Microsoft.CppBuild.targets 473
"

As can be read there is a way around for MS VS 2026 😊

Appreciated.
 
Last edited:
Back
Top