-
Notifications
You must be signed in to change notification settings - Fork 52
Compatibility Notes
Note: These commands will not work with prior versions of OpenBVE, and whilst routefiles which use them will load, they may produce error messages or other unexpected behaviour.
Route.LoadingScreen(FileName.png)
This option allows route developers to add a custom loading screen image.
FileName.png should represent a .bmp, .png or .ace image, with a path relative to the routefile directory.
Route.DisplaySpeed(Unit,ConversionFactor)
This option allows route developers to use a custom speed in interface messages.
Unit should represent the textual string for the unit you wish to display, for example mph
ConversionFactor should represent the conversion factor between km/h and your custom unit of speed. For mph, this is 0.621371
Note: Plugins compiled for this version of OpenBVE will not work on prior versions of OpenBVE.
data.CurrentCurveRadius
Returns the current curve radius in meters at Car 0's location.
data.CurrentCant
Returns the cant value at Car 0's location.
data.CurrentPitch
Returns the pitch value at Car 0's location.
data.CurrentCameraViewMode
Returns the current camera view mode.
PluginManager.NetPlugin.PlaySound
This function has had a further optional parameter added- CarIndex This should be a non-negative integer, representing the car of the train which you wish to emit the sound. If this parameter is not set, then the sound will be emitted from the driver's car.
PluginManager.NetPlugin.AddMessage
This new function allows plugin developers to print a simple textual message to the in-game display, and should be used in a similar manner to the PlaySound function: https://github.com/leezer3/OpenBVE/wiki/Adding-Interface-Messages:-Code-Sample
Note: Formulae using these commands will not work with prior versions of OpenBVE, and will produce error messages.
CurveRadius[CarIndex]
Returns an average of the front and rear axle radii for the selected car.
FrontAxleCurveRadius[CarIndex]
Returns the front axle curve radius for the selected car.
RearAxleCurveRadius[CarIndex]
Returns the rear axle curve radius for the selected car.
CurveCant[CarIndex]
Returns the cant value for the selected car.
Odometer
Returns a signed number representing the distance traveled by the current car.
Odometer[carIndex]
Returns a signed number representing the distance traveled by the selected car.
Note: The odometer will reset if a car travels more than 10m in a single frame. This should only occur when jumping between stations.
Random[Minimum,Maximum]
Returns a new random double-precision floating point number between Minimum and Maximum.
RandomInt[Minimum,Maximum]
Returns a new random integer between Minimum and Maximum.
cameramode
This returns 0 if the camera is currently in a 2-D or 3-D cab, or 1 if in an exterior view.
The format of the controls.cfg file has changed. OpenBVE will detect this, and reset your controls assignments to default.
Attempting to use a newer controls.cfg file with versions 1.4.3.0 and prior will cause OpenBVE to crash. (This is out of my control, sorry)