### Initialize Source: https://bvets.net/jp/edit/formats/vehicle/atsfunctions.html Called when the game starts (after selecting 'Open' or 'Start New'). It receives the initial state of the brake valve. ```APIDOC ## Initialize ### Description Called when the game starts (after selecting 'Open' or 'Start New'). It receives the initial state of the brake valve. ### Method `Initialize(_brake_)` ### Parameters - `_brake_` (int): The initial state of the brake valve. Can be one of: - `ATS_INIT_SVC`: Normal position - `ATS_INIT_EMG`: Emergency position - `ATS_INIT_REMOVED`: Removed (usually when ATS is not engaged) ``` -------------------------------- ### Structure List File Header Example (UTF-8) Source: https://bvets.net/jp/edit/formats/route/structure.html Demonstrates the file header with UTF-8 encoding specified. If encoding is omitted, UTF-8 is assumed. Comments start with a '#' symbol. ```text BveTs Structure List 2.00:UTF-8 track1,tracks\ballast.x ground,grounds\grass.x background,background.x # 晴天用 ``` -------------------------------- ### Starting Gradient Transition Source: https://bvets.net/jp/edit/formats/route/map.html Initiates the vertical curve transition from the current distance. ```text Gradient.BeginTransition(); ``` -------------------------------- ### Begin Continuous Structure Placement with Default Position Source: https://bvets.net/jp/edit/formats/route/map.html Starts continuous placement of structures with default X, Y, Z coordinates (0). ```plaintext Repeater[_repeaterKey_].Begin0(_trackKey, tilt, span, interval, structureKey1, structureKey2, ... , structureKeyN_) ``` -------------------------------- ### Starting Cant Transition Source: https://bvets.net/jp/edit/formats/route/map.html Initiates the cant transition from the current distance for curves or other tracks. ```text Curve.BeginTransition(); ``` ```text Track[_trackKey_].Cant.BeginTransition(); ``` -------------------------------- ### Begin Speed Limit Source: https://bvets.net/jp/edit/formats/route/map.html Starts a speed limit from the current distance. Use Structure.Put to place speed limit sign structures. ```plaintext SpeedLimit.Begin(_v_) ``` -------------------------------- ### Begin Continuous Structure Placement Source: https://bvets.net/jp/edit/formats/route/map.html Starts continuous placement of structures along a track at a specified interval. Structures are selected cyclically if multiple are provided. ```plaintext Repeater[_repeaterKey_].Begin(_trackKey, x, y, z, rx, ry, rz, tilt, span, interval, structureKey1, structureKey2, ... , structureKeyN_) ``` -------------------------------- ### Station List File Header Example Source: https://bvets.net/jp/edit/formats/route/station.html Defines the file format version and character encoding. If encoding is omitted, UTF-8 is assumed. Ensure no spaces around the colon. ```text BveTs Station List 2.00:_encoding_ ``` ```text BveTs Station List 2.00:shift_jis ``` -------------------------------- ### Repeater for Continuous Structure Placement Source: https://bvets.net/jp/edit/formats/route/map.html Configure and start continuous placement of structures along a track at specified intervals. ```APIDOC ## Repeater for Continuous Structure Placement ### Begin Repeater Starts continuous placement of structures from the current distance. #### Method `Repeater[_repeaterKey_].Begin(_trackKey, x, y, z, rx, ry, rz, tilt, span, interval, structureKey1, structureKey2, ... , structureKeyN_)` #### Parameters - `_repeaterKey_` (string) - Name of the repeater. - `_trackKey_` (integer) - Target track name (0: current track). - `_x_` (float) - X-coordinate from the track [m]. - `_y_` (float) - Y-coordinate from the track [m]. - `_z_` (float) - Z-coordinate from the track [m]. - `_rx_` (float) - Angle around the X-axis relative to the track [deg]. - `_ry_` (float) - Angle around the Y-axis relative to the track [deg]. - `_rz_` (float) - Angle around the Z-axis relative to the track [deg]. - `_tilt_` (integer) - Tilt option (0: always horizontal, 1: follow gradient, 2: follow cant, 3: follow gradient and cant). - `_span_` (float) - Chord length in curves [m]. - `_interval_` (float) - Placement interval [m]. - `_structureKey1, ... , structureKeyN_` (string) - Names of structures to place sequentially. ### Begin Repeater (Simplified) Starts continuous placement of structures with default position (0,0,0) and orientation. #### Method `Repeater[_repeaterKey_].Begin0(_trackKey, tilt, span, interval, structureKey1, structureKey2, ... , structureKeyN_)` #### Parameters - `_repeaterKey_` (string) - Name of the repeater. - `_trackKey_` (integer) - Target track name (0: current track). - `_tilt_` (integer) - Tilt option. - `_span_` (float) - Chord length in curves [m]. - `_interval_` (float) - Placement interval [m]. - `_structureKey1, ... , structureKeyN_` (string) - Names of structures to place sequentially. ### End Repeater Ends the continuous placement of structures at the current distance. #### Method `Repeater[_repeaterKey_].End()` #### Parameters - `_repeaterKey_` (string) - Name of the repeater. ``` -------------------------------- ### Starting Circular Curve Source: https://bvets.net/jp/edit/formats/route/map.html Starts a circular curve from the current distance. If setting cant, Curve.BeginTransition must be specified beforehand. Use Curve.BeginCircular for older versions. ```text Curve.Begin(_radius, cant_); ``` ```text Curve.BeginCircular(_radius, cant_); ``` ```text Curve.Begin(_radius_); ``` -------------------------------- ### File Header with Shift_JIS Encoding Source: https://bvets.net/jp/edit/formats/route/signal.html Specifies the file format and character encoding. This example shows the header for a file using Shift_JIS encoding. ```text BveTs Signal Aspects List 2.00:shift_jis ``` -------------------------------- ### Gradient Commands Source: https://bvets.net/jp/edit/formats/route/map.html Commands for defining and manipulating gradients, including starting transitions, setting constant gradients, ending gradients, and interpolating gradient values. ```APIDOC ## Gradient Commands ### BeginTransition Starts a vertical curve from the current distance. ### Begin Ends the vertical curve at the current distance and maintains a constant gradient. - **_gradient_**: Gradient [‰] ### BeginConst Ends the vertical curve at the current distance and maintains a constant gradient. - **_gradient_**: Gradient [‰] ### End Ends the gradient at the current distance and starts a level (horizontal) line. ### Interpolate Sets the gradient at the current distance. The gradient between two `Gradient.Interpolate` calls is linearly interpolated. If arguments are omitted, the value of the previous `Gradient.Interpolate` is used. - **_gradient_**: Gradient [‰] ``` -------------------------------- ### Structure List File Header Example (Shift_JIS) Source: https://bvets.net/jp/edit/formats/route/structure.html Specifies the file format and character encoding (Shift_JIS) for the structure list file. The character encoding must follow the format identifier immediately after a colon. ```text BveTs Structure List 2.00:shift_jis ``` -------------------------------- ### Starting Constant Gradient Source: https://bvets.net/jp/edit/formats/route/map.html Ends the vertical curve at the current distance and maintains a constant gradient. Use Gradient.BeginConst for older versions. ```text Gradient.Begin(_gradient_); ``` ```text Gradient.BeginConst(_gradient_); ``` -------------------------------- ### Begin New Section Source: https://bvets.net/jp/edit/formats/route/map.html Starts a new section (block) from the current distance, defining signal indices for preceding trains. ```plaintext Section.Begin(_signal0_ , _signal1_ , ... , _signalN_) ``` ```plaintext Section.BeginNew(_signal0_ , _signal1_ , ... , _signalN_) ``` -------------------------------- ### Comments in Map Files Source: https://bvets.net/jp/edit/formats/route/map.html Lines starting with '#' or '//' are treated as comments and ignored during file loading. Comments do not support delimiters. ```text 345; # 円曲線終了 ``` -------------------------------- ### Map File Header and Encoding Source: https://bvets.net/jp/edit/formats/route/map.html The first line of a map file must be the file header, followed by the character encoding. UTF-8 is assumed if encoding is omitted. Shift_JIS encoding is shown as an example. ```text BveTs Map 2.02:utf-8 ``` ```text BveTs Map 2.02:shift_jis ``` -------------------------------- ### Ending Curve and Starting Straight Source: https://bvets.net/jp/edit/formats/route/map.html Ends a curve at the current distance and begins a straight section. ```text Curve.End(); ``` -------------------------------- ### Background and Station Configuration Source: https://bvets.net/jp/edit/formats/route/map.html Change the background and define station stop points. ```APIDOC ## Background and Station Configuration ### Change Background Changes the background using a specified structure key. #### Method `Background.Change(_structureKey_)` #### Parameters - `_structureKey_` (string) - Name of the structure to use for the background. ### Load Stations Defines stations based on a station list file. #### Method `Station.Load(_filePath_)` #### Parameters - `_filePath_` (string) - Relative path to the station list file. ### Place Station Sets the stopping position for a train at the current distance. #### Method `Station[_stationKey_].Put(_door, margin1, margin2_)` #### Parameters - `_stationKey_` (string) - Name of the station (defined in the station list file). - `_door_` (integer) - Direction of the opening door (-1: left, 1: right). - `_margin1_` (float) - Allowable backward range for stopping position error (set as a negative value). - `_margin2_` (float) - Allowable forward range for stopping position error. ``` -------------------------------- ### Structure Loading and Placement Source: https://bvets.net/jp/edit/formats/route/map.html Load structure definitions from a file and place individual structures or groups of structures along a track. ```APIDOC ## Structure Loading and Placement ### Load Structures Loads structure definitions from a specified file. #### Method `Structure.Load(_filePath_)` #### Parameters - `_filePath_` (string) - Relative path to the structure list file. ### Place Structure Places a single structure at a specified location and orientation. #### Method `Structure[_structureKey_].Put(_trackKey, x, y, z, rx, ry, rz, tilt, span_)` #### Parameters - `_structureKey_` (string) - Name of the structure (defined in the structure list file). - `_trackKey_` (integer) - Target track name (0: current track). - `_x_` (float) - X-coordinate from the track [m]. - `_y_` (float) - Y-coordinate from the track [m]. - `_z_` (float) - Z-coordinate from the current distance [m]. - `_rx_` (float) - Angle around the X-axis relative to the track [deg]. - `_ry_` (float) - Angle around the Y-axis relative to the track [deg]. - `_rz_` (float) - Angle around the Z-axis relative to the track [deg]. - `_tilt_` (integer) - Tilt option (0: always horizontal, 1: follow gradient, 2: follow cant, 3: follow gradient and cant). - `_span_` (float) - Chord length in curves [m]. ### Place Structure (Simplified) Places a structure with default position (0,0,0) and orientation. #### Method `Structure[_structureKey_].Put0(_trackKey, tilt, span_)` #### Parameters - `_structureKey_` (string) - Name of the structure. - `_trackKey_` (integer) - Target track name (0: current track). - `_tilt_` (integer) - Tilt option. - `_span_` (float) - Chord length in curves [m]. ### Place Structure Between Tracks Places a structure between two tracks, deforming based on the distance between them. #### Method `Structure[_structureKey_].PutBetween(_trackKey1, trackKey2_)` or `Structure[_structureKey_].PutBetween(_trackKey1, trackKey2_, _flag_)` #### Parameters - `_structureKey_` (string) - Name of the structure. - `_trackKey1_` (integer) - Name of one track (0: current track). - `_trackKey2_` (integer) - Name of the other track. - `_flag_` (integer, optional) - Deformation direction (0: deform in x and y, 1: deform in x only). ``` -------------------------------- ### Load Source: https://bvets.net/jp/edit/formats/vehicle/atsfunctions.html This function is called when the plugin is loaded into the simulation. ```APIDOC ## Load ### Description This function is called when the plugin is loaded. ### Method `Load()` ### Parameters None ``` -------------------------------- ### Sound Settings Source: https://bvets.net/jp/edit/formats/route/map.html Manages loading and playing of various sounds, including ambient, 3D, rolling noise, flange squeal, and joint noise. ```APIDOC ## Sound ### Load Sound List `Sound.Load(_filePath_)` Loads sounds based on the sound list file. * _filePath_: Relative path to the sound list file. ### Play Sound `Sound[_soundKey_].Play()` Plays a sound once when passing the current distance. ### Load 3D Sound List `Sound3D.Load(_filePath_)` Loads sounds based on the sound list file. * _filePath_: Relative path to the sound list file. ### Place 3D Sound Source `Sound3D[_soundKey_].Put(_x, y_)` Places a fixed sound source on the ground at the current distance. The sound plays continuously. * _x_: X-coordinate from the track [m] * _y_: Y-coordinate from the track [m] ### Rolling Noise `RollingNoise.Change(_index_)` Sets the wheel rolling noise from the current distance onwards. * _index_: Index defined in the [Run] section of the vehicle sound file. ### Flange Squeal Noise `FlangeNoise.Change(_index_)` Sets the flange squeal noise from the current distance onwards. * _index_: Index defined in the [Flange] section of the vehicle sound file. ### Joint Noise `JointNoise.Play(_index_)` Plays joint noise according to the running speed when passing the current distance. * _index_: Index defined in the [Joint] section of the vehicle sound file. ``` -------------------------------- ### Load Structure List Source: https://bvets.net/jp/edit/formats/route/map.html Loads structures from a structure list file. This must be called before using structure placement syntax. ```plaintext Structure.Load(_filePath_) ``` -------------------------------- ### Assign Value to Variable Source: https://bvets.net/jp/edit/formats/route/map.html Assigns a numerical or string value to a variable. Variable names must start with '$' and can contain alphanumeric characters and underscores. Strings must be enclosed in single quotes. ```mapscript $foo = 1.067; ``` ```mapscript $bar = 'Hello'; ``` -------------------------------- ### Use Variable in Function Call Source: https://bvets.net/jp/edit/formats/route/map.html Uses a variable's value as an argument or key in a function call. The example shows substituting a string variable for a track key and a numerical variable for a gauge value. ```mapscript Track[$bar].Gauge($foo); # Track['Hello'].Gauge(1.067) と書いたことと同じです。 ``` -------------------------------- ### KeyUp Source: https://bvets.net/jp/edit/formats/vehicle/atsfunctions.html Called when an ATS key is released. It receives the key code. ```APIDOC ## KeyUp ### Description Called when an ATS key is released. It receives the key code. ### Method `KeyUp(_atsKeyCode_)` ### Parameters - `_atsKeyCode_` (int): The ATS key code. Can be one of: - `ATS_KEY_S`: S button (default Space) - `ATS_KEY_A1`: A1 button (default Insert) - `ATS_KEY_A2`: A2 button (default Delete) - `ATS_KEY_B1`: B1 button (default Home) - `ATS_KEY_B2`: B2 button (default End) - `ATS_KEY_C1`: C1 button (default Page Up) - `ATS_KEY_C2`: C2 button (default Page Down) - `ATS_KEY_D`: D button - `ATS_KEY_E`: E button - `ATS_KEY_F`: F button - `ATS_KEY_G`: G button - `ATS_KEY_H`: H button - `ATS_KEY_I`: I button - `ATS_KEY_J`: J button - `ATS_KEY_K`: K button - `ATS_KEY_L`: L button ``` -------------------------------- ### Load Station List Source: https://bvets.net/jp/edit/formats/route/map.html Loads station definitions from a station list file. This must be called before using station placement syntax. ```plaintext Station.Load(_filePath_) ``` -------------------------------- ### Ground Signal Placement Source: https://bvets.net/jp/edit/formats/route/map.html Load signal aspect definitions and place ground signals. ```APIDOC ## Ground Signal Placement ### Load Signal Aspects Defines signal aspects based on a signal aspect list file. #### Method `Signal.Load(_filePath_)` #### Parameters - `_filePath_` (string) - Relative path to the signal aspect list file. ### Place Ground Signal Places a ground signal at the current distance. #### Method `Signal[_signalAspectKey_].Put(_section, trackKey, x, y)` or `Signal[_signalAspectKey_].Put(_section, trackKey, x, y, z, rx, ry, rz, tilt, span_)` #### Parameters - `_signalAspectKey_` (string) - Name of the signal aspect (defined in the signal aspect list file). - `_section_` (integer) - Relative index of the associated section. - `_trackKey_` (integer) - Target track name. - `_x_` (float) - X-coordinate from the track [m]. - `_y_` (float) - Y-coordinate from the track [m]. - `_z_` (float, optional) - Z-coordinate from the track [m]. - `_rx_` (float, optional) - Angle around the X-axis relative to the track [deg]. - `_ry_` (float, optional) - Angle around the Y-axis relative to the track [deg]. - `_rz_` (float, optional) - Angle around the Z-axis relative to the track [deg]. - `_tilt_` (integer, optional) - Tilt option (0: always horizontal, 1: follow gradient, 2: follow cant, 3: follow gradient and cant). - `_span_` (float, optional) - Chord length in curves [m]. ``` -------------------------------- ### Place 3D Sound Source Source: https://bvets.net/jp/edit/formats/route/map.html Places a fixed 3D sound source at the current distance. The sound will play continuously. Coordinates are relative to the track. ```mapscript Sound3D[_soundKey_].Put(_x, y_) ``` -------------------------------- ### Load Signal Aspect List Source: https://bvets.net/jp/edit/formats/route/map.html Loads signal aspect definitions from a signal aspect list file. This must be called before using signal placement syntax. ```plaintext Signal.Load(_filePath_) ``` -------------------------------- ### GetPluginVersion Source: https://bvets.net/jp/edit/formats/vehicle/atsfunctions.html Returns the ATS format version the plugin adheres to. It should always return ATS_VERSION. ```APIDOC ## GetPluginVersion ### Description Returns the ATS format version the plugin adheres to. It should always return ATS_VERSION. ### Method `GetPluginVersion()` ### Parameters None ### Returns - `int`: The format version (should be ATS_VERSION). ``` -------------------------------- ### Basic Statement Syntax Source: https://bvets.net/jp/edit/formats/route/map.html Statements define map elements and functions, ending with a semicolon. Multiple statements can be on one line, and whitespace can be inserted between tokens. ```text Curve.SetGauge(1.067); ``` ```text Track['Right'].X.Interpolate(3.8); ``` ```text 123; Curve.BeginTransition(); SpeedLimit.Begin(90); ``` ```text Track [ 'Right' ] . Cant . BeginTransition ( ) ; 234 ; ``` -------------------------------- ### Load Sound Source: https://bvets.net/jp/edit/formats/route/map.html Loads sounds based on a sound list file. The filePath is a relative path to the sound list file. ```mapscript Sound.Load(_filePath_) ``` -------------------------------- ### Station List Data Structure Source: https://bvets.net/jp/edit/formats/route/station.html Defines the parameters for each station entry in the list. Each parameter has a specific meaning and format. ```text _stationKey1, stationName1, arrivalTime1, depertureTime1, stoppageTime1, defaultTime1, signalFlag1, alightingTime1, passengers1, arrivalSoundKey1, depertureSoundKey1, doorReopen1, stuckInDoor1 ``` ```text stationKey2, stationName2, arrivalTime2, depertureTime2, stoppageTime2, defaultTime2, signalFlag2, alightingTime2, passengers2, arrivalSoundKey2, depertureSoundKey2, doorReopen2, stuckInDoor2 ``` ```text ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ... ``` -------------------------------- ### Setting Cant Transition Function Source: https://bvets.net/jp/edit/formats/route/map.html Sets the cant transition function for the current distance onwards. Function 0 is sine half-wavelength decay, and function 1 is linear decay. ```text Curve.SetFunction(_id_); ``` ```text Track[_trackKey_].Cant.SetFunction(_id_); ``` -------------------------------- ### KeyDown Source: https://bvets.net/jp/edit/formats/vehicle/atsfunctions.html Called when an ATS key is pressed. It receives the key code. ```APIDOC ## KeyDown ### Description Called when an ATS key is pressed. It receives the key code. ### Method `KeyDown(_atsKeyCode_)` ### Parameters - `_atsKeyCode_` (int): The ATS key code. Can be one of: - `ATS_KEY_S`: S button (default Space) - `ATS_KEY_A1`: A1 button (default Insert) - `ATS_KEY_A2`: A2 button (default Delete) - `ATS_KEY_B1`: B1 button (default Home) - `ATS_KEY_B2`: B2 button (default End) - `ATS_KEY_C1`: C1 button (default Page Up) - `ATS_KEY_C2`: C2 button (default Page Down) - `ATS_KEY_D`: D button - `ATS_KEY_E`: E button - `ATS_KEY_F`: F button - `ATS_KEY_G`: G button - `ATS_KEY_H`: H button - `ATS_KEY_I`: I button - `ATS_KEY_J`: J button - `ATS_KEY_K`: K button - `ATS_KEY_L`: L button ``` -------------------------------- ### Fog Effects Source: https://bvets.net/jp/edit/formats/route/map.html Configures fog effects, including density and color, with interpolation between settings. ```APIDOC ## Fog Effects `Fog.Interpolate(_density_, _red, _green, _blue_)` [Deprecated] `Fog.Set(_density_, _red, _green, _blue_)` `Fog.Interpolate(_density_)` NEW `Fog.Interpolate()` NEW Sets the fog effect at the current distance. Linear interpolation occurs between two `Fog.Interpolate` calls. * _density_: Density * _red_: Red component (0 ~ 1) * _green_: Green component (0 ~ 1) * _blue_: Blue component (0 ~ 1) ``` -------------------------------- ### Section and Signal Configuration Source: https://bvets.net/jp/edit/formats/route/map.html Define track sections and set speed limits for signals. ```APIDOC ## Section and Signal Configuration ### Begin Section Starts a new track section from the current distance. #### Method `Section.Begin(_signal0_ , _signal1_ , ... , _signalN_)` or `Section.BeginNew(_signal0_ , _signal1_ , ... , _signalN_)` #### Parameters - `_signal0_` to `_signalN_` (integer) - Signal index indicating the presence of a preceding train in 0 to N sections ahead. ### Set Speed Limit Sets the permissible speed for signal aspects. #### Method `Section.SetSpeedLimit(_v0_ , _v1_ , ... , _vn_)` or `Signal.SpeedLimit(_v0_ , _v1_ , ... , _vn_)` #### Parameters - `_v0_` to `_vn_` (float) - Permissible speed [km/h] (null indicates no speed limit). ``` -------------------------------- ### Curve Commands Source: https://bvets.net/jp/edit/formats/route/map.html Commands for defining and manipulating curves, including setting gauge, transition curves, circular curves, and interpolation. ```APIDOC ## Curve Commands ### SetGauge Sets the track gauge from the current distance onwards. This value is used to convert cant to an angle. - **_value_**: Track gauge [m] ### SetCenter Sets the cant's rotation center position from the current distance onwards. - **_x_**: Rotation center's x-coordinate [m] (Positive: inside of the curve, Negative: outside of the curve) ### SetFunction Sets the transition curve function from the current distance onwards. - **_id_**: Function number (0: Sine half-wavelength decay, 1: Linear decay) ### BeginTransition Starts the transition curve of a planar curve from the current distance. ### Begin Starts a circular curve of a planar curve from the current distance. To set cant, `Curve.BeginTransition` must be described before this. - **_radius_**: Curve radius [m] (Positive: right curve, Negative: left curve) - **_cant_**: Cant [m] ### BeginCircular Starts a circular curve of a planar curve from the current distance. - **_radius_**: Curve radius [m] (Positive: right curve, Negative: left curve) - **_cant_**: Cant [m] ### End Ends the planar curve at the current distance and starts a straight line. ### Interpolate Sets the radius and cant of the planar curve at the current distance. Interpolation occurs between the previous `Curve.Interpolate` or `Curve.Change`. The interpolation function is set by `Curve.SetFunction`. If arguments are omitted, the value of the previous `Curve.Interpolate` is used. - **_radius_**: Curve radius [m] (Positive: right curve, Negative: left curve, 0: straight line) - **_cant_**: Cant [m] ### Change Sets the radius of the planar curve from the current distance onwards. Equivalent to `Curve.Begin(_radius_)`. - **_radius_**: Curve radius [m] (Positive: right curve, Negative: left curve, 0: straight line) ``` -------------------------------- ### Light Settings Source: https://bvets.net/jp/edit/formats/route/map.html Controls ambient and diffuse lighting, as well as the direction of directional light. ```APIDOC ## Light Settings ### Ambient Light `Light.Ambient(_red, green, blue_)` Sets the color of the ambient light. This syntax can only be described once in the map file. * _red_: Red component (0 ~ 1) * _green_: Green component (0 ~ 1) * _blue_: Blue component (0 ~ 1) ### Diffuse Light `Light.Diffuse(_red, green, blue_)` Sets the color of the directional light (diffuse color). This syntax can only be described once in the map file. * _red_: Red component (0 ~ 1) * _green_: Green component (0 ~ 1) * _blue_: Blue component (0 ~ 1) ### Light Direction `Light.Direction(_pitch, yaw_)` Sets the direction the directional light points at distance 0. This syntax can only be described once in the map file. * _pitch_: Pitch angle * _yaw_: Yaw angle ``` -------------------------------- ### Dispose Source: https://bvets.net/jp/edit/formats/vehicle/atsfunctions.html This function is called when the plugin is unloaded from the simulation. ```APIDOC ## Dispose ### Description This function is called when the plugin is unloaded. ### Method `Dispose()` ### Parameters None ``` -------------------------------- ### Change Background Source: https://bvets.net/jp/edit/formats/route/map.html Changes the background using a specified structure key. ```plaintext Background.Change(_structureKey_) ``` -------------------------------- ### DoorOpen Source: https://bvets.net/jp/edit/formats/vehicle/atsfunctions.html Called when the passenger doors are opened. ```APIDOC ## DoorOpen ### Description Called when the passenger doors are opened. ### Method `DoorOpen()` ### Parameters None ``` -------------------------------- ### Place Structure with Default Position Source: https://bvets.net/jp/edit/formats/route/map.html Places a structure at the current distance with default X, Y, Z coordinates (0). ```plaintext Structure[_structureKey_].Put0(_trackKey, tilt, span_) ``` -------------------------------- ### Load 3D Sound Source: https://bvets.net/jp/edit/formats/route/map.html Loads 3D sounds based on a sound list file. The filePath is a relative path to the sound list file. ```mapscript Sound3D.Load(_filePath_) ``` -------------------------------- ### Operator Precedence Source: https://bvets.net/jp/edit/formats/route/map.html Demonstrates operator precedence in expressions. Parentheses have the highest priority, followed by unary operators, then multiplication/division, and finally addition/subtraction. ```mapscript 1 - 2 * -(3 + 4) ``` -------------------------------- ### File Header with Default UTF-8 Encoding Source: https://bvets.net/jp/edit/formats/route/signal.html Specifies the file format and character encoding. If the encoding is omitted, UTF-8 is assumed. ```text BveTs Signal Aspects List 2.00 ``` -------------------------------- ### Play Sound Source: https://bvets.net/jp/edit/formats/route/map.html Plays a sound once when the current distance is passed. The soundKey refers to a sound defined in the sound list. ```mapscript Sound[_soundKey_].Play() ``` -------------------------------- ### Elapse Source: https://bvets.net/jp/edit/formats/vehicle/atsfunctions.html Called every frame to update the simulation state. It receives vehicle state, panel information, and sound parameters. ```APIDOC ## Elapse ### Description Called every frame to update the simulation state. It receives vehicle state, panel information, and sound parameters. ### Method `Elapse(_vehicleState_, _panel_, _sound_)` ### Parameters - `_vehicleState_` (ATS_VEHICLESTATE): The current state of the vehicle. - `_panel_` (int[]): Values to be passed to the panel display. - `_sound_` (int[]): Sound volume in dB/100 or control values for sound playback: - `ATS_SOUND_PLAY`: Play once - `ATS_SOUND_PLAYLOOPING`: Play looping - `ATS_SOUND_STOP`: Stop playback - `ATS_SOUND_CONTINUE`: Maintain current state ### Returns - `ATS_HANDLES`: Control values to be passed back to Bve trainsim. ``` -------------------------------- ### SetPower Source: https://bvets.net/jp/edit/formats/vehicle/atsfunctions.html Called when the power handle is manipulated. It receives the selected notch. ```APIDOC ## SetPower ### Description Called when the power handle is manipulated. It receives the selected notch. ### Method `SetPower(_notch_)` ### Parameters - `_notch_` (int): The selected power notch. ``` -------------------------------- ### Changing Curve Radius Source: https://bvets.net/jp/edit/formats/route/map.html Sets the curve radius from the current distance onwards, equivalent to Curve.Begin(_radius_). ```text Curve.Change(_radius_); ``` -------------------------------- ### Speed Limit Configuration Source: https://bvets.net/jp/edit/formats/route/map.html Set and end speed limits at specific distances. ```APIDOC ## Speed Limit Configuration ### Begin Speed Limit Starts a speed limit from the current distance. #### Method `SpeedLimit.Begin(_v_)` #### Parameters - `_v_` (float) - Permissible speed [km/h]. ### End Speed Limit Ends the speed limit at the current distance. #### Method `SpeedLimit.End()` ``` -------------------------------- ### Beacon Definition Source: https://bvets.net/jp/edit/formats/route/map.html Define transmission events for beacons at a specific distance. ```APIDOC ## Beacon Definition ### Place Beacon Defines the transmission event for a beacon at the current distance. #### Method `Beacon.Put(_type_ , _section_ , _sendData_)` #### Parameters - `_type_` (integer) - Beacon type sent to the safety device. - `_section_` (integer) - Relative index of the associated section. - `_sendData_` (integer) - Value sent to the safety device. ``` -------------------------------- ### Include Other Map Files Source: https://bvets.net/jp/edit/formats/route/map.html Insert the content of another map file at the current location using the include directive. The included map file must also have a header, but the header itself will not be inserted. ```map include 'submap.txt'; ``` -------------------------------- ### Other Track Commands Source: https://bvets.net/jp/edit/formats/route/map.html Commands for defining the position, gauge, cant, and other properties of other tracks relative to the main track. ```APIDOC ## Other Track Commands ### Track[trackKey].X.Interpolate Sets the x-direction position of another track at the current distance. The x-coordinate between two `Track[].X.Interpolate` calls is interpolated. If arguments are omitted, the value of the previous `Track[].X.Interpolate` is used. - **_trackKey_**: Track name (any string) - **_x_**: x-coordinate from the main track [m] - **_radius_**: Relative radius of the planar curve with the main track from the current distance onwards [m] (0: straight line) ### Track[trackKey].Y.Interpolate Sets the y-direction position of another track at the current distance. The y-coordinate between two `Track[].Y.Interpolate` calls is interpolated. If arguments are omitted, the value of the previous `Track[].Y.Interpolate` is used. - **_trackKey_**: Track name (any string) - **_y_**: y-coordinate from the main track [m] - **_radius_**: Relative radius of the vertical curve with the main track from the current distance onwards [m] (0: straight line) ### Track[trackKey].Position Sets the position of another track at the current distance. This is equivalent to describing `Track[].X.Interpolate` and `Track[].Y.Interpolate` simultaneously. However, if arguments are omitted, 0 is assigned. - **_trackKey_**: Track name (any string) - **_x_**: x-coordinate from the main track [m] - **_y_**: y-coordinate from the main track [m] - **_radiusH_**: Relative radius of the planar curve with the main track from the current distance onwards [m] (0: straight line) - **_radiusV_**: Relative radius of the vertical curve with the main track from the current distance onwards [m] (0: straight line) ### Track[trackKey].Cant.SetGauge Sets the track gauge of another track from the current distance onwards. This value is used to convert cant to an angle. - **_trackKey_**: Track name (any string) - **_gauge_**: Track gauge [m] ### Track[trackKey].Cant.SetCenter Sets the rotation center position of the cant for another track from the current distance onwards. - **_trackKey_**: Track name (any string) - **_x_**: Rotation center's x-coordinate [m] (Positive: inside of the curve, Negative: outside of the curve) ### Track[trackKey].Cant.SetFunction Sets the cant decay function for another track from the current distance onwards. - **_trackKey_**: Track name (any string) - **_id_**: Function number (0: Sine half-wavelength decay, 1: Linear decay) ### Track[trackKey].Cant.BeginTransition Starts the cant decay for another track from the current distance. - **_trackKey_**: Track name (any string) ### Track[trackKey].Cant.Begin Ends the cant decay for another track at the current distance and maintains a constant cant. - **_trackKey_**: Track name (any string) - **_cant_**: Cant [m] (Positive: tilt to the right, Negative: tilt to the left) ### Track[trackKey].Cant.End Ends the cant for another track at the current distance. - **_trackKey_**: Track name (any string) ### Track[trackKey].Cant.Interpolate Sets the cant for another track at the current distance. The cant between two `Track[].Cant.Interpolate` calls is interpolated. The interpolation function is set by `Track[].Cant.SetFunction`. If arguments are omitted, the value of the previous `Track[].Cant.Interpolate` is used. - **_trackKey_**: Track name (any string) - **_cant_**: Cant [m] (Positive: tilt to the right, Negative: tilt to the left) ``` -------------------------------- ### End Continuous Structure Placement Source: https://bvets.net/jp/edit/formats/route/map.html Ends the continuous placement of structures at the current distance. ```plaintext Repeater[_repeaterKey_].End() ``` -------------------------------- ### Place Structure Source: https://bvets.net/jp/edit/formats/route/map.html Places a structure at the current distance. Specifies detailed positioning and orientation. ```plaintext Structure[_structureKey_].Put(_trackKey, x, y, z, rx, ry, rz, tilt, span_) ``` -------------------------------- ### Preceding Train Configuration Source: https://bvets.net/jp/edit/formats/route/map.html Set the passing time for a preceding train. ```APIDOC ## Preceding Train Configuration ### Set Preceding Train Pass Time Sets the time at which a preceding train passes the current distance. #### Method `PreTrain.Pass(_time_)` or `PreTrain.Pass(_second_)` #### Parameters - `_time_` (string) - Time in 'hh:mm:ss' format. - `_second_` (float) - Elapsed time in seconds from 00:00:00. ``` -------------------------------- ### SetBeaconData Source: https://bvets.net/jp/edit/formats/vehicle/atsfunctions.html Called when passing over a track beacon. It receives the data transmitted by the beacon. ```APIDOC ## SetBeaconData ### Description Called when passing over a track beacon. It receives the data transmitted by the beacon. ### Method `SetBeaconData(_beaconData_)` ### Parameters - `_beaconData_` (ATS_BEACONDATA): The information received by the on-board equipment. ``` -------------------------------- ### Define Beacon Transmission Source: https://bvets.net/jp/edit/formats/route/map.html Defines a beacon transmission event at the current distance. Use Structure.Put to place beacon structures. ```plaintext Beacon.Put(_type_ , _section_ , _sendData_) ``` -------------------------------- ### ATS_HANDLES Structure Source: https://bvets.net/jp/edit/formats/vehicle/atsstructs.html Defines control values passed to Bve trainsim for handle manipulation, such as brake, power, and reverser. ```APIDOC ## ATS_HANDLES ### Description Control values to be passed to Bve trainsim. ### Members - **Brake** (int) - Brake notch. - **Power** (int) - Power notch. - **Reverser** (int) - Reverser position. - **ConstantSpeed** (int) - State of constant speed control. Possible values are: - ATS_CONSTANTSPEED_ENABLE: Enable - ATS_CONSTANTSPEED_DISABLE: Disable - ATS_CONSTANTSPEED_CONTINUE: Maintain current state ``` -------------------------------- ### Arithmetic Operations with Variables Source: https://bvets.net/jp/edit/formats/route/map.html Performs arithmetic operations using variables. Supports addition, subtraction, multiplication, division, and modulo. '+' operator performs string concatenation if operands are strings. ```mapscript $foo = 1 + 2; # $foo = 3 と等価です。 ``` ```mapscript Curve.Gauge(1067 / 1000); # Curve.Gauge(1.067) と等価です。 ``` ```mapscript $bar = 'Hello' + 'World'; # $bar = 'HelloWorld' と等価です。 ``` ```mapscript Track[$bar + 10].Gauge(1.067); # Track['HelloWorld10'].Gauge(1.067) と等価です。 ``` ```mapscript $bar = 1 + 2 + '3' # $bar = '33' と等価です。 ``` -------------------------------- ### Adhesion Characteristics Source: https://bvets.net/jp/edit/formats/route/map.html Sets the adhesion characteristics between wheels and rails from the current distance onwards. ```APIDOC ## Adhesion Characteristics `Adhesion.Change(_a_)` `Adhesion.Change(_a_, _b_, _c_) Sets the adhesion characteristics between wheels and rails from the current distance onwards. * _a_: Adhesion coefficient at 0 km/h running speed * _b_: Coefficient representing the change in adhesion coefficient with running speed * _c_: Coefficient representing the change in adhesion coefficient with running speed Where, v: Running speed [km/h] ``` -------------------------------- ### Place Structure Between Tracks Source: https://bvets.net/jp/edit/formats/route/map.html Places a structure between two tracks, deforming based on the distance between them. Supports specifying deformation direction. ```plaintext Structure[_structureKey_].PutBetween(_trackKey1, trackKey2, flag_) ``` ```plaintext Structure[_structureKey_].PutBetween(_trackKey1, trackKey2_) ``` -------------------------------- ### Define Beacon Data Source: https://bvets.net/jp/edit/formats/vehicle/atsstructs.html ATS_BEACONDATA structures the information received from trackside beacons, including the beacon type, associated signal, distance to the next section, and any optional data. ```cpp struct ATS_BEACONDATA { int Type; int Signal; float Distance; int Optional; }; ``` -------------------------------- ### Set Section Speed Limit Source: https://bvets.net/jp/edit/formats/route/map.html Sets the permissible speed for signal aspects. Use null for no speed limit. ```plaintext Section.SetSpeedLimit(_v0_ , _v1_ , ... , _vn_) ``` ```plaintext Signal.SpeedLimit(_v0_ , _v1_ , ... , _vn_) ``` -------------------------------- ### Interpolate Cab Illuminance Source: https://bvets.net/jp/edit/formats/route/map.html Sets the brightness of the driver's cab at the current distance. Linear interpolation occurs between two CabIlluminance.Interpolate calls. The older CabIlluminance.Set syntax is also supported. ```mapscript CabIlluminance.Interpolate(_value_) ``` ```mapscript CabIlluminance.Set(_value_) ``` ```mapscript CabIlluminance.Interpolate() ``` -------------------------------- ### Signal Aspects List File Structure Source: https://bvets.net/jp/edit/formats/route/signal.html Defines the basic structure of a signal aspects list file, including signal aspect names and their associated structure names. The 'g' suffix indicates glare aspects. ```text 信号現示名1, ストラクチャー名11, ストラクチャー名12, ..., ストラクチャー名1N , ストラクチャー名11g, ストラクチャー名12g, ..., ストラクチャー名Ng 信号現示名2, ストラクチャー名21, ストラクチャー名22, ..., ストラクチャー名2N , ストラクチャー名21g, ストラクチャー名22g, ..., ストラクチャー名2Ng _..., ... ``` -------------------------------- ### Multi-line and Case-Insensitive Statements Source: https://bvets.net/jp/edit/formats/route/map.html Statements can span multiple lines by inserting line breaks between tokens. The syntax is case-insensitive. ```text Curve.Begin( 600, 0.105 ); ``` ```text TRACK['RIGHT'].CANT.BEGIN(0.105); ``` -------------------------------- ### ATS_BEACONDATA Structure Source: https://bvets.net/jp/edit/formats/vehicle/atsstructs.html Holds information received from track beacons, including type, signal, distance to the next section, and optional data. ```APIDOC ## ATS_BEACONDATA ### Description Information received from trackside beacons. ### Members - **Type** (int) - Type of the trackside beacon. - **Signal** (int) - Signal of the corresponding section. - **Distance** (float) - Distance to the corresponding section in meters [m]. - **Optional** (int) - Optional value set in the trackside beacon. ``` -------------------------------- ### Place Ground Signal Source: https://bvets.net/jp/edit/formats/route/map.html Places a ground signal at the current distance. Associates it with a section and track. ```plaintext Signal[_signalAspectKey_].Put(_section, trackKey, x, y) ``` ```plaintext Signal[_signalAspectKey_].Put(_section, trackKey, x, y, z, rx, ry, rz, tilt, span_) ``` -------------------------------- ### Set Ambient Light Color Source: https://bvets.net/jp/edit/formats/route/map.html Sets the ambient light color for the map. This can only be set once per map file. ```mapscript Light.Ambient(_red, green, blue_) ``` -------------------------------- ### Setting Other Track Position Source: https://bvets.net/jp/edit/formats/route/map.html Sets the position of another track at the current distance. This is equivalent to calling Track[].X.Interpolate and Track[].Y.Interpolate simultaneously. Omitted arguments default to 0. ```text Track[_trackKey_].Position(_x, y_ _, radiusH, radiusV_); ``` ```text Track[_trackKey_].Position(_x, y_ _, radiusH_); ``` ```text Track[_trackKey_].Position(_x, y_); ``` -------------------------------- ### SetVehicleSpec Source: https://bvets.net/jp/edit/formats/vehicle/atsfunctions.html Called when vehicle data is loaded. It receives the vehicle's specifications. ```APIDOC ## SetVehicleSpec ### Description Called when vehicle data is loaded. It receives the vehicle's specifications. ### Method `SetVehicleSpec(_vehicleSpec_)` ### Parameters - `_vehicleSpec_` (ATS_VEHICLESPEC): The vehicle specifications. ``` -------------------------------- ### Define Station Stop Position Source: https://bvets.net/jp/edit/formats/route/map.html Sets the stopping position for a train at the current distance. Use Structure.Put for placing train stop target structures. ```plaintext Station[_stationKey_].Put(_door, margin1, margin2_) ``` -------------------------------- ### Draw Distance Source: https://bvets.net/jp/edit/formats/route/map.html Sets the landscape drawing distance from the current distance onwards. ```APIDOC ## Landscape Drawing Distance `DrawDistance.Change(_value_)` Sets the landscape drawing distance from the current distance onwards. The shorter of the drawing distance set in the [Settings] window and the drawing distance set here will be applied. * _value_: Distance [m] (0: Apply drawing distance set in the [Settings] window) ``` -------------------------------- ### Set Directional Light Direction Source: https://bvets.net/jp/edit/formats/route/map.html Sets the direction of the directional light at distance 0. This can only be set once per map file. ```mapscript Light.Direction(_pitch, yaw_) ``` -------------------------------- ### Set Current Distance Source: https://bvets.net/jp/edit/formats/route/map.html Set the current distance in meters. The value must be a non-negative real number. It can be a literal number, a variable holding a number, or an expression evaluating to a number. Consider using smaller values to minimize simulation calculation errors. ```map 1000; ``` ```map 1000 - 25; ``` ```map distance + 0.5; ``` ```map $foo; ```