This is not a standalone mod but a dependency for third-party applications
This mod adds a powerful websocket server (uWebSockets) to the game.
Developers of external applications can use this to obtain data from the game. The basic idea was developed for an external Ebula system, but I would like to create a central API for all external applications. The existing endpoints are gradually being expanded.
If you would like the websocket server to expose more data, please feel free to contact me. I will then try to provide the requested data.
Please intall the dependency (UE4SS) before installing this mod.
Important: This is a beta release of the mod. If you have any problems or suggestions for improvement, please use the comment function. You can also contact me via Discord.
How to use
After installing the game will expose a websocket server at localhost:9187
.
The developer manual is available here: https://vanlueckn.github.io/tsw-websocket-docs
Known issues
- Currently the port is hardoced to
9187
Roadmap
- Add more useful data to expose via the server
- Add configurable interval on subscription
License & Contributing
This mod is now open source. Everyone is allowed to participate. You can view the github repository here.
Changelog
- Version 0.1: Initial release
- Version 0.2: Added execution of console commands
- Version 0.3: Added individual subscription intervals and fixed a crash
Requirements
UE4SS Code Library
Other for Train Sim World · by Luex · 8 days agoNeeded for loading C++ and Lua Mods
Installation Instructions
The downloaded ZIP archive must be unpacked into the folder \WindowsNoEditor\TS2Prototype\Binaries\Win64\ue4ss\Mods
.
If you are playing on XBox Games the Mods folder location may differ.
Files
WebsocketModv0.3.zip 454 KB · Added 16 Jan 2025 · Downloaded 139×Version 0.3
Previously uploaded files have been downloaded 27 times before being withdrawn.
Comments
Thanks !
I know a third party app developer that will be interested by this !
This mod would actually help integrate their app core features in TSW (TSW is not fully integrated yet) so it could work as well as it works for TSC.
It definitely opens a new door for new mods :)
Threw together a web app which uses this mod to track the current train onto Openrailwaymap if anyone finds it useful
https://www.reddit.com/r/trainsimworld/comments/1ilps67/openrailwaymap_train_tracking_app/
Nice. If you want any new features or if there are any problems, just let me know.
@Luex I did notice the mod itself is somewhat unstable; for example any time I disconnect the client while the game is running it crashes
Would it be possible to include scenario objectives, like next stop?
Hi, i will have a look at this
Hi,
this project seems super cool. I am playing with the idea of connecting up real displays to TSW, so for example a destination board shows what youre driving in the game.
Would it be possible to get all infos related to services (headcode, service number, type, station stops, destination, times, etc) out of the API? I mean, taking it to the extreme, we could create a thing similar to ZUSI Display.
Cheers for the mod!
I've had a little less time in the last few weeks. In the future I will work more on updates again and convert this project completely to open source (so that everyone can participate)
Very appreciated and no worries :) thanks a lot for your cool project
This mod is now open source https://github.com/vanlueckn/TSW5Mods
Hey, are you still working on this mod?
I've had a little less time in the last few weeks. In the future I will work more on updates again and convert this project completely to open source (so that everyone can participate)
Hey Luex and ClutchFred,
this is great! Although I hope you haven't already given up on it since you've been quiet for a while now. I'd really love to see all kinds of info from the trains becoming available via this API like LZB data or even just door status. Don't know if it's possible but it'd be great ^^
Cheers!
I've had a little less time in the last few weeks. In the future I will work more on updates again and convert this project completely to open source (so that everyone can participate)
This mod is now open source https://github.com/vanlueckn/TSW5Mods
Add a comment
If you wish to leave a comment, please log in .
About this mod
- Created
- 14 Jan 2025
- Updated
- 8 days ago
- Game
- Train Sim World
- Type of content
- Other
- Train Sim World compatibility
- Train Sim World 5
Thanks, Luex! This will open up so many possibilities, I am sure it will be put to use very soon:-)