TrainHeist

TrainHeist 0.2.27

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.



4da5c3f0ec15a7a37678b8f792d2a7d6.jpg

1767ce666a6b7b5660e9f8fd0d4985de.jpg

70d7b545ba489318d3923236a15faa5d-jpg.jpg

d90c451146e40ee60405337a9399cb19.jpg



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)

Information

Author
k1lly0u
First release
Last update
Rating
3.50 star(s) 14 ratings

Latest Release v0.2.27

Released
Dec 5, 2024 at 11:38 AM
Rating
0.00 star(s) 0 ratings


More resources from k1lly0u

  • PilotEject
    PilotEject
    A mini event where a helicopter malfunctions and the pilot has to eject
  • HeliRefuel
    HeliRefuel
    A mini-event where a helicopter populated with NPCs needs to land to refuel
  • ZombieHorde
    ZombieHorde
    Create hordes of zombies that roam around your server looking for brains
  • Admin Menu
    Admin Menu
    Manage groups, permissions, commands and convars from a GUI menu
  • TeleportGUI
    TeleportGUI
    Teleport, home and warp with a easy to use UI

TrainHeist by k1lly0u
© chaoscode.io Apr 21, 2022

Latest reviews

The turrets cant be destroyed and the developer wont answer me. I would like my money back and I will probably not purchase any other plugins from him
Unfortunately, the plugin is unusable, NPCs are often invisible, and this makes the event impossible. Such a shame. I should have read the discussion before buying a plugin :(
Chaos code should pull this plug until its fixed, we are buying a broken plugin. To continue its sale is acting in bad faith. Npcs are randomly invisible, turrets are indestructable, Wagons do not spawn per config, nor load out per data files. Feel a bit let down about buying it.
Sadly, since i bought the plugin one year ago, havent been able to use it do to invisible npcs ruining the event. This issue has been adressed by several costumers but there has been no solution from the developer. Think twice before you buy this plugin.
Unfortunately the scientists and turrets are often invisible which makes the event impossible for players.
Please install with caution as this plugin will cause the original unloading device of the map train station to disappear
Another great mod from k1lly0u, my players really enjoy this mod on our server.

This mod breaths in new life to the server, if you purchase this mod make sure you enable trains to spawn underground. Give your players an extra scare underground!
Plugin is awesome! Brings life to the underused rail system and gives it purpose. Dude is an insane plugin dev, always fixes stuff when it breaks (thanks to facepunch)
Something amazing!
This is a great event for the server.
Thoughtful, beautiful design, config and run.
easy.
Fun plugin; well thought out and quite adaptable. Only thing I wish I could change easily would be the kits of the bots on the train. Able to change their outfits; but they drop standard loot instead of the loot associated with the kit. I know there's a work-around to this, but would be nice if it could just be configured in the data files. Overall, we absolutely LOVE this plugin--great addition to the server.