I was looking for something for trains that wouldn’t cause issues, and I was blown away when I tried driving them—absolutely amazing! It would be cool to have derailments at high speeds
I appreciate the idea of including cable cars as a free addition, thank you.
I hope to one day see a great heist system integrated with your trains.
Been having train artifacting (like where a container cart is moving without having a engine attached to it). Similar to other train scripts ive tried… however, they are admin removable (dv), which other trains scripts weren’t so im able to clear the rail pretty easily. This seems to happen once we hit 90+ players on server.
Ah you meant detached carriages. Server logic currently allows individual carriages to be deleted. Which can usually lead to some of this behaviour (although migration issues and clone recreation can also cause some of this behaviour which I’m investigating). A fix for the server-side issue has been PR’d and may be merged soon. However, you may also have conflicting scripts that delete parts of the trains (e.g. the engine or other attached carriages) that can lead to this behaviour.
However, I also have another PR that will introduce some train server-getters to help detect when something like this happens so my script will be able to automatically re-create the trains without the need for admin intervention
With artifact version 12160 (PR by Avarian). Server train logic has been improved and issues such as randomly deleting train carriages should be blocked with these fixes. @SAVRP this should missing carriages for you, however detached carriages may still occur due in some migration cases, repro’ing and resolving that issue isn’t easy.
Further improvements to mission train creation has also been merged into canary (see commit), this will make working with custom train variations easier by not crashing your game on invalid train variation indexes or unloaded models.
As for the resource it’s self. Recent updates has included game build 3407 support (correct metro variation if on 3407), support for artifact >12160, Significant improvements to train management which will prevent other scripts from creating trains (as it will usually lead to conflicts) and other protection measures to allow for servers to disable conflicting protection measures that cause conflicts with both my script and trains in general.
Amazing! One very small nitpick: when standing up- I am clipping through the seat and ground. Is it possible to change it? Otherwise it’s just perfect in all aspects. Can’t wait for the cable cars!
Provided client and server with additional data for train variations. This allows for only the needed models to be loaded and significantly speeds up train creation on slower machine. and reduced wasted streaming memory by up to 80%. In cases where train variations aren’t present in the additional data, model loading will fallback on to the models listed in configs.trainModels
Added /parseTrainConfig <fileinResourceRoot> to allow for generating the needed files for custom train variations. Requires config.enableParser to be enabled
Fixed cases where models wouldn’t be marked as no longer needed. This will allow all train models to be released when needed.
Potential candidates only contain clients that have loaded the client script. Rather then all possible clients (which could lead to issue where a client hasn’t loaded the scripts)
Added creation bail conditions for players in solo/networked tutorial sessions (client only)
Fix edge cases in client train creation that may lead to two creation requests for the same train being sent to some clients (and those clients actually doing it)
Disabled train settlement timer until server-setter trains are implemented
Fixed some rare instances of console error spam due to a client not receiving train information before blip updates are sent
Fixed seat animation
Added config.warnOnCandidateAbdication to allow candidate abdication logs to be debug rather then warns.
Added reason to candidate abdication server logs. This should provide more insight for when a client does abdicate candidacy
Added warning when script is renamed to anything other then Ehbw-Trains. Functionality will remain the same, but future addons will only check for and use Ehbw-Trains resource name for exports
Increased default config.unblockBadCandidatesAfterTime to 20000 (20 seconds)
We had made some changes to a previous test for trains in Moonlit Hills, and made a bunch of implementations for cards from ticket systems, as-well as a dispatch notice. Here is this code! Maybe you can take some inspiration or even implement some sort of system! It attaches metadata when using the ticket, and will invalidate when not on train. – (literally just a client and server!) We use sleepless_interact, but you can make it work with ox_target!
It only works with OX_INVENTORY currently for adding and removing the items through server, but you can make it work otherwise with your inventory. (anyone who sees) - Credits: Demi Automatic, MrNewb, VenomXNL, MrCrowley
It’s been a while since I’ve updated this forum post. However there has been several big changes in the meantime:
Fixed cases where setting individual track indexs to metro trains would be ignored.
Made fallback for metro and freight train track index be config.general.trackIndex rather then hardcoded
Allow player driving with Driver NPC (Requires the driver to be dead before the player can drive train)
Added configuration option config.ignoreObstructions in metro.lua (default: true). To make metrotrains not stop for any obstructions in front (such as players, vehicles (that aren’t other trains, submarines or bikes) and objects)
Added configuration option config.setTrainSpeedOnDriverExit in general.lua to allow setting a default speed when the player stops driving a train (assuming train driving is enabled)
Fallback for sitting and leaving seats if the train entity becomes invalid on the owning client. Instead of ending up at 0.0, 0.0, 0.0.
Fix infinite loop if train entity takes too long to be registered on the server
Other minor fixes and clean up.
With some new changes coming very soon:
Ability for all train types to block for obstructions on the track (with changes to prevent colliding/going through other trains)
Support for strict statebag mode when also having driveable trains enabled.
Further expansion on the trains API for future addons.
Might wanna advice people there’s no official support. Asked a simple question on the discord got directly banned. Previous chats also show people asking questions and had to ping the owner for answers. No docs, only configs and some exports. Some functionalities in the script not working, but since we get banned from the Discord we cant even report them.
You weren’t a customer, you never was (you didn’t own any of my resources nor did you make any attempt to prove you were a customer) and still believed you were entitled to receive support at 2am. You intentionally fund FiveM and other games cheats. You have no place in my discord or using my resources. Everyone else got their questions answered either in customer channels or in the general channel, DMs or even email depending on where they asked. and there is documentation about aspects of my resources in the discord for customers.
Customers who own my resource can (and have) joined my discord or emailed me for support and I’ve always provided that support, I will never provide resource support to anyone who actively funds the harming of this platform like you have, regardless if they are a customer or not. I have 200+ customers who have purchased my resources and received support in discord, dms or email and your the only person to come in here with these claims.
Out of the 400+ people that have ever joined my support server. I have punished 1 individual, that being yourself. and for the reasons I mentioned above. No one else that has joined the server has been removed from it by me.
So respectfully, find someone else that might entertain your lies, false claims and racist behaviour because I do have not the slightest interest in doing so. Also please don’t try to act like your smarter then people, then proceeded to pull this to hide your lies (Thanks CommunityOx for providing this).