Documentation ¶
Overview ¶
Dealing with entrances/exits from a ride
Parses TD6 files
Index ¶
Constants ¶
const ( IDX_RIDE_TYPE = 0x0 IDX_VEHICLE_TYPE = 0x1 IDX_COST = 0x2 IDX_OPERATING_MODE = 0x06 IDX_COLOR_SCHEME = 0x07 IDX_CONTROL_FLAG = 0x4b IDX_NUM_TRAINS = 0x4c IDX_CARS_PER_TRAIN = 0x4d IDX_MIN_WAIT_TIME = 0x4e IDX_MAX_WAIT_TIME = 0x4f IDX_MAX_SPEED = 0x51 IDX_AVERAGE_SPEED = 0x52 IDX_POSITIVE_G_FORCE = 0x55 IDX_NEGATIVE_G_FORCE = 0x56 IDX_LATERAL_G_FORCE = 0x57 IDX_NUM_INVERSIONS = 0x58 IDX_NUM_DROPS = 0x59 IDX_HIGHEST_DROP = 0x5a IDX_EXCITEMENT = 0x5b IDX_INTENSITY = 0x5c IDX_NAUSEA = 0x5d IDX_VEHICLE_TYPE_STRING = 0x74 IDX_TRACK_DATA = 0xa3 IDX_X_SPACE = 0x80 IDX_Y_SPACE = 0x81 )
Where to find various pieces of information in the decoded ride.
const ( SCHEME_SAME_COLOR = 0 SCHEME_TRAINS_DIFFERENT_COLOR = 1 SCHEME_CARS_DIFFERENT_COLOR = 2 )
const ( RIDE_SPIRAL RideType = 0x00 RIDE_STAND_UP = 0x01 RIDE_SUSPENDED = 0x02 RIDE_INVERTED = 0x03 RIDE_STEEL_MINI = 0x04 RIDE_MINE_TRAIN = 0x11 RIDE_WOODEN = 0x34 )
http://freerct.github.io/RCTTechDepot-Archive/rideCodes.html
const ( RIDE_LOAD_QUARTER = 0 RIDE_LOAD_HALF = 1 RIDE_LOAD_THREE_QUARTERS = 2 RIDE_LOAD_FULL = 3 RIDE_LOAD_ANY = 4 )
see http://freerct.github.io/RCTTechDepot-Archive/controlFlags.html
const ( OPERATING_MODE_NORMAL = 0 OPERATING_MODE_CONTINUOUS_CIRCUIT = 1 )
const ( VEHICLE_SPIRAL VehicleType = "SPDRCR " VEHICLE_STAND_UP = "TOGST " VEHICLE_WOODEN_ARTICULATED = "MFT " VEHICLE_WOODEN_4SEATER = "PTCT1 " VEHICLE_WOODEN_6SEATER = "PTCT2 " VEHICLE_WOODEN_6SEATER_REVERSED = "PTCT2R " VEHICLE_MINE_TRAIN = "AMT1 " )
const ( LENGTH_VEHICLE_TYPE = 8 BIT_LIFT_CHAIN = 3 BIT_STEEP_LIFT_CHAIN = 4 BIT_CURVED_LIFT_CHAIN = 5 BIT_BANKING = 6 BIT_VERTICAL_LOOP = 7 BIT_STEEP_SLOPE = 1 BIT_FLAT_TO_STEEP = 2 BIT_SLOPED_CURVES = 3 BIT_STEEP_TWIST = 4 BIT_S_BENDS = 5 BIT_SMALL_RADIUS_CURVES = 6 BIT_SMALL_RADIUS_BANKED = 7 )
const DEBUG = false
const DEBUG_LENGTH = 20
const RCT2_TD6_LENGTH = 24735
Variables ¶
This section is empty.
Functions ¶
func Marshal ¶
Deserialize the ride to a string of bytes.
This is a little bit tricky, and requires implementing the format described in the tycoon technical depot, available here: https://github.com/UnknownShadow200/RCTTechDepot-Archive/blob/master/td4.html
Types ¶
type ControlFlags ¶
type OperatingMode ¶
type OperatingMode int
Operating modes described here: http://freerct.github.io/RCTTechDepot-Archive/operatingModes.html
type Ride ¶
type Ride struct { RideType RideType VehicleColorScheme VehicleColorScheme XSpaceRequired int YSpaceRequired int OperatingMode OperatingMode ControlFlags *ControlFlags NumTrains uint8 CarsPerTrain uint8 MinWaitTime uint8 MaxWaitTime uint8 TrackData tracks.Data // set in bit 0 of the ride features list HasLoop bool SteepLiftChain bool CurvedLiftChain bool Banking bool // set in bit 1 SteepSlope bool FlatToSteep bool SlopedCurves bool SteepTwist bool SBends bool SmallRadiusCurves bool SmallRadiusBanked bool NumInversions uint8 MaxSpeed uint8 AverageSpeed uint8 VehicleType VehicleType // This is a little bit of a copout DatData []byte Egresses []*Egress Excitement int16 Intensity int16 Nausea int16 }
Technically this is track data that gets serialized to disk. A RCT2 Ride structure in memory has a different format.
func CreateMineTrainRide ¶
CreateMineTrainRide takes a track and builds all the rest of the ride structure around it
complete: Whether to return a completed track or a partial one. Note RCT2 will crash unless you return a complete track
func NewCoaster ¶
func NewCoaster() *Ride
Initialize a coaster with smarter defaults than the regular
type VehicleColorScheme ¶
type VehicleColorScheme int
type VehicleType ¶
type VehicleType string