Skip to main content

Format

This documentation is for version 2.0, and likely won't be supported or work in older versions.

Please read the description of the book this page is under before asking staff any questions about this.
Unless you are a Senior Mod or above, don't ask for help with this format or rigging trains, as you won't get any.

This page covers the format used by trains in 2.0. Please note:

  • This new format was made completely from scratch (excluding some detection parts for simplicity), previously rigged trains are not compatible with the new driving system and it's not designed to be easy to convert trains - it's meant to be easy and obvious to rig new trains
  • A lot of names and folders are purely for semantic folders to make navigating and editing the train easier - you still have to follow these
  • All trains should have CanCollide disabled for everything except the gliders
  • It's highly recommended to have CanTouch disabled where it's not needed - this massively reduces lag when moving
  • Trains should not exceed the size limits, which are currently as follows. Note that trains that exceed these limits will be auto detected and a log message will be sent to HR
    • 11 studs wide
    • 15 studs high, not including any transparent parts

Structure

Any bullet point that does not have a specified type is a Folder. These types are Luau types, so can be string, boolean, BasePart, etc. Points in <these> under an instance are property or attribute names.

  • [Train Name] - Anything in square brackets will be ignored and not shown in the Driving U and other placesI
    • DirectionalAudio
      • Format not finalised for this folder - will come soon
    • MasterAudio
      • Format not finalised for this folder - will come soon
    • Carriages - Required - Holds all parts in each carriage
      • [Carriage Number] - Must be in the correct order and not missing any numbers
        • DetectionParts - Required - Holds parts used to detect when the train should do something - parts in this folder will automatically become transparent when the train is registered - see Detection Parts for more detailed documentation
          • CamFocus: BasePart - Optional - Used in the first and last carriages, the player's camera subject will be set to this when driving on the side it's in - rotation matters!
          • CircuitTrain_DetectPart: BasePart - Required - Part that updates track circuits in boxes - should be placed on the rails
          • JointTrigger: BasePart - Optional - Can have any number of these, makes a sound when touching a joint
          • TrainDetectPart_F: BasePart - Required for first - Detects AWS, decreased speed limits, changes crossovers, etc - should be placed on front-right side of train on rail - no required children and will auto-change name when swapping side
          • TrainDetectPart_B: BasePart - Required for last - Detects increased speed limits and stuff - should be placed on back-left side of train on rail - no required children and will auto-change name when swapping side
        • Displays - Optional - Holds train info displays
          • Destination - Optional - All TextLabels in this folder will be auto-updated with the user's currently set destination
          • UnitNumber - Optional - All TextLabels in this folder will be auto-set to the train's generated (or fixed) unit number
        • Doors - Optional - Unimplemented, will be used for carriage doors, controllable by the driver, guard and passengers
          • Format not finalised for this folder - will come soon
        • Lights - Optional - Houses the white and red light parts & light button's SpotLight - not actually referred to in the scripts but used in ExtraSettings functions to change lights
        • Seats - Optional - Contains Seat parts for players
        • DriveSeat: VehicleSeat - Required in first & last - A player can enter either seat to start driving the train, not actually referenced by the scripts (config values instead)
        • CarriageModel: Model - Required - Contains the carriage model itself - usually BaseParts - no specifically required children
        • Gliders - Required - Contains parts that (try to) stop the train from leaving the track - parallel gliders should be approximately 1.94 studs apart for optimum stability - if you have gliders above and below the Top and Bottom parts then ideally put them in Top, Middle and Bottom models to make it easier to modify
        • Wheels - Optional - Unimplemented, will be used for accurate wheel spinning in a future update
        • Base: Part - Required - Holds the front and back attachments for each carriage (used with RodConstraints in train.Rods) and the LinearVelocity for moving the train, which is added once initialised
          • [Carriage Number]Front: Attachment - Required unless first carriage
          • [Carriage Number]Back: Attachment - Required unless last carriage
    • Couplers - Optional - Houses the couplers for 
      • FrontCoupler - Optional - Coupler that will be automatically welded to the front carriage - use the Coupler package for this
    • Rods - Required - Contains RodConstraints between carriages all in one place
      • [1st Carriage Number]-[2nd Carriage Number]: RodConstraint - Required - One rod for each carriage connection
    • Config: Configuration - Holds information about how the train should work; driving, lights & general behaviour - each value in the base rig has a Description attribute which is the same as the description here
      • All Values here are required.
      • Driving - Holds configuration on how the driving works in the train - all values except MaxSpeed are in SPS so they can be copied from the original rig
        • BrakeNotches: IntValue - The number of brake notches in the driving GUI
        • BrakePower: NumberValue - SPS acceleration per second at max brake
        • BrakeToFullTime: NumberValue - Seconds to get to full brake from idle
        • BrakeToIdleTime: NumberValue - Seconds to get to idle brake from full
        • MaxSpeed: IntValue - The maximum possible speed in MPH
        • ThrottleNotches: IntValue - The number of throttle notches in the driving GUI
        • ThrottlePower: NumberValue - SPS acceleration per second at max throttle
        • ThrottleToFullTime: NumberValue - Seconds to get to full throttle from idle
        • ThrottleToIdleTime: NumberValue - Seconds to get to idle throttle from full
      • Lights - Holds 

Doors

Ignore this section for now, this is so it doesn't fill up the main format.

  • Left
    • Door: Model - Can be named anything
      • DoorModel: Model - Contains the actual door itself
      • AnimationSpeed: NumberValue - Multiplier for the animation speed
      • Pivot: Part
        • DoorClose: Sound - Will be played after the animation has finished
        • DoorOpen: Sound - Will be played before the animation has been started
      • Motor6D: Motor6D - Controlled by the animation
        • <Part0>: Part - Pivot part in the parent Model
        • <Part1>: Part - Root part inside the DoorModel
      • AnimationController: AnimationController
        • Animation: Animation - 
          • <AnimationId>: string -