TrainHeist

TrainHeist 0.2.22

Fixed spawns not working when above ground config option is toggled false
Ignore TrainBarricades when determining if track is blocked and should branch or reverse (underground)
Force underground trains to use the work cart engine. The locomotive is too big to fit around some of the underground corners
Track selection will not pick underground station off shoots
Randomize track selection when no hazards are present in underground rails so it doesn't default and loop around 1 section of track
Fixed edge case where turrets could potentially still target NPCs
Underground trains have their lights on all the time
Replaced scientist loadouts on underground trains with tunnel dweller loadouts (only applied if no kits are defined)
  • Like
Reactions: Lei_Wong
Ensure despawn doesn't run if the self-destruct timer is active
Added support to include unloadable wagons in the train layout

Added support for underground rail networks
Added config option "Allow spawns to generate in under ground rail network" to include the under ground rail network
Added config option "Allow spawns to generate on above ground rail network" to include the above ground rail network

Added hook methods;
C#:
void OnTrainHeistStarted()
void OnTrainHeistFinished()
Added API method;
C#:
bool IsHeistTrainCar(TrainCar trainCar)
Custom autoturret fire code to prevent damage to NPCs
  • Like
Reactions: crunch
You will need to test out and adjust the config/data files for this update as the new locomotive and missing wagon will change your balance of risk-reward

Fixed compile error
Removed WagonD layout as it no longer exists, changed layout config option to reflect that
Added config option 'Use locomotive as train engine'
Added new layout datafile for the locomotive engine
  • Love
Reactions: cpl_Copper
Ensure despawn timer always includes crate hack time
  • Like
Reactions: Red
All train heist cars ignore the terrain collider. You don't need to add terrain triggers for this to work
Added config options "Use spawn overrides" and a "Preferred spawn overrides" list that you can enter positions in. This will evaluate valid track positions close to these point randomize the starting position between the closest valid points near the positions in the list
Added support for SamSites
Adhere to spawn amount for APC spawns
Ignore track prefabs that register as a loop because they lead on to a rail path loop
Reverse direction if train comes to a complete stop for more than 3 seconds
Added support for spawning APCs on trains (default layouts have these disabled, you will need to add them if you want to use it)
This plugin update is for the coming Rust update. It will only work on staging branch until then

Fixed for Rust update
Attempt to not select tracks that don't have further tracks connected
Track selection changes for better compatibility with new rail branching and rail sidings