- Optional Dependencies
- https://umod.org/plugins/rust-kits
This plugin requires a map with either a above or below ground rail loop! The plugin will not work without one
A event where a train with scientists drives around either the above ground or below ground rail ring. Upon spawn players will be notified of its presence, roughly where it is on the map, and in what direction it is travelling.
Players will need to attack the train via a train, car or helicopter and take out the scientists and sentry turrets on board.
Once the scientist and sentries have been taken out they will need to board the train, either by jumping from a vehicle or shooting the train until it temporarily slows down and catch it on foot.
Once onboard, players can start hacking the loot containers, at which point a helicopter (above ground only) will be called to attack players on and around the train while the hack is in progress.
Other players will be notified when the hacking starts so they can contest it.
If the players make it through all that, once the hacks are complete they will have a certain amount of time to loot the contents of the loot boxes before the train explodes.
Features
- Supports custom map rails loops made with either the path tool or using the individual track prefabs
- Support for both above and below ground train lines
- Automated event, customizable event timer and minimum required players to start
- Customize the train with additional carriages
- Customize how defensible the train is by adding/removing scientists and sentry turrets, change their positions on each carriage and adjust the number of helicopters that come to defend
- Supports rail branching, it will evaluate the tracks ahead and attempt to avoid obstacles on the track by changing branch
- Train spawns on the track the furthest distance away from players and other trains as possible, and despawns after a certain amount of time and inactivity
- Set the speed of the train in the config (slow, medium, fast) and adjust engine power and top speed
- Customize options for slowing down the train by damaging it for players on foot to board
- The train will always keep moving (unless "Stop train on driver death" is enabled in the config)
- If the trains path is blocked by another train and it can not change branch to avoid it, the train will stop and start travelling in the opposite direction, unless the train driver has been killed in which case it will crash into anything in its path
- Helicopters come 1 after the other and will only attack those involved in the train heist
- Customize the loot given in the containers, or just use the default loot table
- Option to display the loot marker on the map so players always know where it is
- Customize the time required to hack the containers, longer times means more chance of other teams contesting it
- Customize NPCs using Kits
Permission
trainheist.admin - Required to use the commands to manually start/stop the event
Chat Commands (requires trainheist.admin permission)
/trainheist start - Manually starts the train heist
/trainheist startnear - Manually starts the train heist near your position (you need to be close to the rail)
/trainheist stop - Cancels any current train heist
Console Commands
trainheist start - Manually starts the train heist
trainheist stop - Cancels any current train heist
Train Carriages
You can customize which carriages the train will have attached. Each carriage has its own layout data file that you can change to your liking.
To change which carriages are part of the event you can modify the config file. Add or remove as many carriage types as you like to this list, but be mindful that the more carriages there are the slower the train will become
Customizing The Loot Table
** You can find the loot table at /oxide/data/TrainHeist/LootTable.json
The loot table in the config use's a weight system. The higher the weight the more likely it will be chosen.
Not all fields for the items are visible in the config, the are additional fields you can add yourself for more customization. These include the skin of the item, whether its a blueprint and other items that you want to spawn with the chosen item (such as ammo for a weapon)
If you want to use any of these features in your loot table use the following as a template to add additional items or edit existing ones
Engine/Carriage Layout
** You can find the engine and carriage layouts in /oxide/data/TrainHeist/
These data files contain the setup for loot containers, scientists, sentry turrets and positions for each of those that you want to be spawned in each carriage.
Config
Hooks
API
A event where a train with scientists drives around either the above ground or below ground rail ring. Upon spawn players will be notified of its presence, roughly where it is on the map, and in what direction it is travelling.
Players will need to attack the train via a train, car or helicopter and take out the scientists and sentry turrets on board.
Once the scientist and sentries have been taken out they will need to board the train, either by jumping from a vehicle or shooting the train until it temporarily slows down and catch it on foot.
Once onboard, players can start hacking the loot containers, at which point a helicopter (above ground only) will be called to attack players on and around the train while the hack is in progress.
Other players will be notified when the hacking starts so they can contest it.
If the players make it through all that, once the hacks are complete they will have a certain amount of time to loot the contents of the loot boxes before the train explodes.
Features
- Supports custom map rails loops made with either the path tool or using the individual track prefabs
- Support for both above and below ground train lines
- Automated event, customizable event timer and minimum required players to start
- Customize the train with additional carriages
- Customize how defensible the train is by adding/removing scientists and sentry turrets, change their positions on each carriage and adjust the number of helicopters that come to defend
- Supports rail branching, it will evaluate the tracks ahead and attempt to avoid obstacles on the track by changing branch
- Train spawns on the track the furthest distance away from players and other trains as possible, and despawns after a certain amount of time and inactivity
- Set the speed of the train in the config (slow, medium, fast) and adjust engine power and top speed
- Customize options for slowing down the train by damaging it for players on foot to board
- The train will always keep moving (unless "Stop train on driver death" is enabled in the config)
- If the trains path is blocked by another train and it can not change branch to avoid it, the train will stop and start travelling in the opposite direction, unless the train driver has been killed in which case it will crash into anything in its path
- Helicopters come 1 after the other and will only attack those involved in the train heist
- Customize the loot given in the containers, or just use the default loot table
- Option to display the loot marker on the map so players always know where it is
- Customize the time required to hack the containers, longer times means more chance of other teams contesting it
- Customize NPCs using Kits
Permission
trainheist.admin - Required to use the commands to manually start/stop the event
Chat Commands (requires trainheist.admin permission)
/trainheist start - Manually starts the train heist
/trainheist startnear - Manually starts the train heist near your position (you need to be close to the rail)
/trainheist stop - Cancels any current train heist
Console Commands
trainheist start - Manually starts the train heist
trainheist stop - Cancels any current train heist
Train Carriages
You can customize which carriages the train will have attached. Each carriage has its own layout data file that you can change to your liking.
To change which carriages are part of the event you can modify the config file. Add or remove as many carriage types as you like to this list, but be mindful that the more carriages there are the slower the train will become
JSON:
"Carriage layout (Combination of WagonA, WagonB, WagonC and WagonD)": [
"WagonA",
"WagonB",
"WagonD"
]
Customizing The Loot Table
** You can find the loot table at /oxide/data/TrainHeist/LootTable.json
The loot table in the config use's a weight system. The higher the weight the more likely it will be chosen.
Not all fields for the items are visible in the config, the are additional fields you can add yourself for more customization. These include the skin of the item, whether its a blueprint and other items that you want to spawn with the chosen item (such as ammo for a weapon)
If you want to use any of these features in your loot table use the following as a template to add additional items or edit existing ones
JSON:
{
"Shortname": "rifle.ak",
"Minimum amount": 1,
"Maximum amount": 1,
"Weight": 20,
"Skin ID": 0,
"Blueprint": false,
"Spawn with item": {
"Shortname": "ammo.rifle",
"Minimum amount": 10,
"Maximum amount": 25,
"Weight": 1
}
},
Engine/Carriage Layout
** You can find the engine and carriage layouts in /oxide/data/TrainHeist/
These data files contain the setup for loot containers, scientists, sentry turrets and positions for each of those that you want to be spawned in each carriage.
JSON:
{
"NPC Settings": {
"Amount to spawn": 3,
"Starting health": 200,
"Scientist kits (chosen at random)": [],
"Local spawn positions": [
{
"Position": {
"X": -0.77,
"Y": 1.54,
"Z": -6.0
},
"Rotation": {
"X": 0.0,
"Y": 0.0,
"Z": 0.0
}
},
{
"Position": {
"X": -0.77,
"Y": 1.54,
"Z": 3.29
},
"Rotation": {
"X": 0.0,
"Y": 0.0,
"Z": 0.0
}
},
{
"Position": {
"X": 0.77,
"Y": 1.54,
"Z": 3.29
},
"Rotation": {
"X": 0.0,
"Y": 0.0,
"Z": 0.0
}
}
]
},
"AutoTurret Settings": {
"Amount to spawn": 1,
"Health": 500.0,
"Local spawn positions": [
{
"Position": {
"X": -0.63,
"Y": 1.54,
"Z": 5.64
},
"Rotation": {
"X": 0.0,
"Y": 180.0,
"Z": 0.0
}
}
]
},
"Loot Settings": {
"The minimum amount of time a crate takes to hack (seconds)": 600,
"The maximum amount of time a crate takes to hack (seconds)": 900,
"Use custom loot table": true,
"Show loot container marker on map": true,
"Amount to spawn": 1,
"Local spawn positions": [
{
"Position": {
"X": 0.77,
"Y": 1.54,
"Z": -2.9
},
"Rotation": {
"X": 0.0,
"Y": 270.0,
"Z": 0.0
}
},
{
"Position": {
"X": 0.77,
"Y": 1.54,
"Z": -0.19
},
"Rotation": {
"X": 0.0,
"Y": 270.0,
"Z": 0.0
}
}
]
}
}
Config
JSON:
{
"Event Automation": {
"Enabled": true,
"Minimum amount of online players to trigger the event": 1,
"Minimum amount of time between events (seconds)": 3600,
"Maximum amount of time between events (seconds)": 5400
},
"Train Settings": {
"Stop train on driver death": false,
"Despawn time for inactivity (seconds)": 600,
"Amount of time from when all crates have been hacked until train self destructs (seconds)": 60,
"Train engine force": 50000.0,
"Train max speed": 18.0,
"Amount of damage required to slow the train down": 200.0,
"Amount of time the train slows down when damaged (seconds)": 8.0,
"Maximum velocity the train can travel when slowed due to damage": 4.0,
"Health regeneration per second": 5.0,
"Desired travel speed (Low, Medium, High)": "Medium",
"Carriage layout (Combination of WagonA, WagonB, WagonC and WagonD)": [
"WagonA",
"WagonB",
"WagonD"
]
},
"Helicopter Settings": {
"Amount to spawn": 1,
"Loot crates to spawn": 0
},
"Use TruePVE exclusion hook": false,
"Version": {
"Major": 0,
"Minor": 2,
"Patch": 0
}
}
Hooks
C#:
void OnTrainHeistStarted()
void OnTrainHeistFinished()
API
C#:
bool IsHeistTrainCar(TrainCar trainCar)