<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.trainzsimulator.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Ciceronmt</id>
	<title>TrainzOnline - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.trainzsimulator.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Ciceronmt"/>
	<link rel="alternate" type="text/html" href="https://wiki.trainzsimulator.com/wiki/Special:Contributions/Ciceronmt"/>
	<updated>2026-11-05T08:52:46Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.46.2</generator>
	<entry>
		<id>https://wiki.trainzsimulator.com/index.php?title=Class_World&amp;diff=33215</id>
		<title>Class World</title>
		<link rel="alternate" type="text/html" href="https://wiki.trainzsimulator.com/index.php?title=Class_World&amp;diff=33215"/>
		<updated>2022-07-29T15:42:21Z</updated>

		<summary type="html">&lt;p&gt;Ciceronmt: /* GetNamedObjectList */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;*[[TrainzScript Library Reference|API Hierarchy]]&lt;br /&gt;
**World (world.gs)&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
*World is a static class used to access various aspects of the Trainz environment.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Constants==&lt;br /&gt;
*These constants are used to define various values and can be used as mnenomics.&lt;br /&gt;
*If accessed from scripts the values must be prefixed &#039;&#039;World.&#039;&#039;, for example:&lt;br /&gt;
 World.SetWeather(World.WEATHER_TYPE_LIGHT_SNOW,World.WEATHER_CHANGEABILITY_PERIODIC);&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Camera View Modes===&lt;br /&gt;
----&lt;br /&gt;
*These values can be used either to choose the current camera viewing mode through World.[[#SetCameraMode|SetCameraMode()]], or to restrict certain camera modes from being accessed through methods such as World.[[#SetCamera|SetCamera()]].&lt;br /&gt;
&lt;br /&gt;
{{TableHeader|width=95%|margin=15px}}&lt;br /&gt;
|width=375|public define int CAMERA_INTERNAL = 1||Internal cabin camera view.&lt;br /&gt;
|-&lt;br /&gt;
|public define int CAMERA_EXTERNAL = 2||External train camera view&lt;br /&gt;
|-&lt;br /&gt;
|public define int CAMERA_TRACKING = 4||External tracking camera view.&lt;br /&gt;
|-&lt;br /&gt;
|public define int CAMERA_ROAMING = 128||Roaming camera view.&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Camera Flags===&lt;br /&gt;
----&lt;br /&gt;
*These flags are used in addition to the Camera Mode Flags to allow or disallow specific camera actions. &lt;br /&gt;
{{TableHeader|width=95%|margin=15px}}&lt;br /&gt;
|width=375|public define int CAMERA_SWITCH_VIEWS = 8||User permitted to swap between the camera views.&lt;br /&gt;
|-&lt;br /&gt;
|public define int CAMERA_SWITCH_VEHICLES = 16||User permitted to swap vehicles within the current train.&lt;br /&gt;
|-&lt;br /&gt;
|public define int CAMERA_SWITCH_TRAINS = 32||User permitted to swap to other trains which are in the consist menu.&lt;br /&gt;
|-&lt;br /&gt;
|public define int CAMERA_LOCKED = 64||User is NOT permitted to adjust camera (i.e. zoom, pan etc.).&lt;br /&gt;
|-&lt;br /&gt;
|public define int CAMERA_NORMAL = * ||Normal camera mode where everything is permitted.&lt;br /&gt;
|-&lt;br /&gt;
|colspan=2|&amp;lt;sup&amp;gt;* NOTE: CAMERA_NORMAL = CAMERA_INTERNAL | CAMERA_EXTERNAL | CAMERA_TRACKING | CAMERA_SWITCH_VIEWS | CAMERA_SWITCH_VEHICLES | CAMERA_SWITCH_TRAINS&amp;lt;/sup&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Weather Type Constants===&lt;br /&gt;
----&lt;br /&gt;
*Define the current state of the weather in Trainz. &lt;br /&gt;
*A variety of weather conditions are supported and can be changed by using one of these values with the World.[[#SetWeather|SetWeather()]] method. &lt;br /&gt;
{{TableHeader|width=95%|margin=15px}}&lt;br /&gt;
|width=375|public define int WEATHER_TYPE_CLEAR = 0||Clear weather, no clouds, rain or snow.&lt;br /&gt;
|-&lt;br /&gt;
|public define int WEATHER_TYPE_CLOUDY = 1||Cloudy weather, no rain.&lt;br /&gt;
|-&lt;br /&gt;
|public define int WEATHER_TYPE_DRIZZLE = 2||Drizzle, light rain.&lt;br /&gt;
|-&lt;br /&gt;
|public define int WEATHER_TYPE_RAIN = 3||Rainy weather.&lt;br /&gt;
|-&lt;br /&gt;
|public define int WEATHER_TYPE_STORMY = 4||Stormy weather that includes lightning and thunder.&lt;br /&gt;
|-&lt;br /&gt;
|public define int WEATHER_TYPE_LIGHT_SNOW = 5||Snowing lightly.&lt;br /&gt;
|-&lt;br /&gt;
|public define int WEATHER_TYPE_MEDIUM_SNOW = 6||Medium level snow fall.&lt;br /&gt;
|-&lt;br /&gt;
|public define int WEATHER_TYPE_HEAVY_SNOW = 7||Heavy snow fall.&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Weather Changeability Constants===&lt;br /&gt;
----&lt;br /&gt;
*Define the changeability settings for the weather. &lt;br /&gt;
*Weather changeability refers to variability of weather conditions rather than to a specific weather type.&lt;br /&gt;
{{TableHeader|width=95%|margin=15px}}&lt;br /&gt;
|width=375|public define int WEATHER_CHANGEABILITY_NONE = 0||Weather remains static.&lt;br /&gt;
|-&lt;br /&gt;
|public define int WEATHER_CHANGEABILITY_PERIODIC = 1||Periodic changes in weather.&lt;br /&gt;
|-&lt;br /&gt;
|public define int WEATHER_CHANGEABILITY_EXTREME = 2||Extreme and frequent changes in weather. &lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Time Values===&lt;br /&gt;
----&lt;br /&gt;
*Time constants defined in seconds.&lt;br /&gt;
{{TableHeader|width=95%|margin=15px}}&lt;br /&gt;
|width=375|public define float TIME_SECOND = 1.0f||One second.&lt;br /&gt;
|-&lt;br /&gt;
|public define float TIME_MINUTE = TIME_SECOND * 60.0f||One minute, 60.0 seconds.&lt;br /&gt;
|-&lt;br /&gt;
|public define float TIME_HOUR = TIME_MINUTE * 60.0f||One hour, 60.0 minutes, 3600.0 seconds.&lt;br /&gt;
|-&lt;br /&gt;
|public define float TIME_DAY = TIME_HOUR * 24.0f||One day, 24 hours, 1440.0 minutes, 86400.0 seconds.&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Time Rate Constants===&lt;br /&gt;
----&lt;br /&gt;
*Values that define the time rates relative to normal time. &lt;br /&gt;
*These constants can be used to set the time rate that Trainz runs out through the World.[[#SetGameTimeRate|SetGameTimeRate()]] method. &lt;br /&gt;
{{TableHeader|width=95%|margin=15px}}&lt;br /&gt;
|width=375|public define int  TIME_RATE_1X = 0||Real time (i.e. time in Trainz passes at the same rate as in the real world)&lt;br /&gt;
|-&lt;br /&gt;
|public define int TIME_RATE_2X = 1||Time passes at twice normal speed.&lt;br /&gt;
|-&lt;br /&gt;
|public define int TIME_RATE_4X = 2||&lt;br /&gt;
|-&lt;br /&gt;
|public define int TIME_RATE_8X = 3||&lt;br /&gt;
|-&lt;br /&gt;
|public define int TIME_RATE_16X = 4||&lt;br /&gt;
|-&lt;br /&gt;
|public define int TIME_RATE_32X = 5||&lt;br /&gt;
|-&lt;br /&gt;
|public define int TIME_RATE_60X = 6||&lt;br /&gt;
|-&lt;br /&gt;
|public define int TIME_RATE_120X = 7||&lt;br /&gt;
|-&lt;br /&gt;
|public define int TIME_RATE_240X = 8||&lt;br /&gt;
|-&lt;br /&gt;
|public define int TIME_RATE_360X = 9||&lt;br /&gt;
|-&lt;br /&gt;
|public define int TIME_RATE_480X = 10||&lt;br /&gt;
|-&lt;br /&gt;
|public define int TIME_RATE_720X = 11||&lt;br /&gt;
|-&lt;br /&gt;
|public define int TIME_RATE_960X = 12||&lt;br /&gt;
|-&lt;br /&gt;
|public define int TIME_RATE_1200X = 13||&lt;br /&gt;
|-&lt;br /&gt;
|public define int TIME_RATE_1440X = 14||&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Layer Type Constants===&lt;br /&gt;
----&lt;br /&gt;
*These constants can be used for querying route/session layers via [[#GetLayerList|GetLayerList]] and [[#GetLayerType|GetLayerType]].&lt;br /&gt;
*&amp;lt;font color=red&amp;gt;Added in TRS19?&amp;lt;/font&amp;gt;&lt;br /&gt;
{{TableHeader|width=95%|margin=15px}}&lt;br /&gt;
|width=375|public define int LAYER_INVALID = 0||&lt;br /&gt;
|-&lt;br /&gt;
|public define int LAYER_ROUTE = 1||&lt;br /&gt;
|-&lt;br /&gt;
|public define int LAYER_SESSION = 2||&lt;br /&gt;
|-&lt;br /&gt;
|public define int LAYER_BOTH = 3||&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===World Editing Mode Constants===&lt;br /&gt;
----&lt;br /&gt;
*These constants can be used to set editing modes through World.[[#SetWorldEditModeEnabled|SetWorldEditModeEnabled()]].&lt;br /&gt;
*&amp;lt;font color=red&amp;gt;Added in TRS19?&amp;lt;/font&amp;gt;&lt;br /&gt;
{{TableHeader|width=95%|margin=15px}}&lt;br /&gt;
|width=375|public define int PERMIT_EDIT_NONE = 0x0||&lt;br /&gt;
|-&lt;br /&gt;
|public define int PERMIT_EDIT_TOPOLOGY = 0x1||&lt;br /&gt;
|-&lt;br /&gt;
|public define int PERMIT_EDIT_PAINT = 0x2||&lt;br /&gt;
|-&lt;br /&gt;
|public define int PERMIT_EDIT_SCENERYOBJECTS = 0x4||&lt;br /&gt;
|-&lt;br /&gt;
|public define int PERMIT_EDIT_SCENERYSPLINES = 0x8||&lt;br /&gt;
|-&lt;br /&gt;
|public define int PERMIT_EDIT_TRACKSPLINES = 0x10||&lt;br /&gt;
|-&lt;br /&gt;
|public define int PERMIT_EDIT_TRACKSIDEOBJECTS = 0x20||&lt;br /&gt;
|-&lt;br /&gt;
|public define int PERMIT_EDIT_TRACKMARKS = 0x40||&lt;br /&gt;
|-&lt;br /&gt;
|public define int PERMIT_EDIT_TOOLS = 0x80||&lt;br /&gt;
|-&lt;br /&gt;
|public define int PERMIT_EDIT_WORLD = 0x100||&lt;br /&gt;
|-&lt;br /&gt;
|public define int PERMIT_EDIT_LAYERS = 0x200||&lt;br /&gt;
|-&lt;br /&gt;
|public define int PERMIT_EDIT_TRAINS = 0x400||&lt;br /&gt;
|-&lt;br /&gt;
|public define int PERMIT_EDIT_CONSISTS = 0x800||&lt;br /&gt;
|-&lt;br /&gt;
|public define int PERMIT_EDIT_ALL = -1||&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Trainz Modules===&lt;br /&gt;
----&lt;br /&gt;
*Trainz module mode constants. &lt;br /&gt;
*These values define the various module environments that Trainz can be in. &lt;br /&gt;
{{TableHeader|width=95%|margin=15px}}&lt;br /&gt;
|width=375|public define int  NO_MODULE = 0||Trainz not running in a module.&lt;br /&gt;
|-&lt;br /&gt;
|public define int SURVEYOR_MODULE = 1||Trainz is currently running in Surveyor.&lt;br /&gt;
|-&lt;br /&gt;
|public define int DRIVER_MODULE = 2||Trainz is currently running in Driver.&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
==Related Messages==&lt;br /&gt;
* [[TrainzScript Message Reference]]&amp;lt;br&amp;gt;&lt;br /&gt;
* [[Camera Messages]]&amp;lt;br&amp;gt;&lt;br /&gt;
* [[Interface Messages]]&amp;lt;br&amp;gt;&lt;br /&gt;
* [[ModuleInit Message]]&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==AddDriverCharacter==&lt;br /&gt;
{{MethodHeader|public native [[Class DriverCharacter|DriverCharacter]] AddDriverCharacter([[Class Asset|Asset]] driverCharacterAsset)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;driverCharacterAsset&#039;&#039;&#039; = Asset containing character to be added.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*Reference to the DriverCharacter if successful, null otherwise.&lt;br /&gt;
;Syntax&lt;br /&gt;
 DriverCharacter Casey = World.AddDriverCharacter(CaseyJones);&lt;br /&gt;
;Notes&lt;br /&gt;
*In multiplayer, this will only succeed on the server.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==AddDriverCommand==&lt;br /&gt;
{{MethodHeader|public native [[Class DriverCommand|DriverCommand]] AddDriverCommand([[Class Asset|Asset]] driverCommandAsset)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;driverCommandAsset&#039;&#039;&#039; = Asset containing command to be added.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*Reference to the DriverCommand if successful, null otherwise.&lt;br /&gt;
;Syntax&lt;br /&gt;
 DriverCommand GoFaster = World.AddDriverCommand(accelerate);&lt;br /&gt;
;Notes&lt;br /&gt;
*In multiplayer, this will only succeed on the server.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==CancelCurrentEditingMode==&lt;br /&gt;
{{MethodHeader|public native void CancelCurrentEditingMode(void)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*None&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 World.CancelCurrentEditingMode();&lt;br /&gt;
;Notes&lt;br /&gt;
* Cancels out of any player entered editing mode, if relevant. This should only normally be called as a result of direct player action.&lt;br /&gt;
*&amp;lt;font color=red&amp;gt;Added in TRS19?&amp;lt;/font&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==CreateBehavior==&lt;br /&gt;
{{MethodHeader|public native [[Class ScenarioBehavior|ScenarioBehavior]] CreateBehavior([[Class KUID|KUID]] kuid, [[Class Soup|Soup]] initialProperties)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;kuid&#039;&#039;&#039; = KUID of scenario.&lt;br /&gt;
&#039;&#039;&#039;initialProperties&#039;&#039;&#039; = Soup object containing initial properties for scenario.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*Reference to the ScenarioBehavior created if successful, null otherwise.&lt;br /&gt;
;Syntax&lt;br /&gt;
 ScenarioBehavior scenario = World.CreateBehavior(scenarioAsset, scenarioSoup);&lt;br /&gt;
;Notes&lt;br /&gt;
*The returned ScenarioBehavior object may be ended by releasing all references to it (resetting all references to null).&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==CreateTrain==&lt;br /&gt;
{{MethodHeader|public native [[Class Train|Train]] CreateTrain([[Class KUID|KUID]][ ] consist, string trackmarkName, bool direction)&amp;lt;br&amp;gt;public native [[Class Train|Train]] CreateTrain([[Class KUID|KUID]][ ] consist, [[Class TrackMark|TrackMark]] trackmark, bool direction)&amp;lt;br&amp;gt;public native [[Class Train|Train]] CreateTrain([[Class KUID|KUID]][ ] consist, [[Class Buildable|Buildable]] buildable, string trackName, float position, bool direction)&amp;lt;br&amp;gt;public native [[Class Train|Train]] CreateTrain([[Class KUID|KUID]][ ] consist, [[Class GSTrackSearch|GSTrackSearch]] tracksearch, bool avoidDerailments)&amp;lt;br&amp;gt;public native [[Class Train|Train]] CreateTrain([[Class KUID|KUID]][ ] consist, [[Class GSTrackSearch|GSTrackSearch]] tracksearch)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;consist&#039;&#039;&#039; = An array of vehicle KUIDs used to describe the required Train object.&lt;br /&gt;
*&#039;&#039;&#039;trackmarkName&#039;&#039;&#039; = Name of Trackmark at which the consist is to be formed.&lt;br /&gt;
*&#039;&#039;&#039;buildable&#039;&#039;&#039; = Buildable on which the consist is to be formed.&lt;br /&gt;
*&#039;&#039;&#039;trackName&#039;&#039;&#039; = Name of track within Buildable object.&lt;br /&gt;
*&#039;&#039;&#039;position&#039;&#039;&#039; = Distance at which the Train is to be placed relative to the start of the track.&lt;br /&gt;
*&#039;&#039;&#039;trackmark&#039;&#039;&#039; = Reference to Trackmark at which the consist is to be formed.&lt;br /&gt;
*&#039;&#039;&#039;direction&#039;&#039;&#039; = Orientation of Train relative to direction of track or trackmark.&lt;br /&gt;
*&#039;&#039;&#039;tracksearch&#039;&#039;&#039; = The location at which to create the train&lt;br /&gt;
*&#039;&#039;&#039;avoidDerailments&#039;&#039;&#039; = If true this function will fail and return null if creating the train would cause a derailment&lt;br /&gt;
;Returned Value&lt;br /&gt;
*Reference to the Train created if successful, null otherwise.&lt;br /&gt;
;Syntax&lt;br /&gt;
 Train train = World.CreateTrain(consist, buildable, &amp;quot;Track 1&amp;quot;, 10.0, true);&lt;br /&gt;
;Notes&lt;br /&gt;
*These methods create a train from a list of vehicles in a consist array.&lt;br /&gt;
*Depending on the variant of the method used, the train can be created at a Trackmark, specified by name or reference, or at a Buildable or Industry object.&lt;br /&gt;
*It is the responsibility of the script programmer to ensure that sufficient track exists at the given location to allow the train to be created.&lt;br /&gt;
*In multiplayer, this will only succeed on the server.&lt;br /&gt;
*&amp;lt;font color=red&amp;gt;&#039;&#039;&#039;GSTrackSearch&#039;&#039;&#039; aliases added in TRS19?&amp;lt;/font&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==DeleteTrain==&lt;br /&gt;
{{MethodHeader|public native void DeleteTrain([[Class Train|Train]] train)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;train&#039;&#039;&#039; = train to be deleted from map.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 World.DeleteTrain(flyingScotsman);&lt;br /&gt;
;Notes&lt;br /&gt;
*Once a train has been deleted, care should be taken to avoid using its reference.&lt;br /&gt;
*In multiplayer, this will only succeed on the server.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==DeleteVehicle==&lt;br /&gt;
{{MethodHeader|public native void DeleteVehicle([[Class Vehicle|Vehicle]] vehicle)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;vehicle&#039;&#039;&#039; = vehicle to be deleted from its train.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 World.DeleteVehicle(vehicles[vehicles.size()-1]);&lt;br /&gt;
;Notes&lt;br /&gt;
*Use [[Class Train#GetVehicles|Train.GetVehicles()]] to obtain an array of vehicles for a given train.&lt;br /&gt;
*Use [[Class Vehicle#GetMyTrain|Vehicle.GetMyTrain()]] to obtain a train reference for a given vehicle.&lt;br /&gt;
*In multiplayer, this will only succeed on the server.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==EndScenario==&lt;br /&gt;
{{MethodHeader|public void EndScenario(float time)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;time&#039;&#039;&#039; = Amount of seconds to delay before ending the session&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 World.EndScenario(30.0);&lt;br /&gt;
;Notes&lt;br /&gt;
*In multiplayer, this will only succeed on the server.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==FindAsset==&lt;br /&gt;
{{MethodHeader|public native [[Class Asset|Asset]] FindAsset([[Class KUID|KUID]] kuid)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;kuid&#039;&#039;&#039; = KUID of Asset to return.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*Given a valid KUID parameter, this method return an Asset reference if successful, null otherwise.&lt;br /&gt;
;Syntax&lt;br /&gt;
 Asset asset = World.FindAsset(kuid);&lt;br /&gt;
;Notes&lt;br /&gt;
*See also Asset.FindAsset()&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==FindDriverCommand==&lt;br /&gt;
{{MethodHeader|public native [[Class DriverCommand|DriverCommand]] FindDriverCommand([[Class Asset|Asset]] driverCommandAsset)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;driverCommandAsset&#039;&#039;&#039; = Asset containing command to be added.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*Reference to the DriverCommand if successful, null otherwise.&lt;br /&gt;
;Syntax&lt;br /&gt;
 DriverCommand GoFaster = World.FindDriverCommand(accelerate);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==GetAssetList==&lt;br /&gt;
{{MethodHeader|public native [[Class Asset|Asset]][ ] GetAssetList(string kind)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;kind&#039;&#039;&#039; = String representing the Kind of asset to return.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*A list of all assets of the given &#039;&#039;kind&#039;&#039;&lt;br /&gt;
;Syntax&lt;br /&gt;
 Asset[] Libraries = World.GetAssetList(&amp;quot;Library&amp;quot;);&lt;br /&gt;
;Notes&lt;br /&gt;
*All installed assets of the given &#039;&#039;kind&#039;&#039; are returned, irrespective of whether or not they are in use on the current map.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==GetBadWeatherFog==&lt;br /&gt;
{{MethodHeader|public obsolete native float GetBadWeatherFog(void)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*None&lt;br /&gt;
;Returned Value&lt;br /&gt;
*Bad weather fog distance as a float in the range 0.0..1.0.&lt;br /&gt;
;Syntax&lt;br /&gt;
 float dist = World.GetBadWeatherFog();&lt;br /&gt;
;Notes&lt;br /&gt;
*Obsolete in TRS19&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==GetBehaviors==&lt;br /&gt;
{{MethodHeader|public native [[Class ScenarioBehavior|ScenarioBehavior]][ ] GetBehaviors(void)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*None&lt;br /&gt;
;Returned Value&lt;br /&gt;
*A list of top-level behaviors or rules on the currently loaded route.&lt;br /&gt;
;Syntax&lt;br /&gt;
 ScenarioBehavior[] rules = World.GetBehaviors();&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==GetCameraPitch==&lt;br /&gt;
{{MethodHeader|public native float GetCameraPitch(void)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*None&lt;br /&gt;
;Returned Value&lt;br /&gt;
*Current camera pitch, in radians&lt;br /&gt;
;Syntax&lt;br /&gt;
 float pitch = World.GetCameraPitch();&lt;br /&gt;
;Notes&lt;br /&gt;
*&amp;lt;font color=red&amp;gt;Added in ...?&amp;lt;/font&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==GetCameraPositionX==&lt;br /&gt;
{{MethodHeader|public obsolete native float GetCameraPositionX(void)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*None&lt;br /&gt;
;Returned Value&lt;br /&gt;
*X Coordinate of the current camera position.&lt;br /&gt;
;Syntax&lt;br /&gt;
 float X = World.GetCameraPositionX();&lt;br /&gt;
;Notes&lt;br /&gt;
*Obsolete in TRS19&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==GetCameraPositionY==&lt;br /&gt;
{{MethodHeader|public obsolete native float GetCameraPositionY(void)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*None&lt;br /&gt;
;Returned Value&lt;br /&gt;
*Y Coordinate of the current camera position.&lt;br /&gt;
;Syntax&lt;br /&gt;
 float Y = World.GetCameraPositionY();&lt;br /&gt;
;Notes&lt;br /&gt;
*Obsolete in TRS19&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==GetCameraPositionZ==&lt;br /&gt;
{{MethodHeader|public obsolete native float GetCameraPositionZ(void)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*None&lt;br /&gt;
;Returned Value&lt;br /&gt;
*Z Coordinate of the current camera position.&lt;br /&gt;
;Syntax&lt;br /&gt;
 float Z = World.GetCameraPositionZ();&lt;br /&gt;
;Notes&lt;br /&gt;
*Obsolete in TRS19&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==GetCameraYaw==&lt;br /&gt;
{{MethodHeader|public native float GetCameraYaw(void)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*None&lt;br /&gt;
;Returned Value&lt;br /&gt;
*Current camera yaw, in radians&lt;br /&gt;
;Syntax&lt;br /&gt;
 float yaw = World.GetCameraYaw();&lt;br /&gt;
;Notes&lt;br /&gt;
*&amp;lt;font color=red&amp;gt;Added in ...?&amp;lt;/font&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==GetCameraZoom==&lt;br /&gt;
{{MethodHeader|public native float GetCameraZoom(void)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*None&lt;br /&gt;
;Returned Value&lt;br /&gt;
*Current camera zoom, in meters&lt;br /&gt;
;Syntax&lt;br /&gt;
 float zoom= World.GetCameraZoom();&lt;br /&gt;
;Notes&lt;br /&gt;
*&amp;lt;font color=red&amp;gt;Is this value equivalent to &#039;&#039;&#039;radius&#039;&#039;&#039; in [[#SetCameraAngle|SetCameraAngle()]]?&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=red&amp;gt;Added in ...?&amp;lt;/font&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==GetCurrentModule==&lt;br /&gt;
{{MethodHeader|public native int GetCurrentModule(void)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*None&lt;br /&gt;
;Returned Value&lt;br /&gt;
*An integer representing the current Trainz module.&lt;br /&gt;
;Syntax&lt;br /&gt;
 int module = World.GetCurrentModule();&lt;br /&gt;
;Notes&lt;br /&gt;
* See [[#Trainz Modules|Trainz Modules]] for details of the constants associated with this method. &lt;br /&gt;
* See [[ModuleInit Message]] for further details.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==GetCurrentProfile==&lt;br /&gt;
{{MethodHeader|public native [[Class Asset|Asset]] GetCurrentProfile(void)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*None&lt;br /&gt;
;Returned Value&lt;br /&gt;
*The current session asset&lt;br /&gt;
;Syntax&lt;br /&gt;
 Asset currentSession = World.GetCurrentProfile();&lt;br /&gt;
;Notes&lt;br /&gt;
*&amp;lt;font color=red&amp;gt;Added in ...?&amp;lt;/font&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==GetCurrentTrain==&lt;br /&gt;
{{MethodHeader|public native Train GetCurrentTrain(void)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*None&lt;br /&gt;
;Returned Value&lt;br /&gt;
*The currently focused train&lt;br /&gt;
;Syntax&lt;br /&gt;
 Train myTrain = World.GetCurrentTrain();&lt;br /&gt;
;Notes&lt;br /&gt;
* The current train is the one currently controlled by the user, which may not be the train the camera is focused on.&lt;br /&gt;
*&amp;lt;font color=red&amp;gt;Added in ...?&amp;lt;/font&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==GetDriverCharacterList==&lt;br /&gt;
{{MethodHeader|public native [[Class DriverCharacter|DriverCharacter]][ ] GetDriverCharacterList(void)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*None&lt;br /&gt;
;Returned Value&lt;br /&gt;
*An array of DriverCharacter objects installed in the current world.&lt;br /&gt;
;Syntax&lt;br /&gt;
 DriverCharacter[] drivers = World.GetDriverCharacterList();&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==GetDriverCommandList==&lt;br /&gt;
{{MethodHeader|public native [[Class DriverCommand|DriverCommand]][ ] GetDriverCommandList(void)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*None&lt;br /&gt;
;Returned Value&lt;br /&gt;
*An array of DriverCommand objects installed in the current world.&lt;br /&gt;
;Syntax&lt;br /&gt;
 DriverCommand[] commands = World.GetDriverCommandList();&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==GetGameDate==&lt;br /&gt;
{{MethodHeader|public native int GetGameDate(void)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*None&lt;br /&gt;
;Returned value&lt;br /&gt;
*Current game day (1 - 31)&lt;br /&gt;
;Syntax&lt;br /&gt;
 int Now = World.GetGameDate();&lt;br /&gt;
;Notes&lt;br /&gt;
*&amp;lt;font color=red&amp;gt;Added in ...?&amp;lt;/font&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==GetGameMonth==&lt;br /&gt;
{{MethodHeader|public native int GetGameMonth(void)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*None&lt;br /&gt;
;Returned value&lt;br /&gt;
*Current game month (1 - 12)&lt;br /&gt;
;Syntax&lt;br /&gt;
 int Now = World.GetGameMonth();&lt;br /&gt;
;Notes&lt;br /&gt;
*&amp;lt;font color=red&amp;gt;Added in ...?&amp;lt;/font&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==GetGameObjectByID==&lt;br /&gt;
{{MethodHeader|public native [[Class AsyncObjectSearchResult|AsyncObjectSearchResult]] GetGameObjectByID([[Class GameObjectID|GameObjectID]] objectID, bool bTriggerLoad)&amp;lt;br&amp;gt;public native [[Class AsyncObjectSearchResult|AsyncObjectSearchResult]] GetGameObjectByID([[Class GameObjectID|GameObjectID]] objectID)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;objectID&#039;&#039;&#039; = The ID of the object to find.&lt;br /&gt;
*&#039;&#039;&#039;bTriggerLoad&#039;&#039;&#039; = Optional, defaults to true. Whether to trigger an asynchronous load of any matching object (if it&#039;s not loaded already).&lt;br /&gt;
;Returned Value&lt;br /&gt;
* Asynchronous search result object. &lt;br /&gt;
;Syntax&lt;br /&gt;
 AsyncObjectSearchResult search_result = World.GetGameObjectByID(objectID, true);  // Search for and load an object&lt;br /&gt;
;Notes&lt;br /&gt;
*See [[HowTo/Search for objects in the world]] for a detailed guide on asynchronous searches.&lt;br /&gt;
*The retured object is a reference to the in-progress object search.&lt;br /&gt;
*When the search completes, a message of type &amp;quot;ObjectSearch&amp;quot;,&amp;quot;AsyncResult&amp;quot; will be posted to the result object.&lt;br /&gt;
*If bTriggerLoad is true, a further message of type &amp;quot;ObjectSearch&amp;quot;,&amp;quot;AsyncLoadComplete&amp;quot; will be posted when all objects are loaded into memory. This message will still be posted if every object is already loaded.&lt;br /&gt;
*Added in TRS19&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==GetGameObjectByIDIfLoaded==&lt;br /&gt;
{{MethodHeader|public native [[Class GameObject|GameObject]] GetGameObjectByIDIfLoaded([[Class GameObjectID|GameObjectID]] objectID)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;objectID&#039;&#039;&#039; = The ID of the boject to find.&lt;br /&gt;
;Returned Value&lt;br /&gt;
* The object, if it exists and is currently loaded.&lt;br /&gt;
;Syntax&lt;br /&gt;
 GameObject my_object = World.GetGameObjectByID(objectID);&lt;br /&gt;
 if (my_object) Interface.Print(&amp;quot;Object exists and is loaded&amp;quot;);&lt;br /&gt;
;Notes&lt;br /&gt;
*Added in TRS19&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==GetGameSeason==&lt;br /&gt;
{{MethodHeader|public native float GetGameSeason(void)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*None&lt;br /&gt;
;Returned value&lt;br /&gt;
*Current game season&lt;br /&gt;
;Syntax&lt;br /&gt;
 float Season = World.GetGameSeason();&lt;br /&gt;
;Notes&lt;br /&gt;
*The returned time is normalised to a value between 0.0 and 1.0&lt;br /&gt;
*0.0 = mid-summer&lt;br /&gt;
*0.5 = mid-winter&lt;br /&gt;
*&amp;lt;font color=red&amp;gt;Added in ...?&amp;lt;/font&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==GetGameTime==&lt;br /&gt;
{{MethodHeader|public native float GetGameTime(void)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*None&lt;br /&gt;
;Returned value&lt;br /&gt;
*Current game time.&lt;br /&gt;
;Syntax&lt;br /&gt;
 float Now = World.GetGameTime();&lt;br /&gt;
;Notes&lt;br /&gt;
*The returned time is normalised to a value between 0.0 and 1.0&lt;br /&gt;
*0.0 = midday&lt;br /&gt;
*0.25 = 6 p.m.&lt;br /&gt;
*0.5 = midnight&lt;br /&gt;
*0.75 = 6 a.m.&lt;br /&gt;
*1.0 = midday again&lt;br /&gt;
*Use the [[#Time_Values|Time Value]] constants to convert the normalised values to human readable times.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==GetGameYear==&lt;br /&gt;
{{MethodHeader|public native int GetGameYear(void)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*None&lt;br /&gt;
;Returned value&lt;br /&gt;
*Current game year.&lt;br /&gt;
;Syntax&lt;br /&gt;
 int Now = World.GetGameYear();&lt;br /&gt;
;Notes&lt;br /&gt;
*&amp;lt;font color=red&amp;gt;Added in ...?&amp;lt;/font&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==GetGoodWeatherFog==&lt;br /&gt;
{{MethodHeader|public obsolete native float GetGoodWeatherFog(void)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*None&lt;br /&gt;
;Returned Value&lt;br /&gt;
*Good weather fog distance as a float in the range 0.0..1.0.&lt;br /&gt;
;Syntax&lt;br /&gt;
 float dist = World.GetGoodWeatherFog();&lt;br /&gt;
;Notes&lt;br /&gt;
*Obsolete in TRS19&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==GetGroundDrawDistance==&lt;br /&gt;
{{MethodHeader|public obsolete native float GetGroundDrawDistance(void)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*None&lt;br /&gt;
;Returned Value&lt;br /&gt;
*Ground draw distance in metres.&lt;br /&gt;
;Syntax&lt;br /&gt;
 float dist = World.GetGroundDrawDistance();&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==GetIndustryList==&lt;br /&gt;
{{MethodHeader|public obsolete native [[Class GameObject|GameObject]][ ] GetIndustryList(void)}}&lt;br /&gt;
;Parameters &lt;br /&gt;
*None&lt;br /&gt;
;Returned Value&lt;br /&gt;
*An array of references to all of the Industry objects for the current route.&lt;br /&gt;
;Syntax&lt;br /&gt;
 GameObject[] Industries = World.GetIndustryList();&lt;br /&gt;
;Notes&lt;br /&gt;
*This function is obsolete and should not be used. Use [[#GetNamedObjectList|GetNamedObjectList]] instead.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==GetJunctionList==&lt;br /&gt;
{{MethodHeader|public obsolete native [[Class Junction|Junction]][ ] GetJunctionList(void)}}&lt;br /&gt;
;Parameters &lt;br /&gt;
*None&lt;br /&gt;
;Returned Value&lt;br /&gt;
*An array of references to all of the trackside junction objects for the current route.&lt;br /&gt;
;Syntax&lt;br /&gt;
 Junction[] junctions = World.GetJunctionList();&lt;br /&gt;
;Notes&lt;br /&gt;
*This function is obsolete and should not be used. Use [[#GetNamedObjectList|GetNamedObjectList]] instead.&lt;br /&gt;
*Junction objects attached to fixed track junctions are not returned by this method.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==GetLayerList==&lt;br /&gt;
{{MethodHeader|public native string[ ] GetLayerList(int layerType)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*layerType = LAYER_ROUTE, LAYER_SESSION, or LAYER_BOTH&lt;br /&gt;
;Returned Value&lt;br /&gt;
*Array of layer names&lt;br /&gt;
;Syntax&lt;br /&gt;
 string[] routeLayerNames = World.GetLayerList(World.LAYER_ROUTE);&lt;br /&gt;
;Notes&lt;br /&gt;
*&amp;lt;font color=red&amp;gt;Added in ...?&amp;lt;/font&amp;gt; &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==GetLayerType==&lt;br /&gt;
{{MethodHeader|public native int GetLayerType(string layerName)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*layerName = The name of the layer&lt;br /&gt;
;Returned Value&lt;br /&gt;
*LAYER_ROUTE or LAYER_SESSION&lt;br /&gt;
;Syntax&lt;br /&gt;
 int layerType = World.GetLayerType(&amp;quot;MyLayer&amp;quot;);&lt;br /&gt;
;Notes&lt;br /&gt;
*&amp;lt;font color=red&amp;gt;Added in ...?&amp;lt;/font&amp;gt; &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==GetLibrary==&lt;br /&gt;
{{MethodHeader|public native [[Class Library|Library]] GetLibrary([[Class KUID|KUID]] kuid)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;kuid&#039;&#039;&#039; = KUID of script library asset to load.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*A reference to the script library asset if successful, null otherwise.&lt;br /&gt;
;Syntax&lt;br /&gt;
 Library codelib = World.GetLibrary(LibraryKUID);&lt;br /&gt;
;Notes&lt;br /&gt;
*The [[Class Library|Library]] asset is initialised when this method is first called in a session.&lt;br /&gt;
*Since only one instance can exist, subsequent calls return a reference to the existing Library object.&lt;br /&gt;
*See [[Class Library|Library]] for notes on how to use this method.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==GetLocalPlayerName==&lt;br /&gt;
{{MethodHeader|public native string GetLocalPlayerName(void)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*None&lt;br /&gt;
;Returned Value&lt;br /&gt;
*The name of the local player&lt;br /&gt;
;Syntax&lt;br /&gt;
 string playerName = World.GetLocalPlayerName();&lt;br /&gt;
;Notes&lt;br /&gt;
* Gets the name of the local player, as should be used for setting ownership on DriverCharacters, etc.&lt;br /&gt;
*&amp;lt;font color=red&amp;gt;Added in .TRS19?&amp;lt;/font&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==GetNamedObjectList==&lt;br /&gt;
{{MethodHeader|public native [[Class AsyncObjectSearchResult|AsyncObjectSearchResult]] GetNamedObjectList(string categoryFilter, string nameFilter, bool bNotifyOfExpiry)&amp;lt;br&amp;gt;public [[Class AsyncObjectSearchResult|AsyncObjectSearchResult]] GetNamedObjectList(string categoryFilter, string nameFilter)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;categoryFilter&#039;&#039;&#039; = A category filter to search for. Optional, provided a nameFilter parameter is provided. A category code reference can be found in [[Class AssetCategory|AssetCategory]].&lt;br /&gt;
*&#039;&#039;&#039;nameFilter&#039;&#039;&#039; = A partial object name to search for. Optional, provided a categoryFilter parameter is provided.&lt;br /&gt;
*&#039;&#039;&#039;bNotifyOfExpiry&#039;&#039;&#039; = Optional, defaults to false. If native code detects that the search results have changed then a message of type &amp;quot;ObjectSearch&amp;quot;,&amp;quot;Expired&amp;quot; will be posted to the result object, and the calling script can perform a new search if desired&lt;br /&gt;
;Returned Value&lt;br /&gt;
* Asynchronous search result object. &lt;br /&gt;
;Syntax&lt;br /&gt;
 AsyncObjectSearchResult search_result = World.GetNamedObjectList(AssetCategory.Locomotive, &amp;quot;SD40-2&amp;quot;); // Search for all SD40-2 locomotives in the world&lt;br /&gt;
;Notes&lt;br /&gt;
*See [[HowTo/Search for objects in the world]] for a detailed guide on asynchronous searches.&lt;br /&gt;
*The retured object is a reference to the in-progress object search.&lt;br /&gt;
*When the search completes, a message of type &amp;quot;ObjectSearch&amp;quot;,&amp;quot;AsyncResult&amp;quot; will be posted to the result object.&lt;br /&gt;
*With expiration notices are enabled, only one notification of type &amp;quot;ObjectSearch&amp;quot;,&amp;quot;Expired&amp;quot; will be posted for each search.&lt;br /&gt;
*Added in TRS19.&lt;br /&gt;
*&#039;&#039;As personal experience has shown, the number of lines in this list is limited to 1000, so for large routes, unfortunately, such a search is not complete.&#039;&#039;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==GetSceneryDrawDistance==&lt;br /&gt;
{{MethodHeader|public obsolete native float GetSceneryDrawDistance(void)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*None&lt;br /&gt;
;Returned Value&lt;br /&gt;
*Undefined.&lt;br /&gt;
;Notes&lt;br /&gt;
*Included for legacy script compatibility only. Has no effect.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==GetSeconds==&lt;br /&gt;
{{MethodHeader|public native float GetSeconds(void)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*None&lt;br /&gt;
;Returned Value&lt;br /&gt;
*The current value of a floating point number incrementing once per second in real time.&lt;br /&gt;
;Syntax&lt;br /&gt;
 float start = World.GetSeconds();&lt;br /&gt;
 // do stuff&lt;br /&gt;
 float finish = World.GetSeconds();&lt;br /&gt;
 float period = finish - start;&lt;br /&gt;
;Notes&lt;br /&gt;
*Each call will return a float value containing the current value of an internal counter.&lt;br /&gt;
*Subtracting a later value from a value saved at an earlier call will enable the delay between the two calls to be established.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==GetSignalList==&lt;br /&gt;
{{MethodHeader|public obsolete native [[Class Signal|Signal]][ ] GetSignalList(void)}}&lt;br /&gt;
;Parameters &lt;br /&gt;
*None&lt;br /&gt;
;Returned Value&lt;br /&gt;
*An array of references to all of the signal objects for the current route.&lt;br /&gt;
;Syntax&lt;br /&gt;
 Signal[] signals = World.GetSignalList();&lt;br /&gt;
;Notes&lt;br /&gt;
*This function is obsolete and should not be used. Use [[#GetNamedObjectList|GetNamedObjectList]] instead.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==GetStringTable==&lt;br /&gt;
{{MethodHeader|public native [[Class StringTable|StringTable]] GetStringTable(void)}}&lt;br /&gt;
;Parameters &lt;br /&gt;
*None&lt;br /&gt;
;Returned Value&lt;br /&gt;
*The StringTable for the current session.&lt;br /&gt;
;Syntax&lt;br /&gt;
 StringTable data = World.GetStringTable();&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==GetSurveyorSavedConsist==&lt;br /&gt;
{{MethodHeader|public obsolete native [[Class Soup|Soup]] GetSurveyorSavedConsist(string name)}}&lt;br /&gt;
;Parameters &lt;br /&gt;
*&#039;&#039;&#039;name&#039;&#039;&#039; = Name of the consist to retrieve.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*Returns a Soup definition of the named consist if it exists, null otherwise.&lt;br /&gt;
;Syntax&lt;br /&gt;
 Soup consist = World.GetSurveyorSavedConsist(&amp;quot;Brighton Belle&amp;quot;);&lt;br /&gt;
;Notes&lt;br /&gt;
*Remember that the returned data is in a Soup format, which is not the same thing as a Train. &lt;br /&gt;
*[[Class TrainUtil#CreateTrainFromSoup|TrainUtil.CreateTrainFromSoup()]] can be used to create a train from the returned Soup.&lt;br /&gt;
*This method only works in Surveyor.&lt;br /&gt;
*Obsolete in TRS19.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==GetSurveyorSavedConsistList==&lt;br /&gt;
{{MethodHeader|public native string[ ] GetSurveyorSavedConsistList()}}&lt;br /&gt;
;Parameters &lt;br /&gt;
*None&lt;br /&gt;
;Returned Value&lt;br /&gt;
*An array of names of all the saved consist objects in Surveyor.&lt;br /&gt;
;Syntax&lt;br /&gt;
 string[] consists = World.GetSurveyorSavedConsistList();&lt;br /&gt;
;Notes&lt;br /&gt;
*This method only works in Surveyor.&lt;br /&gt;
*Obsolete in TRS19.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==GetTimeElapsed==&lt;br /&gt;
{{MethodHeader|public native float GetTimeElapsed(void)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*None&lt;br /&gt;
;Returned Value&lt;br /&gt;
*The number of real-time seconds that have passed since the start of the current session. &lt;br /&gt;
;Syntax&lt;br /&gt;
 float secondsElapsed = World.GetTimeElapsed();&lt;br /&gt;
;Notes&lt;br /&gt;
*This measure of time stops passing while the game is paused.&lt;br /&gt;
*&amp;lt;font color=red&amp;gt;Added in ...?&amp;lt;/font&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==GetTrackmarkList==&lt;br /&gt;
{{MethodHeader|public obsolete native [[Class TrackMark|TrackMark]][ ] GetTrackmarkList(void)}}&lt;br /&gt;
;Parameters &lt;br /&gt;
*None&lt;br /&gt;
;Returned Value&lt;br /&gt;
*An array of references to all of the trackmark objects for the current route.&lt;br /&gt;
;Syntax&lt;br /&gt;
 Trackmark[] trackmarks = World.GetTrackmarkList();&lt;br /&gt;
;Notes&lt;br /&gt;
*This function is obsolete and should not be used. Use [[#GetNamedObjectList|GetNamedObjectList]] instead.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==GetTrainList==&lt;br /&gt;
{{MethodHeader|public obsolete native [[Class Train|Train]][ ] GetTrainList(void)}}&lt;br /&gt;
;Parameters &lt;br /&gt;
*None&lt;br /&gt;
;Returned Value&lt;br /&gt;
*An array of references to all of the trains for the current route.&lt;br /&gt;
;Syntax&lt;br /&gt;
 Train[] trains = World.GetTrainList();&lt;br /&gt;
;Notes&lt;br /&gt;
*This function is obsolete and should not be used. Use [[#GetNamedObjectList|GetNamedObjectList]] instead.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==GetTrainzBuild==&lt;br /&gt;
{{MethodHeader|public native int GetTrainzBuild(void)}}&lt;br /&gt;
;Parameters;&lt;br /&gt;
*None&lt;br /&gt;
;Returned Value&lt;br /&gt;
*Gets the current build number of Trainz. &lt;br /&gt;
;Syntax&lt;br /&gt;
 int build = World.GetTrainzBuild();&lt;br /&gt;
;Notes&lt;br /&gt;
*The value returned corresponds to the build number you can see in the bottom-right side of the main Trainz menu screen.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==GetTrainzVersion==&lt;br /&gt;
{{MethodHeader|public native float GetTrainzVersion(void)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*None&lt;br /&gt;
;Returned Value&lt;br /&gt;
*The TRS version number.&lt;br /&gt;
;Syntax&lt;br /&gt;
 float version = World.GetTrainzVersion();&lt;br /&gt;
;Notes&lt;br /&gt;
*The value returned corresponds to the version number of Content manager (for example 4.6). &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==GetTriggerList==&lt;br /&gt;
{{MethodHeader|public obsolete native [[Class Trigger|Trigger]][ ] GetTriggerList(void)}}&lt;br /&gt;
;Parameters &lt;br /&gt;
*None&lt;br /&gt;
;Returned Value&lt;br /&gt;
*An array of references to all of the trigger objects for the current route.&lt;br /&gt;
;Syntax&lt;br /&gt;
 Trigger[] triggers = World.GetTriggerList();&lt;br /&gt;
;Notes&lt;br /&gt;
*This function is obsolete and should not be used. Use [[#GetNamedObjectList|GetNamedObjectList]] instead.&lt;br /&gt;
*This method does not return scenery triggers, ie those attached to SceneryWithTrack objects and their descendants.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==GetVehicleList==&lt;br /&gt;
{{MethodHeader|public obsolete native [[Class Vehicle|Vehicle]][ ] GetVehicleList(void)}}&lt;br /&gt;
;Parameters &lt;br /&gt;
*None&lt;br /&gt;
;Returned Value&lt;br /&gt;
*An array of references to all of the vehicles in the current route.&lt;br /&gt;
;Syntax&lt;br /&gt;
 Vehicle[] vehicles = World.GetVehicleList();&lt;br /&gt;
;Notes&lt;br /&gt;
*This function is obsolete and should not be used. Use [[#GetNamedObjectList|GetNamedObjectList]] instead.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==GetWeatherChangeability==&lt;br /&gt;
{{MethodHeader|public native int GetWeatherChangeability(void)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*None&lt;br /&gt;
;Returned Value&lt;br /&gt;
*One of the [[#Weather_Changeability_Constants|Weather Changeability Constants]] denoting the variability of weather conditions.&lt;br /&gt;
;Syntax&lt;br /&gt;
 int variability = World.GetWeatherChangeability();&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==GetWeatherType==&lt;br /&gt;
{{MethodHeader|public native int GetWeatherType(void)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*None&lt;br /&gt;
;Returned Value&lt;br /&gt;
*One of the [[#Weather_Type_Constants|Weather Type Constants]] denoting the current weather conditions.&lt;br /&gt;
;Syntax&lt;br /&gt;
 int weather = World.GetWeatherType();&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==IsAssetRestrictionInEffect==&lt;br /&gt;
{{MethodHeader|public native bool IsAssetRestrictionInEffect(string)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*None&lt;br /&gt;
;Returned Value&lt;br /&gt;
*Whether this game world has Asset Restrictions. &lt;br /&gt;
;Syntax&lt;br /&gt;
 bool assetRestrictionsExist = World.IsAssetRestrictionInEffect();&lt;br /&gt;
;Notes&lt;br /&gt;
*Multiplayer Sessions require Asset Restrictions to be in effect to avoid compatibility issues between peers.&lt;br /&gt;
*&amp;lt;font color=red&amp;gt;Added in ...?&amp;lt;/font&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==IsLayerVisible==&lt;br /&gt;
{{MethodHeader|public native bool IsLayerVisible(string layerName)}}&lt;br /&gt;
;Parameter&lt;br /&gt;
*layerName = Name of the layer to check&lt;br /&gt;
;Returned Value&lt;br /&gt;
*Whether the layer is visible&lt;br /&gt;
;Syntax&lt;br /&gt;
 bool isVisible = World.IsLayerVisible(&amp;quot;MyLayer&amp;quot;);&lt;br /&gt;
;Notes&lt;br /&gt;
*&amp;lt;font color=red&amp;gt;Added in ...?&amp;lt;/font&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==LoadMap==&lt;br /&gt;
{{MethodHeader|public native bool LoadMap([[Class KUID|KUID]] kuid)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;kuid&#039;&#039;&#039; = KUID of map to load.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*True if successful, false otherwise.&lt;br /&gt;
;Syntax&lt;br /&gt;
 if (World.LoadMap(mapKUID) Interface.Print(&amp;quot;Map loaded OK&amp;quot;);&lt;br /&gt;
 else Interface.Print(&amp;quot;Map load failed&amp;quot;);&lt;br /&gt;
;Notes&lt;br /&gt;
*Use World.[[#FindKUID|FindKUID()]] to find the desired route KUID.&lt;br /&gt;
*In multiplayer, this will only succeed on the server.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==LoadSession==&lt;br /&gt;
{{MethodHeader|public native bool LoadSession([[Class KUID|KUID]] kuid)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;kuid&#039;&#039;&#039; = KUID of session to load.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*True if successful, false otherwise.&lt;br /&gt;
;Syntax&lt;br /&gt;
 if (World.LoadSession(sessionKUID) Interface.Print(&amp;quot;Session loaded OK&amp;quot;);&lt;br /&gt;
 else Interface.Print(&amp;quot;Session load failed&amp;quot;);&lt;br /&gt;
;Notes&lt;br /&gt;
*Use World.[[#FindKUID|FindKUID()]] to find the desired session KUID.&lt;br /&gt;
*In multiplayer, this will only succeed on the server.&lt;br /&gt;
*&amp;lt;font color=red&amp;gt;Added in ...?&amp;lt;/font&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Play2DSound==&lt;br /&gt;
{{MethodHeader|public float Play2DSound([[Class Asset|Asset]] asset, string wave)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;asset&#039;&#039;&#039; = Asset where the sound file is located.&lt;br /&gt;
*&#039;&#039;&#039;wave&#039;&#039;&#039; = Name of the &#039;&#039;*.wav&#039;&#039; file to be played, a relative path can be included.&lt;br /&gt;
;Returned Value&lt;br /&gt;
* Undefined.&lt;br /&gt;
;Syntax&lt;br /&gt;
 // Play the sound and continues script execution.&lt;br /&gt;
    World.Play2DSound(soundAsset,&amp;quot;sounds/allaboard.wav&amp;quot;);        &lt;br /&gt;
 // Wait until sound has completed before continuing (pre-TS12 only!)&lt;br /&gt;
    Sleep(World.Play2DSound(soundAsset,&amp;quot;sounds/allaboard.wav&amp;quot;)); &lt;br /&gt;
;Notes&lt;br /&gt;
*Plays a &#039;&#039;.wav&amp;quot; sound file from the given asset&#039;s folder.&lt;br /&gt;
*The sound is non directional and can be mono or stereo. &lt;br /&gt;
*This method does not return after the sound has finished playing, it returns with the length of the sound as soon as it is called. &lt;br /&gt;
*This means your code will keep on executing while Trainz is playing the sound.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==PlaySound==&lt;br /&gt;
{{MethodHeader|public native float PlaySound&amp;lt;br&amp;gt;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;([[Class Asset|Asset]] asset, string wave, float vol, float near, float far, [[Class GameObject|GameObject]] target, string pt)&amp;lt;br&amp;gt;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;([[Class Asset|Asset]] asset, string wave, float vol, float near, float far, [[Class GameObject|GameObject]] target, string pt, bool loop)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;asset&#039;&#039;&#039; = Asset where the sound file is located.&lt;br /&gt;
*&#039;&#039;&#039;wave&#039;&#039;&#039; = Name of the &#039;&#039;*.wav&#039;&#039; file to be played, a relative path can be included.&lt;br /&gt;
*&#039;&#039;&#039;vol&#039;&#039;&#039; = Volume level to play the sound at (0 to 1)&amp;lt;- These values taken from TRS2019 world.gs file comments&lt;br /&gt;
*&#039;&#039;&#039;near&#039;&#039;&#039; = Distance from the target asset at which the sound will be played at maximum volume.&lt;br /&gt;
*&#039;&#039;&#039;far&#039;&#039;&#039; = Distance from the target asset at which the sound will become inaudible.&lt;br /&gt;
*&#039;&#039;&#039;target&#039;&#039;&#039; = GameObject to which the sound will be attached if a 3d sound is required, null for 2D.&lt;br /&gt;
*&#039;&#039;&#039;pt&#039;&#039;&#039; = Name of attachment point in the target object if a 3d sound is required, null for 2D.&lt;br /&gt;
*&#039;&#039;&#039;loop&#039;&#039;&#039; = (Optional) If true the sound will loop continuously.&lt;br /&gt;
;Returned Value&lt;br /&gt;
* Sound length in seconds for Trainz before TS12&lt;br /&gt;
* Undefined for TS12 and TANE&lt;br /&gt;
;Syntax&lt;br /&gt;
 // Play the sound and continues script execution.&lt;br /&gt;
    World.PlaySound(soundAsset,&amp;quot;sounds/allaboard.wav&amp;quot;,1.0,10.0,100.0,Station,&amp;quot;a.loudspeaker&amp;quot;);     &lt;br /&gt;
 // Wait until sound has completed before continuing (pre-TS12 only!)&lt;br /&gt;
    Sleep(World.PlaySound(soundAsset,&amp;quot;sounds/allaboard.wav&amp;quot;,1000.0,10.0,100.0,Station,&amp;quot;a.loudspeaker&amp;quot;);     &lt;br /&gt;
;Notes&lt;br /&gt;
*Plays a &#039;&#039;.wav&#039;&#039; sound file from the given asset&#039;s folder.&lt;br /&gt;
*If the sound is to be directional a mono sound file is required. &lt;br /&gt;
*This method does not return after the sound has finished playing: it returns as soon as it is called. &lt;br /&gt;
*This means your code will keep on executing while Trainz is playing the sound.&lt;br /&gt;
*If you want to wait for the sound to complete playing before moving on, wrap the PlaySound() call up in a Sleep() call. &#039;&#039;&#039;Note!&#039;&#039;&#039; This works only in Trainz versions before TS12. For newer versions, TS12 and TANE, you can hard-code the duration of the sound, or store it in the extensions container of the config.txt file.&lt;br /&gt;
*The sound volume will be at a maximum for a camera position at or less than the value of the &#039;&#039;near&#039;&#039; parameter and will reduce with distance until the hearing position reaches &#039;&#039;far&#039;&#039;, when the sound will be inaudible.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==RemoveDriverCharacter==&lt;br /&gt;
{{MethodHeader|public native void RemoveDriverCharacter([[Class DriverCharacter|DriverCharacter]] driver)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;driver&#039;&#039;&#039; = DriverCharacter to remove.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 World.RemoveDriverCharacter(dave);&lt;br /&gt;
;Notes&lt;br /&gt;
*In multiplayer, this will only succeed on the server.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==RemoveDriverCommand==&lt;br /&gt;
{{MethodHeader|public native void RemoveDriverCommand([[Class DriverCommand|DriverCommand]] command)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;command&#039;&#039;&#039; = DriverCommand to remove.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 World.RemoveDriverCommand(driverCommand);&lt;br /&gt;
;Notes&lt;br /&gt;
*In multiplayer, this will only succeed on the server.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==RestartSession==&lt;br /&gt;
{{MethodHeader|public native bool RestartSession()}}&lt;br /&gt;
;Parameters&lt;br /&gt;
;Returned Value&lt;br /&gt;
*True if successful, false otherwise.&lt;br /&gt;
;Syntax&lt;br /&gt;
 World.RestartSession();&lt;br /&gt;
;Notes&lt;br /&gt;
*Valid in Driver mode only.&lt;br /&gt;
*In multiplayer, this will only succeed on the server.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==SetBadWeatherFog==&lt;br /&gt;
{{MethodHeader|public obsolete native void SetBadWeatherFog(float distance)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;distance&#039;&#039;&#039; = Bad weather fog distance to set.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 World.SetBadWeatherFog(0.5);&lt;br /&gt;
;Notes&lt;br /&gt;
*Obsolete in TRS19&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==SetCamera==&lt;br /&gt;
{{MethodHeader|public native bool SetCamera([[Class MapObject|MapObject]] focus)&amp;lt;br&amp;gt;public native void SetCamera([[Class Junction|Junction]] focus)&amp;lt;br&amp;gt;public native void SetCamera([[Class Vehicle|Vehicle]] focus, int cameraMode)&amp;lt;br&amp;gt;public native void SetCamera([[Class Train|Train]] focus, int cameraMode)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;focus&#039;&#039;&#039; = Object on which the camera is to be focused.&lt;br /&gt;
*&#039;&#039;cameraMode&#039;&#039;&#039; = One of the [[#Camera_View_Modes|Camera View Mode]] constants defining the view which should be assigned to the camera.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*The first variant returns a boolean to indicate success or failure.&lt;br /&gt;
*Remaining variants do not return a value&lt;br /&gt;
;Syntax&lt;br /&gt;
 World.SetCamera(train.GetVehicles[0],World.CAMERA_TRACKING); // sets the camera to track the first vehicle in the train.&lt;br /&gt;
;Notes&lt;br /&gt;
*&amp;lt;font color=red&amp;gt;Junction alias removed in TRS19?&amp;lt;/font&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==SetCameraAngle==&lt;br /&gt;
{{MethodHeader|public void SetCameraAngle(float yaw, float pitch, float radius)&amp;lt;br&amp;gt;public obsolete void SetCameraAngle(int yaw, int pitch, float radius)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;yaw&#039;&#039;&#039; = Camera rotation in radians (float) or degrees (int), 90 is a direct front view.&lt;br /&gt;
*&#039;&#039;&#039;pitch&#039;&#039;&#039; = Camera angle relative to the horizon in radians (float), or degrees (int), 0 is horizontal, 90 points vertically upwards.&lt;br /&gt;
*&#039;&#039;&#039;radius&#039;&#039;&#039; = Distance in metres to the object in focus.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 World.SetCameraAngle(90,0,25); // Sets the camera to a direct frontal view at 25 metres from the currently focused object.&lt;br /&gt;
;Notes&lt;br /&gt;
*&#039;&#039;Radius&#039;&#039; is measured from the object origin point (0,0,0). If there&#039;s no target object this will be the distance to the ground.&lt;br /&gt;
*Note difference in units of &#039;&#039;yaw&#039;&#039; and &#039;&#039;pitch&#039;&#039; depending in the method signature used.&lt;br /&gt;
*The integer version of this method call is obsolete in TRS19.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==SetCameraFlags==&lt;br /&gt;
{{MethodHeader|public native void SetCameraFlags(int flags)}}&lt;br /&gt;
;Parameter&lt;br /&gt;
*&#039;&#039;&#039;flags&#039;&#039;&#039;  integer value defining what the user is permitted to do with the game camera.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 // User is permitted to select External or Tracking views only.&lt;br /&gt;
    World.SetCameraFlags(World.CAMERA_EXTERNAL | World.CAMERA_TRACKING);&lt;br /&gt;
;Notes&lt;br /&gt;
*Use any combination of [[#Camera_Flags|Camera Flags]] and [[#Camera_View_Modes|Camera View Modes]] to set the parameter.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==SetCameraMode==&lt;br /&gt;
{{MethodHeader|public void SetCameraMode(int mode)}}&lt;br /&gt;
;Parameter&lt;br /&gt;
*&#039;&#039;&#039;mode&#039;&#039;&#039; = Camera mode to select.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 World.SetCameraMode(World.CAMERA_TRACKING);&lt;br /&gt;
;Notes&lt;br /&gt;
*Use one of the [[#Camera_View_Modes|Camera View Modes]] to set the parameter.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==SetEditingCamera==&lt;br /&gt;
{{MethodHeader|public void SetEditingCamera([[Class GameObject|GameObject]] actor, bool bIsActorEditingCamera)}}&lt;br /&gt;
;Parameter&lt;br /&gt;
*&#039;&#039;&#039;actor&#039;&#039;&#039; = The script who is intended to edit the camera position.&lt;br /&gt;
*&#039;&#039;&#039;bIsActorEditingCamera&#039;&#039;&#039; = True to begin editing, or False to end the editing operation. &lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 World.SetEditingCamera(myScript, true);&lt;br /&gt;
;Notes&lt;br /&gt;
*Hints to the caching systems that the camera position is in the process of being changed. This may reduce the amount of streaming that will occur until the change is complete.&lt;br /&gt;
*This is intended for use-cases where the decision to move the camera happens in advance of the actual call to [[#SetCamera|SetCamera()]] or etc., for example when the new camera target needs to be streamed in first.&lt;br /&gt;
*There is no advantage in calling this unless your code then sleeps/waits before undoing the call.&lt;br /&gt;
*It is not required to call this before using SetCamera() etc.&lt;br /&gt;
*A boolean state is stored per actor; multiple calls to enable editing on a single actor do not need to be matched to multiple calls to disable editing.&lt;br /&gt;
*It is counterproductive to call this when transitioning the camera over a short distance (ie. where the source and target locations can see each other). If jumping to a new location, followed by a visual camera transition at the new location, camera editing may be enabled around the target-selection for the jump, and the jump itself, but should be disabled before proceeding with the transition.&lt;br /&gt;
*&amp;lt;font color=red&amp;gt;Added in TRS19?&amp;lt;/font&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==SetGameDate==&lt;br /&gt;
{{MethodHeader|public void SetGameDate(int year, int month, int date)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;year&#039;&#039;&#039; = The year to set (1970-2038)&lt;br /&gt;
*&#039;&#039;&#039;month&#039;&#039;&#039; = The month to set (1-12)&lt;br /&gt;
*&#039;&#039;&#039;day&#039;&#039;&#039; = The day to set (1-31)&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 World.SetGameDate(2000, 12, 25);  // sets date to 25 December 2000&lt;br /&gt;
;Notes&lt;br /&gt;
*In multiplayer, this will only succeed on the server.&lt;br /&gt;
*&amp;lt;font color=red&amp;gt;Added in ...?&amp;lt;/font&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==SetGameTime==&lt;br /&gt;
{{MethodHeader|public void SetGameTime(float time)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;time&#039;&#039;&#039; = new gane time to set.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 World.SetGameTime(0.5);  // sets time to midnight&lt;br /&gt;
;Notes&lt;br /&gt;
*Game time is normalised to a value between 0.0 and 1.0&lt;br /&gt;
*0.0 = midday&lt;br /&gt;
*0.25 = 6 p.m.&lt;br /&gt;
*0.5 = midnight&lt;br /&gt;
*0.75 = 6 a.m.&lt;br /&gt;
*1.0 = midday again&lt;br /&gt;
*Use the [[#Time_Values|Time Value]] constants to convert human readable times to normalised values. &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==SetGameTimeRate==&lt;br /&gt;
{{MethodHeader|public native void SetGameTimeRate(float rate)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;rate&#039;&#039;&#039; = New time rate to set.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 World.SetGameTimeRate(World.TIME_RATE_8X); // sets game time to advance by 8 minutes per minute of real world time.&lt;br /&gt;
;Notes&lt;br /&gt;
*Use one of the [[#Time_Rate_Constants|Time Rate Constants]] to define the parameter.&lt;br /&gt;
*In multiplayer, this will only succeed on the server.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==SetGoodWeatherFog==&lt;br /&gt;
{{MethodHeader|public obsolete native void SetGoodWeatherFog(float distance)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;distance&#039;&#039;&#039; = Good weather fog distance to set.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 World.SetGoodWeatherFog(0.5);&lt;br /&gt;
;Notes&lt;br /&gt;
*Obsolete in TRS19&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==SetGroundDrawDistance==&lt;br /&gt;
{{MethodHeader|public obsolete native void SetGroundDrawDistance(float distance)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;distance&#039;&#039;&#039; = Ground draw distance in metres.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 World.SetGroundDrawDistance(1000.0);&lt;br /&gt;
;Notes&lt;br /&gt;
*Compatibility warning: Use of this function is not recommended, it may become non-functional in future Trainz versions.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==SetLayerVisible==&lt;br /&gt;
{{MethodHeader|public native void IsLayerVisible(string layerName, bool visible)}}&lt;br /&gt;
;Parameter&lt;br /&gt;
*layerName = Name of the layer to check&lt;br /&gt;
*visible = Whether to set the layer visible or not&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 World.IsLayerVisible(&amp;quot;MyLayer&amp;quot;, False);&lt;br /&gt;
;Notes&lt;br /&gt;
*Show/Hide a route/session layer.&lt;br /&gt;
*In multiplayer, this will only succeed on the server.&lt;br /&gt;
*&amp;lt;font color=red&amp;gt;Added in ...?&amp;lt;/font&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==SetSceneryDrawDistance==&lt;br /&gt;
{{MethodHeader|public obsolete native void SetSceneryDrawDistance(float distance)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;distance&#039;&#039;&#039; = unused.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Notes&lt;br /&gt;
* Does nothing. Included for script compatibility only.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==SetTargetObserver==&lt;br /&gt;
{{MethodHeader|public void SetTargetObserver([[Class GameObject|GameObject]] observer)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;observer&#039;&#039;&#039; = The game object to receive targeting messages.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetTargetObserver(self);&lt;br /&gt;
;Notes&lt;br /&gt;
* It is unlikely a script programmer would ever need to use this method.&lt;br /&gt;
* Causes the specified object to receive &amp;quot;Track&amp;quot;, &amp;quot;LeftClick&amp;quot; messages when a track is clicked. Causes the specified object to receive &amp;quot;Interface-Event&amp;quot;, &amp;quot;Left-Click&amp;quot; messages when a targetable MapObject is clicked. May cause the functionality of a left mouse click to change from what the user is expecting, so should be used with caution. Used in modal scripts to allow the user to indicate a location for train placement, etc. As there is only a single observer at any given time, the script must take care to only call this function when entering placement mode at the user&#039;s request.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==SetWeather==&lt;br /&gt;
{{MethodHeader|public native void SetWeather(int type, int changeability)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;type&#039;&#039;&#039; = Weather conditions as defined by one of the [[#Weather_Type_Constants|Weather Type Constants]].&lt;br /&gt;
*&#039;&#039;&#039;change&#039;&#039;&#039; = Weather variation as defined by one of the [[#Weather_Changeability_Constants|Weather Changeability Constants]].&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 World.SetWeather(World.WEATHER_TYPE_HEAVY_SNOW,World.WEATHER_CHANGEABILITY_EXTREME); // April in Paris.&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==SetWorldEditModeEnabled==&lt;br /&gt;
{{MethodHeader|public native bool SetWorldEditModeEnabled(int editFlags, bool enable)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;editFlags&#039;&#039;&#039; = Bitmask specifying which modes to alter, see PERMIT_EDIT_*&lt;br /&gt;
*&#039;&#039;cameraMode&#039;&#039;&#039; = Whether to enable or disable the mode&lt;br /&gt;
;Returned Value&lt;br /&gt;
*Whether the change was completely successful&lt;br /&gt;
;Syntax&lt;br /&gt;
 World.SetWorldEditModeEnabled(World.PERMIT_EDIT_TRAINS | World.PERMIT_EDIT_CONSISTS, True); // Enable player editing of trains and consists&lt;br /&gt;
;Notes&lt;br /&gt;
*This does not affect scripts which may alter the world, only the availability of the player world editing tools (i.e, the Surveyor tabs).&lt;br /&gt;
*&amp;lt;font color=red&amp;gt;Added in TRS19?&amp;lt;/font&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==SynchronouslyLoadGameObjectByID==&lt;br /&gt;
{{MethodHeader|public [[Class GameObject|GameObject]] SynchronouslyLoadGameObjectByID([[Class GameObjectID|GameObjectID]] objectID)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;objectID&#039;&#039;&#039; = The ID of the object to find.&lt;br /&gt;
;Returned Value&lt;br /&gt;
* The object, if it exists.&lt;br /&gt;
;Syntax&lt;br /&gt;
 GameObject my_object = World.SynchronouslyLoadGameObjectByID(objectID);&lt;br /&gt;
 if (my_object Interface.Print(&amp;quot;Object exists and has been loaded if required&amp;quot;);&lt;br /&gt;
;Notes&lt;br /&gt;
*This function is usable only by script &#039;thread&#039; functions and will throw an exception if called incorrectly.&lt;br /&gt;
*Added in TRS19&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==UpdatePositionToGroundHeight==&lt;br /&gt;
{{MethodHeader|public native bool UpdatePositionToGroundHeight([[Class WorldCoordinate|WorldCoordinate]] position)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;position&#039;&#039;&#039; (in, out) = Position object to update with the ground height at it&#039;s location&lt;br /&gt;
;Returned Value&lt;br /&gt;
* True if the ground position was updated&lt;br /&gt;
;Syntax&lt;br /&gt;
 if (World.UpdatePositionToGroundHeight(position) Interface.Print(&amp;quot;Position was updated&amp;quot;);&lt;br /&gt;
;Notes&lt;br /&gt;
*This updates the input &#039;&#039;position&#039;&#039; object with the ground height at that location.&lt;br /&gt;
*This process may fail if the ground data at the specified location is not currently loaded.&lt;br /&gt;
*&amp;lt;font color=red&amp;gt;Added in TRS19?&amp;lt;/font&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==UpdatePositionToSurfaceHeight==&lt;br /&gt;
{{MethodHeader|public native bool UpdatePositionToSurfaceHeight([[Class WorldCoordinate|WorldCoordinate]] position)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;position&#039;&#039;&#039; (in, out) = Position object to update with the water height at it&#039;s location&lt;br /&gt;
;Returned Value&lt;br /&gt;
* True if the ground position was updated&lt;br /&gt;
;Syntax&lt;br /&gt;
 if (World.UpdatePositionToGroundHeight(position) Interface.Print(&amp;quot;Position was updated&amp;quot;);&lt;br /&gt;
;Notes&lt;br /&gt;
*This updates the input &#039;&#039;position&#039;&#039; object with the water height at that location. If no water is present, the position is adjusted to the ground height.&lt;br /&gt;
*This process may fail if the ground data at the specified location is not currently loaded.&lt;br /&gt;
*&amp;lt;font color=red&amp;gt;Added in TRS19?&amp;lt;/font&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==UserSetCamera==&lt;br /&gt;
{{MethodHeader|public native bool UserSetCamera([[Class GameObject|GameObject]] target)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;target&#039;&#039;&#039; = GameObject to set focus to.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*True if successful, false otherwise.&lt;br /&gt;
;Syntax&lt;br /&gt;
 World.UserSetCamera(Router,GetGameObject(&amp;quot;Junction 5&amp;quot;));&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==UserSetCameraMode==&lt;br /&gt;
{{MethodHeader|public native void UserSetCameraMode(int mode)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;mode&#039;&#039;&#039; = One of the [[#Camera_View_Modes|Camera View Modes]]&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 World.UserSetCameraMode(World.CAMERA_ROAMING);  // switches to roaming view if permitted.&lt;br /&gt;
;Notes&lt;br /&gt;
*This method respects the current [[#Camera_Flags|Camera Flag]] settings, disallowing any change which the flags do not permit.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==UserSetCameraPosition==&lt;br /&gt;
{{MethodHeader|public native bool UserSetCamera([[Class WorldCoordinate|WorldCoordinate]] camPos)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;camPos&#039;&#039;&#039; = World coordinates to set camera to&lt;br /&gt;
;Returned Value&lt;br /&gt;
*True if successful, false otherwise.&lt;br /&gt;
;Syntax&lt;br /&gt;
 World.UserSetCamera(Router,GetGameObject(&amp;quot;Junction 5&amp;quot;));&lt;br /&gt;
;Notes&lt;br /&gt;
* For camera modes which do not need to target specific objects, this allows the camera to be set to an arbitrary world position.&lt;br /&gt;
*&amp;lt;font color=red&amp;gt;Added in TRS19?&amp;lt;/font&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Categories==&lt;br /&gt;
[[Category:Script Class]]&lt;/div&gt;</summary>
		<author><name>Ciceronmt</name></author>
	</entry>
	<entry>
		<id>https://wiki.trainzsimulator.com/index.php?title=Class_World&amp;diff=33208</id>
		<title>Class World</title>
		<link rel="alternate" type="text/html" href="https://wiki.trainzsimulator.com/index.php?title=Class_World&amp;diff=33208"/>
		<updated>2022-07-28T04:42:13Z</updated>

		<summary type="html">&lt;p&gt;Ciceronmt: /* GetGameObjectByIDIfLoaded */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;*[[TrainzScript Library Reference|API Hierarchy]]&lt;br /&gt;
**World (world.gs)&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
*World is a static class used to access various aspects of the Trainz environment.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Constants==&lt;br /&gt;
*These constants are used to define various values and can be used as mnenomics.&lt;br /&gt;
*If accessed from scripts the values must be prefixed &#039;&#039;World.&#039;&#039;, for example:&lt;br /&gt;
 World.SetWeather(World.WEATHER_TYPE_LIGHT_SNOW,World.WEATHER_CHANGEABILITY_PERIODIC);&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Camera View Modes===&lt;br /&gt;
----&lt;br /&gt;
*These values can be used either to choose the current camera viewing mode through World.[[#SetCameraMode|SetCameraMode()]], or to restrict certain camera modes from being accessed through methods such as World.[[#SetCamera|SetCamera()]].&lt;br /&gt;
&lt;br /&gt;
{{TableHeader|width=95%|margin=15px}}&lt;br /&gt;
|width=375|public define int CAMERA_INTERNAL = 1||Internal cabin camera view.&lt;br /&gt;
|-&lt;br /&gt;
|public define int CAMERA_EXTERNAL = 2||External train camera view&lt;br /&gt;
|-&lt;br /&gt;
|public define int CAMERA_TRACKING = 4||External tracking camera view.&lt;br /&gt;
|-&lt;br /&gt;
|public define int CAMERA_ROAMING = 128||Roaming camera view.&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Camera Flags===&lt;br /&gt;
----&lt;br /&gt;
*These flags are used in addition to the Camera Mode Flags to allow or disallow specific camera actions. &lt;br /&gt;
{{TableHeader|width=95%|margin=15px}}&lt;br /&gt;
|width=375|public define int CAMERA_SWITCH_VIEWS = 8||User permitted to swap between the camera views.&lt;br /&gt;
|-&lt;br /&gt;
|public define int CAMERA_SWITCH_VEHICLES = 16||User permitted to swap vehicles within the current train.&lt;br /&gt;
|-&lt;br /&gt;
|public define int CAMERA_SWITCH_TRAINS = 32||User permitted to swap to other trains which are in the consist menu.&lt;br /&gt;
|-&lt;br /&gt;
|public define int CAMERA_LOCKED = 64||User is NOT permitted to adjust camera (i.e. zoom, pan etc.).&lt;br /&gt;
|-&lt;br /&gt;
|public define int CAMERA_NORMAL = * ||Normal camera mode where everything is permitted.&lt;br /&gt;
|-&lt;br /&gt;
|colspan=2|&amp;lt;sup&amp;gt;* NOTE: CAMERA_NORMAL = CAMERA_INTERNAL | CAMERA_EXTERNAL | CAMERA_TRACKING | CAMERA_SWITCH_VIEWS | CAMERA_SWITCH_VEHICLES | CAMERA_SWITCH_TRAINS&amp;lt;/sup&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Weather Type Constants===&lt;br /&gt;
----&lt;br /&gt;
*Define the current state of the weather in Trainz. &lt;br /&gt;
*A variety of weather conditions are supported and can be changed by using one of these values with the World.[[#SetWeather|SetWeather()]] method. &lt;br /&gt;
{{TableHeader|width=95%|margin=15px}}&lt;br /&gt;
|width=375|public define int WEATHER_TYPE_CLEAR = 0||Clear weather, no clouds, rain or snow.&lt;br /&gt;
|-&lt;br /&gt;
|public define int WEATHER_TYPE_CLOUDY = 1||Cloudy weather, no rain.&lt;br /&gt;
|-&lt;br /&gt;
|public define int WEATHER_TYPE_DRIZZLE = 2||Drizzle, light rain.&lt;br /&gt;
|-&lt;br /&gt;
|public define int WEATHER_TYPE_RAIN = 3||Rainy weather.&lt;br /&gt;
|-&lt;br /&gt;
|public define int WEATHER_TYPE_STORMY = 4||Stormy weather that includes lightning and thunder.&lt;br /&gt;
|-&lt;br /&gt;
|public define int WEATHER_TYPE_LIGHT_SNOW = 5||Snowing lightly.&lt;br /&gt;
|-&lt;br /&gt;
|public define int WEATHER_TYPE_MEDIUM_SNOW = 6||Medium level snow fall.&lt;br /&gt;
|-&lt;br /&gt;
|public define int WEATHER_TYPE_HEAVY_SNOW = 7||Heavy snow fall.&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Weather Changeability Constants===&lt;br /&gt;
----&lt;br /&gt;
*Define the changeability settings for the weather. &lt;br /&gt;
*Weather changeability refers to variability of weather conditions rather than to a specific weather type.&lt;br /&gt;
{{TableHeader|width=95%|margin=15px}}&lt;br /&gt;
|width=375|public define int WEATHER_CHANGEABILITY_NONE = 0||Weather remains static.&lt;br /&gt;
|-&lt;br /&gt;
|public define int WEATHER_CHANGEABILITY_PERIODIC = 1||Periodic changes in weather.&lt;br /&gt;
|-&lt;br /&gt;
|public define int WEATHER_CHANGEABILITY_EXTREME = 2||Extreme and frequent changes in weather. &lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Time Values===&lt;br /&gt;
----&lt;br /&gt;
*Time constants defined in seconds.&lt;br /&gt;
{{TableHeader|width=95%|margin=15px}}&lt;br /&gt;
|width=375|public define float TIME_SECOND = 1.0f||One second.&lt;br /&gt;
|-&lt;br /&gt;
|public define float TIME_MINUTE = TIME_SECOND * 60.0f||One minute, 60.0 seconds.&lt;br /&gt;
|-&lt;br /&gt;
|public define float TIME_HOUR = TIME_MINUTE * 60.0f||One hour, 60.0 minutes, 3600.0 seconds.&lt;br /&gt;
|-&lt;br /&gt;
|public define float TIME_DAY = TIME_HOUR * 24.0f||One day, 24 hours, 1440.0 minutes, 86400.0 seconds.&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Time Rate Constants===&lt;br /&gt;
----&lt;br /&gt;
*Values that define the time rates relative to normal time. &lt;br /&gt;
*These constants can be used to set the time rate that Trainz runs out through the World.[[#SetGameTimeRate|SetGameTimeRate()]] method. &lt;br /&gt;
{{TableHeader|width=95%|margin=15px}}&lt;br /&gt;
|width=375|public define int  TIME_RATE_1X = 0||Real time (i.e. time in Trainz passes at the same rate as in the real world)&lt;br /&gt;
|-&lt;br /&gt;
|public define int TIME_RATE_2X = 1||Time passes at twice normal speed.&lt;br /&gt;
|-&lt;br /&gt;
|public define int TIME_RATE_4X = 2||&lt;br /&gt;
|-&lt;br /&gt;
|public define int TIME_RATE_8X = 3||&lt;br /&gt;
|-&lt;br /&gt;
|public define int TIME_RATE_16X = 4||&lt;br /&gt;
|-&lt;br /&gt;
|public define int TIME_RATE_32X = 5||&lt;br /&gt;
|-&lt;br /&gt;
|public define int TIME_RATE_60X = 6||&lt;br /&gt;
|-&lt;br /&gt;
|public define int TIME_RATE_120X = 7||&lt;br /&gt;
|-&lt;br /&gt;
|public define int TIME_RATE_240X = 8||&lt;br /&gt;
|-&lt;br /&gt;
|public define int TIME_RATE_360X = 9||&lt;br /&gt;
|-&lt;br /&gt;
|public define int TIME_RATE_480X = 10||&lt;br /&gt;
|-&lt;br /&gt;
|public define int TIME_RATE_720X = 11||&lt;br /&gt;
|-&lt;br /&gt;
|public define int TIME_RATE_960X = 12||&lt;br /&gt;
|-&lt;br /&gt;
|public define int TIME_RATE_1200X = 13||&lt;br /&gt;
|-&lt;br /&gt;
|public define int TIME_RATE_1440X = 14||&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Layer Type Constants===&lt;br /&gt;
----&lt;br /&gt;
*These constants can be used for querying route/session layers via [[#GetLayerList|GetLayerList]] and [[#GetLayerType|GetLayerType]].&lt;br /&gt;
*&amp;lt;font color=red&amp;gt;Added in TRS19?&amp;lt;/font&amp;gt;&lt;br /&gt;
{{TableHeader|width=95%|margin=15px}}&lt;br /&gt;
|width=375|public define int LAYER_INVALID = 0||&lt;br /&gt;
|-&lt;br /&gt;
|public define int LAYER_ROUTE = 1||&lt;br /&gt;
|-&lt;br /&gt;
|public define int LAYER_SESSION = 2||&lt;br /&gt;
|-&lt;br /&gt;
|public define int LAYER_BOTH = 3||&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===World Editing Mode Constants===&lt;br /&gt;
----&lt;br /&gt;
*These constants can be used to set editing modes through World.[[#SetWorldEditModeEnabled|SetWorldEditModeEnabled()]].&lt;br /&gt;
*&amp;lt;font color=red&amp;gt;Added in TRS19?&amp;lt;/font&amp;gt;&lt;br /&gt;
{{TableHeader|width=95%|margin=15px}}&lt;br /&gt;
|width=375|public define int PERMIT_EDIT_NONE = 0x0||&lt;br /&gt;
|-&lt;br /&gt;
|public define int PERMIT_EDIT_TOPOLOGY = 0x1||&lt;br /&gt;
|-&lt;br /&gt;
|public define int PERMIT_EDIT_PAINT = 0x2||&lt;br /&gt;
|-&lt;br /&gt;
|public define int PERMIT_EDIT_SCENERYOBJECTS = 0x4||&lt;br /&gt;
|-&lt;br /&gt;
|public define int PERMIT_EDIT_SCENERYSPLINES = 0x8||&lt;br /&gt;
|-&lt;br /&gt;
|public define int PERMIT_EDIT_TRACKSPLINES = 0x10||&lt;br /&gt;
|-&lt;br /&gt;
|public define int PERMIT_EDIT_TRACKSIDEOBJECTS = 0x20||&lt;br /&gt;
|-&lt;br /&gt;
|public define int PERMIT_EDIT_TRACKMARKS = 0x40||&lt;br /&gt;
|-&lt;br /&gt;
|public define int PERMIT_EDIT_TOOLS = 0x80||&lt;br /&gt;
|-&lt;br /&gt;
|public define int PERMIT_EDIT_WORLD = 0x100||&lt;br /&gt;
|-&lt;br /&gt;
|public define int PERMIT_EDIT_LAYERS = 0x200||&lt;br /&gt;
|-&lt;br /&gt;
|public define int PERMIT_EDIT_TRAINS = 0x400||&lt;br /&gt;
|-&lt;br /&gt;
|public define int PERMIT_EDIT_CONSISTS = 0x800||&lt;br /&gt;
|-&lt;br /&gt;
|public define int PERMIT_EDIT_ALL = -1||&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Trainz Modules===&lt;br /&gt;
----&lt;br /&gt;
*Trainz module mode constants. &lt;br /&gt;
*These values define the various module environments that Trainz can be in. &lt;br /&gt;
{{TableHeader|width=95%|margin=15px}}&lt;br /&gt;
|width=375|public define int  NO_MODULE = 0||Trainz not running in a module.&lt;br /&gt;
|-&lt;br /&gt;
|public define int SURVEYOR_MODULE = 1||Trainz is currently running in Surveyor.&lt;br /&gt;
|-&lt;br /&gt;
|public define int DRIVER_MODULE = 2||Trainz is currently running in Driver.&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
==Related Messages==&lt;br /&gt;
* [[TrainzScript Message Reference]]&amp;lt;br&amp;gt;&lt;br /&gt;
* [[Camera Messages]]&amp;lt;br&amp;gt;&lt;br /&gt;
* [[Interface Messages]]&amp;lt;br&amp;gt;&lt;br /&gt;
* [[ModuleInit Message]]&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==AddDriverCharacter==&lt;br /&gt;
{{MethodHeader|public native [[Class DriverCharacter|DriverCharacter]] AddDriverCharacter([[Class Asset|Asset]] driverCharacterAsset)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;driverCharacterAsset&#039;&#039;&#039; = Asset containing character to be added.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*Reference to the DriverCharacter if successful, null otherwise.&lt;br /&gt;
;Syntax&lt;br /&gt;
 DriverCharacter Casey = World.AddDriverCharacter(CaseyJones);&lt;br /&gt;
;Notes&lt;br /&gt;
*In multiplayer, this will only succeed on the server.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==AddDriverCommand==&lt;br /&gt;
{{MethodHeader|public native [[Class DriverCommand|DriverCommand]] AddDriverCommand([[Class Asset|Asset]] driverCommandAsset)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;driverCommandAsset&#039;&#039;&#039; = Asset containing command to be added.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*Reference to the DriverCommand if successful, null otherwise.&lt;br /&gt;
;Syntax&lt;br /&gt;
 DriverCommand GoFaster = World.AddDriverCommand(accelerate);&lt;br /&gt;
;Notes&lt;br /&gt;
*In multiplayer, this will only succeed on the server.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==CancelCurrentEditingMode==&lt;br /&gt;
{{MethodHeader|public native void CancelCurrentEditingMode(void)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*None&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 World.CancelCurrentEditingMode();&lt;br /&gt;
;Notes&lt;br /&gt;
* Cancels out of any player entered editing mode, if relevant. This should only normally be called as a result of direct player action.&lt;br /&gt;
*&amp;lt;font color=red&amp;gt;Added in TRS19?&amp;lt;/font&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==CreateBehavior==&lt;br /&gt;
{{MethodHeader|public native [[Class ScenarioBehavior|ScenarioBehavior]] CreateBehavior([[Class KUID|KUID]] kuid, [[Class Soup|Soup]] initialProperties)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;kuid&#039;&#039;&#039; = KUID of scenario.&lt;br /&gt;
&#039;&#039;&#039;initialProperties&#039;&#039;&#039; = Soup object containing initial properties for scenario.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*Reference to the ScenarioBehavior created if successful, null otherwise.&lt;br /&gt;
;Syntax&lt;br /&gt;
 ScenarioBehavior scenario = World.CreateBehavior(scenarioAsset, scenarioSoup);&lt;br /&gt;
;Notes&lt;br /&gt;
*The returned ScenarioBehavior object may be ended by releasing all references to it (resetting all references to null).&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==CreateTrain==&lt;br /&gt;
{{MethodHeader|public native [[Class Train|Train]] CreateTrain([[Class KUID|KUID]][ ] consist, string trackmarkName, bool direction)&amp;lt;br&amp;gt;public native [[Class Train|Train]] CreateTrain([[Class KUID|KUID]][ ] consist, [[Class TrackMark|TrackMark]] trackmark, bool direction)&amp;lt;br&amp;gt;public native [[Class Train|Train]] CreateTrain([[Class KUID|KUID]][ ] consist, [[Class Buildable|Buildable]] buildable, string trackName, float position, bool direction)&amp;lt;br&amp;gt;public native [[Class Train|Train]] CreateTrain([[Class KUID|KUID]][ ] consist, [[Class GSTrackSearch|GSTrackSearch]] tracksearch, bool avoidDerailments)&amp;lt;br&amp;gt;public native [[Class Train|Train]] CreateTrain([[Class KUID|KUID]][ ] consist, [[Class GSTrackSearch|GSTrackSearch]] tracksearch)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;consist&#039;&#039;&#039; = An array of vehicle KUIDs used to describe the required Train object.&lt;br /&gt;
*&#039;&#039;&#039;trackmarkName&#039;&#039;&#039; = Name of Trackmark at which the consist is to be formed.&lt;br /&gt;
*&#039;&#039;&#039;buildable&#039;&#039;&#039; = Buildable on which the consist is to be formed.&lt;br /&gt;
*&#039;&#039;&#039;trackName&#039;&#039;&#039; = Name of track within Buildable object.&lt;br /&gt;
*&#039;&#039;&#039;position&#039;&#039;&#039; = Distance at which the Train is to be placed relative to the start of the track.&lt;br /&gt;
*&#039;&#039;&#039;trackmark&#039;&#039;&#039; = Reference to Trackmark at which the consist is to be formed.&lt;br /&gt;
*&#039;&#039;&#039;direction&#039;&#039;&#039; = Orientation of Train relative to direction of track or trackmark.&lt;br /&gt;
*&#039;&#039;&#039;tracksearch&#039;&#039;&#039; = The location at which to create the train&lt;br /&gt;
*&#039;&#039;&#039;avoidDerailments&#039;&#039;&#039; = If true this function will fail and return null if creating the train would cause a derailment&lt;br /&gt;
;Returned Value&lt;br /&gt;
*Reference to the Train created if successful, null otherwise.&lt;br /&gt;
;Syntax&lt;br /&gt;
 Train train = World.CreateTrain(consist, buildable, &amp;quot;Track 1&amp;quot;, 10.0, true);&lt;br /&gt;
;Notes&lt;br /&gt;
*These methods create a train from a list of vehicles in a consist array.&lt;br /&gt;
*Depending on the variant of the method used, the train can be created at a Trackmark, specified by name or reference, or at a Buildable or Industry object.&lt;br /&gt;
*It is the responsibility of the script programmer to ensure that sufficient track exists at the given location to allow the train to be created.&lt;br /&gt;
*In multiplayer, this will only succeed on the server.&lt;br /&gt;
*&amp;lt;font color=red&amp;gt;&#039;&#039;&#039;GSTrackSearch&#039;&#039;&#039; aliases added in TRS19?&amp;lt;/font&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==DeleteTrain==&lt;br /&gt;
{{MethodHeader|public native void DeleteTrain([[Class Train|Train]] train)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;train&#039;&#039;&#039; = train to be deleted from map.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 World.DeleteTrain(flyingScotsman);&lt;br /&gt;
;Notes&lt;br /&gt;
*Once a train has been deleted, care should be taken to avoid using its reference.&lt;br /&gt;
*In multiplayer, this will only succeed on the server.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==DeleteVehicle==&lt;br /&gt;
{{MethodHeader|public native void DeleteVehicle([[Class Vehicle|Vehicle]] vehicle)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;vehicle&#039;&#039;&#039; = vehicle to be deleted from its train.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 World.DeleteVehicle(vehicles[vehicles.size()-1]);&lt;br /&gt;
;Notes&lt;br /&gt;
*Use [[Class Train#GetVehicles|Train.GetVehicles()]] to obtain an array of vehicles for a given train.&lt;br /&gt;
*Use [[Class Vehicle#GetMyTrain|Vehicle.GetMyTrain()]] to obtain a train reference for a given vehicle.&lt;br /&gt;
*In multiplayer, this will only succeed on the server.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==EndScenario==&lt;br /&gt;
{{MethodHeader|public void EndScenario(float time)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;time&#039;&#039;&#039; = Amount of seconds to delay before ending the session&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 World.EndScenario(30.0);&lt;br /&gt;
;Notes&lt;br /&gt;
*In multiplayer, this will only succeed on the server.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==FindAsset==&lt;br /&gt;
{{MethodHeader|public native [[Class Asset|Asset]] FindAsset([[Class KUID|KUID]] kuid)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;kuid&#039;&#039;&#039; = KUID of Asset to return.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*Given a valid KUID parameter, this method return an Asset reference if successful, null otherwise.&lt;br /&gt;
;Syntax&lt;br /&gt;
 Asset asset = World.FindAsset(kuid);&lt;br /&gt;
;Notes&lt;br /&gt;
*See also Asset.FindAsset()&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==FindDriverCommand==&lt;br /&gt;
{{MethodHeader|public native [[Class DriverCommand|DriverCommand]] FindDriverCommand([[Class Asset|Asset]] driverCommandAsset)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;driverCommandAsset&#039;&#039;&#039; = Asset containing command to be added.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*Reference to the DriverCommand if successful, null otherwise.&lt;br /&gt;
;Syntax&lt;br /&gt;
 DriverCommand GoFaster = World.FindDriverCommand(accelerate);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==GetAssetList==&lt;br /&gt;
{{MethodHeader|public native [[Class Asset|Asset]][ ] GetAssetList(string kind)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;kind&#039;&#039;&#039; = String representing the Kind of asset to return.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*A list of all assets of the given &#039;&#039;kind&#039;&#039;&lt;br /&gt;
;Syntax&lt;br /&gt;
 Asset[] Libraries = World.GetAssetList(&amp;quot;Library&amp;quot;);&lt;br /&gt;
;Notes&lt;br /&gt;
*All installed assets of the given &#039;&#039;kind&#039;&#039; are returned, irrespective of whether or not they are in use on the current map.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==GetBadWeatherFog==&lt;br /&gt;
{{MethodHeader|public obsolete native float GetBadWeatherFog(void)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*None&lt;br /&gt;
;Returned Value&lt;br /&gt;
*Bad weather fog distance as a float in the range 0.0..1.0.&lt;br /&gt;
;Syntax&lt;br /&gt;
 float dist = World.GetBadWeatherFog();&lt;br /&gt;
;Notes&lt;br /&gt;
*Obsolete in TRS19&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==GetBehaviors==&lt;br /&gt;
{{MethodHeader|public native [[Class ScenarioBehavior|ScenarioBehavior]][ ] GetBehaviors(void)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*None&lt;br /&gt;
;Returned Value&lt;br /&gt;
*A list of top-level behaviors or rules on the currently loaded route.&lt;br /&gt;
;Syntax&lt;br /&gt;
 ScenarioBehavior[] rules = World.GetBehaviors();&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==GetCameraPitch==&lt;br /&gt;
{{MethodHeader|public native float GetCameraPitch(void)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*None&lt;br /&gt;
;Returned Value&lt;br /&gt;
*Current camera pitch, in radians&lt;br /&gt;
;Syntax&lt;br /&gt;
 float pitch = World.GetCameraPitch();&lt;br /&gt;
;Notes&lt;br /&gt;
*&amp;lt;font color=red&amp;gt;Added in ...?&amp;lt;/font&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==GetCameraPositionX==&lt;br /&gt;
{{MethodHeader|public obsolete native float GetCameraPositionX(void)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*None&lt;br /&gt;
;Returned Value&lt;br /&gt;
*X Coordinate of the current camera position.&lt;br /&gt;
;Syntax&lt;br /&gt;
 float X = World.GetCameraPositionX();&lt;br /&gt;
;Notes&lt;br /&gt;
*Obsolete in TRS19&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==GetCameraPositionY==&lt;br /&gt;
{{MethodHeader|public obsolete native float GetCameraPositionY(void)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*None&lt;br /&gt;
;Returned Value&lt;br /&gt;
*Y Coordinate of the current camera position.&lt;br /&gt;
;Syntax&lt;br /&gt;
 float Y = World.GetCameraPositionY();&lt;br /&gt;
;Notes&lt;br /&gt;
*Obsolete in TRS19&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==GetCameraPositionZ==&lt;br /&gt;
{{MethodHeader|public obsolete native float GetCameraPositionZ(void)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*None&lt;br /&gt;
;Returned Value&lt;br /&gt;
*Z Coordinate of the current camera position.&lt;br /&gt;
;Syntax&lt;br /&gt;
 float Z = World.GetCameraPositionZ();&lt;br /&gt;
;Notes&lt;br /&gt;
*Obsolete in TRS19&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==GetCameraYaw==&lt;br /&gt;
{{MethodHeader|public native float GetCameraYaw(void)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*None&lt;br /&gt;
;Returned Value&lt;br /&gt;
*Current camera yaw, in radians&lt;br /&gt;
;Syntax&lt;br /&gt;
 float yaw = World.GetCameraYaw();&lt;br /&gt;
;Notes&lt;br /&gt;
*&amp;lt;font color=red&amp;gt;Added in ...?&amp;lt;/font&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==GetCameraZoom==&lt;br /&gt;
{{MethodHeader|public native float GetCameraZoom(void)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*None&lt;br /&gt;
;Returned Value&lt;br /&gt;
*Current camera zoom, in meters&lt;br /&gt;
;Syntax&lt;br /&gt;
 float zoom= World.GetCameraZoom();&lt;br /&gt;
;Notes&lt;br /&gt;
*&amp;lt;font color=red&amp;gt;Is this value equivalent to &#039;&#039;&#039;radius&#039;&#039;&#039; in [[#SetCameraAngle|SetCameraAngle()]]?&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=red&amp;gt;Added in ...?&amp;lt;/font&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==GetCurrentModule==&lt;br /&gt;
{{MethodHeader|public native int GetCurrentModule(void)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*None&lt;br /&gt;
;Returned Value&lt;br /&gt;
*An integer representing the current Trainz module.&lt;br /&gt;
;Syntax&lt;br /&gt;
 int module = World.GetCurrentModule();&lt;br /&gt;
;Notes&lt;br /&gt;
* See [[#Trainz Modules|Trainz Modules]] for details of the constants associated with this method. &lt;br /&gt;
* See [[ModuleInit Message]] for further details.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==GetCurrentProfile==&lt;br /&gt;
{{MethodHeader|public native [[Class Asset|Asset]] GetCurrentProfile(void)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*None&lt;br /&gt;
;Returned Value&lt;br /&gt;
*The current session asset&lt;br /&gt;
;Syntax&lt;br /&gt;
 Asset currentSession = World.GetCurrentProfile();&lt;br /&gt;
;Notes&lt;br /&gt;
*&amp;lt;font color=red&amp;gt;Added in ...?&amp;lt;/font&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==GetCurrentTrain==&lt;br /&gt;
{{MethodHeader|public native Train GetCurrentTrain(void)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*None&lt;br /&gt;
;Returned Value&lt;br /&gt;
*The currently focused train&lt;br /&gt;
;Syntax&lt;br /&gt;
 Train myTrain = World.GetCurrentTrain();&lt;br /&gt;
;Notes&lt;br /&gt;
* The current train is the one currently controlled by the user, which may not be the train the camera is focused on.&lt;br /&gt;
*&amp;lt;font color=red&amp;gt;Added in ...?&amp;lt;/font&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==GetDriverCharacterList==&lt;br /&gt;
{{MethodHeader|public native [[Class DriverCharacter|DriverCharacter]][ ] GetDriverCharacterList(void)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*None&lt;br /&gt;
;Returned Value&lt;br /&gt;
*An array of DriverCharacter objects installed in the current world.&lt;br /&gt;
;Syntax&lt;br /&gt;
 DriverCharacter[] drivers = World.GetDriverCharacterList();&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==GetDriverCommandList==&lt;br /&gt;
{{MethodHeader|public native [[Class DriverCommand|DriverCommand]][ ] GetDriverCommandList(void)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*None&lt;br /&gt;
;Returned Value&lt;br /&gt;
*An array of DriverCommand objects installed in the current world.&lt;br /&gt;
;Syntax&lt;br /&gt;
 DriverCommand[] commands = World.GetDriverCommandList();&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==GetGameDate==&lt;br /&gt;
{{MethodHeader|public native int GetGameDate(void)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*None&lt;br /&gt;
;Returned value&lt;br /&gt;
*Current game day (1 - 31)&lt;br /&gt;
;Syntax&lt;br /&gt;
 int Now = World.GetGameDate();&lt;br /&gt;
;Notes&lt;br /&gt;
*&amp;lt;font color=red&amp;gt;Added in ...?&amp;lt;/font&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==GetGameMonth==&lt;br /&gt;
{{MethodHeader|public native int GetGameMonth(void)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*None&lt;br /&gt;
;Returned value&lt;br /&gt;
*Current game month (1 - 12)&lt;br /&gt;
;Syntax&lt;br /&gt;
 int Now = World.GetGameMonth();&lt;br /&gt;
;Notes&lt;br /&gt;
*&amp;lt;font color=red&amp;gt;Added in ...?&amp;lt;/font&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==GetGameObjectByID==&lt;br /&gt;
{{MethodHeader|public native [[Class AsyncObjectSearchResult|AsyncObjectSearchResult]] GetGameObjectByID([[Class GameObjectID|GameObjectID]] objectID, bool bTriggerLoad)&amp;lt;br&amp;gt;public native [[Class AsyncObjectSearchResult|AsyncObjectSearchResult]] GetGameObjectByID([[Class GameObjectID|GameObjectID]] objectID)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;objectID&#039;&#039;&#039; = The ID of the object to find.&lt;br /&gt;
*&#039;&#039;&#039;bTriggerLoad&#039;&#039;&#039; = Optional, defaults to true. Whether to trigger an asynchronous load of any matching object (if it&#039;s not loaded already).&lt;br /&gt;
;Returned Value&lt;br /&gt;
* Asynchronous search result object. &lt;br /&gt;
;Syntax&lt;br /&gt;
 AsyncObjectSearchResult search_result = World.GetGameObjectByID(objectID, true);  // Search for and load an object&lt;br /&gt;
;Notes&lt;br /&gt;
*See [[HowTo/Search for objects in the world]] for a detailed guide on asynchronous searches.&lt;br /&gt;
*The retured object is a reference to the in-progress object search.&lt;br /&gt;
*When the search completes, a message of type &amp;quot;ObjectSearch&amp;quot;,&amp;quot;AsyncResult&amp;quot; will be posted to the result object.&lt;br /&gt;
*If bTriggerLoad is true, a further message of type &amp;quot;ObjectSearch&amp;quot;,&amp;quot;AsyncLoadComplete&amp;quot; will be posted when all objects are loaded into memory. This message will still be posted if every object is already loaded.&lt;br /&gt;
*Added in TRS19&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==GetGameObjectByIDIfLoaded==&lt;br /&gt;
{{MethodHeader|public native [[Class GameObject|GameObject]] GetGameObjectByIDIfLoaded([[Class GameObjectID|GameObjectID]] objectID)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;objectID&#039;&#039;&#039; = The ID of the boject to find.&lt;br /&gt;
;Returned Value&lt;br /&gt;
* The object, if it exists and is currently loaded.&lt;br /&gt;
;Syntax&lt;br /&gt;
 GameObject my_object = World.GetGameObjectByID(objectID);&lt;br /&gt;
 if (my_object) Interface.Print(&amp;quot;Object exists and is loaded&amp;quot;);&lt;br /&gt;
;Notes&lt;br /&gt;
*Added in TRS19&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==GetGameSeason==&lt;br /&gt;
{{MethodHeader|public native float GetGameSeason(void)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*None&lt;br /&gt;
;Returned value&lt;br /&gt;
*Current game season&lt;br /&gt;
;Syntax&lt;br /&gt;
 float Season = World.GetGameSeason();&lt;br /&gt;
;Notes&lt;br /&gt;
*The returned time is normalised to a value between 0.0 and 1.0&lt;br /&gt;
*0.0 = mid-summer&lt;br /&gt;
*0.5 = mid-winter&lt;br /&gt;
*&amp;lt;font color=red&amp;gt;Added in ...?&amp;lt;/font&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==GetGameTime==&lt;br /&gt;
{{MethodHeader|public native float GetGameTime(void)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*None&lt;br /&gt;
;Returned value&lt;br /&gt;
*Current game time.&lt;br /&gt;
;Syntax&lt;br /&gt;
 float Now = World.GetGameTime();&lt;br /&gt;
;Notes&lt;br /&gt;
*The returned time is normalised to a value between 0.0 and 1.0&lt;br /&gt;
*0.0 = midday&lt;br /&gt;
*0.25 = 6 p.m.&lt;br /&gt;
*0.5 = midnight&lt;br /&gt;
*0.75 = 6 a.m.&lt;br /&gt;
*1.0 = midday again&lt;br /&gt;
*Use the [[#Time_Values|Time Value]] constants to convert the normalised values to human readable times.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==GetGameYear==&lt;br /&gt;
{{MethodHeader|public native int GetGameYear(void)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*None&lt;br /&gt;
;Returned value&lt;br /&gt;
*Current game year.&lt;br /&gt;
;Syntax&lt;br /&gt;
 int Now = World.GetGameYear();&lt;br /&gt;
;Notes&lt;br /&gt;
*&amp;lt;font color=red&amp;gt;Added in ...?&amp;lt;/font&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==GetGoodWeatherFog==&lt;br /&gt;
{{MethodHeader|public obsolete native float GetGoodWeatherFog(void)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*None&lt;br /&gt;
;Returned Value&lt;br /&gt;
*Good weather fog distance as a float in the range 0.0..1.0.&lt;br /&gt;
;Syntax&lt;br /&gt;
 float dist = World.GetGoodWeatherFog();&lt;br /&gt;
;Notes&lt;br /&gt;
*Obsolete in TRS19&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==GetGroundDrawDistance==&lt;br /&gt;
{{MethodHeader|public obsolete native float GetGroundDrawDistance(void)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*None&lt;br /&gt;
;Returned Value&lt;br /&gt;
*Ground draw distance in metres.&lt;br /&gt;
;Syntax&lt;br /&gt;
 float dist = World.GetGroundDrawDistance();&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==GetIndustryList==&lt;br /&gt;
{{MethodHeader|public obsolete native [[Class GameObject|GameObject]][ ] GetIndustryList(void)}}&lt;br /&gt;
;Parameters &lt;br /&gt;
*None&lt;br /&gt;
;Returned Value&lt;br /&gt;
*An array of references to all of the Industry objects for the current route.&lt;br /&gt;
;Syntax&lt;br /&gt;
 GameObject[] Industries = World.GetIndustryList();&lt;br /&gt;
;Notes&lt;br /&gt;
*This function is obsolete and should not be used. Use [[#GetNamedObjectList|GetNamedObjectList]] instead.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==GetJunctionList==&lt;br /&gt;
{{MethodHeader|public obsolete native [[Class Junction|Junction]][ ] GetJunctionList(void)}}&lt;br /&gt;
;Parameters &lt;br /&gt;
*None&lt;br /&gt;
;Returned Value&lt;br /&gt;
*An array of references to all of the trackside junction objects for the current route.&lt;br /&gt;
;Syntax&lt;br /&gt;
 Junction[] junctions = World.GetJunctionList();&lt;br /&gt;
;Notes&lt;br /&gt;
*This function is obsolete and should not be used. Use [[#GetNamedObjectList|GetNamedObjectList]] instead.&lt;br /&gt;
*Junction objects attached to fixed track junctions are not returned by this method.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==GetLayerList==&lt;br /&gt;
{{MethodHeader|public native string[ ] GetLayerList(int layerType)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*layerType = LAYER_ROUTE, LAYER_SESSION, or LAYER_BOTH&lt;br /&gt;
;Returned Value&lt;br /&gt;
*Array of layer names&lt;br /&gt;
;Syntax&lt;br /&gt;
 string[] routeLayerNames = World.GetLayerList(World.LAYER_ROUTE);&lt;br /&gt;
;Notes&lt;br /&gt;
*&amp;lt;font color=red&amp;gt;Added in ...?&amp;lt;/font&amp;gt; &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==GetLayerType==&lt;br /&gt;
{{MethodHeader|public native int GetLayerType(string layerName)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*layerName = The name of the layer&lt;br /&gt;
;Returned Value&lt;br /&gt;
*LAYER_ROUTE or LAYER_SESSION&lt;br /&gt;
;Syntax&lt;br /&gt;
 int layerType = World.GetLayerType(&amp;quot;MyLayer&amp;quot;);&lt;br /&gt;
;Notes&lt;br /&gt;
*&amp;lt;font color=red&amp;gt;Added in ...?&amp;lt;/font&amp;gt; &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==GetLibrary==&lt;br /&gt;
{{MethodHeader|public native [[Class Library|Library]] GetLibrary([[Class KUID|KUID]] kuid)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;kuid&#039;&#039;&#039; = KUID of script library asset to load.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*A reference to the script library asset if successful, null otherwise.&lt;br /&gt;
;Syntax&lt;br /&gt;
 Library codelib = World.GetLibrary(LibraryKUID);&lt;br /&gt;
;Notes&lt;br /&gt;
*The [[Class Library|Library]] asset is initialised when this method is first called in a session.&lt;br /&gt;
*Since only one instance can exist, subsequent calls return a reference to the existing Library object.&lt;br /&gt;
*See [[Class Library|Library]] for notes on how to use this method.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==GetLocalPlayerName==&lt;br /&gt;
{{MethodHeader|public native string GetLocalPlayerName(void)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*None&lt;br /&gt;
;Returned Value&lt;br /&gt;
*The name of the local player&lt;br /&gt;
;Syntax&lt;br /&gt;
 string playerName = World.GetLocalPlayerName();&lt;br /&gt;
;Notes&lt;br /&gt;
* Gets the name of the local player, as should be used for setting ownership on DriverCharacters, etc.&lt;br /&gt;
*&amp;lt;font color=red&amp;gt;Added in .TRS19?&amp;lt;/font&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==GetNamedObjectList==&lt;br /&gt;
{{MethodHeader|public native [[Class AsyncObjectSearchResult|AsyncObjectSearchResult]] GetNamedObjectList(string categoryFilter, string nameFilter, bool bNotifyOfExpiry)&amp;lt;br&amp;gt;public [[Class AsyncObjectSearchResult|AsyncObjectSearchResult]] GetNamedObjectList(string categoryFilter, string nameFilter)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;categoryFilter&#039;&#039;&#039; = A category filter to search for. Optional, provided a nameFilter parameter is provided. A category code reference can be found in [[Class AssetCategory|AssetCategory]].&lt;br /&gt;
*&#039;&#039;&#039;nameFilter&#039;&#039;&#039; = A partial object name to search for. Optional, provided a categoryFilter parameter is provided.&lt;br /&gt;
*&#039;&#039;&#039;bNotifyOfExpiry&#039;&#039;&#039; = Optional, defaults to false. If native code detects that the search results have changed then a message of type &amp;quot;ObjectSearch&amp;quot;,&amp;quot;Expired&amp;quot; will be posted to the result object, and the calling script can perform a new search if desired&lt;br /&gt;
;Returned Value&lt;br /&gt;
* Asynchronous search result object. &lt;br /&gt;
;Syntax&lt;br /&gt;
 AsyncObjectSearchResult search_result = World.GetNamedObjectList(AssetCategory.Locomotive, &amp;quot;SD40-2&amp;quot;); // Search for all SD40-2 locomotives in the world&lt;br /&gt;
;Notes&lt;br /&gt;
*See [[HowTo/Search for objects in the world]] for a detailed guide on asynchronous searches.&lt;br /&gt;
*The retured object is a reference to the in-progress object search.&lt;br /&gt;
*When the search completes, a message of type &amp;quot;ObjectSearch&amp;quot;,&amp;quot;AsyncResult&amp;quot; will be posted to the result object.&lt;br /&gt;
*With expiration notices are enabled, only one notification of type &amp;quot;ObjectSearch&amp;quot;,&amp;quot;Expired&amp;quot; will be posted for each search.&lt;br /&gt;
*Added in TRS19&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==GetSceneryDrawDistance==&lt;br /&gt;
{{MethodHeader|public obsolete native float GetSceneryDrawDistance(void)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*None&lt;br /&gt;
;Returned Value&lt;br /&gt;
*Undefined.&lt;br /&gt;
;Notes&lt;br /&gt;
*Included for legacy script compatibility only. Has no effect.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==GetSeconds==&lt;br /&gt;
{{MethodHeader|public native float GetSeconds(void)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*None&lt;br /&gt;
;Returned Value&lt;br /&gt;
*The current value of a floating point number incrementing once per second in real time.&lt;br /&gt;
;Syntax&lt;br /&gt;
 float start = World.GetSeconds();&lt;br /&gt;
 // do stuff&lt;br /&gt;
 float finish = World.GetSeconds();&lt;br /&gt;
 float period = finish - start;&lt;br /&gt;
;Notes&lt;br /&gt;
*Each call will return a float value containing the current value of an internal counter.&lt;br /&gt;
*Subtracting a later value from a value saved at an earlier call will enable the delay between the two calls to be established.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==GetSignalList==&lt;br /&gt;
{{MethodHeader|public obsolete native [[Class Signal|Signal]][ ] GetSignalList(void)}}&lt;br /&gt;
;Parameters &lt;br /&gt;
*None&lt;br /&gt;
;Returned Value&lt;br /&gt;
*An array of references to all of the signal objects for the current route.&lt;br /&gt;
;Syntax&lt;br /&gt;
 Signal[] signals = World.GetSignalList();&lt;br /&gt;
;Notes&lt;br /&gt;
*This function is obsolete and should not be used. Use [[#GetNamedObjectList|GetNamedObjectList]] instead.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==GetStringTable==&lt;br /&gt;
{{MethodHeader|public native [[Class StringTable|StringTable]] GetStringTable(void)}}&lt;br /&gt;
;Parameters &lt;br /&gt;
*None&lt;br /&gt;
;Returned Value&lt;br /&gt;
*The StringTable for the current session.&lt;br /&gt;
;Syntax&lt;br /&gt;
 StringTable data = World.GetStringTable();&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==GetSurveyorSavedConsist==&lt;br /&gt;
{{MethodHeader|public obsolete native [[Class Soup|Soup]] GetSurveyorSavedConsist(string name)}}&lt;br /&gt;
;Parameters &lt;br /&gt;
*&#039;&#039;&#039;name&#039;&#039;&#039; = Name of the consist to retrieve.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*Returns a Soup definition of the named consist if it exists, null otherwise.&lt;br /&gt;
;Syntax&lt;br /&gt;
 Soup consist = World.GetSurveyorSavedConsist(&amp;quot;Brighton Belle&amp;quot;);&lt;br /&gt;
;Notes&lt;br /&gt;
*Remember that the returned data is in a Soup format, which is not the same thing as a Train. &lt;br /&gt;
*[[Class TrainUtil#CreateTrainFromSoup|TrainUtil.CreateTrainFromSoup()]] can be used to create a train from the returned Soup.&lt;br /&gt;
*This method only works in Surveyor.&lt;br /&gt;
*Obsolete in TRS19.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==GetSurveyorSavedConsistList==&lt;br /&gt;
{{MethodHeader|public native string[ ] GetSurveyorSavedConsistList()}}&lt;br /&gt;
;Parameters &lt;br /&gt;
*None&lt;br /&gt;
;Returned Value&lt;br /&gt;
*An array of names of all the saved consist objects in Surveyor.&lt;br /&gt;
;Syntax&lt;br /&gt;
 string[] consists = World.GetSurveyorSavedConsistList();&lt;br /&gt;
;Notes&lt;br /&gt;
*This method only works in Surveyor.&lt;br /&gt;
*Obsolete in TRS19.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==GetTimeElapsed==&lt;br /&gt;
{{MethodHeader|public native float GetTimeElapsed(void)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*None&lt;br /&gt;
;Returned Value&lt;br /&gt;
*The number of real-time seconds that have passed since the start of the current session. &lt;br /&gt;
;Syntax&lt;br /&gt;
 float secondsElapsed = World.GetTimeElapsed();&lt;br /&gt;
;Notes&lt;br /&gt;
*This measure of time stops passing while the game is paused.&lt;br /&gt;
*&amp;lt;font color=red&amp;gt;Added in ...?&amp;lt;/font&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==GetTrackmarkList==&lt;br /&gt;
{{MethodHeader|public obsolete native [[Class TrackMark|TrackMark]][ ] GetTrackmarkList(void)}}&lt;br /&gt;
;Parameters &lt;br /&gt;
*None&lt;br /&gt;
;Returned Value&lt;br /&gt;
*An array of references to all of the trackmark objects for the current route.&lt;br /&gt;
;Syntax&lt;br /&gt;
 Trackmark[] trackmarks = World.GetTrackmarkList();&lt;br /&gt;
;Notes&lt;br /&gt;
*This function is obsolete and should not be used. Use [[#GetNamedObjectList|GetNamedObjectList]] instead.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==GetTrainList==&lt;br /&gt;
{{MethodHeader|public obsolete native [[Class Train|Train]][ ] GetTrainList(void)}}&lt;br /&gt;
;Parameters &lt;br /&gt;
*None&lt;br /&gt;
;Returned Value&lt;br /&gt;
*An array of references to all of the trains for the current route.&lt;br /&gt;
;Syntax&lt;br /&gt;
 Train[] trains = World.GetTrainList();&lt;br /&gt;
;Notes&lt;br /&gt;
*This function is obsolete and should not be used. Use [[#GetNamedObjectList|GetNamedObjectList]] instead.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==GetTrainzBuild==&lt;br /&gt;
{{MethodHeader|public native int GetTrainzBuild(void)}}&lt;br /&gt;
;Parameters;&lt;br /&gt;
*None&lt;br /&gt;
;Returned Value&lt;br /&gt;
*Gets the current build number of Trainz. &lt;br /&gt;
;Syntax&lt;br /&gt;
 int build = World.GetTrainzBuild();&lt;br /&gt;
;Notes&lt;br /&gt;
*The value returned corresponds to the build number you can see in the bottom-right side of the main Trainz menu screen.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==GetTrainzVersion==&lt;br /&gt;
{{MethodHeader|public native float GetTrainzVersion(void)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*None&lt;br /&gt;
;Returned Value&lt;br /&gt;
*The TRS version number.&lt;br /&gt;
;Syntax&lt;br /&gt;
 float version = World.GetTrainzVersion();&lt;br /&gt;
;Notes&lt;br /&gt;
*The value returned corresponds to the version number of Content manager (for example 4.6). &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==GetTriggerList==&lt;br /&gt;
{{MethodHeader|public obsolete native [[Class Trigger|Trigger]][ ] GetTriggerList(void)}}&lt;br /&gt;
;Parameters &lt;br /&gt;
*None&lt;br /&gt;
;Returned Value&lt;br /&gt;
*An array of references to all of the trigger objects for the current route.&lt;br /&gt;
;Syntax&lt;br /&gt;
 Trigger[] triggers = World.GetTriggerList();&lt;br /&gt;
;Notes&lt;br /&gt;
*This function is obsolete and should not be used. Use [[#GetNamedObjectList|GetNamedObjectList]] instead.&lt;br /&gt;
*This method does not return scenery triggers, ie those attached to SceneryWithTrack objects and their descendants.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==GetVehicleList==&lt;br /&gt;
{{MethodHeader|public obsolete native [[Class Vehicle|Vehicle]][ ] GetVehicleList(void)}}&lt;br /&gt;
;Parameters &lt;br /&gt;
*None&lt;br /&gt;
;Returned Value&lt;br /&gt;
*An array of references to all of the vehicles in the current route.&lt;br /&gt;
;Syntax&lt;br /&gt;
 Vehicle[] vehicles = World.GetVehicleList();&lt;br /&gt;
;Notes&lt;br /&gt;
*This function is obsolete and should not be used. Use [[#GetNamedObjectList|GetNamedObjectList]] instead.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==GetWeatherChangeability==&lt;br /&gt;
{{MethodHeader|public native int GetWeatherChangeability(void)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*None&lt;br /&gt;
;Returned Value&lt;br /&gt;
*One of the [[#Weather_Changeability_Constants|Weather Changeability Constants]] denoting the variability of weather conditions.&lt;br /&gt;
;Syntax&lt;br /&gt;
 int variability = World.GetWeatherChangeability();&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==GetWeatherType==&lt;br /&gt;
{{MethodHeader|public native int GetWeatherType(void)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*None&lt;br /&gt;
;Returned Value&lt;br /&gt;
*One of the [[#Weather_Type_Constants|Weather Type Constants]] denoting the current weather conditions.&lt;br /&gt;
;Syntax&lt;br /&gt;
 int weather = World.GetWeatherType();&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==IsAssetRestrictionInEffect==&lt;br /&gt;
{{MethodHeader|public native bool IsAssetRestrictionInEffect(string)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*None&lt;br /&gt;
;Returned Value&lt;br /&gt;
*Whether this game world has Asset Restrictions. &lt;br /&gt;
;Syntax&lt;br /&gt;
 bool assetRestrictionsExist = World.IsAssetRestrictionInEffect();&lt;br /&gt;
;Notes&lt;br /&gt;
*Multiplayer Sessions require Asset Restrictions to be in effect to avoid compatibility issues between peers.&lt;br /&gt;
*&amp;lt;font color=red&amp;gt;Added in ...?&amp;lt;/font&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==IsLayerVisible==&lt;br /&gt;
{{MethodHeader|public native bool IsLayerVisible(string layerName)}}&lt;br /&gt;
;Parameter&lt;br /&gt;
*layerName = Name of the layer to check&lt;br /&gt;
;Returned Value&lt;br /&gt;
*Whether the layer is visible&lt;br /&gt;
;Syntax&lt;br /&gt;
 bool isVisible = World.IsLayerVisible(&amp;quot;MyLayer&amp;quot;);&lt;br /&gt;
;Notes&lt;br /&gt;
*&amp;lt;font color=red&amp;gt;Added in ...?&amp;lt;/font&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==LoadMap==&lt;br /&gt;
{{MethodHeader|public native bool LoadMap([[Class KUID|KUID]] kuid)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;kuid&#039;&#039;&#039; = KUID of map to load.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*True if successful, false otherwise.&lt;br /&gt;
;Syntax&lt;br /&gt;
 if (World.LoadMap(mapKUID) Interface.Print(&amp;quot;Map loaded OK&amp;quot;);&lt;br /&gt;
 else Interface.Print(&amp;quot;Map load failed&amp;quot;);&lt;br /&gt;
;Notes&lt;br /&gt;
*Use World.[[#FindKUID|FindKUID()]] to find the desired route KUID.&lt;br /&gt;
*In multiplayer, this will only succeed on the server.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==LoadSession==&lt;br /&gt;
{{MethodHeader|public native bool LoadSession([[Class KUID|KUID]] kuid)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;kuid&#039;&#039;&#039; = KUID of session to load.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*True if successful, false otherwise.&lt;br /&gt;
;Syntax&lt;br /&gt;
 if (World.LoadSession(sessionKUID) Interface.Print(&amp;quot;Session loaded OK&amp;quot;);&lt;br /&gt;
 else Interface.Print(&amp;quot;Session load failed&amp;quot;);&lt;br /&gt;
;Notes&lt;br /&gt;
*Use World.[[#FindKUID|FindKUID()]] to find the desired session KUID.&lt;br /&gt;
*In multiplayer, this will only succeed on the server.&lt;br /&gt;
*&amp;lt;font color=red&amp;gt;Added in ...?&amp;lt;/font&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Play2DSound==&lt;br /&gt;
{{MethodHeader|public float Play2DSound([[Class Asset|Asset]] asset, string wave)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;asset&#039;&#039;&#039; = Asset where the sound file is located.&lt;br /&gt;
*&#039;&#039;&#039;wave&#039;&#039;&#039; = Name of the &#039;&#039;*.wav&#039;&#039; file to be played, a relative path can be included.&lt;br /&gt;
;Returned Value&lt;br /&gt;
* Undefined.&lt;br /&gt;
;Syntax&lt;br /&gt;
 // Play the sound and continues script execution.&lt;br /&gt;
    World.Play2DSound(soundAsset,&amp;quot;sounds/allaboard.wav&amp;quot;);        &lt;br /&gt;
 // Wait until sound has completed before continuing (pre-TS12 only!)&lt;br /&gt;
    Sleep(World.Play2DSound(soundAsset,&amp;quot;sounds/allaboard.wav&amp;quot;)); &lt;br /&gt;
;Notes&lt;br /&gt;
*Plays a &#039;&#039;.wav&amp;quot; sound file from the given asset&#039;s folder.&lt;br /&gt;
*The sound is non directional and can be mono or stereo. &lt;br /&gt;
*This method does not return after the sound has finished playing, it returns with the length of the sound as soon as it is called. &lt;br /&gt;
*This means your code will keep on executing while Trainz is playing the sound.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==PlaySound==&lt;br /&gt;
{{MethodHeader|public native float PlaySound&amp;lt;br&amp;gt;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;([[Class Asset|Asset]] asset, string wave, float vol, float near, float far, [[Class GameObject|GameObject]] target, string pt)&amp;lt;br&amp;gt;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;([[Class Asset|Asset]] asset, string wave, float vol, float near, float far, [[Class GameObject|GameObject]] target, string pt, bool loop)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;asset&#039;&#039;&#039; = Asset where the sound file is located.&lt;br /&gt;
*&#039;&#039;&#039;wave&#039;&#039;&#039; = Name of the &#039;&#039;*.wav&#039;&#039; file to be played, a relative path can be included.&lt;br /&gt;
*&#039;&#039;&#039;vol&#039;&#039;&#039; = Volume level to play the sound at (0 to 1)&amp;lt;- These values taken from TRS2019 world.gs file comments&lt;br /&gt;
*&#039;&#039;&#039;near&#039;&#039;&#039; = Distance from the target asset at which the sound will be played at maximum volume.&lt;br /&gt;
*&#039;&#039;&#039;far&#039;&#039;&#039; = Distance from the target asset at which the sound will become inaudible.&lt;br /&gt;
*&#039;&#039;&#039;target&#039;&#039;&#039; = GameObject to which the sound will be attached if a 3d sound is required, null for 2D.&lt;br /&gt;
*&#039;&#039;&#039;pt&#039;&#039;&#039; = Name of attachment point in the target object if a 3d sound is required, null for 2D.&lt;br /&gt;
*&#039;&#039;&#039;loop&#039;&#039;&#039; = (Optional) If true the sound will loop continuously.&lt;br /&gt;
;Returned Value&lt;br /&gt;
* Sound length in seconds for Trainz before TS12&lt;br /&gt;
* Undefined for TS12 and TANE&lt;br /&gt;
;Syntax&lt;br /&gt;
 // Play the sound and continues script execution.&lt;br /&gt;
    World.PlaySound(soundAsset,&amp;quot;sounds/allaboard.wav&amp;quot;,1.0,10.0,100.0,Station,&amp;quot;a.loudspeaker&amp;quot;);     &lt;br /&gt;
 // Wait until sound has completed before continuing (pre-TS12 only!)&lt;br /&gt;
    Sleep(World.PlaySound(soundAsset,&amp;quot;sounds/allaboard.wav&amp;quot;,1000.0,10.0,100.0,Station,&amp;quot;a.loudspeaker&amp;quot;);     &lt;br /&gt;
;Notes&lt;br /&gt;
*Plays a &#039;&#039;.wav&#039;&#039; sound file from the given asset&#039;s folder.&lt;br /&gt;
*If the sound is to be directional a mono sound file is required. &lt;br /&gt;
*This method does not return after the sound has finished playing: it returns as soon as it is called. &lt;br /&gt;
*This means your code will keep on executing while Trainz is playing the sound.&lt;br /&gt;
*If you want to wait for the sound to complete playing before moving on, wrap the PlaySound() call up in a Sleep() call. &#039;&#039;&#039;Note!&#039;&#039;&#039; This works only in Trainz versions before TS12. For newer versions, TS12 and TANE, you can hard-code the duration of the sound, or store it in the extensions container of the config.txt file.&lt;br /&gt;
*The sound volume will be at a maximum for a camera position at or less than the value of the &#039;&#039;near&#039;&#039; parameter and will reduce with distance until the hearing position reaches &#039;&#039;far&#039;&#039;, when the sound will be inaudible.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==RemoveDriverCharacter==&lt;br /&gt;
{{MethodHeader|public native void RemoveDriverCharacter([[Class DriverCharacter|DriverCharacter]] driver)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;driver&#039;&#039;&#039; = DriverCharacter to remove.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 World.RemoveDriverCharacter(dave);&lt;br /&gt;
;Notes&lt;br /&gt;
*In multiplayer, this will only succeed on the server.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==RemoveDriverCommand==&lt;br /&gt;
{{MethodHeader|public native void RemoveDriverCommand([[Class DriverCommand|DriverCommand]] command)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;command&#039;&#039;&#039; = DriverCommand to remove.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 World.RemoveDriverCommand(driverCommand);&lt;br /&gt;
;Notes&lt;br /&gt;
*In multiplayer, this will only succeed on the server.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==RestartSession==&lt;br /&gt;
{{MethodHeader|public native bool RestartSession()}}&lt;br /&gt;
;Parameters&lt;br /&gt;
;Returned Value&lt;br /&gt;
*True if successful, false otherwise.&lt;br /&gt;
;Syntax&lt;br /&gt;
 World.RestartSession();&lt;br /&gt;
;Notes&lt;br /&gt;
*Valid in Driver mode only.&lt;br /&gt;
*In multiplayer, this will only succeed on the server.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==SetBadWeatherFog==&lt;br /&gt;
{{MethodHeader|public obsolete native void SetBadWeatherFog(float distance)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;distance&#039;&#039;&#039; = Bad weather fog distance to set.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 World.SetBadWeatherFog(0.5);&lt;br /&gt;
;Notes&lt;br /&gt;
*Obsolete in TRS19&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==SetCamera==&lt;br /&gt;
{{MethodHeader|public native bool SetCamera([[Class MapObject|MapObject]] focus)&amp;lt;br&amp;gt;public native void SetCamera([[Class Junction|Junction]] focus)&amp;lt;br&amp;gt;public native void SetCamera([[Class Vehicle|Vehicle]] focus, int cameraMode)&amp;lt;br&amp;gt;public native void SetCamera([[Class Train|Train]] focus, int cameraMode)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;focus&#039;&#039;&#039; = Object on which the camera is to be focused.&lt;br /&gt;
*&#039;&#039;cameraMode&#039;&#039;&#039; = One of the [[#Camera_View_Modes|Camera View Mode]] constants defining the view which should be assigned to the camera.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*The first variant returns a boolean to indicate success or failure.&lt;br /&gt;
*Remaining variants do not return a value&lt;br /&gt;
;Syntax&lt;br /&gt;
 World.SetCamera(train.GetVehicles[0],World.CAMERA_TRACKING); // sets the camera to track the first vehicle in the train.&lt;br /&gt;
;Notes&lt;br /&gt;
*&amp;lt;font color=red&amp;gt;Junction alias removed in TRS19?&amp;lt;/font&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==SetCameraAngle==&lt;br /&gt;
{{MethodHeader|public void SetCameraAngle(float yaw, float pitch, float radius)&amp;lt;br&amp;gt;public obsolete void SetCameraAngle(int yaw, int pitch, float radius)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;yaw&#039;&#039;&#039; = Camera rotation in radians (float) or degrees (int), 90 is a direct front view.&lt;br /&gt;
*&#039;&#039;&#039;pitch&#039;&#039;&#039; = Camera angle relative to the horizon in radians (float), or degrees (int), 0 is horizontal, 90 points vertically upwards.&lt;br /&gt;
*&#039;&#039;&#039;radius&#039;&#039;&#039; = Distance in metres to the object in focus.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 World.SetCameraAngle(90,0,25); // Sets the camera to a direct frontal view at 25 metres from the currently focused object.&lt;br /&gt;
;Notes&lt;br /&gt;
*&#039;&#039;Radius&#039;&#039; is measured from the object origin point (0,0,0). If there&#039;s no target object this will be the distance to the ground.&lt;br /&gt;
*Note difference in units of &#039;&#039;yaw&#039;&#039; and &#039;&#039;pitch&#039;&#039; depending in the method signature used.&lt;br /&gt;
*The integer version of this method call is obsolete in TRS19.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==SetCameraFlags==&lt;br /&gt;
{{MethodHeader|public native void SetCameraFlags(int flags)}}&lt;br /&gt;
;Parameter&lt;br /&gt;
*&#039;&#039;&#039;flags&#039;&#039;&#039;  integer value defining what the user is permitted to do with the game camera.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 // User is permitted to select External or Tracking views only.&lt;br /&gt;
    World.SetCameraFlags(World.CAMERA_EXTERNAL | World.CAMERA_TRACKING);&lt;br /&gt;
;Notes&lt;br /&gt;
*Use any combination of [[#Camera_Flags|Camera Flags]] and [[#Camera_View_Modes|Camera View Modes]] to set the parameter.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==SetCameraMode==&lt;br /&gt;
{{MethodHeader|public void SetCameraMode(int mode)}}&lt;br /&gt;
;Parameter&lt;br /&gt;
*&#039;&#039;&#039;mode&#039;&#039;&#039; = Camera mode to select.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 World.SetCameraMode(World.CAMERA_TRACKING);&lt;br /&gt;
;Notes&lt;br /&gt;
*Use one of the [[#Camera_View_Modes|Camera View Modes]] to set the parameter.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==SetEditingCamera==&lt;br /&gt;
{{MethodHeader|public void SetEditingCamera([[Class GameObject|GameObject]] actor, bool bIsActorEditingCamera)}}&lt;br /&gt;
;Parameter&lt;br /&gt;
*&#039;&#039;&#039;actor&#039;&#039;&#039; = The script who is intended to edit the camera position.&lt;br /&gt;
*&#039;&#039;&#039;bIsActorEditingCamera&#039;&#039;&#039; = True to begin editing, or False to end the editing operation. &lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 World.SetEditingCamera(myScript, true);&lt;br /&gt;
;Notes&lt;br /&gt;
*Hints to the caching systems that the camera position is in the process of being changed. This may reduce the amount of streaming that will occur until the change is complete.&lt;br /&gt;
*This is intended for use-cases where the decision to move the camera happens in advance of the actual call to [[#SetCamera|SetCamera()]] or etc., for example when the new camera target needs to be streamed in first.&lt;br /&gt;
*There is no advantage in calling this unless your code then sleeps/waits before undoing the call.&lt;br /&gt;
*It is not required to call this before using SetCamera() etc.&lt;br /&gt;
*A boolean state is stored per actor; multiple calls to enable editing on a single actor do not need to be matched to multiple calls to disable editing.&lt;br /&gt;
*It is counterproductive to call this when transitioning the camera over a short distance (ie. where the source and target locations can see each other). If jumping to a new location, followed by a visual camera transition at the new location, camera editing may be enabled around the target-selection for the jump, and the jump itself, but should be disabled before proceeding with the transition.&lt;br /&gt;
*&amp;lt;font color=red&amp;gt;Added in TRS19?&amp;lt;/font&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==SetGameDate==&lt;br /&gt;
{{MethodHeader|public void SetGameDate(int year, int month, int date)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;year&#039;&#039;&#039; = The year to set (1970-2038)&lt;br /&gt;
*&#039;&#039;&#039;month&#039;&#039;&#039; = The month to set (1-12)&lt;br /&gt;
*&#039;&#039;&#039;day&#039;&#039;&#039; = The day to set (1-31)&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 World.SetGameDate(2000, 12, 25);  // sets date to 25 December 2000&lt;br /&gt;
;Notes&lt;br /&gt;
*In multiplayer, this will only succeed on the server.&lt;br /&gt;
*&amp;lt;font color=red&amp;gt;Added in ...?&amp;lt;/font&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==SetGameTime==&lt;br /&gt;
{{MethodHeader|public void SetGameTime(float time)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;time&#039;&#039;&#039; = new gane time to set.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 World.SetGameTime(0.5);  // sets time to midnight&lt;br /&gt;
;Notes&lt;br /&gt;
*Game time is normalised to a value between 0.0 and 1.0&lt;br /&gt;
*0.0 = midday&lt;br /&gt;
*0.25 = 6 p.m.&lt;br /&gt;
*0.5 = midnight&lt;br /&gt;
*0.75 = 6 a.m.&lt;br /&gt;
*1.0 = midday again&lt;br /&gt;
*Use the [[#Time_Values|Time Value]] constants to convert human readable times to normalised values. &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==SetGameTimeRate==&lt;br /&gt;
{{MethodHeader|public native void SetGameTimeRate(float rate)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;rate&#039;&#039;&#039; = New time rate to set.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 World.SetGameTimeRate(World.TIME_RATE_8X); // sets game time to advance by 8 minutes per minute of real world time.&lt;br /&gt;
;Notes&lt;br /&gt;
*Use one of the [[#Time_Rate_Constants|Time Rate Constants]] to define the parameter.&lt;br /&gt;
*In multiplayer, this will only succeed on the server.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==SetGoodWeatherFog==&lt;br /&gt;
{{MethodHeader|public obsolete native void SetGoodWeatherFog(float distance)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;distance&#039;&#039;&#039; = Good weather fog distance to set.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 World.SetGoodWeatherFog(0.5);&lt;br /&gt;
;Notes&lt;br /&gt;
*Obsolete in TRS19&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==SetGroundDrawDistance==&lt;br /&gt;
{{MethodHeader|public obsolete native void SetGroundDrawDistance(float distance)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;distance&#039;&#039;&#039; = Ground draw distance in metres.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 World.SetGroundDrawDistance(1000.0);&lt;br /&gt;
;Notes&lt;br /&gt;
*Compatibility warning: Use of this function is not recommended, it may become non-functional in future Trainz versions.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==SetLayerVisible==&lt;br /&gt;
{{MethodHeader|public native void IsLayerVisible(string layerName, bool visible)}}&lt;br /&gt;
;Parameter&lt;br /&gt;
*layerName = Name of the layer to check&lt;br /&gt;
*visible = Whether to set the layer visible or not&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 World.IsLayerVisible(&amp;quot;MyLayer&amp;quot;, False);&lt;br /&gt;
;Notes&lt;br /&gt;
*Show/Hide a route/session layer.&lt;br /&gt;
*In multiplayer, this will only succeed on the server.&lt;br /&gt;
*&amp;lt;font color=red&amp;gt;Added in ...?&amp;lt;/font&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==SetSceneryDrawDistance==&lt;br /&gt;
{{MethodHeader|public obsolete native void SetSceneryDrawDistance(float distance)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;distance&#039;&#039;&#039; = unused.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Notes&lt;br /&gt;
* Does nothing. Included for script compatibility only.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==SetTargetObserver==&lt;br /&gt;
{{MethodHeader|public void SetTargetObserver([[Class GameObject|GameObject]] observer)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;observer&#039;&#039;&#039; = The game object to receive targeting messages.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetTargetObserver(self);&lt;br /&gt;
;Notes&lt;br /&gt;
* It is unlikely a script programmer would ever need to use this method.&lt;br /&gt;
* Causes the specified object to receive &amp;quot;Track&amp;quot;, &amp;quot;LeftClick&amp;quot; messages when a track is clicked. Causes the specified object to receive &amp;quot;Interface-Event&amp;quot;, &amp;quot;Left-Click&amp;quot; messages when a targetable MapObject is clicked. May cause the functionality of a left mouse click to change from what the user is expecting, so should be used with caution. Used in modal scripts to allow the user to indicate a location for train placement, etc. As there is only a single observer at any given time, the script must take care to only call this function when entering placement mode at the user&#039;s request.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==SetWeather==&lt;br /&gt;
{{MethodHeader|public native void SetWeather(int type, int changeability)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;type&#039;&#039;&#039; = Weather conditions as defined by one of the [[#Weather_Type_Constants|Weather Type Constants]].&lt;br /&gt;
*&#039;&#039;&#039;change&#039;&#039;&#039; = Weather variation as defined by one of the [[#Weather_Changeability_Constants|Weather Changeability Constants]].&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 World.SetWeather(World.WEATHER_TYPE_HEAVY_SNOW,World.WEATHER_CHANGEABILITY_EXTREME); // April in Paris.&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==SetWorldEditModeEnabled==&lt;br /&gt;
{{MethodHeader|public native bool SetWorldEditModeEnabled(int editFlags, bool enable)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;editFlags&#039;&#039;&#039; = Bitmask specifying which modes to alter, see PERMIT_EDIT_*&lt;br /&gt;
*&#039;&#039;cameraMode&#039;&#039;&#039; = Whether to enable or disable the mode&lt;br /&gt;
;Returned Value&lt;br /&gt;
*Whether the change was completely successful&lt;br /&gt;
;Syntax&lt;br /&gt;
 World.SetWorldEditModeEnabled(World.PERMIT_EDIT_TRAINS | World.PERMIT_EDIT_CONSISTS, True); // Enable player editing of trains and consists&lt;br /&gt;
;Notes&lt;br /&gt;
*This does not affect scripts which may alter the world, only the availability of the player world editing tools (i.e, the Surveyor tabs).&lt;br /&gt;
*&amp;lt;font color=red&amp;gt;Added in TRS19?&amp;lt;/font&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==SynchronouslyLoadGameObjectByID==&lt;br /&gt;
{{MethodHeader|public [[Class GameObject|GameObject]] SynchronouslyLoadGameObjectByID([[Class GameObjectID|GameObjectID]] objectID)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;objectID&#039;&#039;&#039; = The ID of the object to find.&lt;br /&gt;
;Returned Value&lt;br /&gt;
* The object, if it exists.&lt;br /&gt;
;Syntax&lt;br /&gt;
 GameObject my_object = World.SynchronouslyLoadGameObjectByID(objectID);&lt;br /&gt;
 if (my_object Interface.Print(&amp;quot;Object exists and has been loaded if required&amp;quot;);&lt;br /&gt;
;Notes&lt;br /&gt;
*This function is usable only by script &#039;thread&#039; functions and will throw an exception if called incorrectly.&lt;br /&gt;
*Added in TRS19&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==UpdatePositionToGroundHeight==&lt;br /&gt;
{{MethodHeader|public native bool UpdatePositionToGroundHeight([[Class WorldCoordinate|WorldCoordinate]] position)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;position&#039;&#039;&#039; (in, out) = Position object to update with the ground height at it&#039;s location&lt;br /&gt;
;Returned Value&lt;br /&gt;
* True if the ground position was updated&lt;br /&gt;
;Syntax&lt;br /&gt;
 if (World.UpdatePositionToGroundHeight(position) Interface.Print(&amp;quot;Position was updated&amp;quot;);&lt;br /&gt;
;Notes&lt;br /&gt;
*This updates the input &#039;&#039;position&#039;&#039; object with the ground height at that location.&lt;br /&gt;
*This process may fail if the ground data at the specified location is not currently loaded.&lt;br /&gt;
*&amp;lt;font color=red&amp;gt;Added in TRS19?&amp;lt;/font&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==UpdatePositionToSurfaceHeight==&lt;br /&gt;
{{MethodHeader|public native bool UpdatePositionToSurfaceHeight([[Class WorldCoordinate|WorldCoordinate]] position)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;position&#039;&#039;&#039; (in, out) = Position object to update with the water height at it&#039;s location&lt;br /&gt;
;Returned Value&lt;br /&gt;
* True if the ground position was updated&lt;br /&gt;
;Syntax&lt;br /&gt;
 if (World.UpdatePositionToGroundHeight(position) Interface.Print(&amp;quot;Position was updated&amp;quot;);&lt;br /&gt;
;Notes&lt;br /&gt;
*This updates the input &#039;&#039;position&#039;&#039; object with the water height at that location. If no water is present, the position is adjusted to the ground height.&lt;br /&gt;
*This process may fail if the ground data at the specified location is not currently loaded.&lt;br /&gt;
*&amp;lt;font color=red&amp;gt;Added in TRS19?&amp;lt;/font&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==UserSetCamera==&lt;br /&gt;
{{MethodHeader|public native bool UserSetCamera([[Class GameObject|GameObject]] target)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;target&#039;&#039;&#039; = GameObject to set focus to.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*True if successful, false otherwise.&lt;br /&gt;
;Syntax&lt;br /&gt;
 World.UserSetCamera(Router,GetGameObject(&amp;quot;Junction 5&amp;quot;));&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==UserSetCameraMode==&lt;br /&gt;
{{MethodHeader|public native void UserSetCameraMode(int mode)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;mode&#039;&#039;&#039; = One of the [[#Camera_View_Modes|Camera View Modes]]&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 World.UserSetCameraMode(World.CAMERA_ROAMING);  // switches to roaming view if permitted.&lt;br /&gt;
;Notes&lt;br /&gt;
*This method respects the current [[#Camera_Flags|Camera Flag]] settings, disallowing any change which the flags do not permit.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==UserSetCameraPosition==&lt;br /&gt;
{{MethodHeader|public native bool UserSetCamera([[Class WorldCoordinate|WorldCoordinate]] camPos)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;camPos&#039;&#039;&#039; = World coordinates to set camera to&lt;br /&gt;
;Returned Value&lt;br /&gt;
*True if successful, false otherwise.&lt;br /&gt;
;Syntax&lt;br /&gt;
 World.UserSetCamera(Router,GetGameObject(&amp;quot;Junction 5&amp;quot;));&lt;br /&gt;
;Notes&lt;br /&gt;
* For camera modes which do not need to target specific objects, this allows the camera to be set to an arbitrary world position.&lt;br /&gt;
*&amp;lt;font color=red&amp;gt;Added in TRS19?&amp;lt;/font&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Categories==&lt;br /&gt;
[[Category:Script Class]]&lt;/div&gt;</summary>
		<author><name>Ciceronmt</name></author>
	</entry>
	<entry>
		<id>https://wiki.trainzsimulator.com/index.php?title=HowTo/Search_for_objects_in_the_world&amp;diff=33201</id>
		<title>HowTo/Search for objects in the world</title>
		<link rel="alternate" type="text/html" href="https://wiki.trainzsimulator.com/index.php?title=HowTo/Search_for_objects_in_the_world&amp;diff=33201"/>
		<updated>2022-07-27T20:18:42Z</updated>

		<summary type="html">&lt;p&gt;Ciceronmt: /* Named Object Searches */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Scripted asset may sometimes wish to search for other objects within the world, either in bulk lists, or for a specific single object. This page is intended to provide an overview of how this is achieved in the latest versions of Trainz. Details about certain legacy search methods and the best modern techniques to update them to are also provided in the final section of this page.&lt;br /&gt;
&lt;br /&gt;
==Object Identification==&lt;br /&gt;
Scripted objects identified in script using several different methods, many of which have become obsolete as Trainz and the script environment has grown in complexity. As of trainz-build 4.5 (TANE SP2 and later) scripted objects should be identified using their GameObjectID, where present. This ID format has been designed to be future-proof/extensible, should the need arise, and supports various lookup and generic storage functions as per the legacy integer and string based IDs. For more information about legacy ID formats, see [[HowTo/Search_for_objects_in_the_world#Legacy_Search_Functions|here]].&lt;br /&gt;
&lt;br /&gt;
The GameObjectID class is defined within GameObjectID.gs, which can be found in the Trainz core script folder (resources/scripts). For the most up to date and accurate usage instructions please see the comments within that file.&lt;br /&gt;
&lt;br /&gt;
==Named Object Searches==&lt;br /&gt;
It is occasionally desirable for scripted assets to be able to search for objects within the world. Most commonly, this is a requirement of session rules, which frequently require a session creator to specify target trains, junctions, signals, etc, in order to perform some gameplay function. Occasionally, placable assets such as industries etc may also require this feature. One such example is the Interlocking Tower asset type, which performs complex management of track blocks using management of user defined signals, junctions and crossings.&lt;br /&gt;
&lt;br /&gt;
As of trainz-build 4.5 (TANE SP2 and later) manual object searches are performed via the World.GetNamedObjectList() function. This function takes both a [[Category_List|category list]] and a partial name, allowing for very specific searches, or quite broad ones. Once called, this function returns an object of type AsyncObjectSearchResult, which is used to monitor for the search completion, and then to retrieve the results. For the most up to date and accurate information on how to use GetNamedObjectList and AsyncObjectSearchResult, please see their script comments in World.gs and AsyncObjectSearch.gs (respectively), which can be found in the Trainz core script folder (resources/scripts).&lt;br /&gt;
&lt;br /&gt;
Usage example:&lt;br /&gt;
&lt;br /&gt;
 thread void SearchForTrains()&lt;br /&gt;
 {&lt;br /&gt;
   // Start a search for any traincars within the world&lt;br /&gt;
   AsyncObjectSearchResult asyncSearch = World.GetNamedObjectList(AssetCategory.TrainCar, &amp;quot;&amp;quot;);&lt;br /&gt;
   &lt;br /&gt;
   // Sniff for search related messages, and then wait for either completion or failure&lt;br /&gt;
   Sniff(searchObj, &amp;quot;ObjectSearch&amp;quot;, &amp;quot;&amp;quot;, true);&lt;br /&gt;
   Message msg;&lt;br /&gt;
   wait()&lt;br /&gt;
   {&lt;br /&gt;
     on &amp;quot;ObjectSearch&amp;quot;, &amp;quot;Failure&amp;quot;, msg:&lt;br /&gt;
       if (msg.src == asyncSearch)&lt;br /&gt;
         break;&lt;br /&gt;
       continue;&lt;br /&gt;
     &lt;br /&gt;
     on &amp;quot;ObjectSearch&amp;quot;, &amp;quot;AsyncLoadComplete&amp;quot;, msg:&lt;br /&gt;
       if (msg.src == asyncSearch)&lt;br /&gt;
         break;&lt;br /&gt;
       continue;&lt;br /&gt;
   };&lt;br /&gt;
   &lt;br /&gt;
   // Check the results&lt;br /&gt;
   int errCode = asyncSearch.GetSearchErrorCode();&lt;br /&gt;
   if (errCode != AsyncObjectSearchResult.ERROR_NONE)&lt;br /&gt;
   {&lt;br /&gt;
     // TODO: Add any error handling here, such as waiting and reattempting the&lt;br /&gt;
     // search later, showing an error message, throwing script exceptions, etc.&lt;br /&gt;
     return;&lt;br /&gt;
   }&lt;br /&gt;
   &lt;br /&gt;
   // Get the search results&lt;br /&gt;
   NamedObjectInfo[] results = searchObj.GetResults();&lt;br /&gt;
   &lt;br /&gt;
   // TODO: Add any processing of the results here&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
==Storing References to Specific Objects==&lt;br /&gt;
As shown in the example above, named object searches return their results as an array of NamedObjectInfo objects. Currently, this class has 4 member variables:&lt;br /&gt;
* objectRef - A reference to the object, if it is currently loaded&lt;br /&gt;
* objectId - The GameObjectID for the object (see GameObjectID.gs)&lt;br /&gt;
* localisedUsername - The localised name of the object, for displaying to the player&lt;br /&gt;
* categoryString - A category string, usable to further determine the exact type and features of the object&lt;br /&gt;
&lt;br /&gt;
Any script which wishes to save a reference to specific named object should /always/ do so via the GameObjectID. This is currently the /only/ safe and reliable way to store and later retrieve a specific object. If the object is currently loaded it is of course also safe to access and store a reference to the object itself, but note that Trainz may choose to unload the object at any time (if it is inactive, and sufficiently far enough away from the player, etc). Attempts to use an object which native code has unloaded may result in native call errors. To avoid this scripts should call Router.DoesGameObjectStillExist() before attempting to use any object reference that has been stored for some time.&lt;br /&gt;
&lt;br /&gt;
Unlike the named object itself, a referenced GameObjectID will never be deleted by native code, and may be held by a script indefinitely. It can also be stored directly into a [[Soup]] database for storage and retrieval between runs of the game, over a network, etc. For details about saving a GameObjectID into a Soup database please see the comments in Soup.gs, located in the core Trainz script folder (resources/scripts).&lt;br /&gt;
&lt;br /&gt;
In addition to Soup storage, a GameObjectID can be serialised to a string for *temporary* storage. This allows scripts to do things like store the ID directly in a trainzhttp link, etc (provided it is also appropriately escaped). However, it is crucial to note that the format of this string is *not* guaranteed and may change between versions of the game. As such, no attempt should be made to machine parse it, save it between runs or send it over a network. To convert the string back into a GameObjectID, use Router.SerialiseGameObjectIDFromString().&lt;br /&gt;
&lt;br /&gt;
It is also safe to cache and store the localised display name for an object, but it is important to remember that objects can be renamed, and that this object name may become out of date at any time. As such, scripts which store it should remember to update their cache whenever an opportunity arises (e.g. during any validation steps).&lt;br /&gt;
&lt;br /&gt;
==Searching for Specific Objects by ID==&lt;br /&gt;
Several functions exist for looking up an object which has been saved via it&#039;s GameObjectID. Each of these serves a slightly different use-case, so it&#039;s important to understand them all before selecting the one that best suits the needs of a specific script.&lt;br /&gt;
&lt;br /&gt;
Two functions exist to retrieve a loaded object via it&#039;s ID. These both behave identically, and will return a reference to a matching object *only* if that object exists and is currently loaded. In all other cases the functions will return null. There is no way to determine the cause of a null result using these functions.&lt;br /&gt;
&lt;br /&gt;
 GameObject objectRef1 = World.GetGameObjectByIDIfLoaded(mySavedID);&lt;br /&gt;
 &lt;br /&gt;
 GameObject objectRef2 = Router.GetGameObject(mySavedID);&lt;br /&gt;
&lt;br /&gt;
Another function exists to allow scripts to search for objects which are not currently loaded, and to optionally request that they are loaded. Scripts should only request loading of objects when absolutely necessary, and scripts which abuse this feature may have their requests ignored by native code in order to maintain performance. As this function may take a considerable amount of time to run, it uses an AsyncObjectSearchResult, much like the named object list functions described above.&lt;br /&gt;
&lt;br /&gt;
 AsyncObjectSearchResult searchObj = World.GetGameObjectByID(mySavedID, false);&lt;br /&gt;
&lt;br /&gt;
As with GetNamedObjectList(), calling scripts must Sniff the returned search object and wait for the appropriate result message(s) to be posted. To avoid the need for frequent code duplication another function also exists which allows threaded objects to perform this functionality in a pseudo-synchronous way.&lt;br /&gt;
&lt;br /&gt;
 GameObject loadedObjectRef = World.SynchronouslyLoadGameObjectByID(mySavedID);&lt;br /&gt;
&lt;br /&gt;
This function will throw exceptions if used incorrectly (e.g. if called outside of a thread function) so be sure to read and understand the comments on the function itself, before attempting to use it.&lt;br /&gt;
&lt;br /&gt;
==Script Library Lookups==&lt;br /&gt;
Script [[KIND_Library|library assets]] are unique within script in that they exist without any visual presence to the end player, and are shared across all scripts that access them. i.e. It is not possible to instantiate multiple instances of the same library asset within a single script context. This makes them extremely useful for managing, organising or communicating between other scripted asset types. For more information about library assets, see the [[KIND_Library]] page.&lt;br /&gt;
&lt;br /&gt;
As libraries are added to the world by script, and the not the player or session creator, they require a script accessible function to create and load them. This function is TrainzScriptBase.GetLibrary(). When this function is called the library asset will be immediately loaded and returned by Trainz native code. Once loaded into the current script context, the library will remain loaded, and any future calls to GetLibrary() will return the same instance.&lt;br /&gt;
&lt;br /&gt;
Example usage:&lt;br /&gt;
 public void Init(Asset asset)&lt;br /&gt;
 {&lt;br /&gt;
   inherited(asset);&lt;br /&gt;
   &lt;br /&gt;
   // Load our shared library asset&lt;br /&gt;
   KUID libraryKuid = asset.LookupKUIDTable(&amp;quot;shared-library&amp;quot;);&lt;br /&gt;
   m_sharedLibrary = World.GetLibrary(libraryKuid);&lt;br /&gt;
   &lt;br /&gt;
   // TODO: Add any library specific init, registration, etc code here&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
==Legacy Search Functions==&lt;br /&gt;
Prior to trainz-build 4.5 (TANE SP1 and earlier) all world objects were loaded on Route/Session load, and remained that way until the session was ended. As Routes grow larger and larger this technique becomes unmanageable, and it is thus necessary for Trainz (and it&#039;s scripted assets) to support the unloading of objects which are not currently gameplay relevant. As a result of this, numerous script functions have been declared obsolete, as they are incompatible with this concept. Below is a summary of these functions and a mention of their modern replacements.&lt;br /&gt;
&lt;br /&gt;
Note that none of the legacy functions listed here will operate correctly if the game has the &amp;quot;[[Compatibility mode]]&amp;quot; setting set to &amp;quot;Maximise performance&amp;quot; or &amp;quot;Show errors on legacy calls&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
=====GameObject.GetId()=====&lt;br /&gt;
All GameObject instances within a Router are assigned a numeric integer ID. This ID was traditionally retrieved via this function. As the ID varies between runs it was never safe for long term storage, but it was suitable for short term storage and lookup. As objects can now be unloaded at any time, and these IDs then reused by totally different objects, the function has been declared obsolete. Any scripts which use it should be updated to instead use GameObjectID and the related storage functions. See the comments on GameObjectID.gs for more information.&lt;br /&gt;
&lt;br /&gt;
=====GameObject.GetName()=====&lt;br /&gt;
In addition to their integer ID certain GameObject types also supported a &amp;quot;script name&amp;quot;, which was generally automatically assigned on creation, but could also be edited by the player in some scenarios. Despite the script comments in certain older versions of Trainz, this name was never &#039;&#039;guaranteed&#039;&#039; unique, but it was generally considered to be so for ease of use (and that assumption rarely failed). This script name was typically used for object identification in medium to long term storage, including within Soups for session config, savegames, etc. Any scripts which use it should be updated to instead use GameObjectID and the related storage functions. See the comments on GameObjectID.gs for more information.&lt;br /&gt;
&lt;br /&gt;
=====Router.GetGameObject(int)=====&lt;br /&gt;
Much like GetGameObject(GameObjectID), this function would return any loaded object with the integer Router ID passed. As this ID format is now considered obsolete, so is this lookup function. Any scripts which use it should be updated to instead use GameObjectID and that function variant (or the async search functions on World). See the comments on GameObjectID.gs for more information.&lt;br /&gt;
&lt;br /&gt;
=====Router.GetGameObject(string)=====&lt;br /&gt;
Much like GetGameObject(GameObjectID), this function would return any loaded object with the &amp;quot;script name&amp;quot; string passed. As this ID format is now considered obsolete, so is this lookup function. Any scripts which use it should be updated to instead use GameObjectID and that function variant (or the async search functions on World). See the comments on GameObjectID.gs for more information.&lt;br /&gt;
&lt;br /&gt;
=====World.Get*List()=====&lt;br /&gt;
Prior to GetNamedObjectList() multiple functions existed on World to manually retrieve lists of objects of a specific type (e.g. GetIndustryList(), GetTrainList(), etc). These search functions were slow, and scripts would often stall Trainz while the searches were performed. Because of this, and the fact that the functions can now only return those objects that are currently loaded, they have been declared obsolete. Any scripts which use them for custom functionality should be updated to instead call World.GetNamedObjectList() with an appropriate category string. See the comments on this function and the AsyncObjectSearchResult in World.gs for more information on their use. Alternatively, any scripts using them for PropertyObject &amp;quot;list&amp;quot; types may be better served by the new &amp;quot;map-object&amp;quot; type, detailed [[PropertyObject#GetPropertyType|here]].&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
* [[Asynchronous_Route_Streaming| Asynchronous Route Streaming]]&lt;br /&gt;
* [[Compatibility_mode| Compatibility Mode Setting]]&lt;br /&gt;
* [[HowTo/Upgrade_obsolete_script_functions| How to update obsolete script functions]]&lt;/div&gt;</summary>
		<author><name>Ciceronmt</name></author>
	</entry>
	<entry>
		<id>https://wiki.trainzsimulator.com/index.php?title=Class_Browser&amp;diff=29705</id>
		<title>Class Browser</title>
		<link rel="alternate" type="text/html" href="https://wiki.trainzsimulator.com/index.php?title=Class_Browser&amp;diff=29705"/>
		<updated>2021-06-19T10:32:51Z</updated>

		<summary type="html">&lt;p&gt;Ciceronmt: /* SetWindowRect */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;*[[TrainzScript Library Reference|API Hierarchy]]&lt;br /&gt;
**[[Class GSObject|GSObject]] *&lt;br /&gt;
***[[Class GameObject|GameObject]]&lt;br /&gt;
****Browser&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*This class provides an interface with the Trainz [[MiniBrowser]] allowing the programmer to provide a simple HTML interface.&lt;br /&gt;
*The browser supports a small subset of HTML code.&lt;br /&gt;
*Muliple browsers are supported.&lt;br /&gt;
*To create a new Browser, use [[Class Constructors#NewBrowser|Constructors.NewBrowser()]].&lt;br /&gt;
*To populate with HTML code use either [[#LoadHTMLString|LoadHTMLString]] or [[#LoadHTMLFile|LoadHTMLFile]]&lt;br /&gt;
*Refer to the [[MiniBrowser]] page for details of supported tags.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Messages==&lt;br /&gt;
*Messages sent to and from Browser objects are listed below:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
{{TableHeader|width=50%|margin=15px}}&lt;br /&gt;
|-&lt;br /&gt;
|bgcolor=&amp;quot;#EEEEEE&amp;quot;|&#039;&#039;&#039;Major&#039;&#039;&#039;||bgcolor=&amp;quot;#EEEEEE&amp;quot;|&#039;&#039;&#039;Minor&#039;&#039;&#039;||bgcolor=&amp;quot;#EEEEEE&amp;quot;|&#039;&#039;&#039;Source&#039;&#039;&#039;||bgcolor=&amp;quot;#EEEEEE&amp;quot; |&#039;&#039;&#039;Destination&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|[[Browser Messages|Browser-URL]]||&#039;&#039;URL&#039;&#039;||Browser||Broadcast&lt;br /&gt;
|-&lt;br /&gt;
|[[Browser Messages|Browser-Closed]]||null||Browser||Broadcast&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
*The &#039;&#039;URL &#039;&#039; in a &#039;&#039;Browser-URL&#039;&#039; message uses a special hyperlink tag in the form &#039;&#039;live://linkname&#039;&#039;.&lt;br /&gt;
*If your HTML contains the link &#039;&#039;&amp;lt;a href=live://anthem&amp;gt;Play the national anthem&amp;lt;/a&amp;gt;&#039;&#039; and the user clicks on the link, then the Browser-URL message will take the form of &#039;&#039;Browser-URL,live://anthem&#039;&#039; and your script can intercept the message and respond accordingly.&lt;br /&gt;
*Since messages from Browser objects are always broadcast it is crucial that you ensure that the message is originating from the expected window.  You can do this by inspecting the source of the message.&lt;br /&gt;
*When the user closes the browser window by either clicking on the close button or pressing the Esc key, a message with a &#039;&#039;Browser-Closed&#039;&#039; message is broadcast. The Browser object would normally be reset to null in response, so that the browser window disappears. &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Constants==&lt;br /&gt;
*Constants defined in this class are:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
{{TableHeader|width=95%|margin=15px}}&lt;br /&gt;
|bgcolor=#EEEEEE|&amp;lt;b&amp;gt;Browser Window Styles&amp;lt;/b&amp;gt;||bgcolor=#EEEEEE| &lt;br /&gt;
|-&lt;br /&gt;
|width=300|public define int  STYLE_NO_FRAME = 0 ||Frameless Browser (not in a bordered window).&lt;br /&gt;
|-&lt;br /&gt;
|public define int  STYLE_DEFAULT = 1 ||Default browser style. This is defined by Trainz itself and usually means the browser window will have a framed border.&lt;br /&gt;
|-&lt;br /&gt;
|public define int  STYLE_TOOLTIP = 2 ||Browser with no frame and no facility for user interaction.&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==General Methods==&lt;br /&gt;
===BringToFront===&lt;br /&gt;
{{MethodHeader|public native void BringToFront(void)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*None&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 browser.BringToFront();&lt;br /&gt;
;Notes&lt;br /&gt;
*Brings the window in front of all other browsers.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetAsset===&lt;br /&gt;
{{MethodHeader|public native Asset GetAsset(void)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*None&lt;br /&gt;
;Returned Value&lt;br /&gt;
*The Asset from which this Browser is loading html data and resources.&lt;br /&gt;
;Syntax&lt;br /&gt;
 Asset asset = browser.GetAsset();&lt;br /&gt;
;Notes&lt;br /&gt;
*The returned asset will be the asset used in the last call to [[#LoadHTMLFile|LoadHTMLFile]] or [[#LoadHTMLString|LoadHTMLString]].&lt;br /&gt;
*If there has been no such call the returned value will be null.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetWindowVisible===&lt;br /&gt;
{{MethodHeader|public native bool GetWindowVisible(void)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*None&lt;br /&gt;
;Returned Value&lt;br /&gt;
*True to indicate that the browser is currently visible on screen, false that the browser is hidden.&lt;br /&gt;
;Syntax&lt;br /&gt;
 hidden = !browser.GetWindowVisible();&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===LoadHTMLFile===&lt;br /&gt;
{{MethodHeader|public native void LoadHTMLFile(Asset asset, string filename)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;asset&#039;&#039;&#039; = reference to the asset where the HTML file and other resources are located.&lt;br /&gt;
*&#039;&#039;&#039;filename&#039;&#039;&#039; = HTML file to load, may include a relative path specifier.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 browser.LoadHTMLFile(resourceAsset,&amp;quot;/html/File-01.html&amp;quot;);&lt;br /&gt;
;Notes&lt;br /&gt;
*The asset may be of any type, as long as the appropriate files are included in its folder structure.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===LoadHTMLString===&lt;br /&gt;
{{MethodHeader|public native void LoadHTMLString(Asset asset, string htmlData)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;asset&#039;&#039;&#039; = reference to the asset where any resources required are located.&lt;br /&gt;
*&#039;&#039;&#039;htmlData&#039;&#039;&#039; = string containing HTML code to load into browser.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 browser.LoadHTMLString(resourceAsset,htmlData);&lt;br /&gt;
;Notes&lt;br /&gt;
*The asset may be of any type, as long as the appropriate files are included in its folder structure.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===ResetScrollBar===&lt;br /&gt;
{{MethodHeader|public native void ResetScrollBar(void)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*None&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 browser.ResetScrollBar();&lt;br /&gt;
;Notes&lt;br /&gt;
*Moves the scrollbar grip and the html contents to the top.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetCloseEnabled===&lt;br /&gt;
{{MethodHeader|public native void SetCloseEnabled(bool enabled)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;enabled&#039;&#039;&#039; = Set to false to prevent the user from closing the browser, set to true to enable closure.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 browser.SetCloseEnabled(false);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetParam===&lt;br /&gt;
{{MethodHeader|public native void SetParam(int index, string value)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;index&#039;&#039;&#039; = index of parameter to set.&lt;br /&gt;
*&#039;&#039;&#039;value&#039;&#039;&#039; = string value to assign to the specified parameter.&lt;br /&gt;
;Returnd Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 browser.SetParam(2,&amp;quot;Birmingham New Street&amp;quot;);&lt;br /&gt;
;Notes&lt;br /&gt;
*HTML code may contain changeable parameters denoted by the placeholder characters &#039;&#039;$#&#039;&#039;, where # is a number.&lt;br /&gt;
*SetParam() intructs the parser to substitute the text in the function parameter for the placeholder when the browser is loaded.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetScrollEnabled===&lt;br /&gt;
{{MethodHeader|public native void SetScrollEnabled(bool enabled)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;enabled&#039;&#039;&#039; = Set to false to prevent the user from scrolling the browser, set to true to enable.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 browser.SetScrollEnabled(false);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetWindowStyle===&lt;br /&gt;
{{MethodHeader|public native void SetWindowStyle(int style)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;style&#039;&#039;&#039; = One of the [[#Constants|Browser Window Style]] constants defining the type of browser to be provided.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 browser.SetWindowStyle(Browser.STYLE_DEFAULT);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetWindowVisible===&lt;br /&gt;
{{MethodHeader|public native void SetWindowVisible(bool visible)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;visible&#039;&#039;&#039; = true to show the browser window, false to hide it.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetWindowVisible(!GetWindowVisible());&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Browser Size &amp;amp; Position==&lt;br /&gt;
*This group of methods are used to retrieve and set the position and size of the Browser window.&lt;br /&gt;
*A pixel coordinate system is used with 0,0 being the top left and ScreenWidth - 1, ScreenHeight - 1 being the bottom right.&lt;br /&gt;
===GetWindowLeft===&lt;br /&gt;
{{MethodHeader|public native int GetWindowLeft(void)}}&lt;br /&gt;
*Retrieves the pixel coordinate of the left hand edge.&lt;br /&gt;
===GetWindowTop===&lt;br /&gt;
{{MethodHeader|public native int GetWindowTop(void)}}&lt;br /&gt;
*Retrieves the pixel coordinate of the top edge.&lt;br /&gt;
===GetWindowRight===&lt;br /&gt;
{{MethodHeader|public native int GetWindowRight(void)}}&lt;br /&gt;
*Retrieves the pixel coordinate of the right hand edge.&lt;br /&gt;
===GetWindowBottom===&lt;br /&gt;
{{MethodHeader|public native int GetWindowBottom(void)}}&lt;br /&gt;
*Retrieves the pixel coordinate of the bottom edge.&lt;br /&gt;
===GetWindowWidth===&lt;br /&gt;
{{MethodHeader|public native int GetWindowWidth(void)}}&lt;br /&gt;
*Retrieves the width of the window in pixels.&lt;br /&gt;
===GetWindowHeight===&lt;br /&gt;
{{MethodHeader|public native int GetWindowHeight(void)}}&lt;br /&gt;
*Retrieves the height of the window in pixels.&lt;br /&gt;
;Parameters&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 int width = browser.GetWindowWidth();&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetWindowLeft===&lt;br /&gt;
{{MethodHeader|public native void SetWindowLeft(int left)}}&lt;br /&gt;
*Sets the pixel coordinate of the left hand edge.&lt;br /&gt;
===SetWindowTop===&lt;br /&gt;
{{MethodHeader|public native void SetWindowTop(int top)}}&lt;br /&gt;
*Sets the pixel coordinate of the top edge.&lt;br /&gt;
===SetWindowRight===&lt;br /&gt;
{{MethodHeader|public native void SetWindowRight(int right)}}&lt;br /&gt;
*Sets the pixel coordinate of the right hand edge.&lt;br /&gt;
===SetWindowBottom===&lt;br /&gt;
{{MethodHeader|public native void SetWindowBottom(int bottom)}}&lt;br /&gt;
*Sets the pixel coordinate of the bottom edge.&lt;br /&gt;
===SetWindowRect===&lt;br /&gt;
{{MethodHeader|public native void SetWindowRect(int left, int top, int right, int bottom)}}&lt;br /&gt;
*Sets the pixel coordinates of all four edges in a single call.&lt;br /&gt;
&lt;br /&gt;
===SetWindowWidth===&lt;br /&gt;
{{MethodHeader|public native void SetWindowWidth(int width)}}&lt;br /&gt;
*Sets the width of the window in pixels.&lt;br /&gt;
===SetWindowHeight===&lt;br /&gt;
{{MethodHeader|public native void SetWindowHeight(int height )}}&lt;br /&gt;
*Sets the height of the window in pixels.&lt;br /&gt;
===SetWindowSize===&lt;br /&gt;
{{MethodHeader|public native void SetWindowSize(int width, int height )}}&lt;br /&gt;
*Sets the height and width of the window in pixels.&lt;br /&gt;
===SetWindowPosition===&lt;br /&gt;
{{MethodHeader|public native void SetWindowPosition(int left, int top)}}&lt;br /&gt;
*Moves the window to the specified coordinates without affecting its size.&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;left&#039;&#039;&#039; = Pixel coordinate of the left hand edge.&lt;br /&gt;
*&#039;&#039;&#039;top&#039;&#039;&#039; = Pixel coordinate of the top edge.&lt;br /&gt;
*&#039;&#039;&#039;right&#039;&#039;&#039; = Pixel coordinate of the right hand edge.&lt;br /&gt;
*&#039;&#039;&#039;bottom&#039;&#039;&#039; = Pixel coordinate of the bottom edge.&lt;br /&gt;
*&#039;&#039;&#039;width&#039;&#039;&#039; = Window width in pixels.&lt;br /&gt;
*&#039;&#039;&#039;height&#039;&#039;&#039; = Window height in pixels.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 browser.SetWindowRect(0,0,200,300);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetWindowGrow===&lt;br /&gt;
{{MethodHeader|public native void SetWindowGrow(int minWidth, int minHeight, int maxWidth, int maxHeight)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;minWidth,minHeight&#039;&#039;&#039; = Minimum width and height in pixels.&lt;br /&gt;
*&#039;&#039;&#039;maxWidth,maxHeight&#039;&#039;&#039; = Maximum width and height in pixels.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 browser.SetWindowGrow(100,100,300,300);&lt;br /&gt;
;Notes&lt;br /&gt;
*Defines a maximum and minimum height and width that the browser window will be constrained to.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Trainz Object HTML Element==&lt;br /&gt;
*&amp;lt;nowiki&amp;gt;&amp;lt;trainz-object&amp;gt;&amp;lt;/nowiki&amp;gt; tags define special browser objects which the user can interact with.&lt;br /&gt;
*These include a graphic dial, a text entry box or a browser frame and a range of parameters can be applied.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
{{TableHeader|width=50%|margin=15px}}&lt;br /&gt;
|-&lt;br /&gt;
|bgcolor=&amp;quot;#EEEEEE&amp;quot;|&#039;&#039;&#039;Property&#039;&#039;&#039;||bgcolor=&amp;quot;#EEEEEE&amp;quot;|&#039;&#039;&#039;Value&#039;&#039;&#039;||bgcolor=&amp;quot;#EEEEEE&amp;quot;|&#039;&#039;&#039;Description&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|style||string||Type of control, &amp;quot;dial&amp;quot;, &amp;quot;text-line&amp;quot; or &amp;quot;browser&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|id||string||Name of this object in the browser.  &lt;br /&gt;
|-&lt;br /&gt;
|width||integer||Pixel width of area to display object in.  &lt;br /&gt;
|-&lt;br /&gt;
|height||integer||Pixel height of area to display object in.  &lt;br /&gt;
|-&lt;br /&gt;
|texture||filename||Filename of texture for the object.  &lt;br /&gt;
|-&lt;br /&gt;
|min||float||Maximum value of control.  &lt;br /&gt;
|-&lt;br /&gt;
|max||float||Maximum value of control.  &lt;br /&gt;
|-&lt;br /&gt;
|valmin||float||Minimum possible value the object can be.  &lt;br /&gt;
|-&lt;br /&gt;
|valmax||float||Maximum possible value the object can be.  &lt;br /&gt;
|-&lt;br /&gt;
|step||integer||Steps in this control.  &lt;br /&gt;
|-&lt;br /&gt;
|clickstep||integer||Number of steps per click  &lt;br /&gt;
|-&lt;br /&gt;
|value||float||initial default value of the object.  &lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
*The HTML definition for a dial would be&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;&amp;lt;a href=&amp;quot;live://dial/dcc&amp;quot; tooltip=&amp;quot;Speed control&amp;quot;&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
    &amp;lt;trainz-object style=dial &lt;br /&gt;
                   width=100 &lt;br /&gt;
                   height=100&lt;br /&gt;
                   id=&amp;quot;dcc&amp;quot;&lt;br /&gt;
                   texture=&amp;quot;newdriver/dcc/dcc_controller.tga&amp;quot;&lt;br /&gt;
                   min=0.1&lt;br /&gt;
                   max=0.9&lt;br /&gt;
                   valmin=-1.0&lt;br /&gt;
                   valmax=1.0&lt;br /&gt;
                   step=0&lt;br /&gt;
                   clickstep=1&lt;br /&gt;
                   value=0.5&amp;gt;&lt;br /&gt;
    &amp;lt;/trainz-object&amp;gt;&lt;br /&gt;
 &amp;lt;/a&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
*This HTML code implements the issuing of a Browser-URL message whenever the dial is adjusted by the user.&lt;br /&gt;
*When the asset script receives the message it will be able to query the control to determine what it needs to do.&lt;br /&gt;
*Similarly if the script updates any of the dial&#039;s properties the HTML graphics will reflect the change.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetElementProperty===&lt;br /&gt;
{{MethodHeader|public native string GetElementProperty(string elementId, string propertyId)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;elementId&#039;&#039;&#039; = Name of HTML element to query.&lt;br /&gt;
*&#039;&#039;&#039;propertyId&#039;&#039;&#039; = Name of trainz-object property to retrieve.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*Current value of specified property.&lt;br /&gt;
;Syntax&lt;br /&gt;
 float speed = (float)browser.GetElementProperty(&amp;quot;dcc&amp;quot;,&amp;quot;value&amp;quot;); // returns the current dial position&lt;br /&gt;
;Notes&lt;br /&gt;
*All values are returned in string format and must be cast or converted as appropriate.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetElementObjectProperty===&lt;br /&gt;
{{MethodHeader|public native void SetElementProperty(string elementId, string propertyId, object value)}}&lt;br /&gt;
Sets the property of the named object element in this browser to the given object. &lt;br /&gt;
&lt;br /&gt;
This method is used to assign an object value to the property contained in an element that is in the HTML page this Browser is currently loaded with. &lt;br /&gt;
&lt;br /&gt;
An element in a HTML page is usually a something like a text entry box, dial or button defined by a &amp;lt;trainz-object&amp;gt; tag. Each element has multiple properties in it and this method allows those property items to be set by name.&lt;br /&gt;
&lt;br /&gt;
Parameters: &lt;br /&gt;
*elementID  Name of element to set the property of.  &lt;br /&gt;
*propertyID  Property in the element to set. Properties the &amp;lt;trainz-object&amp;gt; tag supports can be used.  &lt;br /&gt;
*value  Object the is the value the property will be assigned. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Some element properties are references to objects, such as the &amp;quot;driver-commands&amp;quot; property of &amp;quot;driver-order-bar&amp;quot;-elements.&lt;br /&gt;
With this method you can for example pass a DriverCommands object reference to the driver-order-bar element.&lt;br /&gt;
Also an embedded browser can receive an Asset reference for it&#039;s &amp;quot;asset&amp;quot; property via this method. This will change the asset where images are loaded from.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetElementProperty===&lt;br /&gt;
{{MethodHeader|public native void SetElementProperty(string elementId, string propertyId, string value)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;elementId&#039;&#039;&#039; = Name of HTML element to update.&lt;br /&gt;
*&#039;&#039;&#039;propertyId&#039;&#039;&#039; = Name of trainz-object property to update.&lt;br /&gt;
*&#039;&#039;&#039;value&#039;&#039;&#039; = New value to set.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 browser.SetElementProperty(&amp;quot;dcc&amp;quot;,&amp;quot;value&amp;quot;,(string)speed); // updates the current dial position&lt;br /&gt;
;Notes&lt;br /&gt;
*All values must be cast or converted to string format for use in this method.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Trainz Text HTML Element==&lt;br /&gt;
*&amp;lt;nowiki&amp;gt;&amp;lt;trainz-text&amp;gt;&amp;lt;/nowiki&amp;gt; tags define text strings which can be updated without the need to reload the page.&lt;br /&gt;
*These take the form &amp;lt;nowiki&amp;gt;&amp;lt;trainz-text id=&amp;quot;speed&amp;quot; text=&amp;quot;0mph&amp;quot;&amp;gt;&amp;lt;/trainz-text&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
*The text tag specifies the default text that is displayed for the item when the page is initially created.&lt;br /&gt;
*Once the page is loaded, a script can use SetTrainzText() to provide a dynamic update.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetTrainzText===&lt;br /&gt;
{{MethodHeader|public native void SetTrainzText(string id, string text)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The id of the &#039;&#039;trainz-text&#039;&#039; item to update.&lt;br /&gt;
*&#039;&#039;&#039;text&#039;&#039;&#039; = The string value to provide.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 browser.SetTrainzText(&amp;quot;speed&amp;quot;,&amp;quot;90mph&amp;quot;);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Code Examples==&lt;br /&gt;
*This code illustrates the basics of handling a browser.&lt;br /&gt;
 class TestBrowser isclass MapObject {&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;font color=#808080&amp;gt;// A global variable to hold the browser object&amp;lt;/font&amp;gt;&lt;br /&gt;
    Browser browser;&lt;br /&gt;
 &lt;br /&gt;
    void OpenBrowser(void) {&lt;br /&gt;
    &amp;lt;font color=#808080&amp;gt;// if the browser doesn&#039;t already exist it needs to be created&amp;lt;/font&amp;gt;&lt;br /&gt;
       if (!browser) browser = Constructors.NewBrowser();&lt;br /&gt;
    &amp;lt;font color=#808080&amp;gt;// define the size and style and load HTML, in this case from a file in the calling asset&amp;lt;/font&amp;gt;&lt;br /&gt;
       browser.SetWindowPosition(0,0);&lt;br /&gt;
       browser.SetWindowStyle(browser.STYLE_DEFAULT);&lt;br /&gt;
       browser.SetWindowSize(200,500);&lt;br /&gt;
       browser.LoadHTMLFile(GetAsset(),&amp;quot;HTMLSource.html&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
 &lt;br /&gt;
    void CloseBrowser(Message msg) {&lt;br /&gt;
    &amp;lt;font color=#808080&amp;gt;// if the browser has been closed we need to destroy the reference to it&amp;lt;/font&amp;gt;&lt;br /&gt;
       if (msg.src == browser) browser = null;&lt;br /&gt;
    }&lt;br /&gt;
 &lt;br /&gt;
    void BrowserLink(Message msg) {&lt;br /&gt;
    &amp;lt;font color=#808080&amp;gt;// make sure that we are responding to the correct browser object&amp;lt;/font&amp;gt;&lt;br /&gt;
       if (msg.src != browser) return;&lt;br /&gt;
    &amp;lt;font color=#808080&amp;gt;// carry out the appropriate response to the link&amp;lt;/font&amp;gt;&lt;br /&gt;
       string link = msg.minor;&lt;br /&gt;
       if (link == &amp;quot;live://anthem&amp;quot;) {&lt;br /&gt;
          World.Play2DSound(GetAsset(),&amp;quot;God Save the Queen.wav&amp;quot;);&lt;br /&gt;
       }&lt;br /&gt;
       else if (link == &amp;quot;live://travesty&amp;quot;) {&lt;br /&gt;
          World.Play2DSound(GetAsset(),&amp;quot;Advance Australia Fair.wav&amp;quot;);&lt;br /&gt;
       }&lt;br /&gt;
    }&lt;br /&gt;
 &lt;br /&gt;
    public void Init(void) {&lt;br /&gt;
       inherited();&lt;br /&gt;
    &amp;lt;font color=#808080&amp;gt;// create handlers for the browser messages&amp;lt;/font&amp;gt;&lt;br /&gt;
       AddHandler(me,&amp;quot;Browser-URL&amp;quot;,&amp;quot;&amp;quot;,&amp;quot;BrowserLink&amp;quot;);&lt;br /&gt;
       AddHandler(me,&amp;quot;Browser-Closed&amp;quot;,&amp;quot;&amp;quot;,&amp;quot;CloseBrowser&amp;quot;);&lt;br /&gt;
    &amp;lt;font color=#808080&amp;gt;// open the browser window&amp;lt;/font&amp;gt;&lt;br /&gt;
       OpenBrowser();&lt;br /&gt;
    }&lt;br /&gt;
 &lt;br /&gt;
 };&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Related Methods==&lt;br /&gt;
[[Class Constructors#NewBrowser|Constructors.NewBrowser()]]&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Categories==&lt;br /&gt;
[[Category:Script Class]]&lt;/div&gt;</summary>
		<author><name>Ciceronmt</name></author>
	</entry>
	<entry>
		<id>https://wiki.trainzsimulator.com/index.php?title=Class_MapObject&amp;diff=25398</id>
		<title>Class MapObject</title>
		<link rel="alternate" type="text/html" href="https://wiki.trainzsimulator.com/index.php?title=Class_MapObject&amp;diff=25398"/>
		<updated>2020-11-21T12:19:33Z</updated>

		<summary type="html">&lt;p&gt;Ciceronmt: /* Methods */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;*[[TrainzScript Language Reference|API Hierarchy]]&lt;br /&gt;
**[[Class GSObject|GSObject]]&lt;br /&gt;
***[[Class GameObject|GameObject]]&lt;br /&gt;
****[[Class PropertyObject|PropertyObject]]&lt;br /&gt;
****[[Class TrainzGameObject|TrainzGameObject]]&lt;br /&gt;
*****[[Class MeshObject|MeshObject]]&lt;br /&gt;
******MapObject&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*This class extends MeshObject to include product queues. &lt;br /&gt;
*A MapObject can have a number of product queues as defined in the queues section of the config.txt file for the asset.&lt;br /&gt;
*The class also provides methods to control particle emissions.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==MapObject Messages==&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
{{TableHeader|width=50%|margin=15px}}&lt;br /&gt;
|-&lt;br /&gt;
|bgcolor=&amp;quot;#EEEEEE&amp;quot;|&#039;&#039;&#039;Major&#039;&#039;&#039;||bgcolor=&amp;quot;#EEEEEE&amp;quot;|&#039;&#039;&#039;Minor&#039;&#039;&#039;||bgcolor=&amp;quot;#EEEEEE&amp;quot;|&#039;&#039;&#039;Source&#039;&#039;&#039;||bgcolor=&amp;quot;#EEEEEE&amp;quot; |&#039;&#039;&#039;Destination&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|[[MapObject Messages|MapObject]]||View-Details||?||MapObject&lt;br /&gt;
|-&lt;br /&gt;
|[[MapObject Messages|MapObject]]||View-Schedule||?||MapObject&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Methods==&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
===AdjustMapObjectPosition===&lt;br /&gt;
{{MethodHeader|public native void AdjustMapObjectPosition(float dx, float dy, float dz)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;dx&#039;&#039;&#039; = The distance (m) to move the object along its x axis (right).&lt;br /&gt;
*&#039;&#039;&#039;dy&#039;&#039;&#039; = The distance (m) to move the object along its y axis (foward).&lt;br /&gt;
*&#039;&#039;&#039;dz&#039;&#039;&#039; = The distance (m) to move the object along its z axis (upward).&lt;br /&gt;
;Returned Value&lt;br /&gt;
* None.&lt;br /&gt;
;Syntax&lt;br /&gt;
 AdjustMapObjectPosition(x, y, z);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetMapObjectOrientation===&lt;br /&gt;
{{MethodHeader|public native Orientation GetMapObjectOrientation(void)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
* None.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*The absolute orientation of this MapObject.&lt;br /&gt;
;Syntax&lt;br /&gt;
 float angel_z = cabin.Loco.GetMapObjectOrientation().rz;&lt;br /&gt;
;Notes&lt;br /&gt;
* A call to GetMapObjectOrientation() which immediately follows a call to SetMapObjectOrientation() is not guaranteed to return the input orientation, since various other orientation restrictions may be in effect.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetMapObjectPosition===&lt;br /&gt;
{{MethodHeader|public native Orientation GetMapObjectPosition(void)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
* None.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*The absolute position of this MapObject.&lt;br /&gt;
;Syntax&lt;br /&gt;
 float axis_z = cabin.Loco.GetMapObjectPosition().z;&lt;br /&gt;
;Notes&lt;br /&gt;
* A call to GetMapObjectPosition() which immediately follows a call to SetMapObjectPosition() is not guaranteed to return the input position, since various other position restrictions may be in effect.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetPFXEmitterLifetime===&lt;br /&gt;
{{MethodHeader|public native float GetPFXEmitterLifetime(int id, int phase)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;phase&#039;&#039;&#039; = The phase of the effect, if there is only one phase use zero.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*Value of the lifetime of the effect at the specified phase.&lt;br /&gt;
;Syntax&lt;br /&gt;
 float lifetime GetPFXEmitterLifetime(0,0);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetPFXEmitterMaxRate===&lt;br /&gt;
{{MethodHeader|public native float GetPFXEmitterMaxRate(int id)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*Maximum rate of emissions per second.&lt;br /&gt;
;Syntax&lt;br /&gt;
 float maxRate = GetPFXEmitterMaxRate(0);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetPFXEmitterMaxSize===&lt;br /&gt;
{{MethodHeader|public native float GetPFXEmitterMaxSize(int id, int phase)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;phase&#039;&#039;&#039; = The phase of the effect, if there is only one phase use zero.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*Maximum size of particle at the specified phase.&lt;br /&gt;
;Syntax&lt;br /&gt;
 float maxsize = GetPFXEmitterMinSize();&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetPFXEmitterMinRate===&lt;br /&gt;
{{MethodHeader|public native float GetPFXEmitterMinRate(int id)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*Maximum rate of emissions per second.&lt;br /&gt;
;Syntax&lt;br /&gt;
 float minRtae = GetPFXEmitterMinRate(0);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetPFXEmitterMinSize===&lt;br /&gt;
{{MethodHeader|public native float GetPFXEmitterMinSize(int id, int phase)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;phase&#039;&#039;&#039; = The phase of the effect, if there is only one phase use zero.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*Minimum size of particle at the specified phase.&lt;br /&gt;
;Syntax&lt;br /&gt;
 float minsize = GetPFXEmitterMinSize();&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetPFXEmitterPhysicsDelay===&lt;br /&gt;
{{MethodHeader|public native float GetPFXEmitterPhysicsDelay(int id, int phase)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;phase&#039;&#039;&#039; = The phase of the effect, if there is only one phase use zero.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*Value for the physics delay in emission.&lt;br /&gt;
;Syntax&lt;br /&gt;
 GetPFXEmitterPhysicsDelay(0,0);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetPFXEmitterRate===&lt;br /&gt;
{{MethodHeader|public native float GetPFXEmitterRate(int id, int phase)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;phase&#039;&#039;&#039; = The phase of the effect, if there is only one phase use zero.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*Rate of particle creation per second.&lt;br /&gt;
;Syntax&lt;br /&gt;
 particlesPerSecond = GetPFXEmitterRate(0,0);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetPFXEmitterVelocity===&lt;br /&gt;
{{MethodHeader|public native float GetPFXEmitterVelocity(int id, int phase)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;phase&#039;&#039;&#039; = The phase of the effect, if there is only one phase use zero.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*Velocity in metres per second along the direction vector of emitted particles at the specified phase.&lt;br /&gt;
;Syntax&lt;br /&gt;
 float speed = GetPFXEmitterVelocity(0,0);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetQueue===&lt;br /&gt;
{{MethodHeader|public native ProductQueue GetQueue(string queueName)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
&#039;&#039;&#039;queueName&#039;&#039;&#039; = Name of the product queue to be returned.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*A reference to the queue if possible, null otherwise.&lt;br /&gt;
;Syntax&lt;br /&gt;
 ProductQueue queue = GetQueue(&amp;quot;passengers&amp;quot;);&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetQueues===&lt;br /&gt;
{{MethodHeader|public native ProductQueue[ ] GetQueues(void)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*None&lt;br /&gt;
;Returned Value&lt;br /&gt;
*An array of product queues, if there are no queues the array will be empty.&lt;br /&gt;
;Syntax&lt;br /&gt;
 ProductQueue[] queues = GetQueues();&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===PlaySoundScriptEvent===&lt;br /&gt;
{{MethodHeader|public native void PlaySoundScriptEvent(string soundTrigger)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
&#039;&#039;&#039;soundTrigger&#039;&#039;&#039; = Name of the sound event to start playing, this equates to the &#039;&#039;trigger&#039;&#039; tag of the sound script subcontainer in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 PlaySoundScriptEvent(&amp;quot;dayloop&amp;quot;);&lt;br /&gt;
;Notes&lt;br /&gt;
*Plays the specified sound event from the asset&#039;s SoundScript. &lt;br /&gt;
*SoundScripts are defined as sub-containers in the soundscript container of the asset&#039;s configuration. &lt;br /&gt;
*For details on creating assets with SoundScripts, see [[&amp;quot;Soundscript&amp;quot; container|here]]. &lt;br /&gt;
*This method will start playing the sound. &lt;br /&gt;
*Depending on the SoundScript configuration, the sound will either be played just once or played continuously in a looping cycle such that [[#StopSoundScriptEvent|StopSoundScriptEvent()]] will need to be called to stop it.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetMapObjectOrientation===&lt;br /&gt;
{{MethodHeader|public native void SetMapObjectOrientation(Orientation orientation)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;orientation&#039;&#039;&#039; =  The new orientation intended for this MapObject.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetMapObjectOrientation(or);&lt;br /&gt;
;Notes&lt;br /&gt;
*Instantly reorients this MapObject to the specified absolute orientation, as best possible. This will not successfully reposition a MapObject which has a parent relationship (for example, a Trackside object.) Various object parameters and game states may restrict or remove the ability to reorient objects.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetMapObjectPosition===&lt;br /&gt;
{{MethodHeader|public native void SetMapObjectPosition(WorldCoordinate position)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;position&#039;&#039;&#039; =  The new position intended for this MapObject.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetMapObjectPosition(pos);&lt;br /&gt;
;Notes&lt;br /&gt;
*Instantly repositions this MapObject to the specified absolute position, as best possible. This will not successfully reposition a MapObject which has a parent relationship (for example, a Trackside object.) This function may be VERY slow and should generally not be used. Various object parameters and game states may restrict or remove the ability to position objects.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetPFXEmitterConeSize===&lt;br /&gt;
{{MethodHeader|public native void SetPFXEmitterConeSize(int id, float x, float y, float z)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;x,y,z&#039;&#039;&#039; = New X,Y and Z components of the particle cone size.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetPFXEmitterConeSize(0,2.0,3.0,2.0);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetPFXEmitterEmitParticles===&lt;br /&gt;
{{MethodHeader|public native void SetPFXEmitterEmitParticles(int id, int number,float time)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;number&#039;&#039;&#039; = The number of particles to emit.&lt;br /&gt;
*&#039;&#039;&#039;time&#039;&#039;&#039; = The time in seconds over which the particles are to be created.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetPFXEmitterEmitParticles(0,100,10.0);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetPFXEmitterEndColor===&lt;br /&gt;
{{MethodHeader|public native void SetPFXEmitterEndColor(int id, int phase, float r, float g, float b, float a)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;phase&#039;&#039;&#039; = The phase of the effect, if there is only one phase use zero.&lt;br /&gt;
*&#039;&#039;&#039;r,g,b&#039;&#039;&#039; = Red, green and blue components of the required color.&lt;br /&gt;
*&#039;&#039;&#039;a&#039;&#039;&#039; = Alpha value of the color.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetPFXEmitterStartColor(0,0,128,128,128,64);&lt;br /&gt;
 SetPFXEmitterStartColor(0,0,0.5,0.5,0.5,0.25);&lt;br /&gt;
;Notes&lt;br /&gt;
*Red, green, blue and alpha may be entered as integer or float values in the ranges 0..255 and 0.0..1.0 respectively.&lt;br /&gt;
*Both of the examples above give the same result.&lt;br /&gt;
*Note that 1,1,1,1 will be interpreted as float input and will produce white, whereas 2,2,2,2 will be interpreted as integers and will give a result which is almost black.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetPFXEmitterLifetime===&lt;br /&gt;
{{MethodHeader|public native void SetPFXEmitterLifetime(int id, int phase, float life)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;phase&#039;&#039;&#039; = The phase of the effect, if there is only one phase use zero.&lt;br /&gt;
*&#039;&#039;&#039;life&#039;&#039;&#039; = The new lifetime of particles in seconds at the specified phase.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetPFXEmitterLifetime(0,0,10);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetPFXEmitterMaxRate===&lt;br /&gt;
{{MethodHeader|public native void SetPFXEmitterMaxRate(int id, float newsize)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;rate&#039;&#039;&#039; = The new maximum rate of emission per second.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetPFXEmitterMaxRate(0,5.0);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetPFXEmitterMaxSize===&lt;br /&gt;
{{MethodHeader|public native void SetPFXEmitterMaxSize(int id, int phase, float newsize)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;phase&#039;&#039;&#039; = The phase of the effect, if there is only one phase use zero.&lt;br /&gt;
*&#039;&#039;&#039;newsize&#039;&#039;&#039; = The new maximum size of particles at the specified phase.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetPFXEmitterMaxSize(0,0,10);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetPFXEmitterMinRate===&lt;br /&gt;
{{MethodHeader|public native void SetPFXEmitterMinRate(int id, float rate)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;rate&#039;&#039;&#039; = The new minimum rate of emission per second.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetPFXEmitterMinRate(0,5.0);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetPFXEmitterMinSize===&lt;br /&gt;
{{MethodHeader|public native void SetPFXEmitterMinSize(int id, int phase, float newsize)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;phase&#039;&#039;&#039; = The phase of the effect, if there is only one phase use zero.&lt;br /&gt;
*&#039;&#039;&#039;newsize&#039;&#039;&#039; = The new minimum size of particles at the specified phase.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetPFXEmitterMinSize(0,0,10);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetPFXEmitterPhysicsDelay===&lt;br /&gt;
{{MethodHeader|public native void SetPFXEmitterPhysicsDelay(int id, int phase, float value)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;phase&#039;&#039;&#039; = The phase of the effect, if there is only one phase use zero.&lt;br /&gt;
*&#039;&#039;&#039;value&#039;&#039;&#039; = The new physics delay value to set for the specified phase.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetPFXEmitterPhysicsDelay(0,0,5.0);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetPFXEmitterRate===&lt;br /&gt;
{{MethodHeader|public native void SetPFXEmitterRate(int id, int phase, float rate)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;phase&#039;&#039;&#039; = The phase of the effect, if there is only one phase use zero.&lt;br /&gt;
*&#039;&#039;&#039;rate&#039;&#039;&#039; = New rate of particle creation per second at the specified phase.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetPFXEmitterRate(0,0,5.0);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetPFXEmitterStartColor===&lt;br /&gt;
{{MethodHeader|public native void SetPFXEmitterStartColor(int id, int phase, float r, float g, float b, float a)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;phase&#039;&#039;&#039; = The phase of the effect, if there is only one phase use zero.&lt;br /&gt;
*&#039;&#039;&#039;r,g,b&#039;&#039;&#039; = Red, green and blue components of the required color.&lt;br /&gt;
*&#039;&#039;&#039;a&#039;&#039;&#039; = Alpha value of the color.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetPFXEmitterStartColor(0,0,128,128,128,64);&lt;br /&gt;
 SetPFXEmitterStartColor(0,0,0.5,0.5,0.5,0.25);&lt;br /&gt;
;Notes&lt;br /&gt;
*Red, green, blue and alpha may be entered as integer or float values in the ranges 0..255 and 0.0..1.0 respectively.&lt;br /&gt;
*Both of the examples above give the same result.&lt;br /&gt;
*Note that 1,1,1,1 will be interpreted as float input and will produce white, whereas 2,2,2,2 will be interpreted as integers and will give a result which is almost black.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetPFXEmitterTexture===&lt;br /&gt;
{{MethodHeader|public native void SetPFXEmitterTexture(int id, KUID textureKUID)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;textureKUID&#039;&#039;&#039; = The kuid of the new texture.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetPFXEmitterTexture(0,&amp;lt;kuid:1234:5678&amp;gt;);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetPFXEmitterVelocity===&lt;br /&gt;
{{MethodHeader|public native void SetPFXEmitterVelocity(int id, int phase, float velocity)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;phase&#039;&#039;&#039; = The phase of the effect, if there is only one phase use zero.&lt;br /&gt;
*&#039;&#039;&#039;velocity&#039;&#039;&#039; = New velocity in metres per second along the direction vector of emitted particles at the specified phase.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetPFXEmitterVelocity(0,0,5.0);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===StopSoundScriptEvent===&lt;br /&gt;
{{MethodHeader|public native void StopSoundScriptEvent(string soundTrigger)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
&#039;&#039;&#039;soundTrigger&#039;&#039;&#039; = Name of the sound event to start playing, this equates to the &#039;&#039;trigger&#039;&#039; tag of the sound script subcontainer in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 StopSoundScriptEvent(&amp;quot;dayloop&amp;quot;);&lt;br /&gt;
;Notes&lt;br /&gt;
*Terminates a looped sound script previously started with [[#PlaySoundScriptEvent|PlaySoundScriptEvent()]].&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Related Methods==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Categories==&lt;br /&gt;
[[Category:Script Class]]&lt;/div&gt;</summary>
		<author><name>Ciceronmt</name></author>
	</entry>
	<entry>
		<id>https://wiki.trainzsimulator.com/index.php?title=Class_MapObject&amp;diff=25395</id>
		<title>Class MapObject</title>
		<link rel="alternate" type="text/html" href="https://wiki.trainzsimulator.com/index.php?title=Class_MapObject&amp;diff=25395"/>
		<updated>2020-11-21T12:12:37Z</updated>

		<summary type="html">&lt;p&gt;Ciceronmt: /* GetMapObjectPosition */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;*[[TrainzScript Language Reference|API Hierarchy]]&lt;br /&gt;
**[[Class GSObject|GSObject]]&lt;br /&gt;
***[[Class GameObject|GameObject]]&lt;br /&gt;
****[[Class PropertyObject|PropertyObject]]&lt;br /&gt;
****[[Class TrainzGameObject|TrainzGameObject]]&lt;br /&gt;
*****[[Class MeshObject|MeshObject]]&lt;br /&gt;
******MapObject&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*This class extends MeshObject to include product queues. &lt;br /&gt;
*A MapObject can have a number of product queues as defined in the queues section of the config.txt file for the asset.&lt;br /&gt;
*The class also provides methods to control particle emissions.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==MapObject Messages==&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
{{TableHeader|width=50%|margin=15px}}&lt;br /&gt;
|-&lt;br /&gt;
|bgcolor=&amp;quot;#EEEEEE&amp;quot;|&#039;&#039;&#039;Major&#039;&#039;&#039;||bgcolor=&amp;quot;#EEEEEE&amp;quot;|&#039;&#039;&#039;Minor&#039;&#039;&#039;||bgcolor=&amp;quot;#EEEEEE&amp;quot;|&#039;&#039;&#039;Source&#039;&#039;&#039;||bgcolor=&amp;quot;#EEEEEE&amp;quot; |&#039;&#039;&#039;Destination&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|[[MapObject Messages|MapObject]]||View-Details||?||MapObject&lt;br /&gt;
|-&lt;br /&gt;
|[[MapObject Messages|MapObject]]||View-Schedule||?||MapObject&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Methods==&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
===AdjustMapObjectPosition===&lt;br /&gt;
{{MethodHeader|public native void AdjustMapObjectPosition(float dx, float dy, float dz)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;dx&#039;&#039;&#039; = The distance (m) to move the object along its x axis (right).&lt;br /&gt;
*&#039;&#039;&#039;dy&#039;&#039;&#039; = The distance (m) to move the object along its y axis (foward).&lt;br /&gt;
*&#039;&#039;&#039;dz&#039;&#039;&#039; = The distance (m) to move the object along its z axis (upward).&lt;br /&gt;
;Returned Value&lt;br /&gt;
* None.&lt;br /&gt;
;Syntax&lt;br /&gt;
 AdjustMapObjectPosition(x, y, z);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetMapObjectOrientation===&lt;br /&gt;
{{MethodHeader|public native Orientation GetMapObjectOrientation(void)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
* None.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*The absolute orientation of this MapObject.&lt;br /&gt;
;Syntax&lt;br /&gt;
 float angel_z = cabin.Loco.GetMapObjectOrientation().rz;&lt;br /&gt;
;Notes&lt;br /&gt;
* A call to GetMapObjectOrientation() which immediately follows a call to SetMapObjectOrientation() is not guaranteed to return the input orientation, since various other orientation restrictions may be in effect.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetMapObjectPosition===&lt;br /&gt;
{{MethodHeader|public native Orientation GetMapObjectPosition(void)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
* None.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*The absolute position of this MapObject.&lt;br /&gt;
;Syntax&lt;br /&gt;
 float axis_z = cabin.Loco.GetMapObjectPosition().z;&lt;br /&gt;
;Notes&lt;br /&gt;
* A call to GetMapObjectPosition() which immediately follows a call to SetMapObjectPosition() is not guaranteed to return the input position, since various other position restrictions may be in effect.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetPFXEmitterLifetime===&lt;br /&gt;
{{MethodHeader|public native float GetPFXEmitterLifetime(int id, int phase)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;phase&#039;&#039;&#039; = The phase of the effect, if there is only one phase use zero.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*Value of the lifetime of the effect at the specified phase.&lt;br /&gt;
;Syntax&lt;br /&gt;
 float lifetime GetPFXEmitterLifetime(0,0);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetPFXEmitterMaxRate===&lt;br /&gt;
{{MethodHeader|public native float GetPFXEmitterMaxRate(int id)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*Maximum rate of emissions per second.&lt;br /&gt;
;Syntax&lt;br /&gt;
 float maxRate = GetPFXEmitterMaxRate(0);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetPFXEmitterMaxSize===&lt;br /&gt;
{{MethodHeader|public native float GetPFXEmitterMaxSize(int id, int phase)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;phase&#039;&#039;&#039; = The phase of the effect, if there is only one phase use zero.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*Maximum size of particle at the specified phase.&lt;br /&gt;
;Syntax&lt;br /&gt;
 float maxsize = GetPFXEmitterMinSize();&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetPFXEmitterMinRate===&lt;br /&gt;
{{MethodHeader|public native float GetPFXEmitterMinRate(int id)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*Maximum rate of emissions per second.&lt;br /&gt;
;Syntax&lt;br /&gt;
 float minRtae = GetPFXEmitterMinRate(0);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetPFXEmitterMinSize===&lt;br /&gt;
{{MethodHeader|public native float GetPFXEmitterMinSize(int id, int phase)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;phase&#039;&#039;&#039; = The phase of the effect, if there is only one phase use zero.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*Minimum size of particle at the specified phase.&lt;br /&gt;
;Syntax&lt;br /&gt;
 float minsize = GetPFXEmitterMinSize();&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetPFXEmitterPhysicsDelay===&lt;br /&gt;
{{MethodHeader|public native float GetPFXEmitterPhysicsDelay(int id, int phase)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;phase&#039;&#039;&#039; = The phase of the effect, if there is only one phase use zero.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*Value for the physics delay in emission.&lt;br /&gt;
;Syntax&lt;br /&gt;
 GetPFXEmitterPhysicsDelay(0,0);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetPFXEmitterRate===&lt;br /&gt;
{{MethodHeader|public native float GetPFXEmitterRate(int id, int phase)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;phase&#039;&#039;&#039; = The phase of the effect, if there is only one phase use zero.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*Rate of particle creation per second.&lt;br /&gt;
;Syntax&lt;br /&gt;
 particlesPerSecond = GetPFXEmitterRate(0,0);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetPFXEmitterVelocity===&lt;br /&gt;
{{MethodHeader|public native float GetPFXEmitterVelocity(int id, int phase)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;phase&#039;&#039;&#039; = The phase of the effect, if there is only one phase use zero.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*Velocity in metres per second along the direction vector of emitted particles at the specified phase.&lt;br /&gt;
;Syntax&lt;br /&gt;
 float speed = GetPFXEmitterVelocity(0,0);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetQueue===&lt;br /&gt;
{{MethodHeader|public native ProductQueue GetQueue(string queueName)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
&#039;&#039;&#039;queueName&#039;&#039;&#039; = Name of the product queue to be returned.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*A reference to the queue if possible, null otherwise.&lt;br /&gt;
;Syntax&lt;br /&gt;
 ProductQueue queue = GetQueue(&amp;quot;passengers&amp;quot;);&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetQueues===&lt;br /&gt;
{{MethodHeader|public native ProductQueue[ ] GetQueues(void)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*None&lt;br /&gt;
;Returned Value&lt;br /&gt;
*An array of product queues, if there are no queues the array will be empty.&lt;br /&gt;
;Syntax&lt;br /&gt;
 ProductQueue[] queues = GetQueues();&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===PlaySoundScriptEvent===&lt;br /&gt;
{{MethodHeader|public native void PlaySoundScriptEvent(string soundTrigger)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
&#039;&#039;&#039;soundTrigger&#039;&#039;&#039; = Name of the sound event to start playing, this equates to the &#039;&#039;trigger&#039;&#039; tag of the sound script subcontainer in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 PlaySoundScriptEvent(&amp;quot;dayloop&amp;quot;);&lt;br /&gt;
;Notes&lt;br /&gt;
*Plays the specified sound event from the asset&#039;s SoundScript. &lt;br /&gt;
*SoundScripts are defined as sub-containers in the soundscript container of the asset&#039;s configuration. &lt;br /&gt;
*For details on creating assets with SoundScripts, see [[&amp;quot;Soundscript&amp;quot; container|here]]. &lt;br /&gt;
*This method will start playing the sound. &lt;br /&gt;
*Depending on the SoundScript configuration, the sound will either be played just once or played continuously in a looping cycle such that [[#StopSoundScriptEvent|StopSoundScriptEvent()]] will need to be called to stop it.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetMapObjectPosition===&lt;br /&gt;
{{MethodHeader|public native void SetMapObjectPosition(WorldCoordinate position)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;position&#039;&#039;&#039; =  The new position intended for this MapObject.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetMapObjectPosition(pos);&lt;br /&gt;
;Notes&lt;br /&gt;
*Instantly repositions this MapObject to the specified absolute position, as best possible. This will not successfully reposition a MapObject which has a parent relationship (for example, a Trackside object.) This function may be VERY slow and should generally not be used. Various object parameters and game states may restrict or remove the ability to position objects.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetPFXEmitterConeSize===&lt;br /&gt;
{{MethodHeader|public native void SetPFXEmitterConeSize(int id, float x, float y, float z)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;x,y,z&#039;&#039;&#039; = New X,Y and Z components of the particle cone size.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetPFXEmitterConeSize(0,2.0,3.0,2.0);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetPFXEmitterEmitParticles===&lt;br /&gt;
{{MethodHeader|public native void SetPFXEmitterEmitParticles(int id, int number,float time)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;number&#039;&#039;&#039; = The number of particles to emit.&lt;br /&gt;
*&#039;&#039;&#039;time&#039;&#039;&#039; = The time in seconds over which the particles are to be created.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetPFXEmitterEmitParticles(0,100,10.0);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetPFXEmitterEndColor===&lt;br /&gt;
{{MethodHeader|public native void SetPFXEmitterEndColor(int id, int phase, float r, float g, float b, float a)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;phase&#039;&#039;&#039; = The phase of the effect, if there is only one phase use zero.&lt;br /&gt;
*&#039;&#039;&#039;r,g,b&#039;&#039;&#039; = Red, green and blue components of the required color.&lt;br /&gt;
*&#039;&#039;&#039;a&#039;&#039;&#039; = Alpha value of the color.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetPFXEmitterStartColor(0,0,128,128,128,64);&lt;br /&gt;
 SetPFXEmitterStartColor(0,0,0.5,0.5,0.5,0.25);&lt;br /&gt;
;Notes&lt;br /&gt;
*Red, green, blue and alpha may be entered as integer or float values in the ranges 0..255 and 0.0..1.0 respectively.&lt;br /&gt;
*Both of the examples above give the same result.&lt;br /&gt;
*Note that 1,1,1,1 will be interpreted as float input and will produce white, whereas 2,2,2,2 will be interpreted as integers and will give a result which is almost black.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetPFXEmitterLifetime===&lt;br /&gt;
{{MethodHeader|public native void SetPFXEmitterLifetime(int id, int phase, float life)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;phase&#039;&#039;&#039; = The phase of the effect, if there is only one phase use zero.&lt;br /&gt;
*&#039;&#039;&#039;life&#039;&#039;&#039; = The new lifetime of particles in seconds at the specified phase.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetPFXEmitterLifetime(0,0,10);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetPFXEmitterMaxRate===&lt;br /&gt;
{{MethodHeader|public native void SetPFXEmitterMaxRate(int id, float newsize)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;rate&#039;&#039;&#039; = The new maximum rate of emission per second.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetPFXEmitterMaxRate(0,5.0);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetPFXEmitterMaxSize===&lt;br /&gt;
{{MethodHeader|public native void SetPFXEmitterMaxSize(int id, int phase, float newsize)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;phase&#039;&#039;&#039; = The phase of the effect, if there is only one phase use zero.&lt;br /&gt;
*&#039;&#039;&#039;newsize&#039;&#039;&#039; = The new maximum size of particles at the specified phase.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetPFXEmitterMaxSize(0,0,10);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetPFXEmitterMinRate===&lt;br /&gt;
{{MethodHeader|public native void SetPFXEmitterMinRate(int id, float rate)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;rate&#039;&#039;&#039; = The new minimum rate of emission per second.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetPFXEmitterMinRate(0,5.0);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetPFXEmitterMinSize===&lt;br /&gt;
{{MethodHeader|public native void SetPFXEmitterMinSize(int id, int phase, float newsize)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;phase&#039;&#039;&#039; = The phase of the effect, if there is only one phase use zero.&lt;br /&gt;
*&#039;&#039;&#039;newsize&#039;&#039;&#039; = The new minimum size of particles at the specified phase.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetPFXEmitterMinSize(0,0,10);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetPFXEmitterPhysicsDelay===&lt;br /&gt;
{{MethodHeader|public native void SetPFXEmitterPhysicsDelay(int id, int phase, float value)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;phase&#039;&#039;&#039; = The phase of the effect, if there is only one phase use zero.&lt;br /&gt;
*&#039;&#039;&#039;value&#039;&#039;&#039; = The new physics delay value to set for the specified phase.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetPFXEmitterPhysicsDelay(0,0,5.0);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetPFXEmitterRate===&lt;br /&gt;
{{MethodHeader|public native void SetPFXEmitterRate(int id, int phase, float rate)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;phase&#039;&#039;&#039; = The phase of the effect, if there is only one phase use zero.&lt;br /&gt;
*&#039;&#039;&#039;rate&#039;&#039;&#039; = New rate of particle creation per second at the specified phase.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetPFXEmitterRate(0,0,5.0);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetPFXEmitterStartColor===&lt;br /&gt;
{{MethodHeader|public native void SetPFXEmitterStartColor(int id, int phase, float r, float g, float b, float a)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;phase&#039;&#039;&#039; = The phase of the effect, if there is only one phase use zero.&lt;br /&gt;
*&#039;&#039;&#039;r,g,b&#039;&#039;&#039; = Red, green and blue components of the required color.&lt;br /&gt;
*&#039;&#039;&#039;a&#039;&#039;&#039; = Alpha value of the color.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetPFXEmitterStartColor(0,0,128,128,128,64);&lt;br /&gt;
 SetPFXEmitterStartColor(0,0,0.5,0.5,0.5,0.25);&lt;br /&gt;
;Notes&lt;br /&gt;
*Red, green, blue and alpha may be entered as integer or float values in the ranges 0..255 and 0.0..1.0 respectively.&lt;br /&gt;
*Both of the examples above give the same result.&lt;br /&gt;
*Note that 1,1,1,1 will be interpreted as float input and will produce white, whereas 2,2,2,2 will be interpreted as integers and will give a result which is almost black.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetPFXEmitterTexture===&lt;br /&gt;
{{MethodHeader|public native void SetPFXEmitterTexture(int id, KUID textureKUID)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;textureKUID&#039;&#039;&#039; = The kuid of the new texture.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetPFXEmitterTexture(0,&amp;lt;kuid:1234:5678&amp;gt;);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetPFXEmitterVelocity===&lt;br /&gt;
{{MethodHeader|public native void SetPFXEmitterVelocity(int id, int phase, float velocity)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;phase&#039;&#039;&#039; = The phase of the effect, if there is only one phase use zero.&lt;br /&gt;
*&#039;&#039;&#039;velocity&#039;&#039;&#039; = New velocity in metres per second along the direction vector of emitted particles at the specified phase.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetPFXEmitterVelocity(0,0,5.0);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===StopSoundScriptEvent===&lt;br /&gt;
{{MethodHeader|public native void StopSoundScriptEvent(string soundTrigger)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
&#039;&#039;&#039;soundTrigger&#039;&#039;&#039; = Name of the sound event to start playing, this equates to the &#039;&#039;trigger&#039;&#039; tag of the sound script subcontainer in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 StopSoundScriptEvent(&amp;quot;dayloop&amp;quot;);&lt;br /&gt;
;Notes&lt;br /&gt;
*Terminates a looped sound script previously started with [[#PlaySoundScriptEvent|PlaySoundScriptEvent()]].&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Related Methods==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Categories==&lt;br /&gt;
[[Category:Script Class]]&lt;/div&gt;</summary>
		<author><name>Ciceronmt</name></author>
	</entry>
	<entry>
		<id>https://wiki.trainzsimulator.com/index.php?title=Class_MapObject&amp;diff=25394</id>
		<title>Class MapObject</title>
		<link rel="alternate" type="text/html" href="https://wiki.trainzsimulator.com/index.php?title=Class_MapObject&amp;diff=25394"/>
		<updated>2020-11-21T12:10:10Z</updated>

		<summary type="html">&lt;p&gt;Ciceronmt: /* Methods */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;*[[TrainzScript Language Reference|API Hierarchy]]&lt;br /&gt;
**[[Class GSObject|GSObject]]&lt;br /&gt;
***[[Class GameObject|GameObject]]&lt;br /&gt;
****[[Class PropertyObject|PropertyObject]]&lt;br /&gt;
****[[Class TrainzGameObject|TrainzGameObject]]&lt;br /&gt;
*****[[Class MeshObject|MeshObject]]&lt;br /&gt;
******MapObject&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*This class extends MeshObject to include product queues. &lt;br /&gt;
*A MapObject can have a number of product queues as defined in the queues section of the config.txt file for the asset.&lt;br /&gt;
*The class also provides methods to control particle emissions.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==MapObject Messages==&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
{{TableHeader|width=50%|margin=15px}}&lt;br /&gt;
|-&lt;br /&gt;
|bgcolor=&amp;quot;#EEEEEE&amp;quot;|&#039;&#039;&#039;Major&#039;&#039;&#039;||bgcolor=&amp;quot;#EEEEEE&amp;quot;|&#039;&#039;&#039;Minor&#039;&#039;&#039;||bgcolor=&amp;quot;#EEEEEE&amp;quot;|&#039;&#039;&#039;Source&#039;&#039;&#039;||bgcolor=&amp;quot;#EEEEEE&amp;quot; |&#039;&#039;&#039;Destination&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|[[MapObject Messages|MapObject]]||View-Details||?||MapObject&lt;br /&gt;
|-&lt;br /&gt;
|[[MapObject Messages|MapObject]]||View-Schedule||?||MapObject&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Methods==&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
===AdjustMapObjectPosition===&lt;br /&gt;
{{MethodHeader|public native void AdjustMapObjectPosition(float dx, float dy, float dz)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;dx&#039;&#039;&#039; = The distance (m) to move the object along its x axis (right).&lt;br /&gt;
*&#039;&#039;&#039;dy&#039;&#039;&#039; = The distance (m) to move the object along its y axis (foward).&lt;br /&gt;
*&#039;&#039;&#039;dz&#039;&#039;&#039; = The distance (m) to move the object along its z axis (upward).&lt;br /&gt;
;Returned Value&lt;br /&gt;
* None.&lt;br /&gt;
;Syntax&lt;br /&gt;
 AdjustMapObjectPosition(x, y, z);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetMapObjectOrientation===&lt;br /&gt;
{{MethodHeader|public native Orientation GetMapObjectOrientation(void)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
* None.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*The absolute orientation of this MapObject.&lt;br /&gt;
;Syntax&lt;br /&gt;
 float angel_z = cabin.Loco.GetMapObjectOrientation().rz;&lt;br /&gt;
;Notes&lt;br /&gt;
* A call to GetMapObjectOrientation() which immediately follows a call to SetMapObjectOrientation() is not guaranteed to return the input orientation, since various other orientation restrictions may be in effect.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetMapObjectPosition===&lt;br /&gt;
{{MethodHeader|public native Orientation GetMapObjectPosition(void)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
* None.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*The absolute position of this MapObject.&lt;br /&gt;
;Syntax&lt;br /&gt;
 float angel_z = cabin.Loco.GetMapObjectPosition().z;&lt;br /&gt;
;Notes&lt;br /&gt;
* A call to GetMapObjectPosition() which immediately follows a call to SetMapObjectPosition() is not guaranteed to return the input position, since various other position restrictions may be in effect.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetPFXEmitterLifetime===&lt;br /&gt;
{{MethodHeader|public native float GetPFXEmitterLifetime(int id, int phase)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;phase&#039;&#039;&#039; = The phase of the effect, if there is only one phase use zero.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*Value of the lifetime of the effect at the specified phase.&lt;br /&gt;
;Syntax&lt;br /&gt;
 float lifetime GetPFXEmitterLifetime(0,0);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetPFXEmitterMaxRate===&lt;br /&gt;
{{MethodHeader|public native float GetPFXEmitterMaxRate(int id)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*Maximum rate of emissions per second.&lt;br /&gt;
;Syntax&lt;br /&gt;
 float maxRate = GetPFXEmitterMaxRate(0);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetPFXEmitterMaxSize===&lt;br /&gt;
{{MethodHeader|public native float GetPFXEmitterMaxSize(int id, int phase)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;phase&#039;&#039;&#039; = The phase of the effect, if there is only one phase use zero.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*Maximum size of particle at the specified phase.&lt;br /&gt;
;Syntax&lt;br /&gt;
 float maxsize = GetPFXEmitterMinSize();&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetPFXEmitterMinRate===&lt;br /&gt;
{{MethodHeader|public native float GetPFXEmitterMinRate(int id)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*Maximum rate of emissions per second.&lt;br /&gt;
;Syntax&lt;br /&gt;
 float minRtae = GetPFXEmitterMinRate(0);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetPFXEmitterMinSize===&lt;br /&gt;
{{MethodHeader|public native float GetPFXEmitterMinSize(int id, int phase)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;phase&#039;&#039;&#039; = The phase of the effect, if there is only one phase use zero.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*Minimum size of particle at the specified phase.&lt;br /&gt;
;Syntax&lt;br /&gt;
 float minsize = GetPFXEmitterMinSize();&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetPFXEmitterPhysicsDelay===&lt;br /&gt;
{{MethodHeader|public native float GetPFXEmitterPhysicsDelay(int id, int phase)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;phase&#039;&#039;&#039; = The phase of the effect, if there is only one phase use zero.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*Value for the physics delay in emission.&lt;br /&gt;
;Syntax&lt;br /&gt;
 GetPFXEmitterPhysicsDelay(0,0);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetPFXEmitterRate===&lt;br /&gt;
{{MethodHeader|public native float GetPFXEmitterRate(int id, int phase)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;phase&#039;&#039;&#039; = The phase of the effect, if there is only one phase use zero.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*Rate of particle creation per second.&lt;br /&gt;
;Syntax&lt;br /&gt;
 particlesPerSecond = GetPFXEmitterRate(0,0);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetPFXEmitterVelocity===&lt;br /&gt;
{{MethodHeader|public native float GetPFXEmitterVelocity(int id, int phase)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;phase&#039;&#039;&#039; = The phase of the effect, if there is only one phase use zero.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*Velocity in metres per second along the direction vector of emitted particles at the specified phase.&lt;br /&gt;
;Syntax&lt;br /&gt;
 float speed = GetPFXEmitterVelocity(0,0);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetQueue===&lt;br /&gt;
{{MethodHeader|public native ProductQueue GetQueue(string queueName)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
&#039;&#039;&#039;queueName&#039;&#039;&#039; = Name of the product queue to be returned.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*A reference to the queue if possible, null otherwise.&lt;br /&gt;
;Syntax&lt;br /&gt;
 ProductQueue queue = GetQueue(&amp;quot;passengers&amp;quot;);&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetQueues===&lt;br /&gt;
{{MethodHeader|public native ProductQueue[ ] GetQueues(void)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*None&lt;br /&gt;
;Returned Value&lt;br /&gt;
*An array of product queues, if there are no queues the array will be empty.&lt;br /&gt;
;Syntax&lt;br /&gt;
 ProductQueue[] queues = GetQueues();&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===PlaySoundScriptEvent===&lt;br /&gt;
{{MethodHeader|public native void PlaySoundScriptEvent(string soundTrigger)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
&#039;&#039;&#039;soundTrigger&#039;&#039;&#039; = Name of the sound event to start playing, this equates to the &#039;&#039;trigger&#039;&#039; tag of the sound script subcontainer in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 PlaySoundScriptEvent(&amp;quot;dayloop&amp;quot;);&lt;br /&gt;
;Notes&lt;br /&gt;
*Plays the specified sound event from the asset&#039;s SoundScript. &lt;br /&gt;
*SoundScripts are defined as sub-containers in the soundscript container of the asset&#039;s configuration. &lt;br /&gt;
*For details on creating assets with SoundScripts, see [[&amp;quot;Soundscript&amp;quot; container|here]]. &lt;br /&gt;
*This method will start playing the sound. &lt;br /&gt;
*Depending on the SoundScript configuration, the sound will either be played just once or played continuously in a looping cycle such that [[#StopSoundScriptEvent|StopSoundScriptEvent()]] will need to be called to stop it.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetMapObjectPosition===&lt;br /&gt;
{{MethodHeader|public native void SetMapObjectPosition(WorldCoordinate position)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;position&#039;&#039;&#039; =  The new position intended for this MapObject.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetMapObjectPosition(pos);&lt;br /&gt;
;Notes&lt;br /&gt;
*Instantly repositions this MapObject to the specified absolute position, as best possible. This will not successfully reposition a MapObject which has a parent relationship (for example, a Trackside object.) This function may be VERY slow and should generally not be used. Various object parameters and game states may restrict or remove the ability to position objects.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetPFXEmitterConeSize===&lt;br /&gt;
{{MethodHeader|public native void SetPFXEmitterConeSize(int id, float x, float y, float z)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;x,y,z&#039;&#039;&#039; = New X,Y and Z components of the particle cone size.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetPFXEmitterConeSize(0,2.0,3.0,2.0);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetPFXEmitterEmitParticles===&lt;br /&gt;
{{MethodHeader|public native void SetPFXEmitterEmitParticles(int id, int number,float time)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;number&#039;&#039;&#039; = The number of particles to emit.&lt;br /&gt;
*&#039;&#039;&#039;time&#039;&#039;&#039; = The time in seconds over which the particles are to be created.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetPFXEmitterEmitParticles(0,100,10.0);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetPFXEmitterEndColor===&lt;br /&gt;
{{MethodHeader|public native void SetPFXEmitterEndColor(int id, int phase, float r, float g, float b, float a)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;phase&#039;&#039;&#039; = The phase of the effect, if there is only one phase use zero.&lt;br /&gt;
*&#039;&#039;&#039;r,g,b&#039;&#039;&#039; = Red, green and blue components of the required color.&lt;br /&gt;
*&#039;&#039;&#039;a&#039;&#039;&#039; = Alpha value of the color.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetPFXEmitterStartColor(0,0,128,128,128,64);&lt;br /&gt;
 SetPFXEmitterStartColor(0,0,0.5,0.5,0.5,0.25);&lt;br /&gt;
;Notes&lt;br /&gt;
*Red, green, blue and alpha may be entered as integer or float values in the ranges 0..255 and 0.0..1.0 respectively.&lt;br /&gt;
*Both of the examples above give the same result.&lt;br /&gt;
*Note that 1,1,1,1 will be interpreted as float input and will produce white, whereas 2,2,2,2 will be interpreted as integers and will give a result which is almost black.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetPFXEmitterLifetime===&lt;br /&gt;
{{MethodHeader|public native void SetPFXEmitterLifetime(int id, int phase, float life)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;phase&#039;&#039;&#039; = The phase of the effect, if there is only one phase use zero.&lt;br /&gt;
*&#039;&#039;&#039;life&#039;&#039;&#039; = The new lifetime of particles in seconds at the specified phase.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetPFXEmitterLifetime(0,0,10);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetPFXEmitterMaxRate===&lt;br /&gt;
{{MethodHeader|public native void SetPFXEmitterMaxRate(int id, float newsize)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;rate&#039;&#039;&#039; = The new maximum rate of emission per second.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetPFXEmitterMaxRate(0,5.0);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetPFXEmitterMaxSize===&lt;br /&gt;
{{MethodHeader|public native void SetPFXEmitterMaxSize(int id, int phase, float newsize)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;phase&#039;&#039;&#039; = The phase of the effect, if there is only one phase use zero.&lt;br /&gt;
*&#039;&#039;&#039;newsize&#039;&#039;&#039; = The new maximum size of particles at the specified phase.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetPFXEmitterMaxSize(0,0,10);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetPFXEmitterMinRate===&lt;br /&gt;
{{MethodHeader|public native void SetPFXEmitterMinRate(int id, float rate)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;rate&#039;&#039;&#039; = The new minimum rate of emission per second.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetPFXEmitterMinRate(0,5.0);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetPFXEmitterMinSize===&lt;br /&gt;
{{MethodHeader|public native void SetPFXEmitterMinSize(int id, int phase, float newsize)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;phase&#039;&#039;&#039; = The phase of the effect, if there is only one phase use zero.&lt;br /&gt;
*&#039;&#039;&#039;newsize&#039;&#039;&#039; = The new minimum size of particles at the specified phase.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetPFXEmitterMinSize(0,0,10);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetPFXEmitterPhysicsDelay===&lt;br /&gt;
{{MethodHeader|public native void SetPFXEmitterPhysicsDelay(int id, int phase, float value)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;phase&#039;&#039;&#039; = The phase of the effect, if there is only one phase use zero.&lt;br /&gt;
*&#039;&#039;&#039;value&#039;&#039;&#039; = The new physics delay value to set for the specified phase.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetPFXEmitterPhysicsDelay(0,0,5.0);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetPFXEmitterRate===&lt;br /&gt;
{{MethodHeader|public native void SetPFXEmitterRate(int id, int phase, float rate)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;phase&#039;&#039;&#039; = The phase of the effect, if there is only one phase use zero.&lt;br /&gt;
*&#039;&#039;&#039;rate&#039;&#039;&#039; = New rate of particle creation per second at the specified phase.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetPFXEmitterRate(0,0,5.0);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetPFXEmitterStartColor===&lt;br /&gt;
{{MethodHeader|public native void SetPFXEmitterStartColor(int id, int phase, float r, float g, float b, float a)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;phase&#039;&#039;&#039; = The phase of the effect, if there is only one phase use zero.&lt;br /&gt;
*&#039;&#039;&#039;r,g,b&#039;&#039;&#039; = Red, green and blue components of the required color.&lt;br /&gt;
*&#039;&#039;&#039;a&#039;&#039;&#039; = Alpha value of the color.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetPFXEmitterStartColor(0,0,128,128,128,64);&lt;br /&gt;
 SetPFXEmitterStartColor(0,0,0.5,0.5,0.5,0.25);&lt;br /&gt;
;Notes&lt;br /&gt;
*Red, green, blue and alpha may be entered as integer or float values in the ranges 0..255 and 0.0..1.0 respectively.&lt;br /&gt;
*Both of the examples above give the same result.&lt;br /&gt;
*Note that 1,1,1,1 will be interpreted as float input and will produce white, whereas 2,2,2,2 will be interpreted as integers and will give a result which is almost black.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetPFXEmitterTexture===&lt;br /&gt;
{{MethodHeader|public native void SetPFXEmitterTexture(int id, KUID textureKUID)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;textureKUID&#039;&#039;&#039; = The kuid of the new texture.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetPFXEmitterTexture(0,&amp;lt;kuid:1234:5678&amp;gt;);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetPFXEmitterVelocity===&lt;br /&gt;
{{MethodHeader|public native void SetPFXEmitterVelocity(int id, int phase, float velocity)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;phase&#039;&#039;&#039; = The phase of the effect, if there is only one phase use zero.&lt;br /&gt;
*&#039;&#039;&#039;velocity&#039;&#039;&#039; = New velocity in metres per second along the direction vector of emitted particles at the specified phase.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetPFXEmitterVelocity(0,0,5.0);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===StopSoundScriptEvent===&lt;br /&gt;
{{MethodHeader|public native void StopSoundScriptEvent(string soundTrigger)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
&#039;&#039;&#039;soundTrigger&#039;&#039;&#039; = Name of the sound event to start playing, this equates to the &#039;&#039;trigger&#039;&#039; tag of the sound script subcontainer in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 StopSoundScriptEvent(&amp;quot;dayloop&amp;quot;);&lt;br /&gt;
;Notes&lt;br /&gt;
*Terminates a looped sound script previously started with [[#PlaySoundScriptEvent|PlaySoundScriptEvent()]].&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Related Methods==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Categories==&lt;br /&gt;
[[Category:Script Class]]&lt;/div&gt;</summary>
		<author><name>Ciceronmt</name></author>
	</entry>
	<entry>
		<id>https://wiki.trainzsimulator.com/index.php?title=Class_MapObject&amp;diff=25393</id>
		<title>Class MapObject</title>
		<link rel="alternate" type="text/html" href="https://wiki.trainzsimulator.com/index.php?title=Class_MapObject&amp;diff=25393"/>
		<updated>2020-11-21T12:03:32Z</updated>

		<summary type="html">&lt;p&gt;Ciceronmt: /* Methods */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;*[[TrainzScript Language Reference|API Hierarchy]]&lt;br /&gt;
**[[Class GSObject|GSObject]]&lt;br /&gt;
***[[Class GameObject|GameObject]]&lt;br /&gt;
****[[Class PropertyObject|PropertyObject]]&lt;br /&gt;
****[[Class TrainzGameObject|TrainzGameObject]]&lt;br /&gt;
*****[[Class MeshObject|MeshObject]]&lt;br /&gt;
******MapObject&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*This class extends MeshObject to include product queues. &lt;br /&gt;
*A MapObject can have a number of product queues as defined in the queues section of the config.txt file for the asset.&lt;br /&gt;
*The class also provides methods to control particle emissions.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==MapObject Messages==&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
{{TableHeader|width=50%|margin=15px}}&lt;br /&gt;
|-&lt;br /&gt;
|bgcolor=&amp;quot;#EEEEEE&amp;quot;|&#039;&#039;&#039;Major&#039;&#039;&#039;||bgcolor=&amp;quot;#EEEEEE&amp;quot;|&#039;&#039;&#039;Minor&#039;&#039;&#039;||bgcolor=&amp;quot;#EEEEEE&amp;quot;|&#039;&#039;&#039;Source&#039;&#039;&#039;||bgcolor=&amp;quot;#EEEEEE&amp;quot; |&#039;&#039;&#039;Destination&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|[[MapObject Messages|MapObject]]||View-Details||?||MapObject&lt;br /&gt;
|-&lt;br /&gt;
|[[MapObject Messages|MapObject]]||View-Schedule||?||MapObject&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Methods==&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
===AdjustMapObjectPosition===&lt;br /&gt;
{{MethodHeader|public native void AdjustMapObjectPosition(float dx, float dy, float dz)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;dx&#039;&#039;&#039; = The distance (m) to move the object along its x axis (right).&lt;br /&gt;
*&#039;&#039;&#039;dy&#039;&#039;&#039; = The distance (m) to move the object along its y axis (foward).&lt;br /&gt;
*&#039;&#039;&#039;dz&#039;&#039;&#039; = The distance (m) to move the object along its z axis (upward).&lt;br /&gt;
;Returned Value&lt;br /&gt;
* None.&lt;br /&gt;
;Syntax&lt;br /&gt;
 AdjustMapObjectPosition(x, y, z);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetMapObjectOrientation===&lt;br /&gt;
{{MethodHeader|public native Orientation GetMapObjectOrientation(void)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
* None.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*The absolute orientation of this MapObject.&lt;br /&gt;
;Syntax&lt;br /&gt;
 float angel_z = cabin.Loco.GetMapObjectOrientation().rz;&lt;br /&gt;
;Notes&lt;br /&gt;
* A call to GetMapObjectOrientation() which immediately follows a call to SetMapObjectOrientation() is not guaranteed to return the input orientation, since various other orientation restrictions may be in effect.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetPFXEmitterLifetime===&lt;br /&gt;
{{MethodHeader|public native float GetPFXEmitterLifetime(int id, int phase)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;phase&#039;&#039;&#039; = The phase of the effect, if there is only one phase use zero.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*Value of the lifetime of the effect at the specified phase.&lt;br /&gt;
;Syntax&lt;br /&gt;
 float lifetime GetPFXEmitterLifetime(0,0);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetPFXEmitterMaxRate===&lt;br /&gt;
{{MethodHeader|public native float GetPFXEmitterMaxRate(int id)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*Maximum rate of emissions per second.&lt;br /&gt;
;Syntax&lt;br /&gt;
 float maxRate = GetPFXEmitterMaxRate(0);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetPFXEmitterMaxSize===&lt;br /&gt;
{{MethodHeader|public native float GetPFXEmitterMaxSize(int id, int phase)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;phase&#039;&#039;&#039; = The phase of the effect, if there is only one phase use zero.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*Maximum size of particle at the specified phase.&lt;br /&gt;
;Syntax&lt;br /&gt;
 float maxsize = GetPFXEmitterMinSize();&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetPFXEmitterMinRate===&lt;br /&gt;
{{MethodHeader|public native float GetPFXEmitterMinRate(int id)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*Maximum rate of emissions per second.&lt;br /&gt;
;Syntax&lt;br /&gt;
 float minRtae = GetPFXEmitterMinRate(0);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetPFXEmitterMinSize===&lt;br /&gt;
{{MethodHeader|public native float GetPFXEmitterMinSize(int id, int phase)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;phase&#039;&#039;&#039; = The phase of the effect, if there is only one phase use zero.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*Minimum size of particle at the specified phase.&lt;br /&gt;
;Syntax&lt;br /&gt;
 float minsize = GetPFXEmitterMinSize();&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetPFXEmitterPhysicsDelay===&lt;br /&gt;
{{MethodHeader|public native float GetPFXEmitterPhysicsDelay(int id, int phase)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;phase&#039;&#039;&#039; = The phase of the effect, if there is only one phase use zero.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*Value for the physics delay in emission.&lt;br /&gt;
;Syntax&lt;br /&gt;
 GetPFXEmitterPhysicsDelay(0,0);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetPFXEmitterRate===&lt;br /&gt;
{{MethodHeader|public native float GetPFXEmitterRate(int id, int phase)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;phase&#039;&#039;&#039; = The phase of the effect, if there is only one phase use zero.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*Rate of particle creation per second.&lt;br /&gt;
;Syntax&lt;br /&gt;
 particlesPerSecond = GetPFXEmitterRate(0,0);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetPFXEmitterVelocity===&lt;br /&gt;
{{MethodHeader|public native float GetPFXEmitterVelocity(int id, int phase)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;phase&#039;&#039;&#039; = The phase of the effect, if there is only one phase use zero.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*Velocity in metres per second along the direction vector of emitted particles at the specified phase.&lt;br /&gt;
;Syntax&lt;br /&gt;
 float speed = GetPFXEmitterVelocity(0,0);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetQueue===&lt;br /&gt;
{{MethodHeader|public native ProductQueue GetQueue(string queueName)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
&#039;&#039;&#039;queueName&#039;&#039;&#039; = Name of the product queue to be returned.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*A reference to the queue if possible, null otherwise.&lt;br /&gt;
;Syntax&lt;br /&gt;
 ProductQueue queue = GetQueue(&amp;quot;passengers&amp;quot;);&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetQueues===&lt;br /&gt;
{{MethodHeader|public native ProductQueue[ ] GetQueues(void)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*None&lt;br /&gt;
;Returned Value&lt;br /&gt;
*An array of product queues, if there are no queues the array will be empty.&lt;br /&gt;
;Syntax&lt;br /&gt;
 ProductQueue[] queues = GetQueues();&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===PlaySoundScriptEvent===&lt;br /&gt;
{{MethodHeader|public native void PlaySoundScriptEvent(string soundTrigger)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
&#039;&#039;&#039;soundTrigger&#039;&#039;&#039; = Name of the sound event to start playing, this equates to the &#039;&#039;trigger&#039;&#039; tag of the sound script subcontainer in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 PlaySoundScriptEvent(&amp;quot;dayloop&amp;quot;);&lt;br /&gt;
;Notes&lt;br /&gt;
*Plays the specified sound event from the asset&#039;s SoundScript. &lt;br /&gt;
*SoundScripts are defined as sub-containers in the soundscript container of the asset&#039;s configuration. &lt;br /&gt;
*For details on creating assets with SoundScripts, see [[&amp;quot;Soundscript&amp;quot; container|here]]. &lt;br /&gt;
*This method will start playing the sound. &lt;br /&gt;
*Depending on the SoundScript configuration, the sound will either be played just once or played continuously in a looping cycle such that [[#StopSoundScriptEvent|StopSoundScriptEvent()]] will need to be called to stop it.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetMapObjectPosition===&lt;br /&gt;
{{MethodHeader|public native void SetMapObjectPosition(WorldCoordinate position)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;position&#039;&#039;&#039; =  The new position intended for this MapObject.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetMapObjectPosition(pos);&lt;br /&gt;
;Notes&lt;br /&gt;
*Instantly repositions this MapObject to the specified absolute position, as best possible. This will not successfully reposition a MapObject which has a parent relationship (for example, a Trackside object.) This function may be VERY slow and should generally not be used. Various object parameters and game states may restrict or remove the ability to position objects.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetPFXEmitterConeSize===&lt;br /&gt;
{{MethodHeader|public native void SetPFXEmitterConeSize(int id, float x, float y, float z)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;x,y,z&#039;&#039;&#039; = New X,Y and Z components of the particle cone size.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetPFXEmitterConeSize(0,2.0,3.0,2.0);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetPFXEmitterEmitParticles===&lt;br /&gt;
{{MethodHeader|public native void SetPFXEmitterEmitParticles(int id, int number,float time)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;number&#039;&#039;&#039; = The number of particles to emit.&lt;br /&gt;
*&#039;&#039;&#039;time&#039;&#039;&#039; = The time in seconds over which the particles are to be created.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetPFXEmitterEmitParticles(0,100,10.0);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetPFXEmitterEndColor===&lt;br /&gt;
{{MethodHeader|public native void SetPFXEmitterEndColor(int id, int phase, float r, float g, float b, float a)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;phase&#039;&#039;&#039; = The phase of the effect, if there is only one phase use zero.&lt;br /&gt;
*&#039;&#039;&#039;r,g,b&#039;&#039;&#039; = Red, green and blue components of the required color.&lt;br /&gt;
*&#039;&#039;&#039;a&#039;&#039;&#039; = Alpha value of the color.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetPFXEmitterStartColor(0,0,128,128,128,64);&lt;br /&gt;
 SetPFXEmitterStartColor(0,0,0.5,0.5,0.5,0.25);&lt;br /&gt;
;Notes&lt;br /&gt;
*Red, green, blue and alpha may be entered as integer or float values in the ranges 0..255 and 0.0..1.0 respectively.&lt;br /&gt;
*Both of the examples above give the same result.&lt;br /&gt;
*Note that 1,1,1,1 will be interpreted as float input and will produce white, whereas 2,2,2,2 will be interpreted as integers and will give a result which is almost black.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetPFXEmitterLifetime===&lt;br /&gt;
{{MethodHeader|public native void SetPFXEmitterLifetime(int id, int phase, float life)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;phase&#039;&#039;&#039; = The phase of the effect, if there is only one phase use zero.&lt;br /&gt;
*&#039;&#039;&#039;life&#039;&#039;&#039; = The new lifetime of particles in seconds at the specified phase.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetPFXEmitterLifetime(0,0,10);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetPFXEmitterMaxRate===&lt;br /&gt;
{{MethodHeader|public native void SetPFXEmitterMaxRate(int id, float newsize)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;rate&#039;&#039;&#039; = The new maximum rate of emission per second.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetPFXEmitterMaxRate(0,5.0);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetPFXEmitterMaxSize===&lt;br /&gt;
{{MethodHeader|public native void SetPFXEmitterMaxSize(int id, int phase, float newsize)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;phase&#039;&#039;&#039; = The phase of the effect, if there is only one phase use zero.&lt;br /&gt;
*&#039;&#039;&#039;newsize&#039;&#039;&#039; = The new maximum size of particles at the specified phase.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetPFXEmitterMaxSize(0,0,10);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetPFXEmitterMinRate===&lt;br /&gt;
{{MethodHeader|public native void SetPFXEmitterMinRate(int id, float rate)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;rate&#039;&#039;&#039; = The new minimum rate of emission per second.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetPFXEmitterMinRate(0,5.0);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetPFXEmitterMinSize===&lt;br /&gt;
{{MethodHeader|public native void SetPFXEmitterMinSize(int id, int phase, float newsize)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;phase&#039;&#039;&#039; = The phase of the effect, if there is only one phase use zero.&lt;br /&gt;
*&#039;&#039;&#039;newsize&#039;&#039;&#039; = The new minimum size of particles at the specified phase.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetPFXEmitterMinSize(0,0,10);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetPFXEmitterPhysicsDelay===&lt;br /&gt;
{{MethodHeader|public native void SetPFXEmitterPhysicsDelay(int id, int phase, float value)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;phase&#039;&#039;&#039; = The phase of the effect, if there is only one phase use zero.&lt;br /&gt;
*&#039;&#039;&#039;value&#039;&#039;&#039; = The new physics delay value to set for the specified phase.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetPFXEmitterPhysicsDelay(0,0,5.0);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetPFXEmitterRate===&lt;br /&gt;
{{MethodHeader|public native void SetPFXEmitterRate(int id, int phase, float rate)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;phase&#039;&#039;&#039; = The phase of the effect, if there is only one phase use zero.&lt;br /&gt;
*&#039;&#039;&#039;rate&#039;&#039;&#039; = New rate of particle creation per second at the specified phase.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetPFXEmitterRate(0,0,5.0);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetPFXEmitterStartColor===&lt;br /&gt;
{{MethodHeader|public native void SetPFXEmitterStartColor(int id, int phase, float r, float g, float b, float a)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;phase&#039;&#039;&#039; = The phase of the effect, if there is only one phase use zero.&lt;br /&gt;
*&#039;&#039;&#039;r,g,b&#039;&#039;&#039; = Red, green and blue components of the required color.&lt;br /&gt;
*&#039;&#039;&#039;a&#039;&#039;&#039; = Alpha value of the color.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetPFXEmitterStartColor(0,0,128,128,128,64);&lt;br /&gt;
 SetPFXEmitterStartColor(0,0,0.5,0.5,0.5,0.25);&lt;br /&gt;
;Notes&lt;br /&gt;
*Red, green, blue and alpha may be entered as integer or float values in the ranges 0..255 and 0.0..1.0 respectively.&lt;br /&gt;
*Both of the examples above give the same result.&lt;br /&gt;
*Note that 1,1,1,1 will be interpreted as float input and will produce white, whereas 2,2,2,2 will be interpreted as integers and will give a result which is almost black.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetPFXEmitterTexture===&lt;br /&gt;
{{MethodHeader|public native void SetPFXEmitterTexture(int id, KUID textureKUID)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;textureKUID&#039;&#039;&#039; = The kuid of the new texture.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetPFXEmitterTexture(0,&amp;lt;kuid:1234:5678&amp;gt;);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetPFXEmitterVelocity===&lt;br /&gt;
{{MethodHeader|public native void SetPFXEmitterVelocity(int id, int phase, float velocity)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;phase&#039;&#039;&#039; = The phase of the effect, if there is only one phase use zero.&lt;br /&gt;
*&#039;&#039;&#039;velocity&#039;&#039;&#039; = New velocity in metres per second along the direction vector of emitted particles at the specified phase.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetPFXEmitterVelocity(0,0,5.0);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===StopSoundScriptEvent===&lt;br /&gt;
{{MethodHeader|public native void StopSoundScriptEvent(string soundTrigger)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
&#039;&#039;&#039;soundTrigger&#039;&#039;&#039; = Name of the sound event to start playing, this equates to the &#039;&#039;trigger&#039;&#039; tag of the sound script subcontainer in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 StopSoundScriptEvent(&amp;quot;dayloop&amp;quot;);&lt;br /&gt;
;Notes&lt;br /&gt;
*Terminates a looped sound script previously started with [[#PlaySoundScriptEvent|PlaySoundScriptEvent()]].&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Related Methods==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Categories==&lt;br /&gt;
[[Category:Script Class]]&lt;/div&gt;</summary>
		<author><name>Ciceronmt</name></author>
	</entry>
	<entry>
		<id>https://wiki.trainzsimulator.com/index.php?title=Class_MapObject&amp;diff=25392</id>
		<title>Class MapObject</title>
		<link rel="alternate" type="text/html" href="https://wiki.trainzsimulator.com/index.php?title=Class_MapObject&amp;diff=25392"/>
		<updated>2020-11-21T11:54:23Z</updated>

		<summary type="html">&lt;p&gt;Ciceronmt: /* GetMapObjectOrientation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;*[[TrainzScript Language Reference|API Hierarchy]]&lt;br /&gt;
**[[Class GSObject|GSObject]]&lt;br /&gt;
***[[Class GameObject|GameObject]]&lt;br /&gt;
****[[Class PropertyObject|PropertyObject]]&lt;br /&gt;
****[[Class TrainzGameObject|TrainzGameObject]]&lt;br /&gt;
*****[[Class MeshObject|MeshObject]]&lt;br /&gt;
******MapObject&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*This class extends MeshObject to include product queues. &lt;br /&gt;
*A MapObject can have a number of product queues as defined in the queues section of the config.txt file for the asset.&lt;br /&gt;
*The class also provides methods to control particle emissions.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==MapObject Messages==&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
{{TableHeader|width=50%|margin=15px}}&lt;br /&gt;
|-&lt;br /&gt;
|bgcolor=&amp;quot;#EEEEEE&amp;quot;|&#039;&#039;&#039;Major&#039;&#039;&#039;||bgcolor=&amp;quot;#EEEEEE&amp;quot;|&#039;&#039;&#039;Minor&#039;&#039;&#039;||bgcolor=&amp;quot;#EEEEEE&amp;quot;|&#039;&#039;&#039;Source&#039;&#039;&#039;||bgcolor=&amp;quot;#EEEEEE&amp;quot; |&#039;&#039;&#039;Destination&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|[[MapObject Messages|MapObject]]||View-Details||?||MapObject&lt;br /&gt;
|-&lt;br /&gt;
|[[MapObject Messages|MapObject]]||View-Schedule||?||MapObject&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Methods==&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
===AdjustMapObjectPosition===&lt;br /&gt;
{{MethodHeader|public native void AdjustMapObjectPosition(float dx, float dy, float dz)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;dx&#039;&#039;&#039; = The distance (m) to move the object along its x axis (right).&lt;br /&gt;
*&#039;&#039;&#039;dy&#039;&#039;&#039; = The distance (m) to move the object along its y axis (foward).&lt;br /&gt;
*&#039;&#039;&#039;dz&#039;&#039;&#039; = The distance (m) to move the object along its z axis (upward).&lt;br /&gt;
;Returned Value&lt;br /&gt;
* None.&lt;br /&gt;
;Syntax&lt;br /&gt;
 AdjustMapObjectPosition(x, y, z);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetMapObjectOrientation===&lt;br /&gt;
{{MethodHeader|public native Orientation GetMapObjectOrientation(void)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
* None.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*The absolute orientation of this MapObject.&lt;br /&gt;
;Syntax&lt;br /&gt;
 float angel_z = cabin.Loco.GetMapObjectOrientation().rz;&lt;br /&gt;
;Notes&lt;br /&gt;
* A call to GetMapObjectOrientation() which immediately follows a call to SetMapObjectOrientation() is not guaranteed to return the input orientation, since various other orientation restrictions may be in effect.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetPFXEmitterLifetime===&lt;br /&gt;
{{MethodHeader|public native float GetPFXEmitterLifetime(int id, int phase)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;phase&#039;&#039;&#039; = The phase of the effect, if there is only one phase use zero.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*Value of the lifetime of the effect at the specified phase.&lt;br /&gt;
;Syntax&lt;br /&gt;
 float lifetime GetPFXEmitterLifetime(0,0);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetPFXEmitterMaxRate===&lt;br /&gt;
{{MethodHeader|public native float GetPFXEmitterMaxRate(int id)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*Maximum rate of emissions per second.&lt;br /&gt;
;Syntax&lt;br /&gt;
 float maxRate = GetPFXEmitterMaxRate(0);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetPFXEmitterMaxSize===&lt;br /&gt;
{{MethodHeader|public native float GetPFXEmitterMaxSize(int id, int phase)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;phase&#039;&#039;&#039; = The phase of the effect, if there is only one phase use zero.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*Maximum size of particle at the specified phase.&lt;br /&gt;
;Syntax&lt;br /&gt;
 float maxsize = GetPFXEmitterMinSize();&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetPFXEmitterMinRate===&lt;br /&gt;
{{MethodHeader|public native float GetPFXEmitterMinRate(int id)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*Maximum rate of emissions per second.&lt;br /&gt;
;Syntax&lt;br /&gt;
 float minRtae = GetPFXEmitterMinRate(0);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetPFXEmitterMinSize===&lt;br /&gt;
{{MethodHeader|public native float GetPFXEmitterMinSize(int id, int phase)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;phase&#039;&#039;&#039; = The phase of the effect, if there is only one phase use zero.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*Minimum size of particle at the specified phase.&lt;br /&gt;
;Syntax&lt;br /&gt;
 float minsize = GetPFXEmitterMinSize();&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetPFXEmitterPhysicsDelay===&lt;br /&gt;
{{MethodHeader|public native float GetPFXEmitterPhysicsDelay(int id, int phase)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;phase&#039;&#039;&#039; = The phase of the effect, if there is only one phase use zero.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*Value for the physics delay in emission.&lt;br /&gt;
;Syntax&lt;br /&gt;
 GetPFXEmitterPhysicsDelay(0,0);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetPFXEmitterRate===&lt;br /&gt;
{{MethodHeader|public native float GetPFXEmitterRate(int id, int phase)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;phase&#039;&#039;&#039; = The phase of the effect, if there is only one phase use zero.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*Rate of particle creation per second.&lt;br /&gt;
;Syntax&lt;br /&gt;
 particlesPerSecond = GetPFXEmitterRate(0,0);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetPFXEmitterVelocity===&lt;br /&gt;
{{MethodHeader|public native float GetPFXEmitterVelocity(int id, int phase)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;phase&#039;&#039;&#039; = The phase of the effect, if there is only one phase use zero.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*Velocity in metres per second along the direction vector of emitted particles at the specified phase.&lt;br /&gt;
;Syntax&lt;br /&gt;
 float speed = GetPFXEmitterVelocity(0,0);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetQueue===&lt;br /&gt;
{{MethodHeader|public native ProductQueue GetQueue(string queueName)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
&#039;&#039;&#039;queueName&#039;&#039;&#039; = Name of the product queue to be returned.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*A reference to the queue if possible, null otherwise.&lt;br /&gt;
;Syntax&lt;br /&gt;
 ProductQueue queue = GetQueue(&amp;quot;passengers&amp;quot;);&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetQueues===&lt;br /&gt;
{{MethodHeader|public native ProductQueue[ ] GetQueues(void)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*None&lt;br /&gt;
;Returned Value&lt;br /&gt;
*An array of product queues, if there are no queues the array will be empty.&lt;br /&gt;
;Syntax&lt;br /&gt;
 ProductQueue[] queues = GetQueues();&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===PlaySoundScriptEvent===&lt;br /&gt;
{{MethodHeader|public native void PlaySoundScriptEvent(string soundTrigger)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
&#039;&#039;&#039;soundTrigger&#039;&#039;&#039; = Name of the sound event to start playing, this equates to the &#039;&#039;trigger&#039;&#039; tag of the sound script subcontainer in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 PlaySoundScriptEvent(&amp;quot;dayloop&amp;quot;);&lt;br /&gt;
;Notes&lt;br /&gt;
*Plays the specified sound event from the asset&#039;s SoundScript. &lt;br /&gt;
*SoundScripts are defined as sub-containers in the soundscript container of the asset&#039;s configuration. &lt;br /&gt;
*For details on creating assets with SoundScripts, see [[&amp;quot;Soundscript&amp;quot; container|here]]. &lt;br /&gt;
*This method will start playing the sound. &lt;br /&gt;
*Depending on the SoundScript configuration, the sound will either be played just once or played continuously in a looping cycle such that [[#StopSoundScriptEvent|StopSoundScriptEvent()]] will need to be called to stop it.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetPFXEmitterConeSize===&lt;br /&gt;
{{MethodHeader|public native void SetPFXEmitterConeSize(int id, float x, float y, float z)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;x,y,z&#039;&#039;&#039; = New X,Y and Z components of the particle cone size.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetPFXEmitterConeSize(0,2.0,3.0,2.0);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetPFXEmitterEmitParticles===&lt;br /&gt;
{{MethodHeader|public native void SetPFXEmitterEmitParticles(int id, int number,float time)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;number&#039;&#039;&#039; = The number of particles to emit.&lt;br /&gt;
*&#039;&#039;&#039;time&#039;&#039;&#039; = The time in seconds over which the particles are to be created.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetPFXEmitterEmitParticles(0,100,10.0);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetPFXEmitterEndColor===&lt;br /&gt;
{{MethodHeader|public native void SetPFXEmitterEndColor(int id, int phase, float r, float g, float b, float a)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;phase&#039;&#039;&#039; = The phase of the effect, if there is only one phase use zero.&lt;br /&gt;
*&#039;&#039;&#039;r,g,b&#039;&#039;&#039; = Red, green and blue components of the required color.&lt;br /&gt;
*&#039;&#039;&#039;a&#039;&#039;&#039; = Alpha value of the color.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetPFXEmitterStartColor(0,0,128,128,128,64);&lt;br /&gt;
 SetPFXEmitterStartColor(0,0,0.5,0.5,0.5,0.25);&lt;br /&gt;
;Notes&lt;br /&gt;
*Red, green, blue and alpha may be entered as integer or float values in the ranges 0..255 and 0.0..1.0 respectively.&lt;br /&gt;
*Both of the examples above give the same result.&lt;br /&gt;
*Note that 1,1,1,1 will be interpreted as float input and will produce white, whereas 2,2,2,2 will be interpreted as integers and will give a result which is almost black.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetPFXEmitterLifetime===&lt;br /&gt;
{{MethodHeader|public native void SetPFXEmitterLifetime(int id, int phase, float life)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;phase&#039;&#039;&#039; = The phase of the effect, if there is only one phase use zero.&lt;br /&gt;
*&#039;&#039;&#039;life&#039;&#039;&#039; = The new lifetime of particles in seconds at the specified phase.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetPFXEmitterLifetime(0,0,10);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetPFXEmitterMaxRate===&lt;br /&gt;
{{MethodHeader|public native void SetPFXEmitterMaxRate(int id, float newsize)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;rate&#039;&#039;&#039; = The new maximum rate of emission per second.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetPFXEmitterMaxRate(0,5.0);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetPFXEmitterMaxSize===&lt;br /&gt;
{{MethodHeader|public native void SetPFXEmitterMaxSize(int id, int phase, float newsize)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;phase&#039;&#039;&#039; = The phase of the effect, if there is only one phase use zero.&lt;br /&gt;
*&#039;&#039;&#039;newsize&#039;&#039;&#039; = The new maximum size of particles at the specified phase.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetPFXEmitterMaxSize(0,0,10);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetPFXEmitterMinRate===&lt;br /&gt;
{{MethodHeader|public native void SetPFXEmitterMinRate(int id, float rate)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;rate&#039;&#039;&#039; = The new minimum rate of emission per second.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetPFXEmitterMinRate(0,5.0);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetPFXEmitterMinSize===&lt;br /&gt;
{{MethodHeader|public native void SetPFXEmitterMinSize(int id, int phase, float newsize)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;phase&#039;&#039;&#039; = The phase of the effect, if there is only one phase use zero.&lt;br /&gt;
*&#039;&#039;&#039;newsize&#039;&#039;&#039; = The new minimum size of particles at the specified phase.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetPFXEmitterMinSize(0,0,10);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetPFXEmitterPhysicsDelay===&lt;br /&gt;
{{MethodHeader|public native void SetPFXEmitterPhysicsDelay(int id, int phase, float value)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;phase&#039;&#039;&#039; = The phase of the effect, if there is only one phase use zero.&lt;br /&gt;
*&#039;&#039;&#039;value&#039;&#039;&#039; = The new physics delay value to set for the specified phase.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetPFXEmitterPhysicsDelay(0,0,5.0);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetPFXEmitterRate===&lt;br /&gt;
{{MethodHeader|public native void SetPFXEmitterRate(int id, int phase, float rate)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;phase&#039;&#039;&#039; = The phase of the effect, if there is only one phase use zero.&lt;br /&gt;
*&#039;&#039;&#039;rate&#039;&#039;&#039; = New rate of particle creation per second at the specified phase.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetPFXEmitterRate(0,0,5.0);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetPFXEmitterStartColor===&lt;br /&gt;
{{MethodHeader|public native void SetPFXEmitterStartColor(int id, int phase, float r, float g, float b, float a)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;phase&#039;&#039;&#039; = The phase of the effect, if there is only one phase use zero.&lt;br /&gt;
*&#039;&#039;&#039;r,g,b&#039;&#039;&#039; = Red, green and blue components of the required color.&lt;br /&gt;
*&#039;&#039;&#039;a&#039;&#039;&#039; = Alpha value of the color.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetPFXEmitterStartColor(0,0,128,128,128,64);&lt;br /&gt;
 SetPFXEmitterStartColor(0,0,0.5,0.5,0.5,0.25);&lt;br /&gt;
;Notes&lt;br /&gt;
*Red, green, blue and alpha may be entered as integer or float values in the ranges 0..255 and 0.0..1.0 respectively.&lt;br /&gt;
*Both of the examples above give the same result.&lt;br /&gt;
*Note that 1,1,1,1 will be interpreted as float input and will produce white, whereas 2,2,2,2 will be interpreted as integers and will give a result which is almost black.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetPFXEmitterTexture===&lt;br /&gt;
{{MethodHeader|public native void SetPFXEmitterTexture(int id, KUID textureKUID)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;textureKUID&#039;&#039;&#039; = The kuid of the new texture.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetPFXEmitterTexture(0,&amp;lt;kuid:1234:5678&amp;gt;);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetPFXEmitterVelocity===&lt;br /&gt;
{{MethodHeader|public native void SetPFXEmitterVelocity(int id, int phase, float velocity)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;phase&#039;&#039;&#039; = The phase of the effect, if there is only one phase use zero.&lt;br /&gt;
*&#039;&#039;&#039;velocity&#039;&#039;&#039; = New velocity in metres per second along the direction vector of emitted particles at the specified phase.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetPFXEmitterVelocity(0,0,5.0);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===StopSoundScriptEvent===&lt;br /&gt;
{{MethodHeader|public native void StopSoundScriptEvent(string soundTrigger)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
&#039;&#039;&#039;soundTrigger&#039;&#039;&#039; = Name of the sound event to start playing, this equates to the &#039;&#039;trigger&#039;&#039; tag of the sound script subcontainer in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 StopSoundScriptEvent(&amp;quot;dayloop&amp;quot;);&lt;br /&gt;
;Notes&lt;br /&gt;
*Terminates a looped sound script previously started with [[#PlaySoundScriptEvent|PlaySoundScriptEvent()]].&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Related Methods==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Categories==&lt;br /&gt;
[[Category:Script Class]]&lt;/div&gt;</summary>
		<author><name>Ciceronmt</name></author>
	</entry>
	<entry>
		<id>https://wiki.trainzsimulator.com/index.php?title=Class_MapObject&amp;diff=25391</id>
		<title>Class MapObject</title>
		<link rel="alternate" type="text/html" href="https://wiki.trainzsimulator.com/index.php?title=Class_MapObject&amp;diff=25391"/>
		<updated>2020-11-21T11:50:11Z</updated>

		<summary type="html">&lt;p&gt;Ciceronmt: /* GetMapObjectOrientation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;*[[TrainzScript Language Reference|API Hierarchy]]&lt;br /&gt;
**[[Class GSObject|GSObject]]&lt;br /&gt;
***[[Class GameObject|GameObject]]&lt;br /&gt;
****[[Class PropertyObject|PropertyObject]]&lt;br /&gt;
****[[Class TrainzGameObject|TrainzGameObject]]&lt;br /&gt;
*****[[Class MeshObject|MeshObject]]&lt;br /&gt;
******MapObject&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*This class extends MeshObject to include product queues. &lt;br /&gt;
*A MapObject can have a number of product queues as defined in the queues section of the config.txt file for the asset.&lt;br /&gt;
*The class also provides methods to control particle emissions.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==MapObject Messages==&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
{{TableHeader|width=50%|margin=15px}}&lt;br /&gt;
|-&lt;br /&gt;
|bgcolor=&amp;quot;#EEEEEE&amp;quot;|&#039;&#039;&#039;Major&#039;&#039;&#039;||bgcolor=&amp;quot;#EEEEEE&amp;quot;|&#039;&#039;&#039;Minor&#039;&#039;&#039;||bgcolor=&amp;quot;#EEEEEE&amp;quot;|&#039;&#039;&#039;Source&#039;&#039;&#039;||bgcolor=&amp;quot;#EEEEEE&amp;quot; |&#039;&#039;&#039;Destination&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|[[MapObject Messages|MapObject]]||View-Details||?||MapObject&lt;br /&gt;
|-&lt;br /&gt;
|[[MapObject Messages|MapObject]]||View-Schedule||?||MapObject&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Methods==&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
===AdjustMapObjectPosition===&lt;br /&gt;
{{MethodHeader|public native void AdjustMapObjectPosition(float dx, float dy, float dz)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;dx&#039;&#039;&#039; = The distance (m) to move the object along its x axis (right).&lt;br /&gt;
*&#039;&#039;&#039;dy&#039;&#039;&#039; = The distance (m) to move the object along its y axis (foward).&lt;br /&gt;
*&#039;&#039;&#039;dz&#039;&#039;&#039; = The distance (m) to move the object along its z axis (upward).&lt;br /&gt;
;Returned Value&lt;br /&gt;
* None.&lt;br /&gt;
;Syntax&lt;br /&gt;
 AdjustMapObjectPosition(x, y, z);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetMapObjectOrientation===&lt;br /&gt;
{{MethodHeader|public native Orientation GetMapObjectOrientation(void)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
* None.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*The absolute orientation of this MapObject.&lt;br /&gt;
;Syntax&lt;br /&gt;
 float angel_z = cabin.Loco.GetMapObjectOrientation().rz;&lt;br /&gt;
;Notes&lt;br /&gt;
A call to GetMapObjectOrientation() which immediately follows a call to SetMapObjectOrientation() is not guaranteed to return the input orientation, since various other orientation restrictions may be in effect.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetPFXEmitterLifetime===&lt;br /&gt;
{{MethodHeader|public native float GetPFXEmitterLifetime(int id, int phase)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;phase&#039;&#039;&#039; = The phase of the effect, if there is only one phase use zero.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*Value of the lifetime of the effect at the specified phase.&lt;br /&gt;
;Syntax&lt;br /&gt;
 float lifetime GetPFXEmitterLifetime(0,0);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetPFXEmitterMaxRate===&lt;br /&gt;
{{MethodHeader|public native float GetPFXEmitterMaxRate(int id)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*Maximum rate of emissions per second.&lt;br /&gt;
;Syntax&lt;br /&gt;
 float maxRate = GetPFXEmitterMaxRate(0);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetPFXEmitterMaxSize===&lt;br /&gt;
{{MethodHeader|public native float GetPFXEmitterMaxSize(int id, int phase)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;phase&#039;&#039;&#039; = The phase of the effect, if there is only one phase use zero.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*Maximum size of particle at the specified phase.&lt;br /&gt;
;Syntax&lt;br /&gt;
 float maxsize = GetPFXEmitterMinSize();&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetPFXEmitterMinRate===&lt;br /&gt;
{{MethodHeader|public native float GetPFXEmitterMinRate(int id)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*Maximum rate of emissions per second.&lt;br /&gt;
;Syntax&lt;br /&gt;
 float minRtae = GetPFXEmitterMinRate(0);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetPFXEmitterMinSize===&lt;br /&gt;
{{MethodHeader|public native float GetPFXEmitterMinSize(int id, int phase)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;phase&#039;&#039;&#039; = The phase of the effect, if there is only one phase use zero.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*Minimum size of particle at the specified phase.&lt;br /&gt;
;Syntax&lt;br /&gt;
 float minsize = GetPFXEmitterMinSize();&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetPFXEmitterPhysicsDelay===&lt;br /&gt;
{{MethodHeader|public native float GetPFXEmitterPhysicsDelay(int id, int phase)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;phase&#039;&#039;&#039; = The phase of the effect, if there is only one phase use zero.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*Value for the physics delay in emission.&lt;br /&gt;
;Syntax&lt;br /&gt;
 GetPFXEmitterPhysicsDelay(0,0);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetPFXEmitterRate===&lt;br /&gt;
{{MethodHeader|public native float GetPFXEmitterRate(int id, int phase)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;phase&#039;&#039;&#039; = The phase of the effect, if there is only one phase use zero.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*Rate of particle creation per second.&lt;br /&gt;
;Syntax&lt;br /&gt;
 particlesPerSecond = GetPFXEmitterRate(0,0);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetPFXEmitterVelocity===&lt;br /&gt;
{{MethodHeader|public native float GetPFXEmitterVelocity(int id, int phase)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;phase&#039;&#039;&#039; = The phase of the effect, if there is only one phase use zero.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*Velocity in metres per second along the direction vector of emitted particles at the specified phase.&lt;br /&gt;
;Syntax&lt;br /&gt;
 float speed = GetPFXEmitterVelocity(0,0);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetQueue===&lt;br /&gt;
{{MethodHeader|public native ProductQueue GetQueue(string queueName)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
&#039;&#039;&#039;queueName&#039;&#039;&#039; = Name of the product queue to be returned.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*A reference to the queue if possible, null otherwise.&lt;br /&gt;
;Syntax&lt;br /&gt;
 ProductQueue queue = GetQueue(&amp;quot;passengers&amp;quot;);&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetQueues===&lt;br /&gt;
{{MethodHeader|public native ProductQueue[ ] GetQueues(void)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*None&lt;br /&gt;
;Returned Value&lt;br /&gt;
*An array of product queues, if there are no queues the array will be empty.&lt;br /&gt;
;Syntax&lt;br /&gt;
 ProductQueue[] queues = GetQueues();&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===PlaySoundScriptEvent===&lt;br /&gt;
{{MethodHeader|public native void PlaySoundScriptEvent(string soundTrigger)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
&#039;&#039;&#039;soundTrigger&#039;&#039;&#039; = Name of the sound event to start playing, this equates to the &#039;&#039;trigger&#039;&#039; tag of the sound script subcontainer in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 PlaySoundScriptEvent(&amp;quot;dayloop&amp;quot;);&lt;br /&gt;
;Notes&lt;br /&gt;
*Plays the specified sound event from the asset&#039;s SoundScript. &lt;br /&gt;
*SoundScripts are defined as sub-containers in the soundscript container of the asset&#039;s configuration. &lt;br /&gt;
*For details on creating assets with SoundScripts, see [[&amp;quot;Soundscript&amp;quot; container|here]]. &lt;br /&gt;
*This method will start playing the sound. &lt;br /&gt;
*Depending on the SoundScript configuration, the sound will either be played just once or played continuously in a looping cycle such that [[#StopSoundScriptEvent|StopSoundScriptEvent()]] will need to be called to stop it.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetPFXEmitterConeSize===&lt;br /&gt;
{{MethodHeader|public native void SetPFXEmitterConeSize(int id, float x, float y, float z)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;x,y,z&#039;&#039;&#039; = New X,Y and Z components of the particle cone size.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetPFXEmitterConeSize(0,2.0,3.0,2.0);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetPFXEmitterEmitParticles===&lt;br /&gt;
{{MethodHeader|public native void SetPFXEmitterEmitParticles(int id, int number,float time)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;number&#039;&#039;&#039; = The number of particles to emit.&lt;br /&gt;
*&#039;&#039;&#039;time&#039;&#039;&#039; = The time in seconds over which the particles are to be created.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetPFXEmitterEmitParticles(0,100,10.0);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetPFXEmitterEndColor===&lt;br /&gt;
{{MethodHeader|public native void SetPFXEmitterEndColor(int id, int phase, float r, float g, float b, float a)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;phase&#039;&#039;&#039; = The phase of the effect, if there is only one phase use zero.&lt;br /&gt;
*&#039;&#039;&#039;r,g,b&#039;&#039;&#039; = Red, green and blue components of the required color.&lt;br /&gt;
*&#039;&#039;&#039;a&#039;&#039;&#039; = Alpha value of the color.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetPFXEmitterStartColor(0,0,128,128,128,64);&lt;br /&gt;
 SetPFXEmitterStartColor(0,0,0.5,0.5,0.5,0.25);&lt;br /&gt;
;Notes&lt;br /&gt;
*Red, green, blue and alpha may be entered as integer or float values in the ranges 0..255 and 0.0..1.0 respectively.&lt;br /&gt;
*Both of the examples above give the same result.&lt;br /&gt;
*Note that 1,1,1,1 will be interpreted as float input and will produce white, whereas 2,2,2,2 will be interpreted as integers and will give a result which is almost black.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetPFXEmitterLifetime===&lt;br /&gt;
{{MethodHeader|public native void SetPFXEmitterLifetime(int id, int phase, float life)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;phase&#039;&#039;&#039; = The phase of the effect, if there is only one phase use zero.&lt;br /&gt;
*&#039;&#039;&#039;life&#039;&#039;&#039; = The new lifetime of particles in seconds at the specified phase.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetPFXEmitterLifetime(0,0,10);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetPFXEmitterMaxRate===&lt;br /&gt;
{{MethodHeader|public native void SetPFXEmitterMaxRate(int id, float newsize)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;rate&#039;&#039;&#039; = The new maximum rate of emission per second.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetPFXEmitterMaxRate(0,5.0);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetPFXEmitterMaxSize===&lt;br /&gt;
{{MethodHeader|public native void SetPFXEmitterMaxSize(int id, int phase, float newsize)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;phase&#039;&#039;&#039; = The phase of the effect, if there is only one phase use zero.&lt;br /&gt;
*&#039;&#039;&#039;newsize&#039;&#039;&#039; = The new maximum size of particles at the specified phase.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetPFXEmitterMaxSize(0,0,10);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetPFXEmitterMinRate===&lt;br /&gt;
{{MethodHeader|public native void SetPFXEmitterMinRate(int id, float rate)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;rate&#039;&#039;&#039; = The new minimum rate of emission per second.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetPFXEmitterMinRate(0,5.0);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetPFXEmitterMinSize===&lt;br /&gt;
{{MethodHeader|public native void SetPFXEmitterMinSize(int id, int phase, float newsize)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;phase&#039;&#039;&#039; = The phase of the effect, if there is only one phase use zero.&lt;br /&gt;
*&#039;&#039;&#039;newsize&#039;&#039;&#039; = The new minimum size of particles at the specified phase.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetPFXEmitterMinSize(0,0,10);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetPFXEmitterPhysicsDelay===&lt;br /&gt;
{{MethodHeader|public native void SetPFXEmitterPhysicsDelay(int id, int phase, float value)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;phase&#039;&#039;&#039; = The phase of the effect, if there is only one phase use zero.&lt;br /&gt;
*&#039;&#039;&#039;value&#039;&#039;&#039; = The new physics delay value to set for the specified phase.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetPFXEmitterPhysicsDelay(0,0,5.0);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetPFXEmitterRate===&lt;br /&gt;
{{MethodHeader|public native void SetPFXEmitterRate(int id, int phase, float rate)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;phase&#039;&#039;&#039; = The phase of the effect, if there is only one phase use zero.&lt;br /&gt;
*&#039;&#039;&#039;rate&#039;&#039;&#039; = New rate of particle creation per second at the specified phase.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetPFXEmitterRate(0,0,5.0);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetPFXEmitterStartColor===&lt;br /&gt;
{{MethodHeader|public native void SetPFXEmitterStartColor(int id, int phase, float r, float g, float b, float a)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;phase&#039;&#039;&#039; = The phase of the effect, if there is only one phase use zero.&lt;br /&gt;
*&#039;&#039;&#039;r,g,b&#039;&#039;&#039; = Red, green and blue components of the required color.&lt;br /&gt;
*&#039;&#039;&#039;a&#039;&#039;&#039; = Alpha value of the color.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetPFXEmitterStartColor(0,0,128,128,128,64);&lt;br /&gt;
 SetPFXEmitterStartColor(0,0,0.5,0.5,0.5,0.25);&lt;br /&gt;
;Notes&lt;br /&gt;
*Red, green, blue and alpha may be entered as integer or float values in the ranges 0..255 and 0.0..1.0 respectively.&lt;br /&gt;
*Both of the examples above give the same result.&lt;br /&gt;
*Note that 1,1,1,1 will be interpreted as float input and will produce white, whereas 2,2,2,2 will be interpreted as integers and will give a result which is almost black.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetPFXEmitterTexture===&lt;br /&gt;
{{MethodHeader|public native void SetPFXEmitterTexture(int id, KUID textureKUID)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;textureKUID&#039;&#039;&#039; = The kuid of the new texture.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetPFXEmitterTexture(0,&amp;lt;kuid:1234:5678&amp;gt;);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetPFXEmitterVelocity===&lt;br /&gt;
{{MethodHeader|public native void SetPFXEmitterVelocity(int id, int phase, float velocity)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;phase&#039;&#039;&#039; = The phase of the effect, if there is only one phase use zero.&lt;br /&gt;
*&#039;&#039;&#039;velocity&#039;&#039;&#039; = New velocity in metres per second along the direction vector of emitted particles at the specified phase.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetPFXEmitterVelocity(0,0,5.0);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===StopSoundScriptEvent===&lt;br /&gt;
{{MethodHeader|public native void StopSoundScriptEvent(string soundTrigger)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
&#039;&#039;&#039;soundTrigger&#039;&#039;&#039; = Name of the sound event to start playing, this equates to the &#039;&#039;trigger&#039;&#039; tag of the sound script subcontainer in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 StopSoundScriptEvent(&amp;quot;dayloop&amp;quot;);&lt;br /&gt;
;Notes&lt;br /&gt;
*Terminates a looped sound script previously started with [[#PlaySoundScriptEvent|PlaySoundScriptEvent()]].&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Related Methods==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Categories==&lt;br /&gt;
[[Category:Script Class]]&lt;/div&gt;</summary>
		<author><name>Ciceronmt</name></author>
	</entry>
	<entry>
		<id>https://wiki.trainzsimulator.com/index.php?title=Class_MapObject&amp;diff=25390</id>
		<title>Class MapObject</title>
		<link rel="alternate" type="text/html" href="https://wiki.trainzsimulator.com/index.php?title=Class_MapObject&amp;diff=25390"/>
		<updated>2020-11-21T11:46:32Z</updated>

		<summary type="html">&lt;p&gt;Ciceronmt: /* Methods */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;*[[TrainzScript Language Reference|API Hierarchy]]&lt;br /&gt;
**[[Class GSObject|GSObject]]&lt;br /&gt;
***[[Class GameObject|GameObject]]&lt;br /&gt;
****[[Class PropertyObject|PropertyObject]]&lt;br /&gt;
****[[Class TrainzGameObject|TrainzGameObject]]&lt;br /&gt;
*****[[Class MeshObject|MeshObject]]&lt;br /&gt;
******MapObject&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*This class extends MeshObject to include product queues. &lt;br /&gt;
*A MapObject can have a number of product queues as defined in the queues section of the config.txt file for the asset.&lt;br /&gt;
*The class also provides methods to control particle emissions.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==MapObject Messages==&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
{{TableHeader|width=50%|margin=15px}}&lt;br /&gt;
|-&lt;br /&gt;
|bgcolor=&amp;quot;#EEEEEE&amp;quot;|&#039;&#039;&#039;Major&#039;&#039;&#039;||bgcolor=&amp;quot;#EEEEEE&amp;quot;|&#039;&#039;&#039;Minor&#039;&#039;&#039;||bgcolor=&amp;quot;#EEEEEE&amp;quot;|&#039;&#039;&#039;Source&#039;&#039;&#039;||bgcolor=&amp;quot;#EEEEEE&amp;quot; |&#039;&#039;&#039;Destination&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|[[MapObject Messages|MapObject]]||View-Details||?||MapObject&lt;br /&gt;
|-&lt;br /&gt;
|[[MapObject Messages|MapObject]]||View-Schedule||?||MapObject&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Methods==&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
===AdjustMapObjectPosition===&lt;br /&gt;
{{MethodHeader|public native void AdjustMapObjectPosition(float dx, float dy, float dz)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;dx&#039;&#039;&#039; = The distance (m) to move the object along its x axis (right).&lt;br /&gt;
*&#039;&#039;&#039;dy&#039;&#039;&#039; = The distance (m) to move the object along its y axis (foward).&lt;br /&gt;
*&#039;&#039;&#039;dz&#039;&#039;&#039; = The distance (m) to move the object along its z axis (upward).&lt;br /&gt;
;Returned Value&lt;br /&gt;
* None.&lt;br /&gt;
;Syntax&lt;br /&gt;
 AdjustMapObjectPosition(x, y, z);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetMapObjectOrientation===&lt;br /&gt;
{{MethodHeader|public native Orientation GetMapObjectOrientation(void)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
* None.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*The absolute orientation of this MapObject.  WorldCoordinate - The current orientation of this MapObject.&lt;br /&gt;
;Syntax&lt;br /&gt;
 float angel_z = cabin.Loco.GetMapObjectOrientation().rz;&lt;br /&gt;
;Notes&lt;br /&gt;
A call to GetMapObjectOrientation() which immediately follows a call to SetMapObjectOrientation() is not guaranteed to return the input orientation, since various other orientation restrictions may be in effect.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetPFXEmitterLifetime===&lt;br /&gt;
{{MethodHeader|public native float GetPFXEmitterLifetime(int id, int phase)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;phase&#039;&#039;&#039; = The phase of the effect, if there is only one phase use zero.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*Value of the lifetime of the effect at the specified phase.&lt;br /&gt;
;Syntax&lt;br /&gt;
 float lifetime GetPFXEmitterLifetime(0,0);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetPFXEmitterMaxRate===&lt;br /&gt;
{{MethodHeader|public native float GetPFXEmitterMaxRate(int id)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*Maximum rate of emissions per second.&lt;br /&gt;
;Syntax&lt;br /&gt;
 float maxRate = GetPFXEmitterMaxRate(0);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetPFXEmitterMaxSize===&lt;br /&gt;
{{MethodHeader|public native float GetPFXEmitterMaxSize(int id, int phase)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;phase&#039;&#039;&#039; = The phase of the effect, if there is only one phase use zero.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*Maximum size of particle at the specified phase.&lt;br /&gt;
;Syntax&lt;br /&gt;
 float maxsize = GetPFXEmitterMinSize();&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetPFXEmitterMinRate===&lt;br /&gt;
{{MethodHeader|public native float GetPFXEmitterMinRate(int id)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*Maximum rate of emissions per second.&lt;br /&gt;
;Syntax&lt;br /&gt;
 float minRtae = GetPFXEmitterMinRate(0);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetPFXEmitterMinSize===&lt;br /&gt;
{{MethodHeader|public native float GetPFXEmitterMinSize(int id, int phase)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;phase&#039;&#039;&#039; = The phase of the effect, if there is only one phase use zero.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*Minimum size of particle at the specified phase.&lt;br /&gt;
;Syntax&lt;br /&gt;
 float minsize = GetPFXEmitterMinSize();&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetPFXEmitterPhysicsDelay===&lt;br /&gt;
{{MethodHeader|public native float GetPFXEmitterPhysicsDelay(int id, int phase)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;phase&#039;&#039;&#039; = The phase of the effect, if there is only one phase use zero.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*Value for the physics delay in emission.&lt;br /&gt;
;Syntax&lt;br /&gt;
 GetPFXEmitterPhysicsDelay(0,0);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetPFXEmitterRate===&lt;br /&gt;
{{MethodHeader|public native float GetPFXEmitterRate(int id, int phase)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;phase&#039;&#039;&#039; = The phase of the effect, if there is only one phase use zero.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*Rate of particle creation per second.&lt;br /&gt;
;Syntax&lt;br /&gt;
 particlesPerSecond = GetPFXEmitterRate(0,0);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetPFXEmitterVelocity===&lt;br /&gt;
{{MethodHeader|public native float GetPFXEmitterVelocity(int id, int phase)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;phase&#039;&#039;&#039; = The phase of the effect, if there is only one phase use zero.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*Velocity in metres per second along the direction vector of emitted particles at the specified phase.&lt;br /&gt;
;Syntax&lt;br /&gt;
 float speed = GetPFXEmitterVelocity(0,0);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetQueue===&lt;br /&gt;
{{MethodHeader|public native ProductQueue GetQueue(string queueName)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
&#039;&#039;&#039;queueName&#039;&#039;&#039; = Name of the product queue to be returned.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*A reference to the queue if possible, null otherwise.&lt;br /&gt;
;Syntax&lt;br /&gt;
 ProductQueue queue = GetQueue(&amp;quot;passengers&amp;quot;);&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetQueues===&lt;br /&gt;
{{MethodHeader|public native ProductQueue[ ] GetQueues(void)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*None&lt;br /&gt;
;Returned Value&lt;br /&gt;
*An array of product queues, if there are no queues the array will be empty.&lt;br /&gt;
;Syntax&lt;br /&gt;
 ProductQueue[] queues = GetQueues();&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===PlaySoundScriptEvent===&lt;br /&gt;
{{MethodHeader|public native void PlaySoundScriptEvent(string soundTrigger)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
&#039;&#039;&#039;soundTrigger&#039;&#039;&#039; = Name of the sound event to start playing, this equates to the &#039;&#039;trigger&#039;&#039; tag of the sound script subcontainer in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 PlaySoundScriptEvent(&amp;quot;dayloop&amp;quot;);&lt;br /&gt;
;Notes&lt;br /&gt;
*Plays the specified sound event from the asset&#039;s SoundScript. &lt;br /&gt;
*SoundScripts are defined as sub-containers in the soundscript container of the asset&#039;s configuration. &lt;br /&gt;
*For details on creating assets with SoundScripts, see [[&amp;quot;Soundscript&amp;quot; container|here]]. &lt;br /&gt;
*This method will start playing the sound. &lt;br /&gt;
*Depending on the SoundScript configuration, the sound will either be played just once or played continuously in a looping cycle such that [[#StopSoundScriptEvent|StopSoundScriptEvent()]] will need to be called to stop it.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetPFXEmitterConeSize===&lt;br /&gt;
{{MethodHeader|public native void SetPFXEmitterConeSize(int id, float x, float y, float z)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;x,y,z&#039;&#039;&#039; = New X,Y and Z components of the particle cone size.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetPFXEmitterConeSize(0,2.0,3.0,2.0);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetPFXEmitterEmitParticles===&lt;br /&gt;
{{MethodHeader|public native void SetPFXEmitterEmitParticles(int id, int number,float time)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;number&#039;&#039;&#039; = The number of particles to emit.&lt;br /&gt;
*&#039;&#039;&#039;time&#039;&#039;&#039; = The time in seconds over which the particles are to be created.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetPFXEmitterEmitParticles(0,100,10.0);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetPFXEmitterEndColor===&lt;br /&gt;
{{MethodHeader|public native void SetPFXEmitterEndColor(int id, int phase, float r, float g, float b, float a)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;phase&#039;&#039;&#039; = The phase of the effect, if there is only one phase use zero.&lt;br /&gt;
*&#039;&#039;&#039;r,g,b&#039;&#039;&#039; = Red, green and blue components of the required color.&lt;br /&gt;
*&#039;&#039;&#039;a&#039;&#039;&#039; = Alpha value of the color.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetPFXEmitterStartColor(0,0,128,128,128,64);&lt;br /&gt;
 SetPFXEmitterStartColor(0,0,0.5,0.5,0.5,0.25);&lt;br /&gt;
;Notes&lt;br /&gt;
*Red, green, blue and alpha may be entered as integer or float values in the ranges 0..255 and 0.0..1.0 respectively.&lt;br /&gt;
*Both of the examples above give the same result.&lt;br /&gt;
*Note that 1,1,1,1 will be interpreted as float input and will produce white, whereas 2,2,2,2 will be interpreted as integers and will give a result which is almost black.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetPFXEmitterLifetime===&lt;br /&gt;
{{MethodHeader|public native void SetPFXEmitterLifetime(int id, int phase, float life)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;phase&#039;&#039;&#039; = The phase of the effect, if there is only one phase use zero.&lt;br /&gt;
*&#039;&#039;&#039;life&#039;&#039;&#039; = The new lifetime of particles in seconds at the specified phase.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetPFXEmitterLifetime(0,0,10);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetPFXEmitterMaxRate===&lt;br /&gt;
{{MethodHeader|public native void SetPFXEmitterMaxRate(int id, float newsize)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;rate&#039;&#039;&#039; = The new maximum rate of emission per second.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetPFXEmitterMaxRate(0,5.0);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetPFXEmitterMaxSize===&lt;br /&gt;
{{MethodHeader|public native void SetPFXEmitterMaxSize(int id, int phase, float newsize)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;phase&#039;&#039;&#039; = The phase of the effect, if there is only one phase use zero.&lt;br /&gt;
*&#039;&#039;&#039;newsize&#039;&#039;&#039; = The new maximum size of particles at the specified phase.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetPFXEmitterMaxSize(0,0,10);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetPFXEmitterMinRate===&lt;br /&gt;
{{MethodHeader|public native void SetPFXEmitterMinRate(int id, float rate)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;rate&#039;&#039;&#039; = The new minimum rate of emission per second.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetPFXEmitterMinRate(0,5.0);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetPFXEmitterMinSize===&lt;br /&gt;
{{MethodHeader|public native void SetPFXEmitterMinSize(int id, int phase, float newsize)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;phase&#039;&#039;&#039; = The phase of the effect, if there is only one phase use zero.&lt;br /&gt;
*&#039;&#039;&#039;newsize&#039;&#039;&#039; = The new minimum size of particles at the specified phase.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetPFXEmitterMinSize(0,0,10);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetPFXEmitterPhysicsDelay===&lt;br /&gt;
{{MethodHeader|public native void SetPFXEmitterPhysicsDelay(int id, int phase, float value)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;phase&#039;&#039;&#039; = The phase of the effect, if there is only one phase use zero.&lt;br /&gt;
*&#039;&#039;&#039;value&#039;&#039;&#039; = The new physics delay value to set for the specified phase.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetPFXEmitterPhysicsDelay(0,0,5.0);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetPFXEmitterRate===&lt;br /&gt;
{{MethodHeader|public native void SetPFXEmitterRate(int id, int phase, float rate)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;phase&#039;&#039;&#039; = The phase of the effect, if there is only one phase use zero.&lt;br /&gt;
*&#039;&#039;&#039;rate&#039;&#039;&#039; = New rate of particle creation per second at the specified phase.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetPFXEmitterRate(0,0,5.0);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetPFXEmitterStartColor===&lt;br /&gt;
{{MethodHeader|public native void SetPFXEmitterStartColor(int id, int phase, float r, float g, float b, float a)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;phase&#039;&#039;&#039; = The phase of the effect, if there is only one phase use zero.&lt;br /&gt;
*&#039;&#039;&#039;r,g,b&#039;&#039;&#039; = Red, green and blue components of the required color.&lt;br /&gt;
*&#039;&#039;&#039;a&#039;&#039;&#039; = Alpha value of the color.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetPFXEmitterStartColor(0,0,128,128,128,64);&lt;br /&gt;
 SetPFXEmitterStartColor(0,0,0.5,0.5,0.5,0.25);&lt;br /&gt;
;Notes&lt;br /&gt;
*Red, green, blue and alpha may be entered as integer or float values in the ranges 0..255 and 0.0..1.0 respectively.&lt;br /&gt;
*Both of the examples above give the same result.&lt;br /&gt;
*Note that 1,1,1,1 will be interpreted as float input and will produce white, whereas 2,2,2,2 will be interpreted as integers and will give a result which is almost black.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetPFXEmitterTexture===&lt;br /&gt;
{{MethodHeader|public native void SetPFXEmitterTexture(int id, KUID textureKUID)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;textureKUID&#039;&#039;&#039; = The kuid of the new texture.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetPFXEmitterTexture(0,&amp;lt;kuid:1234:5678&amp;gt;);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetPFXEmitterVelocity===&lt;br /&gt;
{{MethodHeader|public native void SetPFXEmitterVelocity(int id, int phase, float velocity)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;phase&#039;&#039;&#039; = The phase of the effect, if there is only one phase use zero.&lt;br /&gt;
*&#039;&#039;&#039;velocity&#039;&#039;&#039; = New velocity in metres per second along the direction vector of emitted particles at the specified phase.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetPFXEmitterVelocity(0,0,5.0);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===StopSoundScriptEvent===&lt;br /&gt;
{{MethodHeader|public native void StopSoundScriptEvent(string soundTrigger)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
&#039;&#039;&#039;soundTrigger&#039;&#039;&#039; = Name of the sound event to start playing, this equates to the &#039;&#039;trigger&#039;&#039; tag of the sound script subcontainer in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 StopSoundScriptEvent(&amp;quot;dayloop&amp;quot;);&lt;br /&gt;
;Notes&lt;br /&gt;
*Terminates a looped sound script previously started with [[#PlaySoundScriptEvent|PlaySoundScriptEvent()]].&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Related Methods==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Categories==&lt;br /&gt;
[[Category:Script Class]]&lt;/div&gt;</summary>
		<author><name>Ciceronmt</name></author>
	</entry>
	<entry>
		<id>https://wiki.trainzsimulator.com/index.php?title=Class_MapObject&amp;diff=25389</id>
		<title>Class MapObject</title>
		<link rel="alternate" type="text/html" href="https://wiki.trainzsimulator.com/index.php?title=Class_MapObject&amp;diff=25389"/>
		<updated>2020-11-21T11:44:31Z</updated>

		<summary type="html">&lt;p&gt;Ciceronmt: /* Methods */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;*[[TrainzScript Language Reference|API Hierarchy]]&lt;br /&gt;
**[[Class GSObject|GSObject]]&lt;br /&gt;
***[[Class GameObject|GameObject]]&lt;br /&gt;
****[[Class PropertyObject|PropertyObject]]&lt;br /&gt;
****[[Class TrainzGameObject|TrainzGameObject]]&lt;br /&gt;
*****[[Class MeshObject|MeshObject]]&lt;br /&gt;
******MapObject&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*This class extends MeshObject to include product queues. &lt;br /&gt;
*A MapObject can have a number of product queues as defined in the queues section of the config.txt file for the asset.&lt;br /&gt;
*The class also provides methods to control particle emissions.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==MapObject Messages==&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
{{TableHeader|width=50%|margin=15px}}&lt;br /&gt;
|-&lt;br /&gt;
|bgcolor=&amp;quot;#EEEEEE&amp;quot;|&#039;&#039;&#039;Major&#039;&#039;&#039;||bgcolor=&amp;quot;#EEEEEE&amp;quot;|&#039;&#039;&#039;Minor&#039;&#039;&#039;||bgcolor=&amp;quot;#EEEEEE&amp;quot;|&#039;&#039;&#039;Source&#039;&#039;&#039;||bgcolor=&amp;quot;#EEEEEE&amp;quot; |&#039;&#039;&#039;Destination&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|[[MapObject Messages|MapObject]]||View-Details||?||MapObject&lt;br /&gt;
|-&lt;br /&gt;
|[[MapObject Messages|MapObject]]||View-Schedule||?||MapObject&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Methods==&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
===AdjustMapObjectPosition===&lt;br /&gt;
{{MethodHeader|public native void AdjustMapObjectPosition(float dx, float dy, float dz)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;dx&#039;&#039;&#039; = The distance (m) to move the object along its x axis (right).&lt;br /&gt;
*&#039;&#039;&#039;dy&#039;&#039;&#039; = The distance (m) to move the object along its y axis (foward).&lt;br /&gt;
*&#039;&#039;&#039;dz&#039;&#039;&#039; = The distance (m) to move the object along its z axis (upward).&lt;br /&gt;
;Returned Value&lt;br /&gt;
*= None.&lt;br /&gt;
;Syntax&lt;br /&gt;
 AdjustMapObjectPosition(x, y, z);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetMapObjectOrientation===&lt;br /&gt;
{{MethodHeader|public native Orientation GetMapObjectOrientation(void)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
= None.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*The absolute orientation of this MapObject.  WorldCoordinate - The current orientation of this MapObject.&lt;br /&gt;
;Syntax&lt;br /&gt;
 float angel_z = cabin.Loco.GetMapObjectOrientation().rz;&lt;br /&gt;
;Notes&lt;br /&gt;
A call to GetMapObjectOrientation() which immediately follows a call to SetMapObjectOrientation() is not guaranteed to return the input orientation, since various other orientation restrictions may be in effect.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetPFXEmitterLifetime===&lt;br /&gt;
{{MethodHeader|public native float GetPFXEmitterLifetime(int id, int phase)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;phase&#039;&#039;&#039; = The phase of the effect, if there is only one phase use zero.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*Value of the lifetime of the effect at the specified phase.&lt;br /&gt;
;Syntax&lt;br /&gt;
 float lifetime GetPFXEmitterLifetime(0,0);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetPFXEmitterMaxRate===&lt;br /&gt;
{{MethodHeader|public native float GetPFXEmitterMaxRate(int id)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*Maximum rate of emissions per second.&lt;br /&gt;
;Syntax&lt;br /&gt;
 float maxRate = GetPFXEmitterMaxRate(0);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetPFXEmitterMaxSize===&lt;br /&gt;
{{MethodHeader|public native float GetPFXEmitterMaxSize(int id, int phase)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;phase&#039;&#039;&#039; = The phase of the effect, if there is only one phase use zero.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*Maximum size of particle at the specified phase.&lt;br /&gt;
;Syntax&lt;br /&gt;
 float maxsize = GetPFXEmitterMinSize();&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetPFXEmitterMinRate===&lt;br /&gt;
{{MethodHeader|public native float GetPFXEmitterMinRate(int id)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*Maximum rate of emissions per second.&lt;br /&gt;
;Syntax&lt;br /&gt;
 float minRtae = GetPFXEmitterMinRate(0);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetPFXEmitterMinSize===&lt;br /&gt;
{{MethodHeader|public native float GetPFXEmitterMinSize(int id, int phase)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;phase&#039;&#039;&#039; = The phase of the effect, if there is only one phase use zero.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*Minimum size of particle at the specified phase.&lt;br /&gt;
;Syntax&lt;br /&gt;
 float minsize = GetPFXEmitterMinSize();&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetPFXEmitterPhysicsDelay===&lt;br /&gt;
{{MethodHeader|public native float GetPFXEmitterPhysicsDelay(int id, int phase)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;phase&#039;&#039;&#039; = The phase of the effect, if there is only one phase use zero.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*Value for the physics delay in emission.&lt;br /&gt;
;Syntax&lt;br /&gt;
 GetPFXEmitterPhysicsDelay(0,0);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetPFXEmitterRate===&lt;br /&gt;
{{MethodHeader|public native float GetPFXEmitterRate(int id, int phase)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;phase&#039;&#039;&#039; = The phase of the effect, if there is only one phase use zero.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*Rate of particle creation per second.&lt;br /&gt;
;Syntax&lt;br /&gt;
 particlesPerSecond = GetPFXEmitterRate(0,0);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetPFXEmitterVelocity===&lt;br /&gt;
{{MethodHeader|public native float GetPFXEmitterVelocity(int id, int phase)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;phase&#039;&#039;&#039; = The phase of the effect, if there is only one phase use zero.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*Velocity in metres per second along the direction vector of emitted particles at the specified phase.&lt;br /&gt;
;Syntax&lt;br /&gt;
 float speed = GetPFXEmitterVelocity(0,0);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetQueue===&lt;br /&gt;
{{MethodHeader|public native ProductQueue GetQueue(string queueName)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
&#039;&#039;&#039;queueName&#039;&#039;&#039; = Name of the product queue to be returned.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*A reference to the queue if possible, null otherwise.&lt;br /&gt;
;Syntax&lt;br /&gt;
 ProductQueue queue = GetQueue(&amp;quot;passengers&amp;quot;);&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetQueues===&lt;br /&gt;
{{MethodHeader|public native ProductQueue[ ] GetQueues(void)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*None&lt;br /&gt;
;Returned Value&lt;br /&gt;
*An array of product queues, if there are no queues the array will be empty.&lt;br /&gt;
;Syntax&lt;br /&gt;
 ProductQueue[] queues = GetQueues();&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===PlaySoundScriptEvent===&lt;br /&gt;
{{MethodHeader|public native void PlaySoundScriptEvent(string soundTrigger)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
&#039;&#039;&#039;soundTrigger&#039;&#039;&#039; = Name of the sound event to start playing, this equates to the &#039;&#039;trigger&#039;&#039; tag of the sound script subcontainer in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 PlaySoundScriptEvent(&amp;quot;dayloop&amp;quot;);&lt;br /&gt;
;Notes&lt;br /&gt;
*Plays the specified sound event from the asset&#039;s SoundScript. &lt;br /&gt;
*SoundScripts are defined as sub-containers in the soundscript container of the asset&#039;s configuration. &lt;br /&gt;
*For details on creating assets with SoundScripts, see [[&amp;quot;Soundscript&amp;quot; container|here]]. &lt;br /&gt;
*This method will start playing the sound. &lt;br /&gt;
*Depending on the SoundScript configuration, the sound will either be played just once or played continuously in a looping cycle such that [[#StopSoundScriptEvent|StopSoundScriptEvent()]] will need to be called to stop it.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetPFXEmitterConeSize===&lt;br /&gt;
{{MethodHeader|public native void SetPFXEmitterConeSize(int id, float x, float y, float z)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;x,y,z&#039;&#039;&#039; = New X,Y and Z components of the particle cone size.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetPFXEmitterConeSize(0,2.0,3.0,2.0);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetPFXEmitterEmitParticles===&lt;br /&gt;
{{MethodHeader|public native void SetPFXEmitterEmitParticles(int id, int number,float time)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;number&#039;&#039;&#039; = The number of particles to emit.&lt;br /&gt;
*&#039;&#039;&#039;time&#039;&#039;&#039; = The time in seconds over which the particles are to be created.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetPFXEmitterEmitParticles(0,100,10.0);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetPFXEmitterEndColor===&lt;br /&gt;
{{MethodHeader|public native void SetPFXEmitterEndColor(int id, int phase, float r, float g, float b, float a)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;phase&#039;&#039;&#039; = The phase of the effect, if there is only one phase use zero.&lt;br /&gt;
*&#039;&#039;&#039;r,g,b&#039;&#039;&#039; = Red, green and blue components of the required color.&lt;br /&gt;
*&#039;&#039;&#039;a&#039;&#039;&#039; = Alpha value of the color.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetPFXEmitterStartColor(0,0,128,128,128,64);&lt;br /&gt;
 SetPFXEmitterStartColor(0,0,0.5,0.5,0.5,0.25);&lt;br /&gt;
;Notes&lt;br /&gt;
*Red, green, blue and alpha may be entered as integer or float values in the ranges 0..255 and 0.0..1.0 respectively.&lt;br /&gt;
*Both of the examples above give the same result.&lt;br /&gt;
*Note that 1,1,1,1 will be interpreted as float input and will produce white, whereas 2,2,2,2 will be interpreted as integers and will give a result which is almost black.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetPFXEmitterLifetime===&lt;br /&gt;
{{MethodHeader|public native void SetPFXEmitterLifetime(int id, int phase, float life)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;phase&#039;&#039;&#039; = The phase of the effect, if there is only one phase use zero.&lt;br /&gt;
*&#039;&#039;&#039;life&#039;&#039;&#039; = The new lifetime of particles in seconds at the specified phase.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetPFXEmitterLifetime(0,0,10);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetPFXEmitterMaxRate===&lt;br /&gt;
{{MethodHeader|public native void SetPFXEmitterMaxRate(int id, float newsize)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;rate&#039;&#039;&#039; = The new maximum rate of emission per second.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetPFXEmitterMaxRate(0,5.0);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetPFXEmitterMaxSize===&lt;br /&gt;
{{MethodHeader|public native void SetPFXEmitterMaxSize(int id, int phase, float newsize)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;phase&#039;&#039;&#039; = The phase of the effect, if there is only one phase use zero.&lt;br /&gt;
*&#039;&#039;&#039;newsize&#039;&#039;&#039; = The new maximum size of particles at the specified phase.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetPFXEmitterMaxSize(0,0,10);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetPFXEmitterMinRate===&lt;br /&gt;
{{MethodHeader|public native void SetPFXEmitterMinRate(int id, float rate)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;rate&#039;&#039;&#039; = The new minimum rate of emission per second.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetPFXEmitterMinRate(0,5.0);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetPFXEmitterMinSize===&lt;br /&gt;
{{MethodHeader|public native void SetPFXEmitterMinSize(int id, int phase, float newsize)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;phase&#039;&#039;&#039; = The phase of the effect, if there is only one phase use zero.&lt;br /&gt;
*&#039;&#039;&#039;newsize&#039;&#039;&#039; = The new minimum size of particles at the specified phase.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetPFXEmitterMinSize(0,0,10);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetPFXEmitterPhysicsDelay===&lt;br /&gt;
{{MethodHeader|public native void SetPFXEmitterPhysicsDelay(int id, int phase, float value)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;phase&#039;&#039;&#039; = The phase of the effect, if there is only one phase use zero.&lt;br /&gt;
*&#039;&#039;&#039;value&#039;&#039;&#039; = The new physics delay value to set for the specified phase.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetPFXEmitterPhysicsDelay(0,0,5.0);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetPFXEmitterRate===&lt;br /&gt;
{{MethodHeader|public native void SetPFXEmitterRate(int id, int phase, float rate)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;phase&#039;&#039;&#039; = The phase of the effect, if there is only one phase use zero.&lt;br /&gt;
*&#039;&#039;&#039;rate&#039;&#039;&#039; = New rate of particle creation per second at the specified phase.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetPFXEmitterRate(0,0,5.0);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetPFXEmitterStartColor===&lt;br /&gt;
{{MethodHeader|public native void SetPFXEmitterStartColor(int id, int phase, float r, float g, float b, float a)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;phase&#039;&#039;&#039; = The phase of the effect, if there is only one phase use zero.&lt;br /&gt;
*&#039;&#039;&#039;r,g,b&#039;&#039;&#039; = Red, green and blue components of the required color.&lt;br /&gt;
*&#039;&#039;&#039;a&#039;&#039;&#039; = Alpha value of the color.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetPFXEmitterStartColor(0,0,128,128,128,64);&lt;br /&gt;
 SetPFXEmitterStartColor(0,0,0.5,0.5,0.5,0.25);&lt;br /&gt;
;Notes&lt;br /&gt;
*Red, green, blue and alpha may be entered as integer or float values in the ranges 0..255 and 0.0..1.0 respectively.&lt;br /&gt;
*Both of the examples above give the same result.&lt;br /&gt;
*Note that 1,1,1,1 will be interpreted as float input and will produce white, whereas 2,2,2,2 will be interpreted as integers and will give a result which is almost black.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetPFXEmitterTexture===&lt;br /&gt;
{{MethodHeader|public native void SetPFXEmitterTexture(int id, KUID textureKUID)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;textureKUID&#039;&#039;&#039; = The kuid of the new texture.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetPFXEmitterTexture(0,&amp;lt;kuid:1234:5678&amp;gt;);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetPFXEmitterVelocity===&lt;br /&gt;
{{MethodHeader|public native void SetPFXEmitterVelocity(int id, int phase, float velocity)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;phase&#039;&#039;&#039; = The phase of the effect, if there is only one phase use zero.&lt;br /&gt;
*&#039;&#039;&#039;velocity&#039;&#039;&#039; = New velocity in metres per second along the direction vector of emitted particles at the specified phase.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetPFXEmitterVelocity(0,0,5.0);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===StopSoundScriptEvent===&lt;br /&gt;
{{MethodHeader|public native void StopSoundScriptEvent(string soundTrigger)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
&#039;&#039;&#039;soundTrigger&#039;&#039;&#039; = Name of the sound event to start playing, this equates to the &#039;&#039;trigger&#039;&#039; tag of the sound script subcontainer in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 StopSoundScriptEvent(&amp;quot;dayloop&amp;quot;);&lt;br /&gt;
;Notes&lt;br /&gt;
*Terminates a looped sound script previously started with [[#PlaySoundScriptEvent|PlaySoundScriptEvent()]].&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Related Methods==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Categories==&lt;br /&gt;
[[Category:Script Class]]&lt;/div&gt;</summary>
		<author><name>Ciceronmt</name></author>
	</entry>
	<entry>
		<id>https://wiki.trainzsimulator.com/index.php?title=Class_MapObject&amp;diff=25388</id>
		<title>Class MapObject</title>
		<link rel="alternate" type="text/html" href="https://wiki.trainzsimulator.com/index.php?title=Class_MapObject&amp;diff=25388"/>
		<updated>2020-11-21T11:34:09Z</updated>

		<summary type="html">&lt;p&gt;Ciceronmt: /* GetMapObjectOrientation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;*[[TrainzScript Language Reference|API Hierarchy]]&lt;br /&gt;
**[[Class GSObject|GSObject]]&lt;br /&gt;
***[[Class GameObject|GameObject]]&lt;br /&gt;
****[[Class PropertyObject|PropertyObject]]&lt;br /&gt;
****[[Class TrainzGameObject|TrainzGameObject]]&lt;br /&gt;
*****[[Class MeshObject|MeshObject]]&lt;br /&gt;
******MapObject&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*This class extends MeshObject to include product queues. &lt;br /&gt;
*A MapObject can have a number of product queues as defined in the queues section of the config.txt file for the asset.&lt;br /&gt;
*The class also provides methods to control particle emissions.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==MapObject Messages==&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
{{TableHeader|width=50%|margin=15px}}&lt;br /&gt;
|-&lt;br /&gt;
|bgcolor=&amp;quot;#EEEEEE&amp;quot;|&#039;&#039;&#039;Major&#039;&#039;&#039;||bgcolor=&amp;quot;#EEEEEE&amp;quot;|&#039;&#039;&#039;Minor&#039;&#039;&#039;||bgcolor=&amp;quot;#EEEEEE&amp;quot;|&#039;&#039;&#039;Source&#039;&#039;&#039;||bgcolor=&amp;quot;#EEEEEE&amp;quot; |&#039;&#039;&#039;Destination&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|[[MapObject Messages|MapObject]]||View-Details||?||MapObject&lt;br /&gt;
|-&lt;br /&gt;
|[[MapObject Messages|MapObject]]||View-Schedule||?||MapObject&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Methods==&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetMapObjectOrientation===&lt;br /&gt;
{{MethodHeader|public native Orientation GetMapObjectOrientation(void)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
= None.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*The absolute orientation of this MapObject.  WorldCoordinate - The current orientation of this MapObject.&lt;br /&gt;
;Syntax&lt;br /&gt;
 float angel_z = cabin.Loco.GetMapObjectOrientation().rz;&lt;br /&gt;
;Notes&lt;br /&gt;
A call to GetMapObjectOrientation() which immediately follows a call to SetMapObjectOrientation() is not guaranteed to return the input orientation, since various other orientation restrictions may be in effect.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetPFXEmitterLifetime===&lt;br /&gt;
{{MethodHeader|public native float GetPFXEmitterLifetime(int id, int phase)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;phase&#039;&#039;&#039; = The phase of the effect, if there is only one phase use zero.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*Value of the lifetime of the effect at the specified phase.&lt;br /&gt;
;Syntax&lt;br /&gt;
 float lifetime GetPFXEmitterLifetime(0,0);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetPFXEmitterMaxRate===&lt;br /&gt;
{{MethodHeader|public native float GetPFXEmitterMaxRate(int id)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*Maximum rate of emissions per second.&lt;br /&gt;
;Syntax&lt;br /&gt;
 float maxRate = GetPFXEmitterMaxRate(0);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetPFXEmitterMaxSize===&lt;br /&gt;
{{MethodHeader|public native float GetPFXEmitterMaxSize(int id, int phase)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;phase&#039;&#039;&#039; = The phase of the effect, if there is only one phase use zero.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*Maximum size of particle at the specified phase.&lt;br /&gt;
;Syntax&lt;br /&gt;
 float maxsize = GetPFXEmitterMinSize();&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetPFXEmitterMinRate===&lt;br /&gt;
{{MethodHeader|public native float GetPFXEmitterMinRate(int id)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*Maximum rate of emissions per second.&lt;br /&gt;
;Syntax&lt;br /&gt;
 float minRtae = GetPFXEmitterMinRate(0);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetPFXEmitterMinSize===&lt;br /&gt;
{{MethodHeader|public native float GetPFXEmitterMinSize(int id, int phase)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;phase&#039;&#039;&#039; = The phase of the effect, if there is only one phase use zero.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*Minimum size of particle at the specified phase.&lt;br /&gt;
;Syntax&lt;br /&gt;
 float minsize = GetPFXEmitterMinSize();&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetPFXEmitterPhysicsDelay===&lt;br /&gt;
{{MethodHeader|public native float GetPFXEmitterPhysicsDelay(int id, int phase)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;phase&#039;&#039;&#039; = The phase of the effect, if there is only one phase use zero.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*Value for the physics delay in emission.&lt;br /&gt;
;Syntax&lt;br /&gt;
 GetPFXEmitterPhysicsDelay(0,0);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetPFXEmitterRate===&lt;br /&gt;
{{MethodHeader|public native float GetPFXEmitterRate(int id, int phase)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;phase&#039;&#039;&#039; = The phase of the effect, if there is only one phase use zero.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*Rate of particle creation per second.&lt;br /&gt;
;Syntax&lt;br /&gt;
 particlesPerSecond = GetPFXEmitterRate(0,0);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetPFXEmitterVelocity===&lt;br /&gt;
{{MethodHeader|public native float GetPFXEmitterVelocity(int id, int phase)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;phase&#039;&#039;&#039; = The phase of the effect, if there is only one phase use zero.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*Velocity in metres per second along the direction vector of emitted particles at the specified phase.&lt;br /&gt;
;Syntax&lt;br /&gt;
 float speed = GetPFXEmitterVelocity(0,0);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetQueue===&lt;br /&gt;
{{MethodHeader|public native ProductQueue GetQueue(string queueName)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
&#039;&#039;&#039;queueName&#039;&#039;&#039; = Name of the product queue to be returned.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*A reference to the queue if possible, null otherwise.&lt;br /&gt;
;Syntax&lt;br /&gt;
 ProductQueue queue = GetQueue(&amp;quot;passengers&amp;quot;);&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetQueues===&lt;br /&gt;
{{MethodHeader|public native ProductQueue[ ] GetQueues(void)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*None&lt;br /&gt;
;Returned Value&lt;br /&gt;
*An array of product queues, if there are no queues the array will be empty.&lt;br /&gt;
;Syntax&lt;br /&gt;
 ProductQueue[] queues = GetQueues();&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===PlaySoundScriptEvent===&lt;br /&gt;
{{MethodHeader|public native void PlaySoundScriptEvent(string soundTrigger)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
&#039;&#039;&#039;soundTrigger&#039;&#039;&#039; = Name of the sound event to start playing, this equates to the &#039;&#039;trigger&#039;&#039; tag of the sound script subcontainer in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 PlaySoundScriptEvent(&amp;quot;dayloop&amp;quot;);&lt;br /&gt;
;Notes&lt;br /&gt;
*Plays the specified sound event from the asset&#039;s SoundScript. &lt;br /&gt;
*SoundScripts are defined as sub-containers in the soundscript container of the asset&#039;s configuration. &lt;br /&gt;
*For details on creating assets with SoundScripts, see [[&amp;quot;Soundscript&amp;quot; container|here]]. &lt;br /&gt;
*This method will start playing the sound. &lt;br /&gt;
*Depending on the SoundScript configuration, the sound will either be played just once or played continuously in a looping cycle such that [[#StopSoundScriptEvent|StopSoundScriptEvent()]] will need to be called to stop it.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetPFXEmitterConeSize===&lt;br /&gt;
{{MethodHeader|public native void SetPFXEmitterConeSize(int id, float x, float y, float z)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;x,y,z&#039;&#039;&#039; = New X,Y and Z components of the particle cone size.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetPFXEmitterConeSize(0,2.0,3.0,2.0);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetPFXEmitterEmitParticles===&lt;br /&gt;
{{MethodHeader|public native void SetPFXEmitterEmitParticles(int id, int number,float time)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;number&#039;&#039;&#039; = The number of particles to emit.&lt;br /&gt;
*&#039;&#039;&#039;time&#039;&#039;&#039; = The time in seconds over which the particles are to be created.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetPFXEmitterEmitParticles(0,100,10.0);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetPFXEmitterEndColor===&lt;br /&gt;
{{MethodHeader|public native void SetPFXEmitterEndColor(int id, int phase, float r, float g, float b, float a)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;phase&#039;&#039;&#039; = The phase of the effect, if there is only one phase use zero.&lt;br /&gt;
*&#039;&#039;&#039;r,g,b&#039;&#039;&#039; = Red, green and blue components of the required color.&lt;br /&gt;
*&#039;&#039;&#039;a&#039;&#039;&#039; = Alpha value of the color.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetPFXEmitterStartColor(0,0,128,128,128,64);&lt;br /&gt;
 SetPFXEmitterStartColor(0,0,0.5,0.5,0.5,0.25);&lt;br /&gt;
;Notes&lt;br /&gt;
*Red, green, blue and alpha may be entered as integer or float values in the ranges 0..255 and 0.0..1.0 respectively.&lt;br /&gt;
*Both of the examples above give the same result.&lt;br /&gt;
*Note that 1,1,1,1 will be interpreted as float input and will produce white, whereas 2,2,2,2 will be interpreted as integers and will give a result which is almost black.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetPFXEmitterLifetime===&lt;br /&gt;
{{MethodHeader|public native void SetPFXEmitterLifetime(int id, int phase, float life)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;phase&#039;&#039;&#039; = The phase of the effect, if there is only one phase use zero.&lt;br /&gt;
*&#039;&#039;&#039;life&#039;&#039;&#039; = The new lifetime of particles in seconds at the specified phase.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetPFXEmitterLifetime(0,0,10);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetPFXEmitterMaxRate===&lt;br /&gt;
{{MethodHeader|public native void SetPFXEmitterMaxRate(int id, float newsize)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;rate&#039;&#039;&#039; = The new maximum rate of emission per second.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetPFXEmitterMaxRate(0,5.0);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetPFXEmitterMaxSize===&lt;br /&gt;
{{MethodHeader|public native void SetPFXEmitterMaxSize(int id, int phase, float newsize)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;phase&#039;&#039;&#039; = The phase of the effect, if there is only one phase use zero.&lt;br /&gt;
*&#039;&#039;&#039;newsize&#039;&#039;&#039; = The new maximum size of particles at the specified phase.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetPFXEmitterMaxSize(0,0,10);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetPFXEmitterMinRate===&lt;br /&gt;
{{MethodHeader|public native void SetPFXEmitterMinRate(int id, float rate)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;rate&#039;&#039;&#039; = The new minimum rate of emission per second.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetPFXEmitterMinRate(0,5.0);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetPFXEmitterMinSize===&lt;br /&gt;
{{MethodHeader|public native void SetPFXEmitterMinSize(int id, int phase, float newsize)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;phase&#039;&#039;&#039; = The phase of the effect, if there is only one phase use zero.&lt;br /&gt;
*&#039;&#039;&#039;newsize&#039;&#039;&#039; = The new minimum size of particles at the specified phase.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetPFXEmitterMinSize(0,0,10);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetPFXEmitterPhysicsDelay===&lt;br /&gt;
{{MethodHeader|public native void SetPFXEmitterPhysicsDelay(int id, int phase, float value)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;phase&#039;&#039;&#039; = The phase of the effect, if there is only one phase use zero.&lt;br /&gt;
*&#039;&#039;&#039;value&#039;&#039;&#039; = The new physics delay value to set for the specified phase.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetPFXEmitterPhysicsDelay(0,0,5.0);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetPFXEmitterRate===&lt;br /&gt;
{{MethodHeader|public native void SetPFXEmitterRate(int id, int phase, float rate)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;phase&#039;&#039;&#039; = The phase of the effect, if there is only one phase use zero.&lt;br /&gt;
*&#039;&#039;&#039;rate&#039;&#039;&#039; = New rate of particle creation per second at the specified phase.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetPFXEmitterRate(0,0,5.0);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetPFXEmitterStartColor===&lt;br /&gt;
{{MethodHeader|public native void SetPFXEmitterStartColor(int id, int phase, float r, float g, float b, float a)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;phase&#039;&#039;&#039; = The phase of the effect, if there is only one phase use zero.&lt;br /&gt;
*&#039;&#039;&#039;r,g,b&#039;&#039;&#039; = Red, green and blue components of the required color.&lt;br /&gt;
*&#039;&#039;&#039;a&#039;&#039;&#039; = Alpha value of the color.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetPFXEmitterStartColor(0,0,128,128,128,64);&lt;br /&gt;
 SetPFXEmitterStartColor(0,0,0.5,0.5,0.5,0.25);&lt;br /&gt;
;Notes&lt;br /&gt;
*Red, green, blue and alpha may be entered as integer or float values in the ranges 0..255 and 0.0..1.0 respectively.&lt;br /&gt;
*Both of the examples above give the same result.&lt;br /&gt;
*Note that 1,1,1,1 will be interpreted as float input and will produce white, whereas 2,2,2,2 will be interpreted as integers and will give a result which is almost black.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetPFXEmitterTexture===&lt;br /&gt;
{{MethodHeader|public native void SetPFXEmitterTexture(int id, KUID textureKUID)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;textureKUID&#039;&#039;&#039; = The kuid of the new texture.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetPFXEmitterTexture(0,&amp;lt;kuid:1234:5678&amp;gt;);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetPFXEmitterVelocity===&lt;br /&gt;
{{MethodHeader|public native void SetPFXEmitterVelocity(int id, int phase, float velocity)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;phase&#039;&#039;&#039; = The phase of the effect, if there is only one phase use zero.&lt;br /&gt;
*&#039;&#039;&#039;velocity&#039;&#039;&#039; = New velocity in metres per second along the direction vector of emitted particles at the specified phase.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetPFXEmitterVelocity(0,0,5.0);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===StopSoundScriptEvent===&lt;br /&gt;
{{MethodHeader|public native void StopSoundScriptEvent(string soundTrigger)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
&#039;&#039;&#039;soundTrigger&#039;&#039;&#039; = Name of the sound event to start playing, this equates to the &#039;&#039;trigger&#039;&#039; tag of the sound script subcontainer in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 StopSoundScriptEvent(&amp;quot;dayloop&amp;quot;);&lt;br /&gt;
;Notes&lt;br /&gt;
*Terminates a looped sound script previously started with [[#PlaySoundScriptEvent|PlaySoundScriptEvent()]].&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Related Methods==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Categories==&lt;br /&gt;
[[Category:Script Class]]&lt;/div&gt;</summary>
		<author><name>Ciceronmt</name></author>
	</entry>
	<entry>
		<id>https://wiki.trainzsimulator.com/index.php?title=Class_MapObject&amp;diff=25387</id>
		<title>Class MapObject</title>
		<link rel="alternate" type="text/html" href="https://wiki.trainzsimulator.com/index.php?title=Class_MapObject&amp;diff=25387"/>
		<updated>2020-11-21T11:33:31Z</updated>

		<summary type="html">&lt;p&gt;Ciceronmt: /* GetMapObjectOrientation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;*[[TrainzScript Language Reference|API Hierarchy]]&lt;br /&gt;
**[[Class GSObject|GSObject]]&lt;br /&gt;
***[[Class GameObject|GameObject]]&lt;br /&gt;
****[[Class PropertyObject|PropertyObject]]&lt;br /&gt;
****[[Class TrainzGameObject|TrainzGameObject]]&lt;br /&gt;
*****[[Class MeshObject|MeshObject]]&lt;br /&gt;
******MapObject&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*This class extends MeshObject to include product queues. &lt;br /&gt;
*A MapObject can have a number of product queues as defined in the queues section of the config.txt file for the asset.&lt;br /&gt;
*The class also provides methods to control particle emissions.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==MapObject Messages==&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
{{TableHeader|width=50%|margin=15px}}&lt;br /&gt;
|-&lt;br /&gt;
|bgcolor=&amp;quot;#EEEEEE&amp;quot;|&#039;&#039;&#039;Major&#039;&#039;&#039;||bgcolor=&amp;quot;#EEEEEE&amp;quot;|&#039;&#039;&#039;Minor&#039;&#039;&#039;||bgcolor=&amp;quot;#EEEEEE&amp;quot;|&#039;&#039;&#039;Source&#039;&#039;&#039;||bgcolor=&amp;quot;#EEEEEE&amp;quot; |&#039;&#039;&#039;Destination&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|[[MapObject Messages|MapObject]]||View-Details||?||MapObject&lt;br /&gt;
|-&lt;br /&gt;
|[[MapObject Messages|MapObject]]||View-Schedule||?||MapObject&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Methods==&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetMapObjectOrientation===&lt;br /&gt;
{{MethodHeader|public native Orientation GetMapObjectOrientation(void)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
= None.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*The absolute orientation of this MapObject.  WorldCoordinate - The current orientation of this MapObject.&lt;br /&gt;
;Syntax&lt;br /&gt;
float angel_z = cabin.Loco.GetMapObjectOrientation().rz;&lt;br /&gt;
;Notes&lt;br /&gt;
A call to GetMapObjectOrientation() which immediately follows a call to SetMapObjectOrientation() is not guaranteed to return the input orientation, since various other orientation restrictions may be in effect.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetPFXEmitterLifetime===&lt;br /&gt;
{{MethodHeader|public native float GetPFXEmitterLifetime(int id, int phase)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;phase&#039;&#039;&#039; = The phase of the effect, if there is only one phase use zero.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*Value of the lifetime of the effect at the specified phase.&lt;br /&gt;
;Syntax&lt;br /&gt;
 float lifetime GetPFXEmitterLifetime(0,0);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetPFXEmitterMaxRate===&lt;br /&gt;
{{MethodHeader|public native float GetPFXEmitterMaxRate(int id)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*Maximum rate of emissions per second.&lt;br /&gt;
;Syntax&lt;br /&gt;
 float maxRate = GetPFXEmitterMaxRate(0);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetPFXEmitterMaxSize===&lt;br /&gt;
{{MethodHeader|public native float GetPFXEmitterMaxSize(int id, int phase)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;phase&#039;&#039;&#039; = The phase of the effect, if there is only one phase use zero.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*Maximum size of particle at the specified phase.&lt;br /&gt;
;Syntax&lt;br /&gt;
 float maxsize = GetPFXEmitterMinSize();&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetPFXEmitterMinRate===&lt;br /&gt;
{{MethodHeader|public native float GetPFXEmitterMinRate(int id)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*Maximum rate of emissions per second.&lt;br /&gt;
;Syntax&lt;br /&gt;
 float minRtae = GetPFXEmitterMinRate(0);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetPFXEmitterMinSize===&lt;br /&gt;
{{MethodHeader|public native float GetPFXEmitterMinSize(int id, int phase)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;phase&#039;&#039;&#039; = The phase of the effect, if there is only one phase use zero.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*Minimum size of particle at the specified phase.&lt;br /&gt;
;Syntax&lt;br /&gt;
 float minsize = GetPFXEmitterMinSize();&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetPFXEmitterPhysicsDelay===&lt;br /&gt;
{{MethodHeader|public native float GetPFXEmitterPhysicsDelay(int id, int phase)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;phase&#039;&#039;&#039; = The phase of the effect, if there is only one phase use zero.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*Value for the physics delay in emission.&lt;br /&gt;
;Syntax&lt;br /&gt;
 GetPFXEmitterPhysicsDelay(0,0);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetPFXEmitterRate===&lt;br /&gt;
{{MethodHeader|public native float GetPFXEmitterRate(int id, int phase)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;phase&#039;&#039;&#039; = The phase of the effect, if there is only one phase use zero.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*Rate of particle creation per second.&lt;br /&gt;
;Syntax&lt;br /&gt;
 particlesPerSecond = GetPFXEmitterRate(0,0);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetPFXEmitterVelocity===&lt;br /&gt;
{{MethodHeader|public native float GetPFXEmitterVelocity(int id, int phase)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;phase&#039;&#039;&#039; = The phase of the effect, if there is only one phase use zero.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*Velocity in metres per second along the direction vector of emitted particles at the specified phase.&lt;br /&gt;
;Syntax&lt;br /&gt;
 float speed = GetPFXEmitterVelocity(0,0);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetQueue===&lt;br /&gt;
{{MethodHeader|public native ProductQueue GetQueue(string queueName)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
&#039;&#039;&#039;queueName&#039;&#039;&#039; = Name of the product queue to be returned.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*A reference to the queue if possible, null otherwise.&lt;br /&gt;
;Syntax&lt;br /&gt;
 ProductQueue queue = GetQueue(&amp;quot;passengers&amp;quot;);&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetQueues===&lt;br /&gt;
{{MethodHeader|public native ProductQueue[ ] GetQueues(void)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*None&lt;br /&gt;
;Returned Value&lt;br /&gt;
*An array of product queues, if there are no queues the array will be empty.&lt;br /&gt;
;Syntax&lt;br /&gt;
 ProductQueue[] queues = GetQueues();&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===PlaySoundScriptEvent===&lt;br /&gt;
{{MethodHeader|public native void PlaySoundScriptEvent(string soundTrigger)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
&#039;&#039;&#039;soundTrigger&#039;&#039;&#039; = Name of the sound event to start playing, this equates to the &#039;&#039;trigger&#039;&#039; tag of the sound script subcontainer in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 PlaySoundScriptEvent(&amp;quot;dayloop&amp;quot;);&lt;br /&gt;
;Notes&lt;br /&gt;
*Plays the specified sound event from the asset&#039;s SoundScript. &lt;br /&gt;
*SoundScripts are defined as sub-containers in the soundscript container of the asset&#039;s configuration. &lt;br /&gt;
*For details on creating assets with SoundScripts, see [[&amp;quot;Soundscript&amp;quot; container|here]]. &lt;br /&gt;
*This method will start playing the sound. &lt;br /&gt;
*Depending on the SoundScript configuration, the sound will either be played just once or played continuously in a looping cycle such that [[#StopSoundScriptEvent|StopSoundScriptEvent()]] will need to be called to stop it.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetPFXEmitterConeSize===&lt;br /&gt;
{{MethodHeader|public native void SetPFXEmitterConeSize(int id, float x, float y, float z)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;x,y,z&#039;&#039;&#039; = New X,Y and Z components of the particle cone size.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetPFXEmitterConeSize(0,2.0,3.0,2.0);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetPFXEmitterEmitParticles===&lt;br /&gt;
{{MethodHeader|public native void SetPFXEmitterEmitParticles(int id, int number,float time)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;number&#039;&#039;&#039; = The number of particles to emit.&lt;br /&gt;
*&#039;&#039;&#039;time&#039;&#039;&#039; = The time in seconds over which the particles are to be created.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetPFXEmitterEmitParticles(0,100,10.0);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetPFXEmitterEndColor===&lt;br /&gt;
{{MethodHeader|public native void SetPFXEmitterEndColor(int id, int phase, float r, float g, float b, float a)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;phase&#039;&#039;&#039; = The phase of the effect, if there is only one phase use zero.&lt;br /&gt;
*&#039;&#039;&#039;r,g,b&#039;&#039;&#039; = Red, green and blue components of the required color.&lt;br /&gt;
*&#039;&#039;&#039;a&#039;&#039;&#039; = Alpha value of the color.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetPFXEmitterStartColor(0,0,128,128,128,64);&lt;br /&gt;
 SetPFXEmitterStartColor(0,0,0.5,0.5,0.5,0.25);&lt;br /&gt;
;Notes&lt;br /&gt;
*Red, green, blue and alpha may be entered as integer or float values in the ranges 0..255 and 0.0..1.0 respectively.&lt;br /&gt;
*Both of the examples above give the same result.&lt;br /&gt;
*Note that 1,1,1,1 will be interpreted as float input and will produce white, whereas 2,2,2,2 will be interpreted as integers and will give a result which is almost black.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetPFXEmitterLifetime===&lt;br /&gt;
{{MethodHeader|public native void SetPFXEmitterLifetime(int id, int phase, float life)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;phase&#039;&#039;&#039; = The phase of the effect, if there is only one phase use zero.&lt;br /&gt;
*&#039;&#039;&#039;life&#039;&#039;&#039; = The new lifetime of particles in seconds at the specified phase.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetPFXEmitterLifetime(0,0,10);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetPFXEmitterMaxRate===&lt;br /&gt;
{{MethodHeader|public native void SetPFXEmitterMaxRate(int id, float newsize)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;rate&#039;&#039;&#039; = The new maximum rate of emission per second.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetPFXEmitterMaxRate(0,5.0);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetPFXEmitterMaxSize===&lt;br /&gt;
{{MethodHeader|public native void SetPFXEmitterMaxSize(int id, int phase, float newsize)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;phase&#039;&#039;&#039; = The phase of the effect, if there is only one phase use zero.&lt;br /&gt;
*&#039;&#039;&#039;newsize&#039;&#039;&#039; = The new maximum size of particles at the specified phase.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetPFXEmitterMaxSize(0,0,10);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetPFXEmitterMinRate===&lt;br /&gt;
{{MethodHeader|public native void SetPFXEmitterMinRate(int id, float rate)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;rate&#039;&#039;&#039; = The new minimum rate of emission per second.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetPFXEmitterMinRate(0,5.0);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetPFXEmitterMinSize===&lt;br /&gt;
{{MethodHeader|public native void SetPFXEmitterMinSize(int id, int phase, float newsize)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;phase&#039;&#039;&#039; = The phase of the effect, if there is only one phase use zero.&lt;br /&gt;
*&#039;&#039;&#039;newsize&#039;&#039;&#039; = The new minimum size of particles at the specified phase.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetPFXEmitterMinSize(0,0,10);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetPFXEmitterPhysicsDelay===&lt;br /&gt;
{{MethodHeader|public native void SetPFXEmitterPhysicsDelay(int id, int phase, float value)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;phase&#039;&#039;&#039; = The phase of the effect, if there is only one phase use zero.&lt;br /&gt;
*&#039;&#039;&#039;value&#039;&#039;&#039; = The new physics delay value to set for the specified phase.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetPFXEmitterPhysicsDelay(0,0,5.0);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetPFXEmitterRate===&lt;br /&gt;
{{MethodHeader|public native void SetPFXEmitterRate(int id, int phase, float rate)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;phase&#039;&#039;&#039; = The phase of the effect, if there is only one phase use zero.&lt;br /&gt;
*&#039;&#039;&#039;rate&#039;&#039;&#039; = New rate of particle creation per second at the specified phase.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetPFXEmitterRate(0,0,5.0);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetPFXEmitterStartColor===&lt;br /&gt;
{{MethodHeader|public native void SetPFXEmitterStartColor(int id, int phase, float r, float g, float b, float a)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;phase&#039;&#039;&#039; = The phase of the effect, if there is only one phase use zero.&lt;br /&gt;
*&#039;&#039;&#039;r,g,b&#039;&#039;&#039; = Red, green and blue components of the required color.&lt;br /&gt;
*&#039;&#039;&#039;a&#039;&#039;&#039; = Alpha value of the color.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetPFXEmitterStartColor(0,0,128,128,128,64);&lt;br /&gt;
 SetPFXEmitterStartColor(0,0,0.5,0.5,0.5,0.25);&lt;br /&gt;
;Notes&lt;br /&gt;
*Red, green, blue and alpha may be entered as integer or float values in the ranges 0..255 and 0.0..1.0 respectively.&lt;br /&gt;
*Both of the examples above give the same result.&lt;br /&gt;
*Note that 1,1,1,1 will be interpreted as float input and will produce white, whereas 2,2,2,2 will be interpreted as integers and will give a result which is almost black.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetPFXEmitterTexture===&lt;br /&gt;
{{MethodHeader|public native void SetPFXEmitterTexture(int id, KUID textureKUID)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;textureKUID&#039;&#039;&#039; = The kuid of the new texture.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetPFXEmitterTexture(0,&amp;lt;kuid:1234:5678&amp;gt;);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetPFXEmitterVelocity===&lt;br /&gt;
{{MethodHeader|public native void SetPFXEmitterVelocity(int id, int phase, float velocity)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;phase&#039;&#039;&#039; = The phase of the effect, if there is only one phase use zero.&lt;br /&gt;
*&#039;&#039;&#039;velocity&#039;&#039;&#039; = New velocity in metres per second along the direction vector of emitted particles at the specified phase.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetPFXEmitterVelocity(0,0,5.0);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===StopSoundScriptEvent===&lt;br /&gt;
{{MethodHeader|public native void StopSoundScriptEvent(string soundTrigger)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
&#039;&#039;&#039;soundTrigger&#039;&#039;&#039; = Name of the sound event to start playing, this equates to the &#039;&#039;trigger&#039;&#039; tag of the sound script subcontainer in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 StopSoundScriptEvent(&amp;quot;dayloop&amp;quot;);&lt;br /&gt;
;Notes&lt;br /&gt;
*Terminates a looped sound script previously started with [[#PlaySoundScriptEvent|PlaySoundScriptEvent()]].&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Related Methods==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Categories==&lt;br /&gt;
[[Category:Script Class]]&lt;/div&gt;</summary>
		<author><name>Ciceronmt</name></author>
	</entry>
	<entry>
		<id>https://wiki.trainzsimulator.com/index.php?title=Class_MapObject&amp;diff=25386</id>
		<title>Class MapObject</title>
		<link rel="alternate" type="text/html" href="https://wiki.trainzsimulator.com/index.php?title=Class_MapObject&amp;diff=25386"/>
		<updated>2020-11-21T11:32:06Z</updated>

		<summary type="html">&lt;p&gt;Ciceronmt: /* GetMapObjectOrientation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;*[[TrainzScript Language Reference|API Hierarchy]]&lt;br /&gt;
**[[Class GSObject|GSObject]]&lt;br /&gt;
***[[Class GameObject|GameObject]]&lt;br /&gt;
****[[Class PropertyObject|PropertyObject]]&lt;br /&gt;
****[[Class TrainzGameObject|TrainzGameObject]]&lt;br /&gt;
*****[[Class MeshObject|MeshObject]]&lt;br /&gt;
******MapObject&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*This class extends MeshObject to include product queues. &lt;br /&gt;
*A MapObject can have a number of product queues as defined in the queues section of the config.txt file for the asset.&lt;br /&gt;
*The class also provides methods to control particle emissions.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==MapObject Messages==&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
{{TableHeader|width=50%|margin=15px}}&lt;br /&gt;
|-&lt;br /&gt;
|bgcolor=&amp;quot;#EEEEEE&amp;quot;|&#039;&#039;&#039;Major&#039;&#039;&#039;||bgcolor=&amp;quot;#EEEEEE&amp;quot;|&#039;&#039;&#039;Minor&#039;&#039;&#039;||bgcolor=&amp;quot;#EEEEEE&amp;quot;|&#039;&#039;&#039;Source&#039;&#039;&#039;||bgcolor=&amp;quot;#EEEEEE&amp;quot; |&#039;&#039;&#039;Destination&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|[[MapObject Messages|MapObject]]||View-Details||?||MapObject&lt;br /&gt;
|-&lt;br /&gt;
|[[MapObject Messages|MapObject]]||View-Schedule||?||MapObject&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Methods==&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetMapObjectOrientation===&lt;br /&gt;
{{MethodHeader|public native Orientation GetMapObjectOrientation(void)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
= None.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*The absolute orientation of this MapObject.  WorldCoordinate - The current orientation of this MapObject.&lt;br /&gt;
;Syntax&lt;br /&gt;
 angel_z = cabin.Loco.GetMapObjectOrientation().rz;&lt;br /&gt;
;Notes&lt;br /&gt;
A call to GetMapObjectOrientation() which immediately follows a call to SetMapObjectOrientation() is not guaranteed to return the input orientation, since various other orientation restrictions may be in effect.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetPFXEmitterLifetime===&lt;br /&gt;
{{MethodHeader|public native float GetPFXEmitterLifetime(int id, int phase)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;phase&#039;&#039;&#039; = The phase of the effect, if there is only one phase use zero.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*Value of the lifetime of the effect at the specified phase.&lt;br /&gt;
;Syntax&lt;br /&gt;
 float lifetime GetPFXEmitterLifetime(0,0);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetPFXEmitterMaxRate===&lt;br /&gt;
{{MethodHeader|public native float GetPFXEmitterMaxRate(int id)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*Maximum rate of emissions per second.&lt;br /&gt;
;Syntax&lt;br /&gt;
 float maxRate = GetPFXEmitterMaxRate(0);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetPFXEmitterMaxSize===&lt;br /&gt;
{{MethodHeader|public native float GetPFXEmitterMaxSize(int id, int phase)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;phase&#039;&#039;&#039; = The phase of the effect, if there is only one phase use zero.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*Maximum size of particle at the specified phase.&lt;br /&gt;
;Syntax&lt;br /&gt;
 float maxsize = GetPFXEmitterMinSize();&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetPFXEmitterMinRate===&lt;br /&gt;
{{MethodHeader|public native float GetPFXEmitterMinRate(int id)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*Maximum rate of emissions per second.&lt;br /&gt;
;Syntax&lt;br /&gt;
 float minRtae = GetPFXEmitterMinRate(0);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetPFXEmitterMinSize===&lt;br /&gt;
{{MethodHeader|public native float GetPFXEmitterMinSize(int id, int phase)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;phase&#039;&#039;&#039; = The phase of the effect, if there is only one phase use zero.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*Minimum size of particle at the specified phase.&lt;br /&gt;
;Syntax&lt;br /&gt;
 float minsize = GetPFXEmitterMinSize();&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetPFXEmitterPhysicsDelay===&lt;br /&gt;
{{MethodHeader|public native float GetPFXEmitterPhysicsDelay(int id, int phase)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;phase&#039;&#039;&#039; = The phase of the effect, if there is only one phase use zero.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*Value for the physics delay in emission.&lt;br /&gt;
;Syntax&lt;br /&gt;
 GetPFXEmitterPhysicsDelay(0,0);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetPFXEmitterRate===&lt;br /&gt;
{{MethodHeader|public native float GetPFXEmitterRate(int id, int phase)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;phase&#039;&#039;&#039; = The phase of the effect, if there is only one phase use zero.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*Rate of particle creation per second.&lt;br /&gt;
;Syntax&lt;br /&gt;
 particlesPerSecond = GetPFXEmitterRate(0,0);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetPFXEmitterVelocity===&lt;br /&gt;
{{MethodHeader|public native float GetPFXEmitterVelocity(int id, int phase)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;phase&#039;&#039;&#039; = The phase of the effect, if there is only one phase use zero.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*Velocity in metres per second along the direction vector of emitted particles at the specified phase.&lt;br /&gt;
;Syntax&lt;br /&gt;
 float speed = GetPFXEmitterVelocity(0,0);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetQueue===&lt;br /&gt;
{{MethodHeader|public native ProductQueue GetQueue(string queueName)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
&#039;&#039;&#039;queueName&#039;&#039;&#039; = Name of the product queue to be returned.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*A reference to the queue if possible, null otherwise.&lt;br /&gt;
;Syntax&lt;br /&gt;
 ProductQueue queue = GetQueue(&amp;quot;passengers&amp;quot;);&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetQueues===&lt;br /&gt;
{{MethodHeader|public native ProductQueue[ ] GetQueues(void)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*None&lt;br /&gt;
;Returned Value&lt;br /&gt;
*An array of product queues, if there are no queues the array will be empty.&lt;br /&gt;
;Syntax&lt;br /&gt;
 ProductQueue[] queues = GetQueues();&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===PlaySoundScriptEvent===&lt;br /&gt;
{{MethodHeader|public native void PlaySoundScriptEvent(string soundTrigger)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
&#039;&#039;&#039;soundTrigger&#039;&#039;&#039; = Name of the sound event to start playing, this equates to the &#039;&#039;trigger&#039;&#039; tag of the sound script subcontainer in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 PlaySoundScriptEvent(&amp;quot;dayloop&amp;quot;);&lt;br /&gt;
;Notes&lt;br /&gt;
*Plays the specified sound event from the asset&#039;s SoundScript. &lt;br /&gt;
*SoundScripts are defined as sub-containers in the soundscript container of the asset&#039;s configuration. &lt;br /&gt;
*For details on creating assets with SoundScripts, see [[&amp;quot;Soundscript&amp;quot; container|here]]. &lt;br /&gt;
*This method will start playing the sound. &lt;br /&gt;
*Depending on the SoundScript configuration, the sound will either be played just once or played continuously in a looping cycle such that [[#StopSoundScriptEvent|StopSoundScriptEvent()]] will need to be called to stop it.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetPFXEmitterConeSize===&lt;br /&gt;
{{MethodHeader|public native void SetPFXEmitterConeSize(int id, float x, float y, float z)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;x,y,z&#039;&#039;&#039; = New X,Y and Z components of the particle cone size.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetPFXEmitterConeSize(0,2.0,3.0,2.0);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetPFXEmitterEmitParticles===&lt;br /&gt;
{{MethodHeader|public native void SetPFXEmitterEmitParticles(int id, int number,float time)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;number&#039;&#039;&#039; = The number of particles to emit.&lt;br /&gt;
*&#039;&#039;&#039;time&#039;&#039;&#039; = The time in seconds over which the particles are to be created.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetPFXEmitterEmitParticles(0,100,10.0);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetPFXEmitterEndColor===&lt;br /&gt;
{{MethodHeader|public native void SetPFXEmitterEndColor(int id, int phase, float r, float g, float b, float a)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;phase&#039;&#039;&#039; = The phase of the effect, if there is only one phase use zero.&lt;br /&gt;
*&#039;&#039;&#039;r,g,b&#039;&#039;&#039; = Red, green and blue components of the required color.&lt;br /&gt;
*&#039;&#039;&#039;a&#039;&#039;&#039; = Alpha value of the color.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetPFXEmitterStartColor(0,0,128,128,128,64);&lt;br /&gt;
 SetPFXEmitterStartColor(0,0,0.5,0.5,0.5,0.25);&lt;br /&gt;
;Notes&lt;br /&gt;
*Red, green, blue and alpha may be entered as integer or float values in the ranges 0..255 and 0.0..1.0 respectively.&lt;br /&gt;
*Both of the examples above give the same result.&lt;br /&gt;
*Note that 1,1,1,1 will be interpreted as float input and will produce white, whereas 2,2,2,2 will be interpreted as integers and will give a result which is almost black.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetPFXEmitterLifetime===&lt;br /&gt;
{{MethodHeader|public native void SetPFXEmitterLifetime(int id, int phase, float life)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;phase&#039;&#039;&#039; = The phase of the effect, if there is only one phase use zero.&lt;br /&gt;
*&#039;&#039;&#039;life&#039;&#039;&#039; = The new lifetime of particles in seconds at the specified phase.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetPFXEmitterLifetime(0,0,10);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetPFXEmitterMaxRate===&lt;br /&gt;
{{MethodHeader|public native void SetPFXEmitterMaxRate(int id, float newsize)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;rate&#039;&#039;&#039; = The new maximum rate of emission per second.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetPFXEmitterMaxRate(0,5.0);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetPFXEmitterMaxSize===&lt;br /&gt;
{{MethodHeader|public native void SetPFXEmitterMaxSize(int id, int phase, float newsize)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;phase&#039;&#039;&#039; = The phase of the effect, if there is only one phase use zero.&lt;br /&gt;
*&#039;&#039;&#039;newsize&#039;&#039;&#039; = The new maximum size of particles at the specified phase.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetPFXEmitterMaxSize(0,0,10);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetPFXEmitterMinRate===&lt;br /&gt;
{{MethodHeader|public native void SetPFXEmitterMinRate(int id, float rate)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;rate&#039;&#039;&#039; = The new minimum rate of emission per second.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetPFXEmitterMinRate(0,5.0);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetPFXEmitterMinSize===&lt;br /&gt;
{{MethodHeader|public native void SetPFXEmitterMinSize(int id, int phase, float newsize)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;phase&#039;&#039;&#039; = The phase of the effect, if there is only one phase use zero.&lt;br /&gt;
*&#039;&#039;&#039;newsize&#039;&#039;&#039; = The new minimum size of particles at the specified phase.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetPFXEmitterMinSize(0,0,10);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetPFXEmitterPhysicsDelay===&lt;br /&gt;
{{MethodHeader|public native void SetPFXEmitterPhysicsDelay(int id, int phase, float value)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;phase&#039;&#039;&#039; = The phase of the effect, if there is only one phase use zero.&lt;br /&gt;
*&#039;&#039;&#039;value&#039;&#039;&#039; = The new physics delay value to set for the specified phase.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetPFXEmitterPhysicsDelay(0,0,5.0);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetPFXEmitterRate===&lt;br /&gt;
{{MethodHeader|public native void SetPFXEmitterRate(int id, int phase, float rate)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;phase&#039;&#039;&#039; = The phase of the effect, if there is only one phase use zero.&lt;br /&gt;
*&#039;&#039;&#039;rate&#039;&#039;&#039; = New rate of particle creation per second at the specified phase.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetPFXEmitterRate(0,0,5.0);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetPFXEmitterStartColor===&lt;br /&gt;
{{MethodHeader|public native void SetPFXEmitterStartColor(int id, int phase, float r, float g, float b, float a)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;phase&#039;&#039;&#039; = The phase of the effect, if there is only one phase use zero.&lt;br /&gt;
*&#039;&#039;&#039;r,g,b&#039;&#039;&#039; = Red, green and blue components of the required color.&lt;br /&gt;
*&#039;&#039;&#039;a&#039;&#039;&#039; = Alpha value of the color.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetPFXEmitterStartColor(0,0,128,128,128,64);&lt;br /&gt;
 SetPFXEmitterStartColor(0,0,0.5,0.5,0.5,0.25);&lt;br /&gt;
;Notes&lt;br /&gt;
*Red, green, blue and alpha may be entered as integer or float values in the ranges 0..255 and 0.0..1.0 respectively.&lt;br /&gt;
*Both of the examples above give the same result.&lt;br /&gt;
*Note that 1,1,1,1 will be interpreted as float input and will produce white, whereas 2,2,2,2 will be interpreted as integers and will give a result which is almost black.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetPFXEmitterTexture===&lt;br /&gt;
{{MethodHeader|public native void SetPFXEmitterTexture(int id, KUID textureKUID)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;textureKUID&#039;&#039;&#039; = The kuid of the new texture.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetPFXEmitterTexture(0,&amp;lt;kuid:1234:5678&amp;gt;);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetPFXEmitterVelocity===&lt;br /&gt;
{{MethodHeader|public native void SetPFXEmitterVelocity(int id, int phase, float velocity)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;phase&#039;&#039;&#039; = The phase of the effect, if there is only one phase use zero.&lt;br /&gt;
*&#039;&#039;&#039;velocity&#039;&#039;&#039; = New velocity in metres per second along the direction vector of emitted particles at the specified phase.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetPFXEmitterVelocity(0,0,5.0);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===StopSoundScriptEvent===&lt;br /&gt;
{{MethodHeader|public native void StopSoundScriptEvent(string soundTrigger)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
&#039;&#039;&#039;soundTrigger&#039;&#039;&#039; = Name of the sound event to start playing, this equates to the &#039;&#039;trigger&#039;&#039; tag of the sound script subcontainer in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 StopSoundScriptEvent(&amp;quot;dayloop&amp;quot;);&lt;br /&gt;
;Notes&lt;br /&gt;
*Terminates a looped sound script previously started with [[#PlaySoundScriptEvent|PlaySoundScriptEvent()]].&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Related Methods==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Categories==&lt;br /&gt;
[[Category:Script Class]]&lt;/div&gt;</summary>
		<author><name>Ciceronmt</name></author>
	</entry>
	<entry>
		<id>https://wiki.trainzsimulator.com/index.php?title=Class_MapObject&amp;diff=25385</id>
		<title>Class MapObject</title>
		<link rel="alternate" type="text/html" href="https://wiki.trainzsimulator.com/index.php?title=Class_MapObject&amp;diff=25385"/>
		<updated>2020-11-21T11:30:23Z</updated>

		<summary type="html">&lt;p&gt;Ciceronmt: /* GetMapObjectOrientation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;*[[TrainzScript Language Reference|API Hierarchy]]&lt;br /&gt;
**[[Class GSObject|GSObject]]&lt;br /&gt;
***[[Class GameObject|GameObject]]&lt;br /&gt;
****[[Class PropertyObject|PropertyObject]]&lt;br /&gt;
****[[Class TrainzGameObject|TrainzGameObject]]&lt;br /&gt;
*****[[Class MeshObject|MeshObject]]&lt;br /&gt;
******MapObject&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*This class extends MeshObject to include product queues. &lt;br /&gt;
*A MapObject can have a number of product queues as defined in the queues section of the config.txt file for the asset.&lt;br /&gt;
*The class also provides methods to control particle emissions.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==MapObject Messages==&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
{{TableHeader|width=50%|margin=15px}}&lt;br /&gt;
|-&lt;br /&gt;
|bgcolor=&amp;quot;#EEEEEE&amp;quot;|&#039;&#039;&#039;Major&#039;&#039;&#039;||bgcolor=&amp;quot;#EEEEEE&amp;quot;|&#039;&#039;&#039;Minor&#039;&#039;&#039;||bgcolor=&amp;quot;#EEEEEE&amp;quot;|&#039;&#039;&#039;Source&#039;&#039;&#039;||bgcolor=&amp;quot;#EEEEEE&amp;quot; |&#039;&#039;&#039;Destination&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|[[MapObject Messages|MapObject]]||View-Details||?||MapObject&lt;br /&gt;
|-&lt;br /&gt;
|[[MapObject Messages|MapObject]]||View-Schedule||?||MapObject&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Methods==&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetMapObjectOrientation===&lt;br /&gt;
{{MethodHeader|public native Orientation GetMapObjectOrientation(void)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
= None.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*WorldCoordinate - The current orientation of this MapObject.&lt;br /&gt;
;Syntax&lt;br /&gt;
 angel_z = cabin.Loco.GetMapObjectOrientation().rz;&lt;br /&gt;
;Notes&lt;br /&gt;
Returns the absolute orientation of this MapObject. A call to GetMapObjectOrientation() which immediately follows a call to SetMapObjectOrientation() is not guaranteed to return the input orientation, since various other orientation restrictions may be in effect.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetPFXEmitterLifetime===&lt;br /&gt;
{{MethodHeader|public native float GetPFXEmitterLifetime(int id, int phase)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;phase&#039;&#039;&#039; = The phase of the effect, if there is only one phase use zero.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*Value of the lifetime of the effect at the specified phase.&lt;br /&gt;
;Syntax&lt;br /&gt;
 float lifetime GetPFXEmitterLifetime(0,0);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetPFXEmitterMaxRate===&lt;br /&gt;
{{MethodHeader|public native float GetPFXEmitterMaxRate(int id)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*Maximum rate of emissions per second.&lt;br /&gt;
;Syntax&lt;br /&gt;
 float maxRate = GetPFXEmitterMaxRate(0);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetPFXEmitterMaxSize===&lt;br /&gt;
{{MethodHeader|public native float GetPFXEmitterMaxSize(int id, int phase)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;phase&#039;&#039;&#039; = The phase of the effect, if there is only one phase use zero.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*Maximum size of particle at the specified phase.&lt;br /&gt;
;Syntax&lt;br /&gt;
 float maxsize = GetPFXEmitterMinSize();&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetPFXEmitterMinRate===&lt;br /&gt;
{{MethodHeader|public native float GetPFXEmitterMinRate(int id)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*Maximum rate of emissions per second.&lt;br /&gt;
;Syntax&lt;br /&gt;
 float minRtae = GetPFXEmitterMinRate(0);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetPFXEmitterMinSize===&lt;br /&gt;
{{MethodHeader|public native float GetPFXEmitterMinSize(int id, int phase)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;phase&#039;&#039;&#039; = The phase of the effect, if there is only one phase use zero.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*Minimum size of particle at the specified phase.&lt;br /&gt;
;Syntax&lt;br /&gt;
 float minsize = GetPFXEmitterMinSize();&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetPFXEmitterPhysicsDelay===&lt;br /&gt;
{{MethodHeader|public native float GetPFXEmitterPhysicsDelay(int id, int phase)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;phase&#039;&#039;&#039; = The phase of the effect, if there is only one phase use zero.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*Value for the physics delay in emission.&lt;br /&gt;
;Syntax&lt;br /&gt;
 GetPFXEmitterPhysicsDelay(0,0);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetPFXEmitterRate===&lt;br /&gt;
{{MethodHeader|public native float GetPFXEmitterRate(int id, int phase)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;phase&#039;&#039;&#039; = The phase of the effect, if there is only one phase use zero.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*Rate of particle creation per second.&lt;br /&gt;
;Syntax&lt;br /&gt;
 particlesPerSecond = GetPFXEmitterRate(0,0);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetPFXEmitterVelocity===&lt;br /&gt;
{{MethodHeader|public native float GetPFXEmitterVelocity(int id, int phase)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;phase&#039;&#039;&#039; = The phase of the effect, if there is only one phase use zero.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*Velocity in metres per second along the direction vector of emitted particles at the specified phase.&lt;br /&gt;
;Syntax&lt;br /&gt;
 float speed = GetPFXEmitterVelocity(0,0);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetQueue===&lt;br /&gt;
{{MethodHeader|public native ProductQueue GetQueue(string queueName)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
&#039;&#039;&#039;queueName&#039;&#039;&#039; = Name of the product queue to be returned.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*A reference to the queue if possible, null otherwise.&lt;br /&gt;
;Syntax&lt;br /&gt;
 ProductQueue queue = GetQueue(&amp;quot;passengers&amp;quot;);&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetQueues===&lt;br /&gt;
{{MethodHeader|public native ProductQueue[ ] GetQueues(void)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*None&lt;br /&gt;
;Returned Value&lt;br /&gt;
*An array of product queues, if there are no queues the array will be empty.&lt;br /&gt;
;Syntax&lt;br /&gt;
 ProductQueue[] queues = GetQueues();&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===PlaySoundScriptEvent===&lt;br /&gt;
{{MethodHeader|public native void PlaySoundScriptEvent(string soundTrigger)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
&#039;&#039;&#039;soundTrigger&#039;&#039;&#039; = Name of the sound event to start playing, this equates to the &#039;&#039;trigger&#039;&#039; tag of the sound script subcontainer in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 PlaySoundScriptEvent(&amp;quot;dayloop&amp;quot;);&lt;br /&gt;
;Notes&lt;br /&gt;
*Plays the specified sound event from the asset&#039;s SoundScript. &lt;br /&gt;
*SoundScripts are defined as sub-containers in the soundscript container of the asset&#039;s configuration. &lt;br /&gt;
*For details on creating assets with SoundScripts, see [[&amp;quot;Soundscript&amp;quot; container|here]]. &lt;br /&gt;
*This method will start playing the sound. &lt;br /&gt;
*Depending on the SoundScript configuration, the sound will either be played just once or played continuously in a looping cycle such that [[#StopSoundScriptEvent|StopSoundScriptEvent()]] will need to be called to stop it.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetPFXEmitterConeSize===&lt;br /&gt;
{{MethodHeader|public native void SetPFXEmitterConeSize(int id, float x, float y, float z)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;x,y,z&#039;&#039;&#039; = New X,Y and Z components of the particle cone size.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetPFXEmitterConeSize(0,2.0,3.0,2.0);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetPFXEmitterEmitParticles===&lt;br /&gt;
{{MethodHeader|public native void SetPFXEmitterEmitParticles(int id, int number,float time)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;number&#039;&#039;&#039; = The number of particles to emit.&lt;br /&gt;
*&#039;&#039;&#039;time&#039;&#039;&#039; = The time in seconds over which the particles are to be created.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetPFXEmitterEmitParticles(0,100,10.0);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetPFXEmitterEndColor===&lt;br /&gt;
{{MethodHeader|public native void SetPFXEmitterEndColor(int id, int phase, float r, float g, float b, float a)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;phase&#039;&#039;&#039; = The phase of the effect, if there is only one phase use zero.&lt;br /&gt;
*&#039;&#039;&#039;r,g,b&#039;&#039;&#039; = Red, green and blue components of the required color.&lt;br /&gt;
*&#039;&#039;&#039;a&#039;&#039;&#039; = Alpha value of the color.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetPFXEmitterStartColor(0,0,128,128,128,64);&lt;br /&gt;
 SetPFXEmitterStartColor(0,0,0.5,0.5,0.5,0.25);&lt;br /&gt;
;Notes&lt;br /&gt;
*Red, green, blue and alpha may be entered as integer or float values in the ranges 0..255 and 0.0..1.0 respectively.&lt;br /&gt;
*Both of the examples above give the same result.&lt;br /&gt;
*Note that 1,1,1,1 will be interpreted as float input and will produce white, whereas 2,2,2,2 will be interpreted as integers and will give a result which is almost black.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetPFXEmitterLifetime===&lt;br /&gt;
{{MethodHeader|public native void SetPFXEmitterLifetime(int id, int phase, float life)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;phase&#039;&#039;&#039; = The phase of the effect, if there is only one phase use zero.&lt;br /&gt;
*&#039;&#039;&#039;life&#039;&#039;&#039; = The new lifetime of particles in seconds at the specified phase.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetPFXEmitterLifetime(0,0,10);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetPFXEmitterMaxRate===&lt;br /&gt;
{{MethodHeader|public native void SetPFXEmitterMaxRate(int id, float newsize)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;rate&#039;&#039;&#039; = The new maximum rate of emission per second.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetPFXEmitterMaxRate(0,5.0);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetPFXEmitterMaxSize===&lt;br /&gt;
{{MethodHeader|public native void SetPFXEmitterMaxSize(int id, int phase, float newsize)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;phase&#039;&#039;&#039; = The phase of the effect, if there is only one phase use zero.&lt;br /&gt;
*&#039;&#039;&#039;newsize&#039;&#039;&#039; = The new maximum size of particles at the specified phase.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetPFXEmitterMaxSize(0,0,10);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetPFXEmitterMinRate===&lt;br /&gt;
{{MethodHeader|public native void SetPFXEmitterMinRate(int id, float rate)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;rate&#039;&#039;&#039; = The new minimum rate of emission per second.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetPFXEmitterMinRate(0,5.0);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetPFXEmitterMinSize===&lt;br /&gt;
{{MethodHeader|public native void SetPFXEmitterMinSize(int id, int phase, float newsize)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;phase&#039;&#039;&#039; = The phase of the effect, if there is only one phase use zero.&lt;br /&gt;
*&#039;&#039;&#039;newsize&#039;&#039;&#039; = The new minimum size of particles at the specified phase.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetPFXEmitterMinSize(0,0,10);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetPFXEmitterPhysicsDelay===&lt;br /&gt;
{{MethodHeader|public native void SetPFXEmitterPhysicsDelay(int id, int phase, float value)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;phase&#039;&#039;&#039; = The phase of the effect, if there is only one phase use zero.&lt;br /&gt;
*&#039;&#039;&#039;value&#039;&#039;&#039; = The new physics delay value to set for the specified phase.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetPFXEmitterPhysicsDelay(0,0,5.0);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetPFXEmitterRate===&lt;br /&gt;
{{MethodHeader|public native void SetPFXEmitterRate(int id, int phase, float rate)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;phase&#039;&#039;&#039; = The phase of the effect, if there is only one phase use zero.&lt;br /&gt;
*&#039;&#039;&#039;rate&#039;&#039;&#039; = New rate of particle creation per second at the specified phase.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetPFXEmitterRate(0,0,5.0);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetPFXEmitterStartColor===&lt;br /&gt;
{{MethodHeader|public native void SetPFXEmitterStartColor(int id, int phase, float r, float g, float b, float a)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;phase&#039;&#039;&#039; = The phase of the effect, if there is only one phase use zero.&lt;br /&gt;
*&#039;&#039;&#039;r,g,b&#039;&#039;&#039; = Red, green and blue components of the required color.&lt;br /&gt;
*&#039;&#039;&#039;a&#039;&#039;&#039; = Alpha value of the color.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetPFXEmitterStartColor(0,0,128,128,128,64);&lt;br /&gt;
 SetPFXEmitterStartColor(0,0,0.5,0.5,0.5,0.25);&lt;br /&gt;
;Notes&lt;br /&gt;
*Red, green, blue and alpha may be entered as integer or float values in the ranges 0..255 and 0.0..1.0 respectively.&lt;br /&gt;
*Both of the examples above give the same result.&lt;br /&gt;
*Note that 1,1,1,1 will be interpreted as float input and will produce white, whereas 2,2,2,2 will be interpreted as integers and will give a result which is almost black.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetPFXEmitterTexture===&lt;br /&gt;
{{MethodHeader|public native void SetPFXEmitterTexture(int id, KUID textureKUID)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;textureKUID&#039;&#039;&#039; = The kuid of the new texture.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetPFXEmitterTexture(0,&amp;lt;kuid:1234:5678&amp;gt;);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetPFXEmitterVelocity===&lt;br /&gt;
{{MethodHeader|public native void SetPFXEmitterVelocity(int id, int phase, float velocity)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;phase&#039;&#039;&#039; = The phase of the effect, if there is only one phase use zero.&lt;br /&gt;
*&#039;&#039;&#039;velocity&#039;&#039;&#039; = New velocity in metres per second along the direction vector of emitted particles at the specified phase.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetPFXEmitterVelocity(0,0,5.0);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===StopSoundScriptEvent===&lt;br /&gt;
{{MethodHeader|public native void StopSoundScriptEvent(string soundTrigger)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
&#039;&#039;&#039;soundTrigger&#039;&#039;&#039; = Name of the sound event to start playing, this equates to the &#039;&#039;trigger&#039;&#039; tag of the sound script subcontainer in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 StopSoundScriptEvent(&amp;quot;dayloop&amp;quot;);&lt;br /&gt;
;Notes&lt;br /&gt;
*Terminates a looped sound script previously started with [[#PlaySoundScriptEvent|PlaySoundScriptEvent()]].&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Related Methods==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Categories==&lt;br /&gt;
[[Category:Script Class]]&lt;/div&gt;</summary>
		<author><name>Ciceronmt</name></author>
	</entry>
	<entry>
		<id>https://wiki.trainzsimulator.com/index.php?title=Class_MapObject&amp;diff=25384</id>
		<title>Class MapObject</title>
		<link rel="alternate" type="text/html" href="https://wiki.trainzsimulator.com/index.php?title=Class_MapObject&amp;diff=25384"/>
		<updated>2020-11-21T11:27:37Z</updated>

		<summary type="html">&lt;p&gt;Ciceronmt: /* Methods */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;*[[TrainzScript Language Reference|API Hierarchy]]&lt;br /&gt;
**[[Class GSObject|GSObject]]&lt;br /&gt;
***[[Class GameObject|GameObject]]&lt;br /&gt;
****[[Class PropertyObject|PropertyObject]]&lt;br /&gt;
****[[Class TrainzGameObject|TrainzGameObject]]&lt;br /&gt;
*****[[Class MeshObject|MeshObject]]&lt;br /&gt;
******MapObject&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*This class extends MeshObject to include product queues. &lt;br /&gt;
*A MapObject can have a number of product queues as defined in the queues section of the config.txt file for the asset.&lt;br /&gt;
*The class also provides methods to control particle emissions.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==MapObject Messages==&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
{{TableHeader|width=50%|margin=15px}}&lt;br /&gt;
|-&lt;br /&gt;
|bgcolor=&amp;quot;#EEEEEE&amp;quot;|&#039;&#039;&#039;Major&#039;&#039;&#039;||bgcolor=&amp;quot;#EEEEEE&amp;quot;|&#039;&#039;&#039;Minor&#039;&#039;&#039;||bgcolor=&amp;quot;#EEEEEE&amp;quot;|&#039;&#039;&#039;Source&#039;&#039;&#039;||bgcolor=&amp;quot;#EEEEEE&amp;quot; |&#039;&#039;&#039;Destination&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|[[MapObject Messages|MapObject]]||View-Details||?||MapObject&lt;br /&gt;
|-&lt;br /&gt;
|[[MapObject Messages|MapObject]]||View-Schedule||?||MapObject&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Methods==&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetMapObjectOrientation===&lt;br /&gt;
{{MethodHeader|public native Orientation GetMapObjectOrientation(void)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
= None.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*WorldCoordinate - The current orientation of this MapObject.&lt;br /&gt;
;Syntax&lt;br /&gt;
 GetMapObjectOrientation();&lt;br /&gt;
;Notes&lt;br /&gt;
Returns the absolute orientation of this MapObject. A call to GetMapObjectOrientation() which immediately follows a call to SetMapObjectOrientation() is not guaranteed to return the input orientation, since various other orientation restrictions may be in effect.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetPFXEmitterLifetime===&lt;br /&gt;
{{MethodHeader|public native float GetPFXEmitterLifetime(int id, int phase)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;phase&#039;&#039;&#039; = The phase of the effect, if there is only one phase use zero.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*Value of the lifetime of the effect at the specified phase.&lt;br /&gt;
;Syntax&lt;br /&gt;
 float lifetime GetPFXEmitterLifetime(0,0);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetPFXEmitterMaxRate===&lt;br /&gt;
{{MethodHeader|public native float GetPFXEmitterMaxRate(int id)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*Maximum rate of emissions per second.&lt;br /&gt;
;Syntax&lt;br /&gt;
 float maxRate = GetPFXEmitterMaxRate(0);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetPFXEmitterMaxSize===&lt;br /&gt;
{{MethodHeader|public native float GetPFXEmitterMaxSize(int id, int phase)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;phase&#039;&#039;&#039; = The phase of the effect, if there is only one phase use zero.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*Maximum size of particle at the specified phase.&lt;br /&gt;
;Syntax&lt;br /&gt;
 float maxsize = GetPFXEmitterMinSize();&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetPFXEmitterMinRate===&lt;br /&gt;
{{MethodHeader|public native float GetPFXEmitterMinRate(int id)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*Maximum rate of emissions per second.&lt;br /&gt;
;Syntax&lt;br /&gt;
 float minRtae = GetPFXEmitterMinRate(0);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetPFXEmitterMinSize===&lt;br /&gt;
{{MethodHeader|public native float GetPFXEmitterMinSize(int id, int phase)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;phase&#039;&#039;&#039; = The phase of the effect, if there is only one phase use zero.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*Minimum size of particle at the specified phase.&lt;br /&gt;
;Syntax&lt;br /&gt;
 float minsize = GetPFXEmitterMinSize();&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetPFXEmitterPhysicsDelay===&lt;br /&gt;
{{MethodHeader|public native float GetPFXEmitterPhysicsDelay(int id, int phase)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;phase&#039;&#039;&#039; = The phase of the effect, if there is only one phase use zero.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*Value for the physics delay in emission.&lt;br /&gt;
;Syntax&lt;br /&gt;
 GetPFXEmitterPhysicsDelay(0,0);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetPFXEmitterRate===&lt;br /&gt;
{{MethodHeader|public native float GetPFXEmitterRate(int id, int phase)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;phase&#039;&#039;&#039; = The phase of the effect, if there is only one phase use zero.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*Rate of particle creation per second.&lt;br /&gt;
;Syntax&lt;br /&gt;
 particlesPerSecond = GetPFXEmitterRate(0,0);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetPFXEmitterVelocity===&lt;br /&gt;
{{MethodHeader|public native float GetPFXEmitterVelocity(int id, int phase)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;phase&#039;&#039;&#039; = The phase of the effect, if there is only one phase use zero.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*Velocity in metres per second along the direction vector of emitted particles at the specified phase.&lt;br /&gt;
;Syntax&lt;br /&gt;
 float speed = GetPFXEmitterVelocity(0,0);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetQueue===&lt;br /&gt;
{{MethodHeader|public native ProductQueue GetQueue(string queueName)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
&#039;&#039;&#039;queueName&#039;&#039;&#039; = Name of the product queue to be returned.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*A reference to the queue if possible, null otherwise.&lt;br /&gt;
;Syntax&lt;br /&gt;
 ProductQueue queue = GetQueue(&amp;quot;passengers&amp;quot;);&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetQueues===&lt;br /&gt;
{{MethodHeader|public native ProductQueue[ ] GetQueues(void)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*None&lt;br /&gt;
;Returned Value&lt;br /&gt;
*An array of product queues, if there are no queues the array will be empty.&lt;br /&gt;
;Syntax&lt;br /&gt;
 ProductQueue[] queues = GetQueues();&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===PlaySoundScriptEvent===&lt;br /&gt;
{{MethodHeader|public native void PlaySoundScriptEvent(string soundTrigger)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
&#039;&#039;&#039;soundTrigger&#039;&#039;&#039; = Name of the sound event to start playing, this equates to the &#039;&#039;trigger&#039;&#039; tag of the sound script subcontainer in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 PlaySoundScriptEvent(&amp;quot;dayloop&amp;quot;);&lt;br /&gt;
;Notes&lt;br /&gt;
*Plays the specified sound event from the asset&#039;s SoundScript. &lt;br /&gt;
*SoundScripts are defined as sub-containers in the soundscript container of the asset&#039;s configuration. &lt;br /&gt;
*For details on creating assets with SoundScripts, see [[&amp;quot;Soundscript&amp;quot; container|here]]. &lt;br /&gt;
*This method will start playing the sound. &lt;br /&gt;
*Depending on the SoundScript configuration, the sound will either be played just once or played continuously in a looping cycle such that [[#StopSoundScriptEvent|StopSoundScriptEvent()]] will need to be called to stop it.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetPFXEmitterConeSize===&lt;br /&gt;
{{MethodHeader|public native void SetPFXEmitterConeSize(int id, float x, float y, float z)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;x,y,z&#039;&#039;&#039; = New X,Y and Z components of the particle cone size.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetPFXEmitterConeSize(0,2.0,3.0,2.0);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetPFXEmitterEmitParticles===&lt;br /&gt;
{{MethodHeader|public native void SetPFXEmitterEmitParticles(int id, int number,float time)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;number&#039;&#039;&#039; = The number of particles to emit.&lt;br /&gt;
*&#039;&#039;&#039;time&#039;&#039;&#039; = The time in seconds over which the particles are to be created.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetPFXEmitterEmitParticles(0,100,10.0);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetPFXEmitterEndColor===&lt;br /&gt;
{{MethodHeader|public native void SetPFXEmitterEndColor(int id, int phase, float r, float g, float b, float a)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;phase&#039;&#039;&#039; = The phase of the effect, if there is only one phase use zero.&lt;br /&gt;
*&#039;&#039;&#039;r,g,b&#039;&#039;&#039; = Red, green and blue components of the required color.&lt;br /&gt;
*&#039;&#039;&#039;a&#039;&#039;&#039; = Alpha value of the color.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetPFXEmitterStartColor(0,0,128,128,128,64);&lt;br /&gt;
 SetPFXEmitterStartColor(0,0,0.5,0.5,0.5,0.25);&lt;br /&gt;
;Notes&lt;br /&gt;
*Red, green, blue and alpha may be entered as integer or float values in the ranges 0..255 and 0.0..1.0 respectively.&lt;br /&gt;
*Both of the examples above give the same result.&lt;br /&gt;
*Note that 1,1,1,1 will be interpreted as float input and will produce white, whereas 2,2,2,2 will be interpreted as integers and will give a result which is almost black.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetPFXEmitterLifetime===&lt;br /&gt;
{{MethodHeader|public native void SetPFXEmitterLifetime(int id, int phase, float life)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;phase&#039;&#039;&#039; = The phase of the effect, if there is only one phase use zero.&lt;br /&gt;
*&#039;&#039;&#039;life&#039;&#039;&#039; = The new lifetime of particles in seconds at the specified phase.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetPFXEmitterLifetime(0,0,10);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetPFXEmitterMaxRate===&lt;br /&gt;
{{MethodHeader|public native void SetPFXEmitterMaxRate(int id, float newsize)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;rate&#039;&#039;&#039; = The new maximum rate of emission per second.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetPFXEmitterMaxRate(0,5.0);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetPFXEmitterMaxSize===&lt;br /&gt;
{{MethodHeader|public native void SetPFXEmitterMaxSize(int id, int phase, float newsize)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;phase&#039;&#039;&#039; = The phase of the effect, if there is only one phase use zero.&lt;br /&gt;
*&#039;&#039;&#039;newsize&#039;&#039;&#039; = The new maximum size of particles at the specified phase.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetPFXEmitterMaxSize(0,0,10);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetPFXEmitterMinRate===&lt;br /&gt;
{{MethodHeader|public native void SetPFXEmitterMinRate(int id, float rate)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;rate&#039;&#039;&#039; = The new minimum rate of emission per second.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetPFXEmitterMinRate(0,5.0);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetPFXEmitterMinSize===&lt;br /&gt;
{{MethodHeader|public native void SetPFXEmitterMinSize(int id, int phase, float newsize)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;phase&#039;&#039;&#039; = The phase of the effect, if there is only one phase use zero.&lt;br /&gt;
*&#039;&#039;&#039;newsize&#039;&#039;&#039; = The new minimum size of particles at the specified phase.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetPFXEmitterMinSize(0,0,10);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetPFXEmitterPhysicsDelay===&lt;br /&gt;
{{MethodHeader|public native void SetPFXEmitterPhysicsDelay(int id, int phase, float value)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;phase&#039;&#039;&#039; = The phase of the effect, if there is only one phase use zero.&lt;br /&gt;
*&#039;&#039;&#039;value&#039;&#039;&#039; = The new physics delay value to set for the specified phase.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetPFXEmitterPhysicsDelay(0,0,5.0);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetPFXEmitterRate===&lt;br /&gt;
{{MethodHeader|public native void SetPFXEmitterRate(int id, int phase, float rate)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;phase&#039;&#039;&#039; = The phase of the effect, if there is only one phase use zero.&lt;br /&gt;
*&#039;&#039;&#039;rate&#039;&#039;&#039; = New rate of particle creation per second at the specified phase.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetPFXEmitterRate(0,0,5.0);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetPFXEmitterStartColor===&lt;br /&gt;
{{MethodHeader|public native void SetPFXEmitterStartColor(int id, int phase, float r, float g, float b, float a)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;phase&#039;&#039;&#039; = The phase of the effect, if there is only one phase use zero.&lt;br /&gt;
*&#039;&#039;&#039;r,g,b&#039;&#039;&#039; = Red, green and blue components of the required color.&lt;br /&gt;
*&#039;&#039;&#039;a&#039;&#039;&#039; = Alpha value of the color.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetPFXEmitterStartColor(0,0,128,128,128,64);&lt;br /&gt;
 SetPFXEmitterStartColor(0,0,0.5,0.5,0.5,0.25);&lt;br /&gt;
;Notes&lt;br /&gt;
*Red, green, blue and alpha may be entered as integer or float values in the ranges 0..255 and 0.0..1.0 respectively.&lt;br /&gt;
*Both of the examples above give the same result.&lt;br /&gt;
*Note that 1,1,1,1 will be interpreted as float input and will produce white, whereas 2,2,2,2 will be interpreted as integers and will give a result which is almost black.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetPFXEmitterTexture===&lt;br /&gt;
{{MethodHeader|public native void SetPFXEmitterTexture(int id, KUID textureKUID)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;textureKUID&#039;&#039;&#039; = The kuid of the new texture.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetPFXEmitterTexture(0,&amp;lt;kuid:1234:5678&amp;gt;);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetPFXEmitterVelocity===&lt;br /&gt;
{{MethodHeader|public native void SetPFXEmitterVelocity(int id, int phase, float velocity)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;id&#039;&#039;&#039; = The ID of the particle effect, starting at zero and in the order defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*&#039;&#039;&#039;phase&#039;&#039;&#039; = The phase of the effect, if there is only one phase use zero.&lt;br /&gt;
*&#039;&#039;&#039;velocity&#039;&#039;&#039; = New velocity in metres per second along the direction vector of emitted particles at the specified phase.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetPFXEmitterVelocity(0,0,5.0);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===StopSoundScriptEvent===&lt;br /&gt;
{{MethodHeader|public native void StopSoundScriptEvent(string soundTrigger)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
&#039;&#039;&#039;soundTrigger&#039;&#039;&#039; = Name of the sound event to start playing, this equates to the &#039;&#039;trigger&#039;&#039; tag of the sound script subcontainer in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 StopSoundScriptEvent(&amp;quot;dayloop&amp;quot;);&lt;br /&gt;
;Notes&lt;br /&gt;
*Terminates a looped sound script previously started with [[#PlaySoundScriptEvent|PlaySoundScriptEvent()]].&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Related Methods==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Categories==&lt;br /&gt;
[[Category:Script Class]]&lt;/div&gt;</summary>
		<author><name>Ciceronmt</name></author>
	</entry>
	<entry>
		<id>https://wiki.trainzsimulator.com/index.php?title=Class_World&amp;diff=24590</id>
		<title>Class World</title>
		<link rel="alternate" type="text/html" href="https://wiki.trainzsimulator.com/index.php?title=Class_World&amp;diff=24590"/>
		<updated>2020-10-31T05:33:45Z</updated>

		<summary type="html">&lt;p&gt;Ciceronmt: /* GetTrainzVersion */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;*[[TrainzScript Language Reference|API Hierarchy]]&lt;br /&gt;
**World&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
*World is a static class used to access various aspects of the Trainz environment.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Constants==&lt;br /&gt;
*These constants are used to define various values and can be used as mnenomics.&lt;br /&gt;
*If accessed from scripts the values must be prefixed &#039;&#039;World.&#039;&#039;, for example:&lt;br /&gt;
 World.SetWeather(World.WEATHER_TYPE_LIGHT_SNOW,World.WEATHER_CHANGEABILITY_PERIODIC);&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Camera View Modes===&lt;br /&gt;
----&lt;br /&gt;
*These values can be used either to choose the current camera viewing mode through World.SetCameraMode(), or to restrict certain camera modes from being accessed through methods such as World.SetCamera().&lt;br /&gt;
&lt;br /&gt;
{{TableHeader|width=95%|margin=15px}}&lt;br /&gt;
|width=375|public define int CAMERA_INTERNAL = 1||Internal cabin camera view.&lt;br /&gt;
|-&lt;br /&gt;
|public define int CAMERA_EXTERNAL = 2||External train camera view&lt;br /&gt;
|-&lt;br /&gt;
|public define int CAMERA_TRACKING = 4||External tracking camera view.&lt;br /&gt;
|-&lt;br /&gt;
|public define int CAMERA_ROAMING = 128||Roaming camera view.&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Camera Flags===&lt;br /&gt;
----&lt;br /&gt;
*These flags are used in addition to the Camera Mode Flags to allow or disallow specific camera actions. &lt;br /&gt;
{{TableHeader|width=95%|margin=15px}}&lt;br /&gt;
|width=375|public define int CAMERA_SWITCH_VIEWS = 8||User permitted to swap between the camera views.&lt;br /&gt;
|-&lt;br /&gt;
|public define int CAMERA_SWITCH_VEHICLES = 16||User permitted to swap vehicles within the current train.&lt;br /&gt;
|-&lt;br /&gt;
|public define int CAMERA_SWITCH_TRAINS = 32||User permitted to swap to other trains which are in the consist menu.&lt;br /&gt;
|-&lt;br /&gt;
|public define int CAMERA_LOCKED = 64||User is NOT permitted to adjust camera (i.e. zoom, pan etc.).&lt;br /&gt;
|-&lt;br /&gt;
|public define int CAMERA_NORMAL = * ||Normal camera mode where everything is permitted.&lt;br /&gt;
|-&lt;br /&gt;
|colspan=2|&amp;lt;sup&amp;gt;* NOTE: CAMERA_NORMAL = CAMERA_INTERNAL | CAMERA_EXTERNAL | CAMERA_TRACKING | CAMERA_SWITCH_VIEWS | CAMERA_SWITCH_VEHICLES | CAMERA_SWITCH_TRAINS&amp;lt;/sup&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Weather Type Constants===&lt;br /&gt;
----&lt;br /&gt;
*Define the current state of the weather in Trainz. &lt;br /&gt;
*A variety of weather conditions are supported and can be changed by using one of these values with the World.SetWeather() method. &lt;br /&gt;
{{TableHeader|width=95%|margin=15px}}&lt;br /&gt;
|width=375|public define int WEATHER_TYPE_CLEAR = 0||Clear weather, no clouds, rain or snow.&lt;br /&gt;
|-&lt;br /&gt;
|public define int WEATHER_TYPE_CLOUDY = 1||Cloudy weather, no rain.&lt;br /&gt;
|-&lt;br /&gt;
|public define int WEATHER_TYPE_DRIZZLE = 2||Drizzle, light rain.&lt;br /&gt;
|-&lt;br /&gt;
|public define int WEATHER_TYPE_RAIN = 3||Rainy weather.&lt;br /&gt;
|-&lt;br /&gt;
|public define int WEATHER_TYPE_STORMY = 4||Stormy weather that includes lightning and thunder.&lt;br /&gt;
|-&lt;br /&gt;
|public define int WEATHER_TYPE_LIGHT_SNOW = 5||Snowing lightly.&lt;br /&gt;
|-&lt;br /&gt;
|public define int WEATHER_TYPE_MEDIUM_SNOW = 6||Medium level snow fall.&lt;br /&gt;
|-&lt;br /&gt;
|public define int WEATHER_TYPE_HEAVY_SNOW = 7||Heavy snow fall.&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Weather Changeability Constants===&lt;br /&gt;
----&lt;br /&gt;
*Define the changeability settings for the weather. &lt;br /&gt;
*Weather changeability refers to variability of weather conditions rather than to a specific weather type.&lt;br /&gt;
{{TableHeader|width=95%|margin=15px}}&lt;br /&gt;
|width=375|public define int WEATHER_CHANGEABILITY_NONE = 0||Weather remains static.&lt;br /&gt;
|-&lt;br /&gt;
|public define int WEATHER_CHANGEABILITY_PERIODIC = 1||Periodic changes in weather.&lt;br /&gt;
|-&lt;br /&gt;
|public define int WEATHER_CHANGEABILITY_EXTREME = 2||Extreme and frequent changes in weather. &lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Time Values===&lt;br /&gt;
----&lt;br /&gt;
*Time constants defined in seconds.&lt;br /&gt;
{{TableHeader|width=95%|margin=15px}}&lt;br /&gt;
|width=375|public define float TIME_SECOND = 1.0f||One second.&lt;br /&gt;
|-&lt;br /&gt;
|public define float TIME_MINUTE = TIME_SECOND * 60.0f||One minute, 60.0 seconds.&lt;br /&gt;
|-&lt;br /&gt;
|public define float TIME_HOUR = TIME_MINUTE * 60.0f||One hour, 60.0 minutes, 3600.0 seconds.&lt;br /&gt;
|-&lt;br /&gt;
|public define float TIME_DAY = TIME_HOUR * 24.0f||One day, 24 hours, 1440.0 minutes, 86400.0 seconds.&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Time Rate Constants===&lt;br /&gt;
----&lt;br /&gt;
*Values that define the time rates relative to normal time. &lt;br /&gt;
*These constants can be used to set the time rate that Trainz runs out through the World.SetGameTimeRate() method. &lt;br /&gt;
{{TableHeader|width=95%|margin=15px}}&lt;br /&gt;
|width=375|public define int  TIME_RATE_1X = 0||Real time (i.e. time in Trainz passes at the same rate as in the real world)&lt;br /&gt;
|-&lt;br /&gt;
|public define int TIME_RATE_2X = 1||Time passes at twice normal speed.&lt;br /&gt;
|-&lt;br /&gt;
|public define int TIME_RATE_4X = 2||&lt;br /&gt;
|-&lt;br /&gt;
|public define int TIME_RATE_8X = 3||&lt;br /&gt;
|-&lt;br /&gt;
|public define int TIME_RATE_16X = 4||&lt;br /&gt;
|-&lt;br /&gt;
|public define int TIME_RATE_32X = 5||&lt;br /&gt;
|-&lt;br /&gt;
|public define int TIME_RATE_60X = 6||&lt;br /&gt;
|-&lt;br /&gt;
| public define int TIME_RATE_120X = 7||&lt;br /&gt;
|-&lt;br /&gt;
| public define int TIME_RATE_240X = 8||&lt;br /&gt;
|-&lt;br /&gt;
|public define int TIME_RATE_360X = 9||&lt;br /&gt;
|-&lt;br /&gt;
|public define int TIME_RATE_480X = 10||&lt;br /&gt;
|-&lt;br /&gt;
|public define int TIME_RATE_720X = 11||&lt;br /&gt;
|-&lt;br /&gt;
|public define int TIME_RATE_960X = 12||&lt;br /&gt;
|-&lt;br /&gt;
|public define int TIME_RATE_1200X = 13||&lt;br /&gt;
|-&lt;br /&gt;
|public define int TIME_RATE_1440X = 14||&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Trainz Modules===&lt;br /&gt;
----&lt;br /&gt;
*Trainz module mode constants. &lt;br /&gt;
*These values define the various module environments that Trainz can be in. &lt;br /&gt;
{{TableHeader|width=95%|margin=15px}}&lt;br /&gt;
|width=375|public define int  NO_MODULE = 0||Trainz not running in a module.&lt;br /&gt;
|-&lt;br /&gt;
|public define int SURVEYOR_MODULE = 1||Trainz is currently running in Surveyor.&lt;br /&gt;
|-&lt;br /&gt;
|public define int DRIVER_MODULE = 2||Trainz is currently running in Driver.&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
==Related Messages==&lt;br /&gt;
* [[TrainzScript Message Reference]]&amp;lt;br&amp;gt;&lt;br /&gt;
* [[Camera Messages]]&amp;lt;br&amp;gt;&lt;br /&gt;
* [[Interface Messages]]&amp;lt;br&amp;gt;&lt;br /&gt;
* [[ModuleInit Message]]&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==AddDriverCharacter==&lt;br /&gt;
{{MethodHeader|public native DriverCharacter AddDriverCharacter(Asset driverCharacterAsset)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;driverCharacterAsset&#039;&#039;&#039; = Asset containing character to be added.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*Reference to the DriverCharacter if successful, null otherwise.&lt;br /&gt;
;Syntax&lt;br /&gt;
 DriverCharacter Casey = World.AddDriverCharacter(CaseyJones);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==AddDriverCommand==&lt;br /&gt;
{{MethodHeader|public native DriverCommand AddDriverCommand(Asset driverCommandAsset)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;driverCommandAsset&#039;&#039;&#039; = Asset containing command to be added.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*Reference to the DriverCommand if successful, null otherwise.&lt;br /&gt;
;Syntax&lt;br /&gt;
 DriverCommand GoFaster = World.AddDriverCommand(accelerate);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==CreateBehavior==&lt;br /&gt;
{{MethodHeader|public native ScenarioBehavior CreateBehavior(KUID kuid, Soup initialProperties)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;kuid&#039;&#039;&#039; = KUID of scenario.&lt;br /&gt;
&#039;&#039;&#039;initialProperties&#039;&#039;&#039; = Soup object containing initial properties for scenario.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*Reference to the ScenarioBehavior created if successful, null otherwise.&lt;br /&gt;
;Syntax&lt;br /&gt;
 ScenarioBehavior scenario = World.CreateBehavior(scenarioAsset, scenarioSoup);&lt;br /&gt;
;Notes&lt;br /&gt;
*The returned ScenarioBehavior object may be ended by releasing all references to it (resetting all references to null).&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==CreateTrain==&lt;br /&gt;
{{MethodHeader|public native Train CreateTrain(KUID[ ] consist, string trackmarkName, bool direction)&amp;lt;br&amp;gt;public native Train CreateTrain(KUID[ ] consist, TrackMark trackmark, bool direction)&amp;lt;br&amp;gt;public native Train CreateTrain(KUID[ ] consist, Buildable buildable, string trackName, float position, bool direction)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;consist&#039;&#039;&#039; = An array of vehicle KUIDs used to describe the required Train object.&lt;br /&gt;
*&#039;&#039;&#039;trackmarkName&#039;&#039;&#039; = Name of Trackmark at which the consist is to be formed.&lt;br /&gt;
*&#039;&#039;&#039;buildable&#039;&#039;&#039; = Buildable on which the consist is to be formed.&lt;br /&gt;
*&#039;&#039;&#039;trackName&#039;&#039;&#039; = Name of track within Buildable object.&lt;br /&gt;
*&#039;&#039;&#039;position&#039;&#039;&#039; = Distance at which the Train is to be placed relative to the start of the track.&lt;br /&gt;
*&#039;&#039;&#039;trackmark&#039;&#039;&#039; = Reference to Trackmark at which the consist is to be formed.&lt;br /&gt;
*&#039;&#039;&#039;direction&#039;&#039;&#039; = Orientation of Train relative to direction of track or trackmark.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*Reference to the Train created if successful, null otherwise.&lt;br /&gt;
;Syntax&lt;br /&gt;
 Train train = World.CreateTrain(consist, buildable, &amp;quot;Track 1&amp;quot;, 10.0, true);&lt;br /&gt;
;Notes&lt;br /&gt;
*These methods create a train from a list of vehicles in a consist array.&lt;br /&gt;
*Depending on the variant of the method used, the train can be created at a Trackmark, specified by name or reference, or at a Buildable or Industry object.&lt;br /&gt;
*It is the responsibility of the script programmer to ensure that sufficient track exists at the given location to allow the train to be created.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==DeleteTrain==&lt;br /&gt;
{{MethodHeader|public native void DeleteTrain(Train train)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;train&#039;&#039;&#039; = train to be deleted from map.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 World.DeleteTrain(flyingScotsman);&lt;br /&gt;
;Notes&lt;br /&gt;
*Once a train has been deleted, care should be taken to avoid using its reference.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==DeleteVehicle==&lt;br /&gt;
{{MethodHeader|public native void DeleteVehicle(Vehicle vehicle)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;vehicle&#039;&#039;&#039; = vehicle to be deleted from its train.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 World.DeleteVehicle(vehicles[vehicles.size()-1]);&lt;br /&gt;
;Notes&lt;br /&gt;
*Use Train.GetVehicles() to obtain an array of vehicles for a given train.&lt;br /&gt;
*Use Vehicle.GetMyTrain() to obtain a train reference for a given vehicle.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==FindAsset==&lt;br /&gt;
{{MethodHeader|public native Asset FindAsset(KUID kuid)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;kuid&#039;&#039;&#039; = KUID of Asset to return.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*Given a valid KUID parameter, this method return an Asset reference if successful, null otherwise.&lt;br /&gt;
;Syntax&lt;br /&gt;
 Asset asset = World.FindAsset(kuid);&lt;br /&gt;
;Notes&lt;br /&gt;
*See also Asset.FindAsset()&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==FindDriverCommand==&lt;br /&gt;
{{MethodHeader|public native DriverCommand FindDriverCommand(Asset driverCommandAsset)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;driverCommandAsset&#039;&#039;&#039; = Asset containing command to be added.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*Reference to the DriverCommand if successful, null otherwise.&lt;br /&gt;
;Syntax&lt;br /&gt;
 DriverCommand GoFaster = World.FindDriverCommand(accelerate);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==GetAssetList==&lt;br /&gt;
{{MethodHeader|public native Asset[ ] GetAssetList(string kind)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;kind&#039;&#039;&#039; = String representing the Kind of asset to return.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*A list of all assets of the given &#039;&#039;kind&#039;&#039;&lt;br /&gt;
;Syntax&lt;br /&gt;
 Asset[] Libraries = World.GetAssetList(&amp;quot;Library&amp;quot;);&lt;br /&gt;
;Notes&lt;br /&gt;
*All installed assets of the given &#039;&#039;kind&#039;&#039; are returned, irrespective of whether or not they are in use on the current map.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==GetBadWeatherFog==&lt;br /&gt;
{{MethodHeader|public native float GetBadWeatherFog(void)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*None&lt;br /&gt;
;Returned Value&lt;br /&gt;
*Bad weather fog distance as a float in the range 0.0..1.0.&lt;br /&gt;
;Syntax&lt;br /&gt;
 float dist = World.GetBadWeatherFog();&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==GetBehaviors==&lt;br /&gt;
{{MethodHeader|public native ScenarioBehavior[ ] GetBehaviors(void)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*None&lt;br /&gt;
;Returned Value&lt;br /&gt;
*A list of top-level behaviors or rules on the currently loaded route.&lt;br /&gt;
;Syntax&lt;br /&gt;
 ScenarioBehavior[] rules = World.GetBehaviors();&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==GetCameraPositionX==&lt;br /&gt;
{{MethodHeader|public native float GetCameraPositionX(void)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*None&lt;br /&gt;
;Returned Value&lt;br /&gt;
*X Coordinate of the current camera position.&lt;br /&gt;
;Syntax&lt;br /&gt;
 float X = World.GetCameraPositionX();&lt;br /&gt;
*Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==GetCameraPositionY==&lt;br /&gt;
{{MethodHeader|public native float GetCameraPositionY(void)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*None&lt;br /&gt;
;Returned Value&lt;br /&gt;
*Y Coordinate of the current camera position.&lt;br /&gt;
;Syntax&lt;br /&gt;
 float Y = World.GetCameraPositionY();&lt;br /&gt;
*Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==GetCameraPositionZ==&lt;br /&gt;
{{MethodHeader|public native float GetCameraPositionZ(void)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*None&lt;br /&gt;
;Returned Value&lt;br /&gt;
*Z Coordinate of the current camera position.&lt;br /&gt;
;Syntax&lt;br /&gt;
 float Z = World.GetCameraPositionZ();&lt;br /&gt;
*Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==GetCurrentModule==&lt;br /&gt;
{{MethodHeader|public native int GetCurrentModule(void)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*None&lt;br /&gt;
;Returned Value&lt;br /&gt;
*An integer representing the current Trainz module.&lt;br /&gt;
;Syntax&lt;br /&gt;
 int module = World.GetCurrentModule();&lt;br /&gt;
;Notes&lt;br /&gt;
* See [[#Trainz Modules|Trainz Modules]] for details of the constants associated with this method. &lt;br /&gt;
* See [[ModuleInit Message]] for further details.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==GetDriverCharacterList==&lt;br /&gt;
{{MethodHeader|public native DriverCharacter[ ] GetDriverCharacterList(void)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*None&lt;br /&gt;
;Returned Value&lt;br /&gt;
*An array of DriverCharacter objects installed in the current world.&lt;br /&gt;
;Syntax&lt;br /&gt;
 DriverCharacter[] drivers = World.GetDriverCharacterList();&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==GetDriverCommandList==&lt;br /&gt;
{{MethodHeader|public native DriverCommand[ ] GetDriverCommandList(void)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*None&lt;br /&gt;
;Returned Value&lt;br /&gt;
*An array of DriverCommand objects installed in the current world.&lt;br /&gt;
;Syntax&lt;br /&gt;
 DriverCommand[] commands = World.GetDriverCommandList();&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==GetGameTime==&lt;br /&gt;
{{MethodHeader|public native float GetGameTime(void)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*None&lt;br /&gt;
;Returned value&lt;br /&gt;
*Current game time.&lt;br /&gt;
;Syntax&lt;br /&gt;
 float Now = World.GetGameTime();&lt;br /&gt;
;Notes&lt;br /&gt;
*The returned time is normalised to a value between 0.0 and 1.0&lt;br /&gt;
*0.0 = midday.&lt;br /&gt;
*0.5 = midnight&lt;br /&gt;
*Use the [[#Time_Values|Time Value]] constants to convert the normalised values to human readable times.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==GetGoodWeatherFog==&lt;br /&gt;
{{MethodHeader|public native float GetGoodWeatherFog(void)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*None&lt;br /&gt;
;Returned Value&lt;br /&gt;
*Good weather fog distance as a float in the range 0.0..1.0.&lt;br /&gt;
;Syntax&lt;br /&gt;
 float dist = World.GetGoodWeatherFog();&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==GetGroundDrawDistance==&lt;br /&gt;
{{MethodHeader|public native float GetGroundDrawDistance(void)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*None&lt;br /&gt;
;Returned Value&lt;br /&gt;
*Ground draw distance in metres.&lt;br /&gt;
;Syntax&lt;br /&gt;
 float dist = World.GetGroundDrawDistance();&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==GetIndustryList==&lt;br /&gt;
{{MethodHeader|public native GameObject[ ] GetIndustryList(void)}}&lt;br /&gt;
;Parameters &lt;br /&gt;
*None&lt;br /&gt;
;Returned Value&lt;br /&gt;
*An array of references to all of the Industry objects for the current route.&lt;br /&gt;
;Syntax&lt;br /&gt;
 GameObject[] Industries = World.GetIndustryList();&lt;br /&gt;
;Notes&lt;br /&gt;
*This function is obsolete and should not be used.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==GetJunctionList==&lt;br /&gt;
{{MethodHeader|public native Junction[ ] GetJunctionList(void)}}&lt;br /&gt;
;Parameters &lt;br /&gt;
*None&lt;br /&gt;
;Returned Value&lt;br /&gt;
*An array of references to all of the trackside junction objects for the current route.&lt;br /&gt;
;Syntax&lt;br /&gt;
 Junction[] junctions = World.GetJunctionList();&lt;br /&gt;
;Notes&lt;br /&gt;
*This function is obsolete and should not be used.&lt;br /&gt;
*Junction objects attached to fixed track junctions are not returned by this method.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==GetLibrary==&lt;br /&gt;
{{MethodHeader|public native Library GetLibrary(KUID kuid)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;kuid&#039;&#039;&#039; = KUID of script library asset to load.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*A reference to the script library asset if successful, null otherwise.&lt;br /&gt;
;Syntax&lt;br /&gt;
 Library codelib = World.GetLibrary(LibraryKUID);&lt;br /&gt;
;Notes&lt;br /&gt;
*The [[Class Library|Library]] asset is initialised when this method is first called in a session.&lt;br /&gt;
*Since only one instance can exist, subsequent calls return a reference to the existing Library object.&lt;br /&gt;
*See [[Class Library|Library]] for notes on how to use this method.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==GetSceneryDrawDistance==&lt;br /&gt;
{{MethodHeader|public native float GetSceneryDrawDistance(void)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*None&lt;br /&gt;
;Returned Value&lt;br /&gt;
*Undefined.&lt;br /&gt;
;Notes&lt;br /&gt;
*Included for legacy script compatibility only. Has no effect.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==GetSeconds==&lt;br /&gt;
{{MethodHeader|public native float GetSeconds(void)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*None&lt;br /&gt;
;Returned Value&lt;br /&gt;
*The current value of a floating point number incrementing once per second in real time.&lt;br /&gt;
;Syntax&lt;br /&gt;
 float start = World.GetSeconds();&lt;br /&gt;
 // do stuff&lt;br /&gt;
 float finish = World.GetSeconds();&lt;br /&gt;
 float period = finish - start;&lt;br /&gt;
;Notes&lt;br /&gt;
*Each call will return a float value containing the current value of an internal counter.&lt;br /&gt;
*Subtracting a later value from a value saved at an earlier call will enable the delay between the two calls to be established.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==GetSignalList==&lt;br /&gt;
{{MethodHeader|public native Signal[ ] GetSignalList(void)}}&lt;br /&gt;
;Parameters &lt;br /&gt;
*None&lt;br /&gt;
;Returned Value&lt;br /&gt;
*An array of references to all of the signal objects for the current route.&lt;br /&gt;
;Syntax&lt;br /&gt;
 Signal[] signals = World.GetSignalList();&lt;br /&gt;
;Notes&lt;br /&gt;
*This function is obsolete and should not be used.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==GetStringTable==&lt;br /&gt;
{{MethodHeader|public native StringTable GetStringTable(void)}}&lt;br /&gt;
;Parameters &lt;br /&gt;
*None&lt;br /&gt;
;Returned Value&lt;br /&gt;
*The StringTable for the current session.&lt;br /&gt;
;Syntax&lt;br /&gt;
 StringTable data = World.GetStringTable();&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==GetSurveyorSavedConsist==&lt;br /&gt;
{{MethodHeader|public native Soup GetSurveyorSavedConsistList(string name)}}&lt;br /&gt;
;Parameters &lt;br /&gt;
*&#039;&#039;&#039;name&#039;&#039;&#039; = Name of the consist to retireiev.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*Returns a Soup definition of the named consist if it exists, null otherwise.&lt;br /&gt;
;Syntax&lt;br /&gt;
 Soup consist = World.GetSurveyorSavedConsist(&amp;quot;Brighton Belle&amp;quot;);&lt;br /&gt;
;Notes&lt;br /&gt;
*Remember that the returned data is in a Soup format, which is not the same thing as a Train. &lt;br /&gt;
*TrainUtil.CreateTrainFormSoup() can be used to create a train from the returned Soup.&lt;br /&gt;
*This method only works in Surveyor.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==GetSurveyorSavedConsistList==&lt;br /&gt;
{{MethodHeader|public native string[ ] GetSurveyorSavedConsistList()}}&lt;br /&gt;
;Parameters &lt;br /&gt;
*None&lt;br /&gt;
;Returned Value&lt;br /&gt;
*An array of names of all the saved consist objects in Surveyor.&lt;br /&gt;
;Syntax&lt;br /&gt;
 string[] consists = World.GetSurveyorSavedConsistList();&lt;br /&gt;
;Notes&lt;br /&gt;
*This method only works in Surveyor.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==GetTrackmarkList==&lt;br /&gt;
{{MethodHeader|public native TrackMark[ ] GetTrackmarkList(void)}}&lt;br /&gt;
;Parameters &lt;br /&gt;
*None&lt;br /&gt;
;Returned Value&lt;br /&gt;
*An array of references to all of the trackmark objects for the current route.&lt;br /&gt;
;Syntax&lt;br /&gt;
 Trackmark[] trackmarks = World.GetTrackmarkList();&lt;br /&gt;
;Notes&lt;br /&gt;
*This function is obsolete and should not be used.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==GetTrainList==&lt;br /&gt;
{{MethodHeader|public native Train[ ] GetTrainList(void)}}&lt;br /&gt;
;Parameters &lt;br /&gt;
*None&lt;br /&gt;
;Returned Value&lt;br /&gt;
*An array of references to all of the trains for the current route.&lt;br /&gt;
;Syntax&lt;br /&gt;
 Train[] trains = World.GetTrainList();&lt;br /&gt;
;Notes&lt;br /&gt;
*This function is obsolete and should not be used.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==GetTrainzBuild==&lt;br /&gt;
{{MethodHeader|public native int GetTrainzBuild(void)}}&lt;br /&gt;
;Parameters;&lt;br /&gt;
*None&lt;br /&gt;
;Returned Value&lt;br /&gt;
*Gets the current build number of Trainz. &lt;br /&gt;
;Syntax&lt;br /&gt;
 int build = World.GetTrainzBuild();&lt;br /&gt;
;Notes&lt;br /&gt;
*The value returned corresponds to the build number you can see in the bottom-right side of the main Trainz menu screen.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==GetTrainzVersion==&lt;br /&gt;
{{MethodHeader|public native float GetTrainzVersion(void)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*None&lt;br /&gt;
;Returned Value&lt;br /&gt;
*The TRS version number.&lt;br /&gt;
;Syntax&lt;br /&gt;
 float version = World.GetTrainzVersion();&lt;br /&gt;
;Notes&lt;br /&gt;
*The value returned corresponds to the version number of Content manager (for example 4.6). &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==GetTriggerList==&lt;br /&gt;
{{MethodHeader|public native Trigger[ ] GetTriggerList(void)}}&lt;br /&gt;
;Parameters &lt;br /&gt;
*None&lt;br /&gt;
;Returned Value&lt;br /&gt;
*An array of references to all of the trigger objects for the current route.&lt;br /&gt;
;Syntax&lt;br /&gt;
 Trigger[] triggers = World.GetTriggerList();&lt;br /&gt;
;Notes&lt;br /&gt;
*This function is obsolete and should not be used.&lt;br /&gt;
*This method does not return scenery triggers, ie those attached to SceneryWithTrack objects and their descendants.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==GetVehicleList==&lt;br /&gt;
{{MethodHeader|public native Vehicle[ ] GetVehicleList(void)}}&lt;br /&gt;
;Parameters &lt;br /&gt;
*None&lt;br /&gt;
;Returned Value&lt;br /&gt;
*An array of references to all of the vehicles in the current route.&lt;br /&gt;
;Syntax&lt;br /&gt;
 Vehicle[] vehicles = World.GetVehicleList();&lt;br /&gt;
;Notes&lt;br /&gt;
*This function is obsolete and should not be used.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==GetWeatherChangeability==&lt;br /&gt;
{{MethodHeader|public native int GetWeatherChangeability(void)}}&lt;br /&gt;
;Parameter&lt;br /&gt;
*None&lt;br /&gt;
;Returned Value&lt;br /&gt;
*One of the [[#Weather_Changeability_Constants|Weather Changeability Constants]] denoting the variability of weather conditions.&lt;br /&gt;
;Syntax&lt;br /&gt;
 int variability = World.GetWeatherChangeability();&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==GetWeatherType==&lt;br /&gt;
{{MethodHeader|public native int GetWeatherType(void)}}&lt;br /&gt;
;Parameter&lt;br /&gt;
*None&lt;br /&gt;
;Returned Value&lt;br /&gt;
*One of the [[#Weather_Type_Constants|Weather Type Constants]] denoting the current weather conditions.&lt;br /&gt;
;Syntax&lt;br /&gt;
 int weather = World.GetWeatherType();&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==LoadMap==&lt;br /&gt;
{{MethodHeader|public native bool LoadMap(KUID kuid)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;kuid&#039;&#039;&#039; = KUID of map to load.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*True if successful, false otherwise.&lt;br /&gt;
;Syntax&lt;br /&gt;
 if (World.LoadMap(mapKUID) Interface.Print(&amp;quot;Map loaded OK&amp;quot;);&lt;br /&gt;
 else Interface.Print(&amp;quot;Map load failed&amp;quot;);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Play2DSound==&lt;br /&gt;
{{MethodHeader|public float Play2DSound(Asset asset, string wave)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;asset&#039;&#039;&#039; = Asset where the sound file is located.&lt;br /&gt;
*&#039;&#039;&#039;wave&#039;&#039;&#039; = Name of the &#039;&#039;*.wav&#039;&#039; file to be played, a relative path can be included.&lt;br /&gt;
;Returned Value&lt;br /&gt;
* Undefined.&lt;br /&gt;
;Syntax&lt;br /&gt;
 // Play the sound and continues script execution.&lt;br /&gt;
    World.Play2DSound(soundAsset,&amp;quot;sounds/allaboard.wav&amp;quot;);        &lt;br /&gt;
 // Wait until sound has completed before continuing (pre-TS12 only!)&lt;br /&gt;
    Sleep(World.Play2DSound(soundAsset,&amp;quot;sounds/allaboard.wav&amp;quot;)); &lt;br /&gt;
;Notes&lt;br /&gt;
*Plays a &#039;&#039;.wav&amp;quot; sound file from the given asset&#039;s folder.&lt;br /&gt;
*The sound is non directional and can be mono or stereo. &lt;br /&gt;
*This method does not return after the sound has finished playing, it returns with the length of the sound as soon as it is called. &lt;br /&gt;
*This means your code will keep on executing while Trainz is playing the sound.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==PlaySound==&lt;br /&gt;
{{MethodHeader|public native float PlaySound&amp;lt;br&amp;gt;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;(Asset asset, string wave, float vol, float near, float far, GameObject target, string pt)&amp;lt;br&amp;gt;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;(Asset asset, string wave, float vol, float near, float far, GameObject target, string pt, bool loop)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;asset&#039;&#039;&#039; = Asset where the sound file is located.&lt;br /&gt;
*&#039;&#039;&#039;wave&#039;&#039;&#039; = Name of the &#039;&#039;*.wav&#039;&#039; file to be played, a relative path can be included.&lt;br /&gt;
*&#039;&#039;&#039;vol&#039;&#039;&#039; = Volume level to play the sound at (0 to 1)&amp;lt;- These values taken from TRS2019 world.gs file comments&lt;br /&gt;
*&#039;&#039;&#039;near&#039;&#039;&#039; = Distance from the target asset at which the sound will be played at maximum volume.&lt;br /&gt;
*&#039;&#039;&#039;far&#039;&#039;&#039; = Distance from the target asset at which the sound will become inaudible.&lt;br /&gt;
*&#039;&#039;&#039;target&#039;&#039;&#039; = GameObject to which the sound will be attached if a 3d sound is required, null for 2D.&lt;br /&gt;
*&#039;&#039;&#039;pt&#039;&#039;&#039; = Name of attachment point in the target object if a 3d sound is required, null for 2D.&lt;br /&gt;
*&#039;&#039;&#039;loop&#039;&#039;&#039; = (Optional) If true the sound will loop continuously.&lt;br /&gt;
;Returned Value&lt;br /&gt;
* Sound length in seconds for Trainz before TS12&lt;br /&gt;
* Undefined for TS12 and TANE&lt;br /&gt;
;Syntax&lt;br /&gt;
 // Play the sound and continues script execution.&lt;br /&gt;
    World.PlaySound(soundAsset,&amp;quot;sounds/allaboard.wav&amp;quot;,1.0,10.0,100.0,Station,&amp;quot;a.loudspeaker&amp;quot;);     &lt;br /&gt;
 // Wait until sound has completed before continuing (pre-TS12 only!)&lt;br /&gt;
    Sleep(World.PlaySound(soundAsset,&amp;quot;sounds/allaboard.wav&amp;quot;,1000.0,10.0,100.0,Station,&amp;quot;a.loudspeaker&amp;quot;);     &lt;br /&gt;
;Notes&lt;br /&gt;
*Plays a &#039;&#039;.wav&#039;&#039; sound file from the given asset&#039;s folder.&lt;br /&gt;
*If the sound is to be directional a mono sound file is required. &lt;br /&gt;
*This method does not return after the sound has finished playing: it returns as soon as it is called. &lt;br /&gt;
*This means your code will keep on executing while Trainz is playing the sound.&lt;br /&gt;
*If you want to wait for the sound to complete playing before moving on, wrap the PlaySound() call up in a Sleep() call. &#039;&#039;&#039;Note!&#039;&#039;&#039; This works only in Trainz versions before TS12. For newer versions, TS12 and TANE, you can hard-code the duration of the sound, or store it in the extensions container of the config.txt file.&lt;br /&gt;
*The sound volume will be at a maximum for a camera position at or less than the value of the &#039;&#039;near&#039;&#039; parameter and will reduce with distance until the hearing position reaches &#039;&#039;far&#039;&#039;, when the sound will be inaudible.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==RemoveDriverCharacter==&lt;br /&gt;
{{MethodHeader|public native void RemoveDriverCharacter(DriverCharacter driver)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;driver&#039;&#039;&#039; = DriverCharacter to remove.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 World.RemoveDriverCharacter(dave);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==RemoveDriverCommand==&lt;br /&gt;
{{MethodHeader|public native void RemoveDriverCommand(DriverCommand command)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;command&#039;&#039;&#039; = DriverCommand to remove.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 World.RemoveDriverCommand(driverCommand);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==SetBadWeatherFog==&lt;br /&gt;
{{MethodHeader|public native void SetBadWeatherFog(float distance)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;distance&#039;&#039;&#039; = Bad weather fog distance to set.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 World.SetBadWeatherFog(0.5);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==SetCamera==&lt;br /&gt;
{{MethodHeader|public native bool SetCamera(MapObject focus)&amp;lt;br&amp;gt;public native void SetCamera(Junction focus)&amp;lt;br&amp;gt;public native void SetCamera(Vehicle focus, int cameraMode)&amp;lt;br&amp;gt;public native void SetCamera(Train focus, int cameraMode)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;focus&#039;&#039;&#039; = Object on which the camera is to be focused.&lt;br /&gt;
*&#039;&#039;cameraMode&#039;&#039;&#039; = One of the [[#Camera_View_Modes|Camera View Mode]] constants defining the view which should be assigned to the camera.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*The first variant returns a boolean to indicate success or failure.&lt;br /&gt;
*Remaining variants do not return a value&lt;br /&gt;
&#039;Syntax&lt;br /&gt;
 World.SetCamera(train.GetVehicles[0],World.CAMERA_TRACKING); // sets the camera to track the first vehicle in the train.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==SetCameraAngle==&lt;br /&gt;
{{MethodHeader|public void SetCameraAngle(int yaw, int pitch, float radius)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;yaw&#039;&#039;&#039; = Camera rotation in degrees, 90 is a direct front view.&lt;br /&gt;
*&#039;&#039;&#039;pitch&#039;&#039;&#039; = Camera angle relative to the horizon, 0 is horizontal, 90 points vertically upwards.&lt;br /&gt;
*&#039;&#039;&#039;radius&#039;&#039;&#039; = Distance in metres to the object in focus.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 World.SetCameraAngle(90,0,25); // Sets the camera to a direct frontal view at 25 metres from the currently focused object.&lt;br /&gt;
;Notes&lt;br /&gt;
*&#039;&#039;Radius&#039;&#039; is measured from the object origin point (0,0,0).&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==SetCameraFlags==&lt;br /&gt;
{{MethodHeader|public native void SetCameraFlags(int flags)}}&lt;br /&gt;
;Parameter&lt;br /&gt;
*&#039;&#039;&#039;flags&#039;&#039;&#039;  integer value defining what the user is permitted to do with the game camera.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 // User is permitted to select External or Tracking views only.&lt;br /&gt;
    World.SetCameraFlags(World.CAMERA_EXTERNAL | World.CAMERA_TRACKING);&lt;br /&gt;
;Notes&lt;br /&gt;
*Use any combination of [[#Camera_Flags|Camera Flags]] and [[#Camera_View_Modes|Camera View Modes]] to set the parameter.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==SetCameraMode==&lt;br /&gt;
{{MethodHeader|public void SetCameraMode(int mode)}}&lt;br /&gt;
;Parameter&lt;br /&gt;
*&#039;&#039;&#039;mode&#039;&#039;&#039; = Camera mode to select.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 World.SetCameraMode(World.CAMERA_TRACKING);&lt;br /&gt;
;Notes&lt;br /&gt;
*Use one of the [[#Camera_View_Modes|Camera View Modes]] to set the parameter.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==SetGameTime==&lt;br /&gt;
{{MethodHeader|public void SetGameTime(float time)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;time&#039;&#039;&#039; = new gane time to set.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 World.SetGameTime(0.5);  // sets time to midnight&lt;br /&gt;
;Notes&lt;br /&gt;
*Game time is normalised to a value between 0.0 and 1.0&lt;br /&gt;
*0.0 = midday.&lt;br /&gt;
*0.5 = midnight&lt;br /&gt;
*Use the [[#Time_Values|Time Value]] constants to convert human readable times to normalised values. &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==SetGameTimeRate==&lt;br /&gt;
{{MethodHeader|public native void SetGameTimeRate(float rate)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;rate&#039;&#039;&#039; = New time rate to set.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 World.SetGameTimeRate(World.TIME_RATE_8X); // sets game time to advance by 8 minutes per minute of real world time.&lt;br /&gt;
;Notes&lt;br /&gt;
*Use one of the [[#Time_Rate_Constants|Time Rate Constants]] to define the parameter.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==SetGoodWeatherFog==&lt;br /&gt;
{{MethodHeader|public native void SetGoodWeatherFog(float distance)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;distance&#039;&#039;&#039; = Good weather fog distance to set.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 World.SetGoodWeatherFog(0.5);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==SetGroundDrawDistance==&lt;br /&gt;
{{MethodHeader|public native void SetGroundDrawDistance(float distance)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;distance&#039;&#039;&#039; = Ground draw distance in metres.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 World.SetGroundDrawDistance(1000.0);&lt;br /&gt;
;Notes&lt;br /&gt;
*Compatibility warning: Use of this function is not recommended, it may become non-functional in future Trainz versions.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==SetSceneryDrawDistance==&lt;br /&gt;
{{MethodHeader|public native void SetSceneryDrawDistance(float distance)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;distance&#039;&#039;&#039; = unused.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Notes&lt;br /&gt;
* Does nothing. Included for script compatibility only.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==SetTargetObserver==&lt;br /&gt;
{{MethodHeader|public void SetTargetObserver(GameObject observer)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;observer&#039;&#039;&#039; = The game object to receive targeting messages.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetTargetObserver(self);&lt;br /&gt;
;Notes&lt;br /&gt;
* Causes the specified object to receive &amp;quot;Track&amp;quot;, &amp;quot;LeftClick&amp;quot; messages when a track is clicked. Causes the specified object to receive &amp;quot;Interface-Event&amp;quot;, &amp;quot;Left-Click&amp;quot; messages when a targetable MapObject is clicked. May cause the functionality of a left mouse click to change from what the user is expecting, so should be used with caution. Used in modal scripts to allow the user to indicate a location for train placement, etc. As there is only a single observer at any given time, the script must take care to only call this function when entering placement mode at the user&#039;s request.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==SetWeather==&lt;br /&gt;
{{MethodHeader|public native void SetWeather(int type, int changeability)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;type&#039;&#039;&#039; = Weather conditions as defined by one of the [[#Weather_Type_Constants|Weather Type Constants]].&lt;br /&gt;
*&#039;&#039;&#039;change&#039;&#039;&#039; = Weather variation as defined by one of the [[#Weather_Changeability_Constants|Weather Changeability Constants]].&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 World.SetWeather(World.WEATHER_TYPE_HEAVY_SNOW,World.WEATHER_CHANGEABILITY_EXTREME); // April in Paris.&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==UserSetCamera==&lt;br /&gt;
{{MethodHeader|public native bool UserSetCamera(GameObject target)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;target&#039;&#039;&#039; = GameObject to set focus to.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*True if successful, false otherwise.&lt;br /&gt;
;Syntax&lt;br /&gt;
 World.UserSetCamera(Router,GetGameObject(&amp;quot;Junction 5&amp;quot;));&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==UserSetCameraMode==&lt;br /&gt;
{{MethodHeader|public native void UserSetCameraMode(int mode)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;mode&#039;&#039;&#039; = One of the [[#Camera_View_Modes|Camera View Modes]]&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 World.UserSetCameraMode(World.CAMERA_ROAMING);  // switches to roaming view if permitted.&lt;br /&gt;
;Notes&lt;br /&gt;
*This method respects the current [[#Camera_Flags|Camera Flag]] settings, disallowing any change which the flags do not permit.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Categories==&lt;br /&gt;
[[Category:Script Class]]&lt;/div&gt;</summary>
		<author><name>Ciceronmt</name></author>
	</entry>
	<entry>
		<id>https://wiki.trainzsimulator.com/index.php?title=Class_MeshObject&amp;diff=24280</id>
		<title>Class MeshObject</title>
		<link rel="alternate" type="text/html" href="https://wiki.trainzsimulator.com/index.php?title=Class_MeshObject&amp;diff=24280"/>
		<updated>2020-10-04T10:36:35Z</updated>

		<summary type="html">&lt;p&gt;Ciceronmt: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;*[[TrainzScript Language Reference|API Hierarchy]]&lt;br /&gt;
**[[Class GSObject|GSObject]]&lt;br /&gt;
***[[Class GameObject|GameObject]]&lt;br /&gt;
****[[Class PropertyObject|PropertyObject]]&lt;br /&gt;
****[[Class TrainzGameObject|TrainzGameObject]]&lt;br /&gt;
*****MeshObject&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is a base class for [[class Asset|Asset]] based game objects that have meshes, effects, animations and particles. Interface methods to deal with these are provided so things like showing or hiding a mesh, attaching a mesh to an attachment point or controlling an animation can be done from a script.&lt;br /&gt;
&lt;br /&gt;
For animation Trainz interpolates between key frames. This means an intermediate animation frame is calculated dynamically to be-in-synch with the game&#039;s framerate.&lt;br /&gt;
&lt;br /&gt;
Trainzscript is an interpreted scripting language intended to be used to monitor and react to events in the Trainz world, not to perform sophisticated real-time animation tasks. Using a script to start an animation in response to an event in a thread is reasonable. However trying to control animation tightly down to short intervals is likely to provide unsatisfactory results and to adversely affect overall performance of the game.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==MeshObject Messages==&lt;br /&gt;
Messages related to MeshObject assets:&lt;br /&gt;
*[[Animation-Event Message]]&lt;br /&gt;
*[[pfx Message]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==GetFXAttachment==&lt;br /&gt;
{{MethodHeader|public native MeshObject GetFXAttachment(string effect)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;effect&#039;&#039;&#039; = name of the mesh effect to query. &lt;br /&gt;
;Returned Value&lt;br /&gt;
*Returns a reference to the MeshObject currently attached to the named effect.&lt;br /&gt;
;Syntax&lt;br /&gt;
 MeshObject attachment = GetFXAttachment(&amp;quot;coupler&amp;quot;);&lt;br /&gt;
;Notes&lt;br /&gt;
*The method returns null if the effect is unoccupied.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==GetMeshAnimationFrame==&lt;br /&gt;
{{MethodHeader|public native float GetMeshAnimationFrame(string mesh)&#039;&#039;&#039;}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;mesh&#039;&#039;&#039; = the name of the mesh or submesh container which includes the animation file to be queried.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*Current fame of the animation file within the specified mesh container.&lt;br /&gt;
;Syntax&lt;br /&gt;
 float height = GetMeshAnimationFrame(&amp;quot;zPosition&amp;quot;)&lt;br /&gt;
;Notes&lt;br /&gt;
*Note that the returned value is likely to be an interpreted floating point value.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==GetMeshAnimationFrameCount==&lt;br /&gt;
{{MethodHeader|public native float GetMeshAnimationFrameCount(string mesh)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;mesh&#039;&#039;&#039; = the name of the mesh or submesh container which includes the animation file to be queried.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*The number of frames in the specified animation.&lt;br /&gt;
;Syntax&lt;br /&gt;
 float positions = GetMeshAnimationFrameCount(&amp;quot;lever&amp;quot;);&lt;br /&gt;
;Notes&lt;br /&gt;
*Note that the returned value is a float rather than an integer.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==GetTextureSelfIlluminationState==&lt;br /&gt;
{{MethodHeader|public native bool GetTextureSelfIlluminationState(string texture)&#039;&#039;&#039;}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;texture&#039;&#039;&#039; = root name of &#039;&#039;*.texture.text&#039;&#039; file to query.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*Returns true if the specified texture has self illumination set.&lt;br /&gt;
;Syntax&lt;br /&gt;
 bool isEmissive = GetTextureSelfIlluminationState(&amp;quot;texture&amp;quot;);&lt;br /&gt;
;Notes&lt;br /&gt;
*Compatibility warning: Use of this function is not recommended, it may become non-functional in future Trainz versions.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==HasMesh==&lt;br /&gt;
{{MethodHeader|public native bool HasMesh(string mesh)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;mesh&#039;&#039;&#039; = the name of the mesh or submesh to be queried.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 if (HasMesh(&amp;quot;ventilation&amp;quot;)) StartMeshAnimationLoop(&amp;quot;fans&amp;quot;);&lt;br /&gt;
;Notes&lt;br /&gt;
*&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==SetFXAnimationState==&lt;br /&gt;
{{MethodHeader|public native void SetFXAnimationState(string effect, bool state)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;effect&#039;&#039;&#039; = name of attached-animation effect containing the animation to play.&lt;br /&gt;
*&#039;&#039;&#039;state&#039;&#039;&#039; = true to start the animation loop, false to stop.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 if (gateClosed) SetFXAnimationState(&amp;quot;gate&amp;quot;,false);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==SetFXAttachment==&lt;br /&gt;
{{MethodHeader|public native MeshObject SetFXAttachment(string effect, Asset asset)&#039;&#039;&#039;}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;effect&#039;&#039;&#039; = effect containing the attachment to be manipulated.&lt;br /&gt;
*&#039;&#039;&#039;asset&#039;&#039;&#039; = mesh asset to attach to the effect. If asset is null any existing asset will be removed and nothing will be added.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*Returns a reference to the MeshObject which has been attached to the named effect. If the mesh asset isn&#039;t &amp;quot;kind mesh&amp;quot;, returns null.&lt;br /&gt;
;Syntax&lt;br /&gt;
 MeshObject lamp = SetFXAttachment(&amp;quot;lamp0&amp;quot;,redlamp);&lt;br /&gt;
;Notes&lt;br /&gt;
*Returns null if the effect is unoccupied when the method returns.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==SetFXCoronaTexture==&lt;br /&gt;
{{MethodHeader|public native void SetFXCoronaTexture(string effect, Asset texture)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;effect&#039;&#039;&#039; = effect containg the corona to be manipulated.&lt;br /&gt;
*&#039;&#039;&#039;asset&#039;&#039;&#039; = corona texture asset to attach to the effect. If asset is null the corona will be turned off.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetFXCoronaTexture(&amp;quot;stopLight&amp;quot;,redCorona);&lt;br /&gt;
;Notes&lt;br /&gt;
*Other corona parameters such as frequency and size are defined in &#039;&#039;config.txt&#039;&#039; and cannot be altered by script code.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==SetFXNameText==&lt;br /&gt;
{{MethodHeader|public native void SetFXNameText(string effect, string text)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;effect&#039;&#039;&#039; = effect containg the name effect to be changed.&lt;br /&gt;
*&#039;&#039;&#039;text&#039;&#039;&#039; = new string value.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetFXNameText(&amp;quot;home&amp;quot;,&amp;quot;Shangri-La&amp;quot;);&lt;br /&gt;
;Notes&lt;br /&gt;
*Method will not accept an empty string in the &#039;&#039;text&#039;&#039; parameter.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==SetFXTextureReplacement==&lt;br /&gt;
{{MethodHeader|public native void SetFXTextureReplacement(string effect, Asset textureGroup, int index)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;effect&#039;&#039;&#039; = texture-replacement effect to be changed.&lt;br /&gt;
*&#039;&#039;&#039;textureGroup&#039;&#039;&#039; = reference to texture group asset which is the source of the texture to be applied.&lt;br /&gt;
*&#039;&#039;&#039;index&#039;&#039;&#039; = index into &#039;&#039;textures&#039;&#039; table of texture-group indicating which texture to apply.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetFXTextureReplacement(&amp;quot;load&amp;quot;,loadTextures,5);   // applies texture 5 from texture-group&lt;br /&gt;
 SetFXTextureReplacement(&amp;quot;load&amp;quot;,null,0);             // clears the effect, reinstating the texture defined in the asset.&lt;br /&gt;
;Notes&lt;br /&gt;
*Use null in the textureGroup parameter to turn texture replacement off.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==SetFXTextureReplacementTexture==&lt;br /&gt;
{{MethodHeader|public native void SetFXTextureReplacementTexture(string effectName, string textureName)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;effectName&#039;&#039;&#039; = the name of the texture-replacement effect that is in the effects container of the mesh.&lt;br /&gt;
*&#039;&#039;&#039;textureName&#039;&#039;&#039; = the &#039;&#039;*.texture.txt&#039;&#039; file that will replace the current texture being used on the mesh.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetFXTextureReplacementTexture(&amp;quot;fk_parameter&amp;quot;,&amp;quot;lms_p3_fk_body/fk_parameter.texture&amp;quot;);&lt;br /&gt;
;Notes&lt;br /&gt;
*This should replace any instance of SwapTextureOnMesh.&lt;br /&gt;
*Unlike SwapTextureOnMesh, there is no need to mention what the previous texture being used was. Simply telling Trainz to load the new texture is all that is needed for this to work.&lt;br /&gt;
*Swap one texture against another texture on specified mesh.&lt;br /&gt;
*Similar to texture-replacement effects, but without the need for an extra texture asset. &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==SetMesh==&lt;br /&gt;
{{MethodHeader|public native void SetMesh(string mesh, float fadeDuration)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;mesh&#039;&#039;&#039; = the name of the mesh or submesh to be displayed.&lt;br /&gt;
*&#039;&#039;&#039;fadeDuration&#039;&#039;&#039; = period in seconds during which mesh visibility will be faded in or out.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetMesh(&amp;quot;default&amp;quot;,0.5);&lt;br /&gt;
;Notes&lt;br /&gt;
*Shows the specified mesh and hides all other meshes.&lt;br /&gt;
*If fadeDuration is 0.0 the mesh transition will be instantaneous.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==SetMeshAnimationFrame==&lt;br /&gt;
{{MethodHeader|public native void SetMeshAnimationFrame(string mesh, float frame)&amp;lt;br&amp;gt;&lt;br /&gt;
public native void SetMeshAnimationFrame(string mesh, float frame, float period)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;mesh&#039;&#039;&#039; = the name of the mesh or submesh container which includes the animation file to be manipulated.&lt;br /&gt;
*&#039;&#039;&#039;frame&#039;&#039;&#039; = the frame position to which the animation is to be moved, this may be an interpolated value.&lt;br /&gt;
*&#039;&#039;&#039;period&#039;&#039;&#039; = the period over which the animation will be moved from its current position to the newly specified point.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetMeshAnimationFrame(&amp;quot;default&amp;quot;,5.0);      // move the animation to frame 5 instantaneously&lt;br /&gt;
 SetMeshAnimationFrame(&amp;quot;default&amp;quot;,5.0,2.0);  // move the animation to frame 5 over 2 seconds&lt;br /&gt;
;Notes&lt;br /&gt;
*Moves the specified animation to the specified frame.&lt;br /&gt;
*For the first variant the transition is instant.&lt;br /&gt;
*For the second variant the transition will complete during the specified period.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==SetMeshAnimationSpeed==&lt;br /&gt;
{{MethodHeader|public native void SetMeshAnimationSpeed(string mesh, float speed)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;mesh&#039;&#039;&#039; = the name of the mesh or submesh container which includes the animation file to be manipulated.&lt;br /&gt;
*&#039;&#039;&#039;speed&#039;&#039;&#039; = multiplication factor to apply to the original animation speed.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetMeshAnimationSpeed(&amp;quot;fans&amp;quot;,2.0);   // run fans at double speed&lt;br /&gt;
 SetMeshAnimationSpeed(&amp;quot;fans&amp;quot;,-1.0);  // run fans backwards at original speed&lt;br /&gt;
;Notes&lt;br /&gt;
*Modifies the speed at which the animation is played.&lt;br /&gt;
*The original speed is multiplied by the new speed factor.&lt;br /&gt;
*Use negative values to make the animation run in reverse.&lt;br /&gt;
*It is &#039;&#039;not&#039;&#039; compatible with SetMeshAnimationState function for the same mesh. &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==SetMeshAnimationState==&lt;br /&gt;
{{MethodHeader|public native void SetMeshAnimationState(string mesh, bool state)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;mesh&#039;&#039;&#039; = the name of the mesh or submesh container which includes the animation file to be played.&lt;br /&gt;
*&#039;&#039;&#039;state&#039;&#039;&#039; = the direction in which the file is to be played, true for forwards, false for backwards.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetMeshAnimationState(&amp;quot;door&amp;quot;,true);    // opens the door&lt;br /&gt;
 SetMeshAnimationState(&amp;quot;door&amp;quot;,false);   // closes the door&lt;br /&gt;
;Notes&lt;br /&gt;
*This method plays animations and is best suited to those which have defined start and end points such as the opening and closing of a gate or door.&lt;br /&gt;
*If &#039;&#039;state&#039;&#039; is true the animation plays forwards from its current position to the last frame. If the current position is already at the last frame the call has no effect.&lt;br /&gt;
*If &#039;&#039;state&#039;&#039; is false the animation plays backwards from its current position to the first frame. If the current position is already at the first frame the call has no effect.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==SetMeshOrientation==&lt;br /&gt;
{{MethodHeader|public native void SetMeshOrientation(string meshName, float x, float y, float z)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;meshName&#039;&#039;&#039; = name of the mesh to set the visibility of.&lt;br /&gt;
*&#039;&#039;&#039;x,y,z&#039;&#039;&#039; = rotations about each axis for the new orientation (radians).&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetMeshOrientation(&amp;quot;controllershunt&amp;quot;,0,0.5,0);&lt;br /&gt;
;Notes&lt;br /&gt;
*Sets the orientation of the specified mesh relative to the object orientation or attachment point.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==SetMeshTranslation==&lt;br /&gt;
{{MethodHeader|public native void SetMeshTranslation(string meshName, float x, float y, float z)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;meshName&#039;&#039;&#039; = the name of the mesh or submesh to be displayed.&lt;br /&gt;
*&#039;&#039;&#039;x, y, z&#039;&#039;&#039; = new position in the coordinate axis.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetMeshTranslation(&amp;quot;controllershunt&amp;quot;,0,0,0);&lt;br /&gt;
;Notes&lt;br /&gt;
*Sets the translation of the specified mesh relative to the object origin or attachment point.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==SetTextureSelfIllumination==&lt;br /&gt;
{{MethodHeader|public native void SetTextureSelfIllumination(string texture, float r, float g, float b)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;texture&#039;&#039;&#039; = root name of &#039;&#039;*.texture.text&#039;&#039; file to query.&lt;br /&gt;
*&#039;&#039;&#039;r,g,b&#039;&#039;&#039; = red green and blue components of self illumination value to apply.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetTextureSelfIllumination(&amp;quot;interior&amp;quot;,0.5,0.5,0.5);&lt;br /&gt;
;Notes&lt;br /&gt;
*Applies a [[material emissive color]] to materials that use the texture, using the red, green and blue components specified.&lt;br /&gt;
*Compatibility warning: Use of this function is not recommended, it may become non-functional in future Trainz versions.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==StartMeshAnimationLoop==&lt;br /&gt;
{{MethodHeader|public native void StartMeshAnimationLoop(string mesh)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;mesh&#039;&#039;&#039; = the name of the mesh or submesh container which includes the animation file to be played.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 StartMeshAnimationLoop(&amp;quot;windmill&amp;quot;);&lt;br /&gt;
;Notes&lt;br /&gt;
*This method plays animations and is best suited to those which are designed to run in a continuous loop.&lt;br /&gt;
*The speed of the animation can be altered using [[#SetMeshAnimationSpeed|SetMeshAnimationSpeed()]]&lt;br /&gt;
*Using [[#SetMeshAnimationSpeed|SetMeshAnimationSpeed()]] with a negative value will cause the animation to play in reverse.&lt;br /&gt;
*[[#StopMeshAnimation|StopMeshAnimation()]] will halt the animation.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==StopMeshAnimation==&lt;br /&gt;
{{MethodHeader|public native void StopMeshAnimation(string mesh)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;mesh&#039;&#039;&#039; = the name of the mesh or submesh container which includes the animation file to be stopped.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 StopMeshAnimation(&amp;quot;default&amp;quot;);&lt;br /&gt;
;Notes&lt;br /&gt;
*Turns animation off for the specified mesh.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==SwapTextureOnMesh==&lt;br /&gt;
{{MethodHeader|public native void SwapTextureOnMesh(string mesh, string oldTexture, string newTexture)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;mesh&#039;&#039;&#039; = the name of the mesh or submesh container which includes the texture to be changed.&lt;br /&gt;
*&#039;&#039;&#039;oldTexture&#039;&#039;&#039; = the original &#039;&#039;*.texture.txt&#039;&#039; file to use as the source of the transition.&lt;br /&gt;
*&#039;&#039;&#039;newTexture&#039;&#039;&#039; = the new &#039;&#039;*.texture.txt&#039;&#039; file to apply.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SwapTextureOnMesh(&amp;quot;left-passenger-door&amp;quot;,&amp;quot;gwr&amp;quot;,&amp;quot;lms&amp;quot;);&lt;br /&gt;
;Notes&lt;br /&gt;
*&#039;&#039;&#039;Obsolete: Use SetFXTextureReplacementTexture instead.&#039;&#039;&#039;&lt;br /&gt;
*Swap one texture against another texture on specified mesh.&lt;br /&gt;
*Similar to texture-replacement effects, but without the need for an extra texture asset. &lt;br /&gt;
*&#039;&#039;&#039;possible bug&#039;&#039;&#039; Texture names in the .im file must be lower case for this function to work properly.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Code Examples==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Related Methods==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Categories==&lt;br /&gt;
[[Category:Script Class]]&lt;/div&gt;</summary>
		<author><name>Ciceronmt</name></author>
	</entry>
	<entry>
		<id>https://wiki.trainzsimulator.com/index.php?title=Class_MeshObject&amp;diff=24279</id>
		<title>Class MeshObject</title>
		<link rel="alternate" type="text/html" href="https://wiki.trainzsimulator.com/index.php?title=Class_MeshObject&amp;diff=24279"/>
		<updated>2020-10-04T10:27:44Z</updated>

		<summary type="html">&lt;p&gt;Ciceronmt: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;*[[TrainzScript Language Reference|API Hierarchy]]&lt;br /&gt;
**[[Class GSObject|GSObject]]&lt;br /&gt;
***[[Class GameObject|GameObject]]&lt;br /&gt;
****[[Class PropertyObject|PropertyObject]]&lt;br /&gt;
****[[Class TrainzGameObject|TrainzGameObject]]&lt;br /&gt;
*****MeshObject&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is a base class for [[class Asset|Asset]] based game objects that have meshes, effects, animations and particles. Interface methods to deal with these are provided so things like showing or hiding a mesh, attaching a mesh to an attachment point or controlling an animation can be done from a script.&lt;br /&gt;
&lt;br /&gt;
For animation Trainz interpolates between key frames. This means an intermediate animation frame is calculated dynamically to be-in-synch with the game&#039;s framerate.&lt;br /&gt;
&lt;br /&gt;
Trainzscript is an interpreted scripting language intended to be used to monitor and react to events in the Trainz world, not to perform sophisticated real-time animation tasks. Using a script to start an animation in response to an event in a thread is reasonable. However trying to control animation tightly down to short intervals is likely to provide unsatisfactory results and to adversely affect overall performance of the game.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==MeshObject Messages==&lt;br /&gt;
Messages related to MeshObject assets:&lt;br /&gt;
*[[Animation-Event Message]]&lt;br /&gt;
*[[pfx Message]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==GetFXAttachment==&lt;br /&gt;
{{MethodHeader|public native MeshObject GetFXAttachment(string effect)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;effect&#039;&#039;&#039; = name of the mesh effect to query. &lt;br /&gt;
;Returned Value&lt;br /&gt;
*Returns a reference to the MeshObject currently attached to the named effect.&lt;br /&gt;
;Syntax&lt;br /&gt;
 MeshObject attachment = GetFXAttachment(&amp;quot;coupler&amp;quot;);&lt;br /&gt;
;Notes&lt;br /&gt;
*The method returns null if the effect is unoccupied.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==GetMeshAnimationFrame==&lt;br /&gt;
{{MethodHeader|public native float GetMeshAnimationFrame(string mesh)&#039;&#039;&#039;}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;mesh&#039;&#039;&#039; = the name of the mesh or submesh container which includes the animation file to be queried.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*Current fame of the animation file within the specified mesh container.&lt;br /&gt;
;Syntax&lt;br /&gt;
 float height = GetMeshAnimationFrame(&amp;quot;zPosition&amp;quot;)&lt;br /&gt;
;Notes&lt;br /&gt;
*Note that the returned value is likely to be an interpreted floating point value.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==GetMeshAnimationFrameCount==&lt;br /&gt;
{{MethodHeader|public native float GetMeshAnimationFrameCount(string mesh)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;mesh&#039;&#039;&#039; = the name of the mesh or submesh container which includes the animation file to be queried.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*The number of frames in the specified animation.&lt;br /&gt;
;Syntax&lt;br /&gt;
 float positions = GetMeshAnimationFrameCount(&amp;quot;lever&amp;quot;);&lt;br /&gt;
;Notes&lt;br /&gt;
*Note that the returned value is a float rather than an integer.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==GetTextureSelfIlluminationState==&lt;br /&gt;
{{MethodHeader|public native bool GetTextureSelfIlluminationState(string texture)&#039;&#039;&#039;}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;texture&#039;&#039;&#039; = root name of &#039;&#039;*.texture.text&#039;&#039; file to query.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*Returns true if the specified texture has self illumination set.&lt;br /&gt;
;Syntax&lt;br /&gt;
 bool isEmissive = GetTextureSelfIlluminationState(&amp;quot;texture&amp;quot;);&lt;br /&gt;
;Notes&lt;br /&gt;
*Compatibility warning: Use of this function is not recommended, it may become non-functional in future Trainz versions.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==HasMesh==&lt;br /&gt;
{{MethodHeader|public native bool HasMesh(string mesh)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;mesh&#039;&#039;&#039; = the name of the mesh or submesh to be queried.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 if (HasMesh(&amp;quot;ventilation&amp;quot;)) StartMeshAnimationLoop(&amp;quot;fans&amp;quot;);&lt;br /&gt;
;Notes&lt;br /&gt;
*&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==SetFXAnimationState==&lt;br /&gt;
{{MethodHeader|public native void SetFXAnimationState(string effect, bool state)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;effect&#039;&#039;&#039; = name of attached-animation effect containing the animation to play.&lt;br /&gt;
*&#039;&#039;&#039;state&#039;&#039;&#039; = true to start the animation loop, false to stop.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 if (gateClosed) SetFXAnimationState(&amp;quot;gate&amp;quot;,false);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==SetFXAttachment==&lt;br /&gt;
{{MethodHeader|public native MeshObject SetFXAttachment(string effect, Asset asset)&#039;&#039;&#039;}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;effect&#039;&#039;&#039; = effect containing the attachment to be manipulated.&lt;br /&gt;
*&#039;&#039;&#039;asset&#039;&#039;&#039; = mesh asset to attach to the effect. If asset is null any existing asset will be removed and nothing will be added.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*Returns a reference to the MeshObject which has been attached to the named effect. If the mesh asset isn&#039;t &amp;quot;kind mesh&amp;quot;, returns null.&lt;br /&gt;
;Syntax&lt;br /&gt;
 MeshObject lamp = SetFXAttachment(&amp;quot;lamp0&amp;quot;,redlamp);&lt;br /&gt;
;Notes&lt;br /&gt;
*Returns null if the effect is unoccupied when the method returns.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==SetFXCoronaTexture==&lt;br /&gt;
{{MethodHeader|public native void SetFXCoronaTexture(string effect, Asset texture)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;effect&#039;&#039;&#039; = effect containg the corona to be manipulated.&lt;br /&gt;
*&#039;&#039;&#039;asset&#039;&#039;&#039; = corona texture asset to attach to the effect. If asset is null the corona will be turned off.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetFXCoronaTexture(&amp;quot;stopLight&amp;quot;,redCorona);&lt;br /&gt;
;Notes&lt;br /&gt;
*Other corona parameters such as frequency and size are defined in &#039;&#039;config.txt&#039;&#039; and cannot be altered by script code.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==SetFXNameText==&lt;br /&gt;
{{MethodHeader|public native void SetFXNameText(string effect, string text)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;effect&#039;&#039;&#039; = effect containg the name effect to be changed.&lt;br /&gt;
*&#039;&#039;&#039;text&#039;&#039;&#039; = new string value.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetFXNameText(&amp;quot;home&amp;quot;,&amp;quot;Shangri-La&amp;quot;);&lt;br /&gt;
;Notes&lt;br /&gt;
*Method will not accept an empty string in the &#039;&#039;text&#039;&#039; parameter.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==SetFXTextureReplacement==&lt;br /&gt;
{{MethodHeader|public native void SetFXTextureReplacement(string effect, Asset textureGroup, int index)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;effect&#039;&#039;&#039; = texture-replacement effect to be changed.&lt;br /&gt;
*&#039;&#039;&#039;textureGroup&#039;&#039;&#039; = reference to texture group asset which is the source of the texture to be applied.&lt;br /&gt;
*&#039;&#039;&#039;index&#039;&#039;&#039; = index into &#039;&#039;textures&#039;&#039; table of texture-group indicating which texture to apply.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetFXTextureReplacement(&amp;quot;load&amp;quot;,loadTextures,5);   // applies texture 5 from texture-group&lt;br /&gt;
 SetFXTextureReplacement(&amp;quot;load&amp;quot;,null,0);             // clears the effect, reinstating the texture defined in the asset.&lt;br /&gt;
;Notes&lt;br /&gt;
*Use null in the textureGroup parameter to turn texture replacement off.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==SetFXTextureReplacementTexture==&lt;br /&gt;
{{MethodHeader|public native void SetFXTextureReplacementTexture(string effectName, string textureName)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;effectName&#039;&#039;&#039; = the name of the texture-replacement effect that is in the effects container of the mesh.&lt;br /&gt;
*&#039;&#039;&#039;textureName&#039;&#039;&#039; = the &#039;&#039;*.texture.txt&#039;&#039; file that will replace the current texture being used on the mesh.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetFXTextureReplacementTexture(&amp;quot;fk_parameter&amp;quot;,&amp;quot;lms_p3_fk_body/fk_parameter.texture&amp;quot;);&lt;br /&gt;
;Notes&lt;br /&gt;
*This should replace any instance of SwapTextureOnMesh.&lt;br /&gt;
*Unlike SwapTextureOnMesh, there is no need to mention what the previous texture being used was. Simply telling Trainz to load the new texture is all that is needed for this to work.&lt;br /&gt;
*Swap one texture against another texture on specified mesh.&lt;br /&gt;
*Similar to texture-replacement effects, but without the need for an extra texture asset. &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==SetMesh==&lt;br /&gt;
{{MethodHeader|public native void SetMesh(string mesh, float fadeDuration)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;mesh&#039;&#039;&#039; = the name of the mesh or submesh to be displayed.&lt;br /&gt;
*&#039;&#039;&#039;fadeDuration&#039;&#039;&#039; = period in seconds during which mesh visibility will be faded in or out.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetMesh(&amp;quot;default&amp;quot;,0.5);&lt;br /&gt;
;Notes&lt;br /&gt;
*Shows the specified mesh and hides all other meshes.&lt;br /&gt;
*If fadeDuration is 0.0 the mesh transition will be instantaneous.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==SetMeshAnimationFrame==&lt;br /&gt;
{{MethodHeader|public native void SetMeshAnimationFrame(string mesh, float frame)&amp;lt;br&amp;gt;&lt;br /&gt;
public native void SetMeshAnimationFrame(string mesh, float frame, float period)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;mesh&#039;&#039;&#039; = the name of the mesh or submesh container which includes the animation file to be manipulated.&lt;br /&gt;
*&#039;&#039;&#039;frame&#039;&#039;&#039; = the frame position to which the animation is to be moved, this may be an interpolated value.&lt;br /&gt;
*&#039;&#039;&#039;period&#039;&#039;&#039; = the period over which the animation will be moved from its current position to the newly specified point.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetMeshAnimationFrame(&amp;quot;default&amp;quot;,5.0);      // move the animation to frame 5 instantaneously&lt;br /&gt;
 SetMeshAnimationFrame(&amp;quot;default&amp;quot;,5.0,2.0);  // move the animation to frame 5 over 2 seconds&lt;br /&gt;
;Notes&lt;br /&gt;
*Moves the specified animation to the specified frame.&lt;br /&gt;
*For the first variant the transition is instant.&lt;br /&gt;
*For the second variant the transition will complete during the specified period.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==SetMeshAnimationSpeed==&lt;br /&gt;
{{MethodHeader|public native void SetMeshAnimationSpeed(string mesh, float speed)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;mesh&#039;&#039;&#039; = the name of the mesh or submesh container which includes the animation file to be manipulated.&lt;br /&gt;
*&#039;&#039;&#039;speed&#039;&#039;&#039; = multiplication factor to apply to the original animation speed.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetMeshAnimationSpeed(&amp;quot;fans&amp;quot;,2.0);   // run fans at double speed&lt;br /&gt;
 SetMeshAnimationSpeed(&amp;quot;fans&amp;quot;,-1.0);  // run fans backwards at original speed&lt;br /&gt;
;Notes&lt;br /&gt;
*Modifies the speed at which the animation is played.&lt;br /&gt;
*The original speed is multiplied by the new speed factor.&lt;br /&gt;
*Use negative values to make the animation run in reverse.&lt;br /&gt;
*It is &#039;&#039;not&#039;&#039; compatible with SetMeshAnimationState function for the same mesh. &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==SetMeshAnimationState==&lt;br /&gt;
{{MethodHeader|public native void SetMeshAnimationState(string mesh, bool state)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;mesh&#039;&#039;&#039; = the name of the mesh or submesh container which includes the animation file to be played.&lt;br /&gt;
*&#039;&#039;&#039;state&#039;&#039;&#039; = the direction in which the file is to be played, true for forwards, false for backwards.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetMeshAnimationState(&amp;quot;door&amp;quot;,true);    // opens the door&lt;br /&gt;
 SetMeshAnimationState(&amp;quot;door&amp;quot;,false);   // closes the door&lt;br /&gt;
;Notes&lt;br /&gt;
*This method plays animations and is best suited to those which have defined start and end points such as the opening and closing of a gate or door.&lt;br /&gt;
*If &#039;&#039;state&#039;&#039; is true the animation plays forwards from its current position to the last frame. If the current position is already at the last frame the call has no effect.&lt;br /&gt;
*If &#039;&#039;state&#039;&#039; is false the animation plays backwards from its current position to the first frame. If the current position is already at the first frame the call has no effect.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==SetMesh==&lt;br /&gt;
{{MethodHeader|public native void SetMesh(string mesh, float fadeDuration)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;mesh&#039;&#039;&#039; = the name of the mesh or submesh to be displayed.&lt;br /&gt;
*&#039;&#039;&#039;fadeDuration&#039;&#039;&#039; = period in seconds during which mesh visibility will be faded in or out.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetMesh(&amp;quot;default&amp;quot;,0.5);&lt;br /&gt;
;Notes&lt;br /&gt;
*Shows the specified mesh and hides all other meshes.&lt;br /&gt;
*If fadeDuration is 0.0 the mesh transition will be instantaneous.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==SetMeshTranslation==&lt;br /&gt;
{{MethodHeader|public native void SetMeshTranslation(string meshName, float x, float y, float z)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;meshName&#039;&#039;&#039; = the name of the mesh or submesh to be displayed.&lt;br /&gt;
*&#039;&#039;&#039;x, y, z&#039;&#039;&#039; = new position in the coordinate axis.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetMeshTranslation(&amp;quot;controllershunt&amp;quot;,0,0,0);&lt;br /&gt;
;Notes&lt;br /&gt;
*Sets the translation of the specified mesh relative to the object origin or attachment point.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==SetTextureSelfIllumination==&lt;br /&gt;
{{MethodHeader|public native void SetTextureSelfIllumination(string texture, float r, float g, float b)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;texture&#039;&#039;&#039; = root name of &#039;&#039;*.texture.text&#039;&#039; file to query.&lt;br /&gt;
*&#039;&#039;&#039;r,g,b&#039;&#039;&#039; = red green and blue components of self illumination value to apply.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetTextureSelfIllumination(&amp;quot;interior&amp;quot;,0.5,0.5,0.5);&lt;br /&gt;
;Notes&lt;br /&gt;
*Applies a [[material emissive color]] to materials that use the texture, using the red, green and blue components specified.&lt;br /&gt;
*Compatibility warning: Use of this function is not recommended, it may become non-functional in future Trainz versions.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==StartMeshAnimationLoop==&lt;br /&gt;
{{MethodHeader|public native void StartMeshAnimationLoop(string mesh)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;mesh&#039;&#039;&#039; = the name of the mesh or submesh container which includes the animation file to be played.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 StartMeshAnimationLoop(&amp;quot;windmill&amp;quot;);&lt;br /&gt;
;Notes&lt;br /&gt;
*This method plays animations and is best suited to those which are designed to run in a continuous loop.&lt;br /&gt;
*The speed of the animation can be altered using [[#SetMeshAnimationSpeed|SetMeshAnimationSpeed()]]&lt;br /&gt;
*Using [[#SetMeshAnimationSpeed|SetMeshAnimationSpeed()]] with a negative value will cause the animation to play in reverse.&lt;br /&gt;
*[[#StopMeshAnimation|StopMeshAnimation()]] will halt the animation.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==StopMeshAnimation==&lt;br /&gt;
{{MethodHeader|public native void StopMeshAnimation(string mesh)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;mesh&#039;&#039;&#039; = the name of the mesh or submesh container which includes the animation file to be stopped.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 StopMeshAnimation(&amp;quot;default&amp;quot;);&lt;br /&gt;
;Notes&lt;br /&gt;
*Turns animation off for the specified mesh.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==SwapTextureOnMesh==&lt;br /&gt;
{{MethodHeader|public native void SwapTextureOnMesh(string mesh, string oldTexture, string newTexture)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;mesh&#039;&#039;&#039; = the name of the mesh or submesh container which includes the texture to be changed.&lt;br /&gt;
*&#039;&#039;&#039;oldTexture&#039;&#039;&#039; = the original &#039;&#039;*.texture.txt&#039;&#039; file to use as the source of the transition.&lt;br /&gt;
*&#039;&#039;&#039;newTexture&#039;&#039;&#039; = the new &#039;&#039;*.texture.txt&#039;&#039; file to apply.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SwapTextureOnMesh(&amp;quot;left-passenger-door&amp;quot;,&amp;quot;gwr&amp;quot;,&amp;quot;lms&amp;quot;);&lt;br /&gt;
;Notes&lt;br /&gt;
*&#039;&#039;&#039;Obsolete: Use SetFXTextureReplacementTexture instead.&#039;&#039;&#039;&lt;br /&gt;
*Swap one texture against another texture on specified mesh.&lt;br /&gt;
*Similar to texture-replacement effects, but without the need for an extra texture asset. &lt;br /&gt;
*&#039;&#039;&#039;possible bug&#039;&#039;&#039; Texture names in the .im file must be lower case for this function to work properly.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Code Examples==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Related Methods==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Categories==&lt;br /&gt;
[[Category:Script Class]]&lt;/div&gt;</summary>
		<author><name>Ciceronmt</name></author>
	</entry>
	<entry>
		<id>https://wiki.trainzsimulator.com/index.php?title=Class_Interface&amp;diff=23199</id>
		<title>Class Interface</title>
		<link rel="alternate" type="text/html" href="https://wiki.trainzsimulator.com/index.php?title=Class_Interface&amp;diff=23199"/>
		<updated>2020-04-13T15:02:05Z</updated>

		<summary type="html">&lt;p&gt;Ciceronmt: /* SetAlert */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;*[[TrainzScript Language Reference|API Hierarchy]]&lt;br /&gt;
**Interface&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*The Interface class provides scripts with methods to handle the user interface.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Constants &amp;amp; Messages==&lt;br /&gt;
&lt;br /&gt;
===RGB Color Constants===&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
{{TableHeader|width=55%|margin=15px}}&lt;br /&gt;
|bgcolor=#EEEEEE|&#039;&#039;&#039;Predefined 24 bit Red,Green,Blue color values&#039;&#039;&#039;||bgcolor=#EEEEEE|&lt;br /&gt;
|-&lt;br /&gt;
|width=375|public define int  Colour_Red = 0xFF0000||width=225|Red&lt;br /&gt;
|-&lt;br /&gt;
|public define int  Colour_Green = 0x00FF00||Green&lt;br /&gt;
|-&lt;br /&gt;
|public define int  Colour_Blue = 0x0000FF||Blue&lt;br /&gt;
|-&lt;br /&gt;
|public define int  Colour_Yellow = 0xFFFF20||Yellow&lt;br /&gt;
|-&lt;br /&gt;
|public define int  Colour_Cyan = 0xB0C0FF||Cyan&lt;br /&gt;
|-&lt;br /&gt;
|public define int  Colour_White = 0xFFFFFF||White&lt;br /&gt;
|-&lt;br /&gt;
|public define int  Colour_Black = 0x000000||Black&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Button Element Indices===&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
{{TableHeader|width=55%|margin=15px}}&lt;br /&gt;
|bgcolor=#EEEEEE|&#039;&#039;&#039;Constants referring to the buttons on the Driver menu&#039;&#039;&#039;||bgcolor=#EEEEEE|&lt;br /&gt;
|-&lt;br /&gt;
|width=375|public define int  ButtonBar_Element_Close = 0||width=225|Exit button&lt;br /&gt;
|-&lt;br /&gt;
|public define int  ButtonBar_Element_Pause = 1||Pause button.&lt;br /&gt;
|-&lt;br /&gt;
|public define int  ButtonBar_Element_Save = 2||Save button.&lt;br /&gt;
|-&lt;br /&gt;
|public define int  ButtonBar_Element_Performance = 3||Performance Settings button.&lt;br /&gt;
|-&lt;br /&gt;
|public define int  ButtonBar_Element_MetricImp = 4||Imperial/Metric button.&lt;br /&gt;
|-&lt;br /&gt;
|public define int  ButtonBar_Element_Find = 5||Find button.&lt;br /&gt;
|-&lt;br /&gt;
|public define int  ButtonBar_Element_Help = 6||On Screen Help button.&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Related Messages===&lt;br /&gt;
*Messages sent to and from Industry objects are listed below:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
{{TableHeader|width=55%|margin=15px}}&lt;br /&gt;
|-&lt;br /&gt;
|bgcolor=&amp;quot;#EEEEEE&amp;quot;|&#039;&#039;&#039;Major&#039;&#039;&#039;||bgcolor=&amp;quot;#EEEEEE&amp;quot;|&#039;&#039;&#039;Minor&#039;&#039;&#039;||bgcolor=&amp;quot;#EEEEEE&amp;quot;|&#039;&#039;&#039;Source&#039;&#039;&#039;||bgcolor=&amp;quot;#EEEEEE&amp;quot; |&#039;&#039;&#039;Destination&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|[[Interface Messages|Interface-Event]]||MapViewOff||?||Broadcast&lt;br /&gt;
|-&lt;br /&gt;
|[[Interface Messages|Interface-Event]]||MapViewOn||?||Broadcast&lt;br /&gt;
|-&lt;br /&gt;
|[[Interface Messages|Interface-Event]]||Mouse-Enter||MapObject||Broadcast&lt;br /&gt;
|-&lt;br /&gt;
|[[Interface Messages|Interface-Event]]||Mouse-Leave||?||Broadcast&lt;br /&gt;
|-&lt;br /&gt;
|[[Interface Messages|Interface-Event]]||Set-Metric-Mode||?||Broadcast&lt;br /&gt;
|-&lt;br /&gt;
|[[Interface Messages|Interface-Event]]||Toggle-Interface||?||Broadcast&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Methods==&lt;br /&gt;
&lt;br /&gt;
===AdjustScore===&lt;br /&gt;
{{MethodHeader|public void AdjustScore(int delta)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;delta&#039;&#039;&#039; = Positive or negative increment to apply to score.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 AdjustScore(-5);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Exception===&lt;br /&gt;
{{MethodHeader|public native void Exception(string message)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;message&#039;&#039;&#039; = Message to be displayed and logged when the Exception occurs.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 Interface.Exception(&amp;quot;Fatal Error&amp;quot;);&lt;br /&gt;
;Notes&lt;br /&gt;
*Allows an exception to be explicitly raised by a script in the event of a major error condition.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetDecoupleMode===&lt;br /&gt;
{{MethodHeader|public native bool GetDecoupleMode(void)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*None&lt;br /&gt;
;Returned Value&lt;br /&gt;
*Returns the current decoupling mode from the Driver interface.&lt;br /&gt;
;Syntax&lt;br /&gt;
 bool dcMode = Interface.GetDecoupleMode();&lt;br /&gt;
;Notes&lt;br /&gt;
*The decouple mode can be enabled or disabled when the user clicks on the decouple icon located on the Driver button bar or presses &#039;&#039;Ctrl + D&#039;&#039;.&lt;br /&gt;
*When the interface is in decouple mode, the decouple icon will be highlighted.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetDisplayHeight===&lt;br /&gt;
{{MethodHeader|public native int GetDisplayHeight(void)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*None&lt;br /&gt;
;Returned Value&lt;br /&gt;
*The height of the user&#039;s display in pixels.&lt;br /&gt;
;Syntax&lt;br /&gt;
 int height = Interface.GetDisplayHeight();&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetDisplayWidth===&lt;br /&gt;
{{MethodHeader|public native int GetDisplayWidth(void)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*None&lt;br /&gt;
;Returned Value&lt;br /&gt;
*The width of the user&#039;s display in pixels.&lt;br /&gt;
;Syntax&lt;br /&gt;
 int width = Interface.GetDisplayWidth();&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetElementProperty===&lt;br /&gt;
{{MethodHeader|public native string GetElementProperty(string elementId, string propertyId)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;elementId&#039;&#039;&#039; = Element to query.&lt;br /&gt;
*&#039;&#039;&#039;propertyId&#039;&#039;&#039; = Property to query.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*The value of the specified property if it exists, null otherwise.&lt;br /&gt;
;Syntax&lt;br /&gt;
 &lt;br /&gt;
;Notes&lt;br /&gt;
*This method is used to read element properties of browser windows in the Trainz interface such as the Minimap.&lt;br /&gt;
*See also [[#SetElementProperty|SetElementProperty()]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetInterfaceVisible===&lt;br /&gt;
{{MethodHeader|public native bool GetInterfaceVisible(void)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*None&lt;br /&gt;
;Returned Value&lt;br /&gt;
*True if the Driver interface is visible, false otherwise.&lt;br /&gt;
;Syntax&lt;br /&gt;
 bool visible = Interface.GetInterfaceVisible();&lt;br /&gt;
;Notes&lt;br /&gt;
*The entire Driver mode interface can be hidden from view with the &#039;&#039;F5&#039;&#039; key.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetMapView===&lt;br /&gt;
{{MethodHeader|public native bool GetMapView(void)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*None&lt;br /&gt;
;Returned Value&lt;br /&gt;
*True if the map view window is visible, false otherwise.&lt;br /&gt;
;Syntax&lt;br /&gt;
 bool visible = Interface.GetMapView();&lt;br /&gt;
;Notes&lt;br /&gt;
*The minimap can be displayed or hidden by pressing &#039;&#039;M&#039;&#039; or &#039;&#039;Control + M&#039;&#039;;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetMessageWindowVisible===&lt;br /&gt;
{{MethodHeader|public native bool GetMessageWindowVisible(void)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*None&lt;br /&gt;
;Returned Value&lt;br /&gt;
*True if the message window at the top of the screen is visible, false otherwise.&lt;br /&gt;
;Syntax&lt;br /&gt;
 bool visible = Interface.GetMessageWindowVisible();&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetMetricMode===&lt;br /&gt;
{{MethodHeader|public native bool GetMetricMode(void)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*None&lt;br /&gt;
;Returned Value&lt;br /&gt;
*True if the interface is displaying metric units, false for imperial.&lt;br /&gt;
;Syntax&lt;br /&gt;
 bool imperial = !Interface.GetMetricMode();&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetObjectiveBarVisible===&lt;br /&gt;
{{MethodHeader|public native bool GetObjectiveBarVisible()}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*None&lt;br /&gt;
;Returned Value&lt;br /&gt;
*True if the Driver objective panel is visible, false otherwise.&lt;br /&gt;
;Syntax&lt;br /&gt;
 bool objectivesShown = Interface.GetObjectiveBarVisible();&lt;br /&gt;
;Notes&lt;br /&gt;
*The objective bar visibility can be toggled with the &#039;&#039;F6&#039;&#039; key.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetScore===&lt;br /&gt;
{{MethodHeader|public int GetScore(void)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*None&lt;br /&gt;
;Returned Value&lt;br /&gt;
*The current score.&lt;br /&gt;
;Syntax&lt;br /&gt;
 int score = GetScore();&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetTimeStamp===&lt;br /&gt;
{{MethodHeader|public native string GetTimeStamp(void)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*None&lt;br /&gt;
;Returned Value&lt;br /&gt;
*A real time timestamp in seconds.&lt;br /&gt;
;Syntax&lt;br /&gt;
 string timestamp = Interface.GetTimeStamp();&lt;br /&gt;
;Notes&lt;br /&gt;
*Returns the current time expressed as seconds elapsed since midnight on January 1, 1970 UTC.&lt;br /&gt;
*The return value is a string as Trainzscript does not support any extended integer types.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetWaybillWindowVisible===&lt;br /&gt;
{{MethodHeader|public bool GetWaybillWindowVisible()}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*None&lt;br /&gt;
;Returned Value&lt;br /&gt;
*True if the Waybill Window is displayed, false otherwise.&lt;br /&gt;
;Syntax&lt;br /&gt;
 bool waybillVisible = GetWaybillWindowVisible();&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===HasUnseenMessages===&lt;br /&gt;
{{MethodHeader|public native bool HasUnseenMessages(void)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*None&lt;br /&gt;
;Returned Value&lt;br /&gt;
*True if there are messages intended for the Driver message window which have not been displayed, false otherwise.&lt;br /&gt;
;Syntax&lt;br /&gt;
 if (Interface.HasUnseenMessages()) Interface.SetMessageWindowVisible(true);&lt;br /&gt;
;Notes&lt;br /&gt;
*There are unseen messages if the message window is invisible yet messages have been received.&lt;br /&gt;
*This is indicated to the user by the highlighted microphone icon on the Driver button bar.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===HighlightButtonBarElement===&lt;br /&gt;
{{MethodHeader|public native void HighlightButtonBarElement(int buttonIndex, bool state)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;buttonIndex&#039;&#039;&#039; = One of the [[#Button Element Indices|Button Element Index]] values defining the button to highlight.&lt;br /&gt;
*&#039;&#039;&#039;state&#039;&#039;&#039; = True to turn highlighting on, false to turn it off.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 Interface.HighlightButtonBarElement(ButtonBar_Element_Pause,true);&lt;br /&gt;
;Notes&lt;br /&gt;
*Turns highlighting for a button on the Driver Menu either on or off.&lt;br /&gt;
*This method allows a button on the Driver Menu found in the top left corner of the screen to be highlighted as if the mouse cursor was hovering above that button.&lt;br /&gt;
*Note that the Driver Menu is not always visible, but you can explicitly show it with [[#ShowDriverButtonMenu|ShowDriverButtonMenu()]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Log===&lt;br /&gt;
{{MethodHeader|public native void Log(string message)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;message&#039;&#039;&#039; = Text string to print to log file.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 Interface.Log(&amp;quot;Session ended&amp;quot;);&lt;br /&gt;
;Notes&lt;br /&gt;
*Prints a string of text to the &#039;&#039;jetlog.txt&#039;&#039; log file.&lt;br /&gt;
*See also [[#Print|Print()]].&lt;br /&gt;
*Disabled by default in TS12. See [[CCG/Modelling: TrainzOptions File]].&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===LogCallStack===&lt;br /&gt;
{{MethodHeader|public native void LogCallStack(string message)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;message&#039;&#039;&#039; = Text string to be included with the call stack and printed to the log file.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 Interface.LogCallStack(&amp;quot;Call Stack Contents&amp;quot;);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===LogResult===&lt;br /&gt;
{{MethodHeader|public void LogResult(string message)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;message&#039;&#039;&#039; = Text string to be included with the result and printed to the result log.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 Interface.LogResult(&amp;quot;Result Appended&amp;quot;);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Print===&lt;br /&gt;
{{MethodHeader|Print()}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;message&#039;&#039;&#039; = Text string to print to log file and to the message window.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 Interface.Print(&amp;quot;Session ended&amp;quot;);&lt;br /&gt;
;Notes&lt;br /&gt;
*Prints a string of text to the &#039;&#039;jetlog.txt&#039;&#039; log file and echoes it to the messag window.&lt;br /&gt;
*See also [[#Log|Log()]].&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===ResetResults===&lt;br /&gt;
{{MethodHeader|public void ResetResults()}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*None&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 Interface.ResetResults();&lt;br /&gt;
;Notes&lt;br /&gt;
*Clears the result log.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetAlert===&lt;br /&gt;
{{MethodHeader|public native void SetAlert(string message, string iconTexture, float duration, int colour)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;message&#039;&#039;&#039; = Text of message to display.&lt;br /&gt;
*&#039;&#039;&#039;iconTexture&#039;&#039;&#039; = Icon for alert, use an empty string for no icon.&lt;br /&gt;
*&#039;&#039;&#039;duration&#039;&#039;&#039; = Time in seconds to keep the alert displayed.&lt;br /&gt;
*&#039;&#039;&#039;colour&#039;&#039;&#039; = Color of alert text as a 24 bit RGB or as one of the [[#RGB Color Constants|RGB Color Constants]].&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 Interface.SetAlert(&amp;quot;Train Halted due to leaves on line&amp;quot;,&amp;quot;&amp;quot;,10.0,Interface.Colour_Red);&lt;br /&gt;
;Notes: do not use in &amp;quot;Trainz 2019&amp;quot;.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetDecoupleMode===&lt;br /&gt;
{{MethodHeader|public native void SetDecoupleMode(bool enabled)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;enabled&#039;&#039;&#039; = Use true to enable decoupling, false to prevent.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 Interface.SetDecoupleMode(false);&lt;br /&gt;
;Notes&lt;br /&gt;
*The driver interface decoupling mode can be enabled or disabled using the icon on the Driver button bar or by keypress &#039;&#039;Ctrl + D&#039;&#039;.&lt;br /&gt;
*When the interface is in decouple mode, the decouple icon will be highlighted.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetElementProperty===&lt;br /&gt;
{{MethodHeader|public native void SetElementProperty(string elementId, string propertyId, string value)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;elementId&#039;&#039;&#039; = Element to update.&lt;br /&gt;
*&#039;&#039;&#039;propertyId&#039;&#039;&#039; = Property to update.&lt;br /&gt;
*&#039;&#039;&#039;value&#039;&#039;&#039; = New value to set.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 Interface.SetElementProperty(elementId,propertyId,value);&lt;br /&gt;
;Notes&lt;br /&gt;
*This method is used to modify element properties of browser windows in the Trainz interface such as the Minimap&lt;br /&gt;
*See also [[#GetElementProperty|GetElementProperty()]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetHelperIconScale===&lt;br /&gt;
{{MethodHeader|public native void SetHelperIconScale(float scale)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;scale&#039;&#039;&#039; = Scale factor to apply to on screen junction icons etc, range 0.5..1.0&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 Interface.SetHelperIconScale(0.5); // set to 50% of default size&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetMapView===&lt;br /&gt;
{{MethodHeader|public native void SetMapView(bool visible)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;visible&#039;&#039;&#039; = Use true to display and false to hide.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 Interface.SetMapView(true);&lt;br /&gt;
;Notes&lt;br /&gt;
*The user can show or hide the map view window by pressing &#039;&#039;M&#039;&#039; or &#039;&#039;Ctrl + M&#039;&#039; on the keyboard&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetMessageWindowVisible===&lt;br /&gt;
{{MethodHeader|public native void SetMessageWindowVisible(bool visible)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;visible&#039;&#039;&#039; = Use true to display and false to hide.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 if (Interface.HasUnseenMessages()) Interface.SetMessageWindowVisible(true);&lt;br /&gt;
;Notes&lt;br /&gt;
*See Also [[#GetMessageWindowVisible|GetMessageWindowVisible()]] and [[#HasUnseenMessages|HasUnseenMessages()]].&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetMetricMode===&lt;br /&gt;
{{MethodHeader|public native mode SetMetricMode(bool useMetric)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;useMetric&#039;&#039;&#039; = Use true to select metric units, false to select imperial.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 Interface.SetMetricMode(false);&lt;br /&gt;
;Notes&lt;br /&gt;
**See also [[#GetMetricMode|GetMetricMode()]].&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetObjective===&lt;br /&gt;
{{MethodHeader|public native void SetObjective(string message, string iconTexture)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;message&#039;&#039;&#039; = Text for objective message.&lt;br /&gt;
*&#039;&#039;&#039;iconTexture&#039;&#039;&#039; = Icon to display, use an empty string to omit the icon.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 Interface.SetObjective(&amp;quot;Line closed ahead&amp;quot;,&amp;quot;&amp;quot;);&lt;br /&gt;
;Notes&lt;br /&gt;
*This method will cause the driver objective panel to become visible.&lt;br /&gt;
*The User can hide or show the panel at their discretion.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetObjectiveBarVisible===&lt;br /&gt;
{{MethodHeader|public native void SetObjectiveBarVisible(bool visible)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;visible&#039;&#039;&#039; = Use true to display and false to hide.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 Interface.SetObjectiveBarVisible(false);&lt;br /&gt;
;Notes&lt;br /&gt;
*The Driver objective bar can be toggled between invisible and visible by pressing the &#039;&#039;F6&#039;&#039; key.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetObjectiveIcon===&lt;br /&gt;
{{MethodHeader|public native void SetObjectiveIcon(string iconTexture)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;iconTexture&#039;&#039;&#039; = Icon to display, use an empty string to remove a previous icon.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 Interface.SetObjectiveIcon(&amp;quot;&amp;quot;);&lt;br /&gt;
;Notes&lt;br /&gt;
*The image file to use as the icon must be a 32x32 *.tga image.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetResults===&lt;br /&gt;
{{MethodHeader|public native void SetResults(string message)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;message&#039;&#039;&#039; = String to display in results box.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 Interface.SetResults(&amp;quot;Result text to display&amp;quot;);&lt;br /&gt;
;Notes&lt;br /&gt;
*Displays the results of a scenario.&lt;br /&gt;
*This method will change the activities menu to the results screen and fill out the results box with the given string.&lt;br /&gt;
*The results will be visible when the user closes the activity module.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetScore===&lt;br /&gt;
{{MethodHeader|public native void SetScore(string message)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;message&#039;&#039;&#039; = Message to display in the activity bar.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 Interface.SetScore(&amp;quot;Score&amp;quot;);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetTooltip===&lt;br /&gt;
{{MethodHeader|public native void SetTooltip(Browser tooltip)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;tooltip&#039;&#039;&#039; = Browser to use as a tooltip window, if null the current tooltip will be removed.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 Interface.SetTooltip(tooltip);&lt;br /&gt;
;Notes&lt;br /&gt;
*Sets the tooltip that should follow the mouse around.&lt;br /&gt;
*This method specifies that tooltip should follow the mouse.&lt;br /&gt;
*Any existing tooltip will be replaced.&lt;br /&gt;
*If this Browser is released, it will be removed automatically.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetWaybillWindowVisible===&lt;br /&gt;
{{MethodHeader|public void SetWaybillWindowVisible(bool visible)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;visible&#039;&#039;&#039; = Use true to display and false to hide.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 Interface.SetWaybillWindowVisible(false);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===ShowDriverButtonMenu===&lt;br /&gt;
{{MethodHeader|public native void ShowDriverButtonMenu(bool visible)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;visible&#039;&#039;&#039; = Use true to display and false to hide.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 Interface.ShowDriverButtonMenu(true);&lt;br /&gt;
;Notes&lt;br /&gt;
*Showing and hiding is not immediate, there may be a delay before it slides on or off.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===ShowObjective===&lt;br /&gt;
{{MethodHeader|public native void ShowObjective(bool visible)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;visible&#039;&#039;&#039; = Use true to display and false to hide.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 Interface.ShowObjective(true);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===ShowOnScreenHelp===&lt;br /&gt;
{{MethodHeader|public native void ShowOnScreenHelp(bool visible)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;visible&#039;&#039;&#039; = Use true to display and false to hide.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 Interface.ShowOnScreenHelp(true);&lt;br /&gt;
;Notes&lt;br /&gt;
*This method performs the same function as the &#039;&#039;Show On-screen Help&#039;&#039; menu item in Driver which is used to display or hide names on map objects such as junctions.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===WarnObsolete===&lt;br /&gt;
{{MethodHeader|public native void WarnObsolete(string warning)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;warning&#039;&#039;&#039; = Message to log to &#039;&#039;jetlog.txt&#039;&#039; at the first time this method is called.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 Interface.WarnObsolete(&amp;quot;Method is obsolete&amp;quot;);&lt;br /&gt;
;Notes&lt;br /&gt;
*Generates a runtime warning that a given function or usage is obsolete.&lt;br /&gt;
*The warning goes to the JetLog.txt file and is not visible to the casual user within Trainz. &lt;br /&gt;
*Only one warning is generated for any given warning string.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Code Examples==&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Related Methods==&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Categories==&lt;br /&gt;
[[Category:Script Class]]&lt;/div&gt;</summary>
		<author><name>Ciceronmt</name></author>
	</entry>
	<entry>
		<id>https://wiki.trainzsimulator.com/index.php?title=Class_Locomotive&amp;diff=21456</id>
		<title>Class Locomotive</title>
		<link rel="alternate" type="text/html" href="https://wiki.trainzsimulator.com/index.php?title=Class_Locomotive&amp;diff=21456"/>
		<updated>2019-09-29T15:34:52Z</updated>

		<summary type="html">&lt;p&gt;Ciceronmt: /* SetEngineSetting */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;*[[TrainzScript Language Reference|API Hierarchy]]&lt;br /&gt;
**[[Class GSObject|GSObject]] *&lt;br /&gt;
***[[Class GameObject|GameObject]]&lt;br /&gt;
****[[Class TrainzGameObject|TrainzGameObject]]&lt;br /&gt;
****[[Class PropertyObject|PropertyObject]] *&lt;br /&gt;
*****[[Class MeshObject|MeshObject]]&lt;br /&gt;
******[[Class MapObject|MapObject]]&lt;br /&gt;
*******[[Class Trackside|Trackside]]&lt;br /&gt;
********[[Class Vehicle|Vehicle]]&lt;br /&gt;
*********Locomotive&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*A Locomotive is a specialised instance of a vehicle.&lt;br /&gt;
*In practice many of the methods in [[Class Vehicle]] apply to powered vehicles.&lt;br /&gt;
*A locomotive is always part of a train, if a locomotive is decoupled and left alone TRS will create a new consist to include it.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Methods==&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
===GetCabinData===&lt;br /&gt;
{{MethodHeader|public CabinData GetCabinData(void)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*None&lt;br /&gt;
;Returned Value&lt;br /&gt;
*A reference to a data object which stores the state of the locomotive&#039;s cabin.&lt;br /&gt;
;Syntax&lt;br /&gt;
 MyCabinData = loco.GetCabinData();&lt;br /&gt;
;Notes&lt;br /&gt;
*See [[Class CabinData]]&lt;br /&gt;
*The data object refers to an internal private CabinData object in this class that represents the state of the cabin&#039;s controls.&lt;br /&gt;
*This is usually maintained by the Cabin.Attach() and Cabin.Update() methods of the Cabin script.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetEngineSetting===&lt;br /&gt;
{{MethodHeader|public native float GetEngineSetting(string setting)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;setting&#039;&#039;&#039; = The name of the setting to retrieve.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*The value of the named setting.&lt;br /&gt;
;Syntax&lt;br /&gt;
 float throttle = GetEngineSetting(&amp;quot;throttle&amp;quot;);&lt;br /&gt;
;Notes&lt;br /&gt;
*See [[#SetEngineSetting|SetEngineSetting()]] for details of the values which can be used for the &#039;&#039;setting&#039;&#039; parameter.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetBellState===&lt;br /&gt;
{{MethodHeader|public native void SetBellState(bool state)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;state&#039;&#039;&#039; = If true plays and loops the sound of a bell, a value of false will deactivation it.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetBellState(true);&lt;br /&gt;
;Notes&lt;br /&gt;
*Asset of kind &amp;quot;hornsound&amp;quot; must be in the locomotive config.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetBrokenReverser===&lt;br /&gt;
{{MethodHeader|public native void SetBrokenReverser(bool broken)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;broken&#039;&#039;&#039; = If true the reverser will not function, a value of false will reactivate it.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetBrokenReverser(true); &lt;br /&gt;
;Notes&lt;br /&gt;
*When broken the reverser lever can still be used by the player but it will have no effect on the locomotive.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetBrokenThrottle===&lt;br /&gt;
{{MethodHeader|public native void SetBrokenThrottle(bool broken)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;broken&#039;&#039;&#039; = If true the throttle will not function, a value of false will reactivate it.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetBrokenThrottle(true);&lt;br /&gt;
;Notes&lt;br /&gt;
*When broken the throttle lever can still be used by the player but it will have no effect on the locomotive.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetCabinData===&lt;br /&gt;
{{MethodHeader|public void SetCabinData(CabinData data)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;data&#039;&#039;&#039; = A reference to the data object used to store details of the locomotive&#039;s cabin controls.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetCabinData(MyCabinData);&lt;br /&gt;
;Notes&lt;br /&gt;
*See [[Class CabinData]]&lt;br /&gt;
*The data object refers to an internal private CabinData object in this class that represents the state of the cabin&#039;s controls.&lt;br /&gt;
*This is usually maintained by the Cabin.Attach() and Cabin.Update() methods of the Cabin script.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetCompressorEfficiency===&lt;br /&gt;
{{MethodHeader|public native void SetCompressorEfficiency(float efficiency)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;efficiency&#039;&#039;&#039; = Efficiency of the compressor in the range 0.0 .. 1.0&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetCompressorEfficiency(0.5);&lt;br /&gt;
;Notes&lt;br /&gt;
*For a slow increase in pressure of the main reservoir.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetEngineSetting===&lt;br /&gt;
{{MethodHeader|public native void SetEngineSetting(string setting, float value)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;setting&#039;&#039;&#039; = The name of the setting to save.&lt;br /&gt;
*&#039;&#039;&#039;value&#039;&#039;&#039; = The value of the named setting.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetEngineSetting(&amp;quot;regulator&amp;quot;,0.5);&lt;br /&gt;
;Notes&lt;br /&gt;
*Settings you can write to with this method are:&lt;br /&gt;
**&amp;quot;dynamic-brake&amp;quot;&lt;br /&gt;
**&amp;quot;headlight&amp;quot; (value 0,0.5,1 only)&lt;br /&gt;
**&amp;quot;horn&amp;quot;&lt;br /&gt;
**&amp;quot;injector&amp;quot;&lt;br /&gt;
**&amp;quot;loco-auto-brake&amp;quot; (i.e independantbrake_lever)&lt;br /&gt;
**&amp;quot;pantograph&amp;quot;&lt;br /&gt;
**&amp;quot;regulator&amp;quot;&lt;br /&gt;
**&amp;quot;reverser&amp;quot;&lt;br /&gt;
**&amp;quot;steam-blower&amp;quot;&lt;br /&gt;
**&amp;quot;throttle&amp;quot;&lt;br /&gt;
**&amp;quot;train-auto-brake&amp;quot; (i.e. trainbrake_lever&#039;)&lt;br /&gt;
**&amp;quot;train-lap-brake&amp;quot;&lt;br /&gt;
**&amp;quot;script-brake-pressure&amp;quot; - A script-only brake pressure which does not correspond to any real brake device, specified in kPa. This may be used by interior scripts for implementing custom cab-mode braking behaviour, and is intended to be directly mapped from the cab controls rather than updated on a regular frame-by-frame basis from script. Native brake controls should be used where possible to avoid significant performance problems.&lt;br /&gt;
*Some apply to steam locomotives only.&lt;br /&gt;
*From personal experience: the settings for the electric locomotive are set in whole numbers (&amp;quot;dynamic-brake&amp;quot; 0-1-2; &amp;quot;reverser&amp;quot; 0-1-2 and so on).&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetHasDriver===&lt;br /&gt;
{{MethodHeader|public native void SetHasDriver(bool hasDriver)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;hasDriver&#039;&#039;&#039; = If true the locomotive has an assigned driver, if false it does not.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetHasDriver(true);&lt;br /&gt;
;Notes&lt;br /&gt;
*Only one locomotive in a train may have a driver. &lt;br /&gt;
*If you attempt to place a driver in this loco, any other driver on the train will be removed. &lt;br /&gt;
*The consist name and id will always stay with the driver.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Code Examples==&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Related Methods==&lt;br /&gt;
[[Class Train#GetFrontmostLocomotive|Train.GetFrontmostLocomotive()]]&amp;lt;br&amp;gt;&lt;br /&gt;
[[Class Train#GetVehicles|Train.GetVehicles()]]&amp;lt;br&amp;gt;&lt;br /&gt;
[[Class World#GetVehicleList|World.GetVehicleList()]]&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Categories==&lt;br /&gt;
[[Category:Script Class]]&lt;/div&gt;</summary>
		<author><name>Ciceronmt</name></author>
	</entry>
	<entry>
		<id>https://wiki.trainzsimulator.com/index.php?title=Class_Locomotive&amp;diff=21455</id>
		<title>Class Locomotive</title>
		<link rel="alternate" type="text/html" href="https://wiki.trainzsimulator.com/index.php?title=Class_Locomotive&amp;diff=21455"/>
		<updated>2019-09-29T15:34:25Z</updated>

		<summary type="html">&lt;p&gt;Ciceronmt: /* SetEngineSetting */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;*[[TrainzScript Language Reference|API Hierarchy]]&lt;br /&gt;
**[[Class GSObject|GSObject]] *&lt;br /&gt;
***[[Class GameObject|GameObject]]&lt;br /&gt;
****[[Class TrainzGameObject|TrainzGameObject]]&lt;br /&gt;
****[[Class PropertyObject|PropertyObject]] *&lt;br /&gt;
*****[[Class MeshObject|MeshObject]]&lt;br /&gt;
******[[Class MapObject|MapObject]]&lt;br /&gt;
*******[[Class Trackside|Trackside]]&lt;br /&gt;
********[[Class Vehicle|Vehicle]]&lt;br /&gt;
*********Locomotive&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*A Locomotive is a specialised instance of a vehicle.&lt;br /&gt;
*In practice many of the methods in [[Class Vehicle]] apply to powered vehicles.&lt;br /&gt;
*A locomotive is always part of a train, if a locomotive is decoupled and left alone TRS will create a new consist to include it.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Methods==&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
===GetCabinData===&lt;br /&gt;
{{MethodHeader|public CabinData GetCabinData(void)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*None&lt;br /&gt;
;Returned Value&lt;br /&gt;
*A reference to a data object which stores the state of the locomotive&#039;s cabin.&lt;br /&gt;
;Syntax&lt;br /&gt;
 MyCabinData = loco.GetCabinData();&lt;br /&gt;
;Notes&lt;br /&gt;
*See [[Class CabinData]]&lt;br /&gt;
*The data object refers to an internal private CabinData object in this class that represents the state of the cabin&#039;s controls.&lt;br /&gt;
*This is usually maintained by the Cabin.Attach() and Cabin.Update() methods of the Cabin script.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetEngineSetting===&lt;br /&gt;
{{MethodHeader|public native float GetEngineSetting(string setting)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;setting&#039;&#039;&#039; = The name of the setting to retrieve.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*The value of the named setting.&lt;br /&gt;
;Syntax&lt;br /&gt;
 float throttle = GetEngineSetting(&amp;quot;throttle&amp;quot;);&lt;br /&gt;
;Notes&lt;br /&gt;
*See [[#SetEngineSetting|SetEngineSetting()]] for details of the values which can be used for the &#039;&#039;setting&#039;&#039; parameter.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetBellState===&lt;br /&gt;
{{MethodHeader|public native void SetBellState(bool state)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;state&#039;&#039;&#039; = If true plays and loops the sound of a bell, a value of false will deactivation it.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetBellState(true);&lt;br /&gt;
;Notes&lt;br /&gt;
*Asset of kind &amp;quot;hornsound&amp;quot; must be in the locomotive config.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetBrokenReverser===&lt;br /&gt;
{{MethodHeader|public native void SetBrokenReverser(bool broken)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;broken&#039;&#039;&#039; = If true the reverser will not function, a value of false will reactivate it.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetBrokenReverser(true); &lt;br /&gt;
;Notes&lt;br /&gt;
*When broken the reverser lever can still be used by the player but it will have no effect on the locomotive.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetBrokenThrottle===&lt;br /&gt;
{{MethodHeader|public native void SetBrokenThrottle(bool broken)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;broken&#039;&#039;&#039; = If true the throttle will not function, a value of false will reactivate it.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetBrokenThrottle(true);&lt;br /&gt;
;Notes&lt;br /&gt;
*When broken the throttle lever can still be used by the player but it will have no effect on the locomotive.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetCabinData===&lt;br /&gt;
{{MethodHeader|public void SetCabinData(CabinData data)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;data&#039;&#039;&#039; = A reference to the data object used to store details of the locomotive&#039;s cabin controls.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetCabinData(MyCabinData);&lt;br /&gt;
;Notes&lt;br /&gt;
*See [[Class CabinData]]&lt;br /&gt;
*The data object refers to an internal private CabinData object in this class that represents the state of the cabin&#039;s controls.&lt;br /&gt;
*This is usually maintained by the Cabin.Attach() and Cabin.Update() methods of the Cabin script.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetCompressorEfficiency===&lt;br /&gt;
{{MethodHeader|public native void SetCompressorEfficiency(float efficiency)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;efficiency&#039;&#039;&#039; = Efficiency of the compressor in the range 0.0 .. 1.0&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetCompressorEfficiency(0.5);&lt;br /&gt;
;Notes&lt;br /&gt;
*For a slow increase in pressure of the main reservoir.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetEngineSetting===&lt;br /&gt;
{{MethodHeader|public native void SetEngineSetting(string setting, float value)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;setting&#039;&#039;&#039; = The name of the setting to save.&lt;br /&gt;
*&#039;&#039;&#039;value&#039;&#039;&#039; = The value of the named setting.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetEngineSetting(&amp;quot;regulator&amp;quot;,0.5);&lt;br /&gt;
;Notes&lt;br /&gt;
*Settings you can write to with this method are:&lt;br /&gt;
**&amp;quot;dynamic-brake&amp;quot;&lt;br /&gt;
**&amp;quot;headlight&amp;quot;(value 0,0.5,1 only)&lt;br /&gt;
**&amp;quot;horn&amp;quot;&lt;br /&gt;
**&amp;quot;injector&amp;quot;&lt;br /&gt;
**&amp;quot;loco-auto-brake&amp;quot; (i.e independantbrake_lever)&lt;br /&gt;
**&amp;quot;pantograph&amp;quot;&lt;br /&gt;
**&amp;quot;regulator&amp;quot;&lt;br /&gt;
**&amp;quot;reverser&amp;quot;&lt;br /&gt;
**&amp;quot;steam-blower&amp;quot;&lt;br /&gt;
**&amp;quot;throttle&amp;quot;&lt;br /&gt;
**&amp;quot;train-auto-brake&amp;quot; (i.e. trainbrake_lever&#039;)&lt;br /&gt;
**&amp;quot;train-lap-brake&amp;quot;&lt;br /&gt;
**&amp;quot;script-brake-pressure&amp;quot; - A script-only brake pressure which does not correspond to any real brake device, specified in kPa. This may be used by interior scripts for implementing custom cab-mode braking behaviour, and is intended to be directly mapped from the cab controls rather than updated on a regular frame-by-frame basis from script. Native brake controls should be used where possible to avoid significant performance problems.&lt;br /&gt;
*Some apply to steam locomotives only.&lt;br /&gt;
*From personal experience: the settings for the electric locomotive are set in whole numbers (&amp;quot;dynamic-brake&amp;quot; 0-1-2; &amp;quot;reverser&amp;quot; 0-1-2 and so on).&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetHasDriver===&lt;br /&gt;
{{MethodHeader|public native void SetHasDriver(bool hasDriver)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;hasDriver&#039;&#039;&#039; = If true the locomotive has an assigned driver, if false it does not.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetHasDriver(true);&lt;br /&gt;
;Notes&lt;br /&gt;
*Only one locomotive in a train may have a driver. &lt;br /&gt;
*If you attempt to place a driver in this loco, any other driver on the train will be removed. &lt;br /&gt;
*The consist name and id will always stay with the driver.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Code Examples==&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Related Methods==&lt;br /&gt;
[[Class Train#GetFrontmostLocomotive|Train.GetFrontmostLocomotive()]]&amp;lt;br&amp;gt;&lt;br /&gt;
[[Class Train#GetVehicles|Train.GetVehicles()]]&amp;lt;br&amp;gt;&lt;br /&gt;
[[Class World#GetVehicleList|World.GetVehicleList()]]&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Categories==&lt;br /&gt;
[[Category:Script Class]]&lt;/div&gt;</summary>
		<author><name>Ciceronmt</name></author>
	</entry>
	<entry>
		<id>https://wiki.trainzsimulator.com/index.php?title=Class_Locomotive&amp;diff=21445</id>
		<title>Class Locomotive</title>
		<link rel="alternate" type="text/html" href="https://wiki.trainzsimulator.com/index.php?title=Class_Locomotive&amp;diff=21445"/>
		<updated>2019-09-24T09:32:22Z</updated>

		<summary type="html">&lt;p&gt;Ciceronmt: /* SetBellState */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;*[[TrainzScript Language Reference|API Hierarchy]]&lt;br /&gt;
**[[Class GSObject|GSObject]] *&lt;br /&gt;
***[[Class GameObject|GameObject]]&lt;br /&gt;
****[[Class TrainzGameObject|TrainzGameObject]]&lt;br /&gt;
****[[Class PropertyObject|PropertyObject]] *&lt;br /&gt;
*****[[Class MeshObject|MeshObject]]&lt;br /&gt;
******[[Class MapObject|MapObject]]&lt;br /&gt;
*******[[Class Trackside|Trackside]]&lt;br /&gt;
********[[Class Vehicle|Vehicle]]&lt;br /&gt;
*********Locomotive&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*A Locomotive is a specialised instance of a vehicle.&lt;br /&gt;
*In practice many of the methods in [[Class Vehicle]] apply to powered vehicles.&lt;br /&gt;
*A locomotive is always part of a train, if a locomotive is decoupled and left alone TRS will create a new consist to include it.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Methods==&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
===GetCabinData===&lt;br /&gt;
{{MethodHeader|public CabinData GetCabinData(void)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*None&lt;br /&gt;
;Returned Value&lt;br /&gt;
*A reference to a data object which stores the state of the locomotive&#039;s cabin.&lt;br /&gt;
;Syntax&lt;br /&gt;
 MyCabinData = loco.GetCabinData();&lt;br /&gt;
;Notes&lt;br /&gt;
*See [[Class CabinData]]&lt;br /&gt;
*The data object refers to an internal private CabinData object in this class that represents the state of the cabin&#039;s controls.&lt;br /&gt;
*This is usually maintained by the Cabin.Attach() and Cabin.Update() methods of the Cabin script.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetEngineSetting===&lt;br /&gt;
{{MethodHeader|public native float GetEngineSetting(string setting)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;setting&#039;&#039;&#039; = The name of the setting to retrieve.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*The value of the named setting.&lt;br /&gt;
;Syntax&lt;br /&gt;
 float throttle = GetEngineSetting(&amp;quot;throttle&amp;quot;);&lt;br /&gt;
;Notes&lt;br /&gt;
*See [[#SetEngineSetting|SetEngineSetting()]] for details of the values which can be used for the &#039;&#039;setting&#039;&#039; parameter.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetBellState===&lt;br /&gt;
{{MethodHeader|public native void SetBellState(bool state)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;state&#039;&#039;&#039; = If true plays and loops the sound of a bell, a value of false will deactivation it.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetBellState(true);&lt;br /&gt;
;Notes&lt;br /&gt;
*Asset of kind &amp;quot;hornsound&amp;quot; must be in the locomotive config.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetBrokenReverser===&lt;br /&gt;
{{MethodHeader|public native void SetBrokenReverser(bool broken)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;broken&#039;&#039;&#039; = If true the reverser will not function, a value of false will reactivate it.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetBrokenReverser(true); &lt;br /&gt;
;Notes&lt;br /&gt;
*When broken the reverser lever can still be used by the player but it will have no effect on the locomotive.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetBrokenThrottle===&lt;br /&gt;
{{MethodHeader|public native void SetBrokenThrottle(bool broken)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;broken&#039;&#039;&#039; = If true the throttle will not function, a value of false will reactivate it.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetBrokenThrottle(true);&lt;br /&gt;
;Notes&lt;br /&gt;
*When broken the throttle lever can still be used by the player but it will have no effect on the locomotive.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetCabinData===&lt;br /&gt;
{{MethodHeader|public void SetCabinData(CabinData data)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;data&#039;&#039;&#039; = A reference to the data object used to store details of the locomotive&#039;s cabin controls.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetCabinData(MyCabinData);&lt;br /&gt;
;Notes&lt;br /&gt;
*See [[Class CabinData]]&lt;br /&gt;
*The data object refers to an internal private CabinData object in this class that represents the state of the cabin&#039;s controls.&lt;br /&gt;
*This is usually maintained by the Cabin.Attach() and Cabin.Update() methods of the Cabin script.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetCompressorEfficiency===&lt;br /&gt;
{{MethodHeader|public native void SetCompressorEfficiency(float efficiency)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;efficiency&#039;&#039;&#039; = Efficiency of the compressor in the range 0.0 .. 1.0&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetCompressorEfficiency(0.5);&lt;br /&gt;
;Notes&lt;br /&gt;
*For a slow increase in pressure of the main reservoir.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetEngineSetting===&lt;br /&gt;
{{MethodHeader|public native void SetEngineSetting(string setting, float value)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;setting&#039;&#039;&#039; = The name of the setting to save.&lt;br /&gt;
*&#039;&#039;&#039;value&#039;&#039;&#039; = The value of the named setting.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetEngineSetting(&amp;quot;regulator&amp;quot;,0.5);&lt;br /&gt;
;Notes&lt;br /&gt;
*Settings you can write to with this method are:&lt;br /&gt;
**&amp;quot;dynamic-brake&amp;quot;&lt;br /&gt;
**&amp;quot;headlight&amp;quot;&lt;br /&gt;
**&amp;quot;horn&amp;quot;&lt;br /&gt;
**&amp;quot;injector&amp;quot;&lt;br /&gt;
**&amp;quot;loco-auto-brake&amp;quot; (i.e independantbrake_lever)&lt;br /&gt;
**&amp;quot;pantograph&amp;quot;&lt;br /&gt;
**&amp;quot;regulator&amp;quot;&lt;br /&gt;
**&amp;quot;reverser&amp;quot;&lt;br /&gt;
**&amp;quot;steam-blower&amp;quot;&lt;br /&gt;
**&amp;quot;throttle&amp;quot;&lt;br /&gt;
**&amp;quot;train-auto-brake&amp;quot; (i.e. trainbrake_lever&#039;)&lt;br /&gt;
**&amp;quot;train-lap-brake&amp;quot;&lt;br /&gt;
**&amp;quot;script-brake-pressure&amp;quot; - A script-only brake pressure which does not correspond to any real brake device, specified in kPa. This may be used by interior scripts for implementing custom cab-mode braking behaviour, and is intended to be directly mapped from the cab controls rather than updated on a regular frame-by-frame basis from script. Native brake controls should be used where possible to avoid significant performance problems.&lt;br /&gt;
*Some apply to steam locomotives only.&lt;br /&gt;
*From personal experience: the settings for the electric locomotive are set in whole numbers (&amp;quot;dynamic-brake&amp;quot; 0-1-2; &amp;quot;reverser&amp;quot; 0-1-2 and so on).&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetHasDriver===&lt;br /&gt;
{{MethodHeader|public native void SetHasDriver(bool hasDriver)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;hasDriver&#039;&#039;&#039; = If true the locomotive has an assigned driver, if false it does not.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetHasDriver(true);&lt;br /&gt;
;Notes&lt;br /&gt;
*Only one locomotive in a train may have a driver. &lt;br /&gt;
*If you attempt to place a driver in this loco, any other driver on the train will be removed. &lt;br /&gt;
*The consist name and id will always stay with the driver.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Code Examples==&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Related Methods==&lt;br /&gt;
[[Class Train#GetFrontmostLocomotive|Train.GetFrontmostLocomotive()]]&amp;lt;br&amp;gt;&lt;br /&gt;
[[Class Train#GetVehicles|Train.GetVehicles()]]&amp;lt;br&amp;gt;&lt;br /&gt;
[[Class World#GetVehicleList|World.GetVehicleList()]]&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Categories==&lt;br /&gt;
[[Category:Script Class]]&lt;/div&gt;</summary>
		<author><name>Ciceronmt</name></author>
	</entry>
	<entry>
		<id>https://wiki.trainzsimulator.com/index.php?title=Class_Locomotive&amp;diff=21444</id>
		<title>Class Locomotive</title>
		<link rel="alternate" type="text/html" href="https://wiki.trainzsimulator.com/index.php?title=Class_Locomotive&amp;diff=21444"/>
		<updated>2019-09-24T09:30:02Z</updated>

		<summary type="html">&lt;p&gt;Ciceronmt: /* SetEngineSetting */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;*[[TrainzScript Language Reference|API Hierarchy]]&lt;br /&gt;
**[[Class GSObject|GSObject]] *&lt;br /&gt;
***[[Class GameObject|GameObject]]&lt;br /&gt;
****[[Class TrainzGameObject|TrainzGameObject]]&lt;br /&gt;
****[[Class PropertyObject|PropertyObject]] *&lt;br /&gt;
*****[[Class MeshObject|MeshObject]]&lt;br /&gt;
******[[Class MapObject|MapObject]]&lt;br /&gt;
*******[[Class Trackside|Trackside]]&lt;br /&gt;
********[[Class Vehicle|Vehicle]]&lt;br /&gt;
*********Locomotive&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*A Locomotive is a specialised instance of a vehicle.&lt;br /&gt;
*In practice many of the methods in [[Class Vehicle]] apply to powered vehicles.&lt;br /&gt;
*A locomotive is always part of a train, if a locomotive is decoupled and left alone TRS will create a new consist to include it.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Methods==&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
===GetCabinData===&lt;br /&gt;
{{MethodHeader|public CabinData GetCabinData(void)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*None&lt;br /&gt;
;Returned Value&lt;br /&gt;
*A reference to a data object which stores the state of the locomotive&#039;s cabin.&lt;br /&gt;
;Syntax&lt;br /&gt;
 MyCabinData = loco.GetCabinData();&lt;br /&gt;
;Notes&lt;br /&gt;
*See [[Class CabinData]]&lt;br /&gt;
*The data object refers to an internal private CabinData object in this class that represents the state of the cabin&#039;s controls.&lt;br /&gt;
*This is usually maintained by the Cabin.Attach() and Cabin.Update() methods of the Cabin script.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetEngineSetting===&lt;br /&gt;
{{MethodHeader|public native float GetEngineSetting(string setting)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;setting&#039;&#039;&#039; = The name of the setting to retrieve.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*The value of the named setting.&lt;br /&gt;
;Syntax&lt;br /&gt;
 float throttle = GetEngineSetting(&amp;quot;throttle&amp;quot;);&lt;br /&gt;
;Notes&lt;br /&gt;
*See [[#SetEngineSetting|SetEngineSetting()]] for details of the values which can be used for the &#039;&#039;setting&#039;&#039; parameter.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetBellState===&lt;br /&gt;
{{MethodHeader|public native void SetBellState(bool state)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;state&#039;&#039;&#039; = If true plays and loops the sound of a bell, a value of false will reactivate it.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetBellState(true);&lt;br /&gt;
;Notes&lt;br /&gt;
*Asset of kind &amp;quot;hornsound&amp;quot; must be in the locomotive config.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetBrokenReverser===&lt;br /&gt;
{{MethodHeader|public native void SetBrokenReverser(bool broken)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;broken&#039;&#039;&#039; = If true the reverser will not function, a value of false will reactivate it.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetBrokenReverser(true); &lt;br /&gt;
;Notes&lt;br /&gt;
*When broken the reverser lever can still be used by the player but it will have no effect on the locomotive.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetBrokenThrottle===&lt;br /&gt;
{{MethodHeader|public native void SetBrokenThrottle(bool broken)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;broken&#039;&#039;&#039; = If true the throttle will not function, a value of false will reactivate it.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetBrokenThrottle(true);&lt;br /&gt;
;Notes&lt;br /&gt;
*When broken the throttle lever can still be used by the player but it will have no effect on the locomotive.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetCabinData===&lt;br /&gt;
{{MethodHeader|public void SetCabinData(CabinData data)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;data&#039;&#039;&#039; = A reference to the data object used to store details of the locomotive&#039;s cabin controls.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetCabinData(MyCabinData);&lt;br /&gt;
;Notes&lt;br /&gt;
*See [[Class CabinData]]&lt;br /&gt;
*The data object refers to an internal private CabinData object in this class that represents the state of the cabin&#039;s controls.&lt;br /&gt;
*This is usually maintained by the Cabin.Attach() and Cabin.Update() methods of the Cabin script.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetCompressorEfficiency===&lt;br /&gt;
{{MethodHeader|public native void SetCompressorEfficiency(float efficiency)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;efficiency&#039;&#039;&#039; = Efficiency of the compressor in the range 0.0 .. 1.0&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetCompressorEfficiency(0.5);&lt;br /&gt;
;Notes&lt;br /&gt;
*For a slow increase in pressure of the main reservoir.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetEngineSetting===&lt;br /&gt;
{{MethodHeader|public native void SetEngineSetting(string setting, float value)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;setting&#039;&#039;&#039; = The name of the setting to save.&lt;br /&gt;
*&#039;&#039;&#039;value&#039;&#039;&#039; = The value of the named setting.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetEngineSetting(&amp;quot;regulator&amp;quot;,0.5);&lt;br /&gt;
;Notes&lt;br /&gt;
*Settings you can write to with this method are:&lt;br /&gt;
**&amp;quot;dynamic-brake&amp;quot;&lt;br /&gt;
**&amp;quot;headlight&amp;quot;&lt;br /&gt;
**&amp;quot;horn&amp;quot;&lt;br /&gt;
**&amp;quot;injector&amp;quot;&lt;br /&gt;
**&amp;quot;loco-auto-brake&amp;quot; (i.e independantbrake_lever)&lt;br /&gt;
**&amp;quot;pantograph&amp;quot;&lt;br /&gt;
**&amp;quot;regulator&amp;quot;&lt;br /&gt;
**&amp;quot;reverser&amp;quot;&lt;br /&gt;
**&amp;quot;steam-blower&amp;quot;&lt;br /&gt;
**&amp;quot;throttle&amp;quot;&lt;br /&gt;
**&amp;quot;train-auto-brake&amp;quot; (i.e. trainbrake_lever&#039;)&lt;br /&gt;
**&amp;quot;train-lap-brake&amp;quot;&lt;br /&gt;
**&amp;quot;script-brake-pressure&amp;quot; - A script-only brake pressure which does not correspond to any real brake device, specified in kPa. This may be used by interior scripts for implementing custom cab-mode braking behaviour, and is intended to be directly mapped from the cab controls rather than updated on a regular frame-by-frame basis from script. Native brake controls should be used where possible to avoid significant performance problems.&lt;br /&gt;
*Some apply to steam locomotives only.&lt;br /&gt;
*From personal experience: the settings for the electric locomotive are set in whole numbers (&amp;quot;dynamic-brake&amp;quot; 0-1-2; &amp;quot;reverser&amp;quot; 0-1-2 and so on).&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetHasDriver===&lt;br /&gt;
{{MethodHeader|public native void SetHasDriver(bool hasDriver)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;hasDriver&#039;&#039;&#039; = If true the locomotive has an assigned driver, if false it does not.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetHasDriver(true);&lt;br /&gt;
;Notes&lt;br /&gt;
*Only one locomotive in a train may have a driver. &lt;br /&gt;
*If you attempt to place a driver in this loco, any other driver on the train will be removed. &lt;br /&gt;
*The consist name and id will always stay with the driver.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Code Examples==&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Related Methods==&lt;br /&gt;
[[Class Train#GetFrontmostLocomotive|Train.GetFrontmostLocomotive()]]&amp;lt;br&amp;gt;&lt;br /&gt;
[[Class Train#GetVehicles|Train.GetVehicles()]]&amp;lt;br&amp;gt;&lt;br /&gt;
[[Class World#GetVehicleList|World.GetVehicleList()]]&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Categories==&lt;br /&gt;
[[Category:Script Class]]&lt;/div&gt;</summary>
		<author><name>Ciceronmt</name></author>
	</entry>
	<entry>
		<id>https://wiki.trainzsimulator.com/index.php?title=Class_Locomotive&amp;diff=21443</id>
		<title>Class Locomotive</title>
		<link rel="alternate" type="text/html" href="https://wiki.trainzsimulator.com/index.php?title=Class_Locomotive&amp;diff=21443"/>
		<updated>2019-09-24T09:27:52Z</updated>

		<summary type="html">&lt;p&gt;Ciceronmt: /* Methods */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;*[[TrainzScript Language Reference|API Hierarchy]]&lt;br /&gt;
**[[Class GSObject|GSObject]] *&lt;br /&gt;
***[[Class GameObject|GameObject]]&lt;br /&gt;
****[[Class TrainzGameObject|TrainzGameObject]]&lt;br /&gt;
****[[Class PropertyObject|PropertyObject]] *&lt;br /&gt;
*****[[Class MeshObject|MeshObject]]&lt;br /&gt;
******[[Class MapObject|MapObject]]&lt;br /&gt;
*******[[Class Trackside|Trackside]]&lt;br /&gt;
********[[Class Vehicle|Vehicle]]&lt;br /&gt;
*********Locomotive&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*A Locomotive is a specialised instance of a vehicle.&lt;br /&gt;
*In practice many of the methods in [[Class Vehicle]] apply to powered vehicles.&lt;br /&gt;
*A locomotive is always part of a train, if a locomotive is decoupled and left alone TRS will create a new consist to include it.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Methods==&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
===GetCabinData===&lt;br /&gt;
{{MethodHeader|public CabinData GetCabinData(void)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*None&lt;br /&gt;
;Returned Value&lt;br /&gt;
*A reference to a data object which stores the state of the locomotive&#039;s cabin.&lt;br /&gt;
;Syntax&lt;br /&gt;
 MyCabinData = loco.GetCabinData();&lt;br /&gt;
;Notes&lt;br /&gt;
*See [[Class CabinData]]&lt;br /&gt;
*The data object refers to an internal private CabinData object in this class that represents the state of the cabin&#039;s controls.&lt;br /&gt;
*This is usually maintained by the Cabin.Attach() and Cabin.Update() methods of the Cabin script.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetEngineSetting===&lt;br /&gt;
{{MethodHeader|public native float GetEngineSetting(string setting)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;setting&#039;&#039;&#039; = The name of the setting to retrieve.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*The value of the named setting.&lt;br /&gt;
;Syntax&lt;br /&gt;
 float throttle = GetEngineSetting(&amp;quot;throttle&amp;quot;);&lt;br /&gt;
;Notes&lt;br /&gt;
*See [[#SetEngineSetting|SetEngineSetting()]] for details of the values which can be used for the &#039;&#039;setting&#039;&#039; parameter.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetBellState===&lt;br /&gt;
{{MethodHeader|public native void SetBellState(bool state)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;state&#039;&#039;&#039; = If true plays and loops the sound of a bell, a value of false will reactivate it.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetBellState(true);&lt;br /&gt;
;Notes&lt;br /&gt;
*Asset of kind &amp;quot;hornsound&amp;quot; must be in the locomotive config.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetBrokenReverser===&lt;br /&gt;
{{MethodHeader|public native void SetBrokenReverser(bool broken)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;broken&#039;&#039;&#039; = If true the reverser will not function, a value of false will reactivate it.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetBrokenReverser(true); &lt;br /&gt;
;Notes&lt;br /&gt;
*When broken the reverser lever can still be used by the player but it will have no effect on the locomotive.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetBrokenThrottle===&lt;br /&gt;
{{MethodHeader|public native void SetBrokenThrottle(bool broken)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;broken&#039;&#039;&#039; = If true the throttle will not function, a value of false will reactivate it.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetBrokenThrottle(true);&lt;br /&gt;
;Notes&lt;br /&gt;
*When broken the throttle lever can still be used by the player but it will have no effect on the locomotive.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetCabinData===&lt;br /&gt;
{{MethodHeader|public void SetCabinData(CabinData data)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;data&#039;&#039;&#039; = A reference to the data object used to store details of the locomotive&#039;s cabin controls.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetCabinData(MyCabinData);&lt;br /&gt;
;Notes&lt;br /&gt;
*See [[Class CabinData]]&lt;br /&gt;
*The data object refers to an internal private CabinData object in this class that represents the state of the cabin&#039;s controls.&lt;br /&gt;
*This is usually maintained by the Cabin.Attach() and Cabin.Update() methods of the Cabin script.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetCompressorEfficiency===&lt;br /&gt;
{{MethodHeader|public native void SetCompressorEfficiency(float efficiency)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;efficiency&#039;&#039;&#039; = Efficiency of the compressor in the range 0.0 .. 1.0&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetCompressorEfficiency(0.5);&lt;br /&gt;
;Notes&lt;br /&gt;
*For a slow increase in pressure of the main reservoir.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetEngineSetting===&lt;br /&gt;
{{MethodHeader|public native void SetEngineSetting(string setting, float value)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;setting&#039;&#039;&#039; = The name of the setting to save.&lt;br /&gt;
*&#039;&#039;&#039;value&#039;&#039;&#039; = The value of the named setting.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetEngineSetting(&amp;quot;regulator&amp;quot;,0.5);&lt;br /&gt;
;Notes&lt;br /&gt;
*Settings you can write to with this method are:&lt;br /&gt;
**&amp;quot;dynamic-brake&amp;quot;&lt;br /&gt;
**&amp;quot;headlight&amp;quot;&lt;br /&gt;
**&amp;quot;injector&amp;quot;&lt;br /&gt;
**&amp;quot;loco-auto-brake&amp;quot; (i.e independantbrake_lever)&lt;br /&gt;
**&amp;quot;pantograph&amp;quot;&lt;br /&gt;
**&amp;quot;regulator&amp;quot;&lt;br /&gt;
**&amp;quot;reverser&amp;quot;&lt;br /&gt;
**&amp;quot;steam-blower&amp;quot;&lt;br /&gt;
**&amp;quot;throttle&amp;quot;&lt;br /&gt;
**&amp;quot;train-auto-brake&amp;quot; (i.e. trainbrake_lever&#039;)&lt;br /&gt;
**&amp;quot;train-lap-brake&amp;quot;&lt;br /&gt;
**&amp;quot;script-brake-pressure&amp;quot; - A script-only brake pressure which does not correspond to any real brake device, specified in kPa. This may be used by interior scripts for implementing custom cab-mode braking behaviour, and is intended to be directly mapped from the cab controls rather than updated on a regular frame-by-frame basis from script. Native brake controls should be used where possible to avoid significant performance problems.&lt;br /&gt;
*Some apply to steam locomotives only.&lt;br /&gt;
*From personal experience: the settings for the electric locomotive are set in whole numbers (&amp;quot;dynamic-brake&amp;quot; 0-1-2; &amp;quot;reverser&amp;quot; 0-1-2 and so on).&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetHasDriver===&lt;br /&gt;
{{MethodHeader|public native void SetHasDriver(bool hasDriver)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;hasDriver&#039;&#039;&#039; = If true the locomotive has an assigned driver, if false it does not.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetHasDriver(true);&lt;br /&gt;
;Notes&lt;br /&gt;
*Only one locomotive in a train may have a driver. &lt;br /&gt;
*If you attempt to place a driver in this loco, any other driver on the train will be removed. &lt;br /&gt;
*The consist name and id will always stay with the driver.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Code Examples==&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Related Methods==&lt;br /&gt;
[[Class Train#GetFrontmostLocomotive|Train.GetFrontmostLocomotive()]]&amp;lt;br&amp;gt;&lt;br /&gt;
[[Class Train#GetVehicles|Train.GetVehicles()]]&amp;lt;br&amp;gt;&lt;br /&gt;
[[Class World#GetVehicleList|World.GetVehicleList()]]&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Categories==&lt;br /&gt;
[[Category:Script Class]]&lt;/div&gt;</summary>
		<author><name>Ciceronmt</name></author>
	</entry>
	<entry>
		<id>https://wiki.trainzsimulator.com/index.php?title=Class_Locomotive&amp;diff=21442</id>
		<title>Class Locomotive</title>
		<link rel="alternate" type="text/html" href="https://wiki.trainzsimulator.com/index.php?title=Class_Locomotive&amp;diff=21442"/>
		<updated>2019-09-23T16:01:04Z</updated>

		<summary type="html">&lt;p&gt;Ciceronmt: /* SetCompressorEfficiency */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;*[[TrainzScript Language Reference|API Hierarchy]]&lt;br /&gt;
**[[Class GSObject|GSObject]] *&lt;br /&gt;
***[[Class GameObject|GameObject]]&lt;br /&gt;
****[[Class TrainzGameObject|TrainzGameObject]]&lt;br /&gt;
****[[Class PropertyObject|PropertyObject]] *&lt;br /&gt;
*****[[Class MeshObject|MeshObject]]&lt;br /&gt;
******[[Class MapObject|MapObject]]&lt;br /&gt;
*******[[Class Trackside|Trackside]]&lt;br /&gt;
********[[Class Vehicle|Vehicle]]&lt;br /&gt;
*********Locomotive&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*A Locomotive is a specialised instance of a vehicle.&lt;br /&gt;
*In practice many of the methods in [[Class Vehicle]] apply to powered vehicles.&lt;br /&gt;
*A locomotive is always part of a train, if a locomotive is decoupled and left alone TRS will create a new consist to include it.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Methods==&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
===GetCabinData===&lt;br /&gt;
{{MethodHeader|public CabinData GetCabinData(void)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*None&lt;br /&gt;
;Returned Value&lt;br /&gt;
*A reference to a data object which stores the state of the locomotive&#039;s cabin.&lt;br /&gt;
;Syntax&lt;br /&gt;
 MyCabinData = loco.GetCabinData();&lt;br /&gt;
;Notes&lt;br /&gt;
*See [[Class CabinData]]&lt;br /&gt;
*The data object refers to an internal private CabinData object in this class that represents the state of the cabin&#039;s controls.&lt;br /&gt;
*This is usually maintained by the Cabin.Attach() and Cabin.Update() methods of the Cabin script.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetEngineSetting===&lt;br /&gt;
{{MethodHeader|public native float GetEngineSetting(string setting)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;setting&#039;&#039;&#039; = The name of the setting to retrieve.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*The value of the named setting.&lt;br /&gt;
;Syntax&lt;br /&gt;
 float throttle = GetEngineSetting(&amp;quot;throttle&amp;quot;);&lt;br /&gt;
;Notes&lt;br /&gt;
*See [[#SetEngineSetting|SetEngineSetting()]] for details of the values which can be used for the &#039;&#039;setting&#039;&#039; parameter.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetBrokenReverser===&lt;br /&gt;
{{MethodHeader|public native void SetBrokenReverser(bool broken)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;broken&#039;&#039;&#039; = If true the reverser will not function, a value of false will reactivate it.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetBrokenReverser(true); &lt;br /&gt;
;Notes&lt;br /&gt;
*When broken the reverser lever can still be used by the player but it will have no effect on the locomotive.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetBrokenThrottle===&lt;br /&gt;
{{MethodHeader|public native void SetBrokenThrottle(bool broken)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;broken&#039;&#039;&#039; = If true the throttle will not function, a value of false will reactivate it.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetBrokenThrottle(true);&lt;br /&gt;
;Notes&lt;br /&gt;
*When broken the throttle lever can still be used by the player but it will have no effect on the locomotive.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetCabinData===&lt;br /&gt;
{{MethodHeader|public void SetCabinData(CabinData data)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;data&#039;&#039;&#039; = A reference to the data object used to store details of the locomotive&#039;s cabin controls.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetCabinData(MyCabinData);&lt;br /&gt;
;Notes&lt;br /&gt;
*See [[Class CabinData]]&lt;br /&gt;
*The data object refers to an internal private CabinData object in this class that represents the state of the cabin&#039;s controls.&lt;br /&gt;
*This is usually maintained by the Cabin.Attach() and Cabin.Update() methods of the Cabin script.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetCompressorEfficiency===&lt;br /&gt;
{{MethodHeader|public native void SetCompressorEfficiency(float efficiency)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;efficiency&#039;&#039;&#039; = Efficiency of the compressor in the range 0.0 .. 1.0&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetCompressorEfficiency(0.5);&lt;br /&gt;
;Notes&lt;br /&gt;
*For a slow increase in pressure of the main reservoir.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetEngineSetting===&lt;br /&gt;
{{MethodHeader|public native void SetEngineSetting(string setting, float value)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;setting&#039;&#039;&#039; = The name of the setting to save.&lt;br /&gt;
*&#039;&#039;&#039;value&#039;&#039;&#039; = The value of the named setting.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetEngineSetting(&amp;quot;regulator&amp;quot;,0.5);&lt;br /&gt;
;Notes&lt;br /&gt;
*Settings you can write to with this method are:&lt;br /&gt;
**&amp;quot;dynamic-brake&amp;quot;&lt;br /&gt;
**&amp;quot;headlight&amp;quot;&lt;br /&gt;
**&amp;quot;injector&amp;quot;&lt;br /&gt;
**&amp;quot;loco-auto-brake&amp;quot; (i.e independantbrake_lever)&lt;br /&gt;
**&amp;quot;pantograph&amp;quot;&lt;br /&gt;
**&amp;quot;regulator&amp;quot;&lt;br /&gt;
**&amp;quot;reverser&amp;quot;&lt;br /&gt;
**&amp;quot;steam-blower&amp;quot;&lt;br /&gt;
**&amp;quot;throttle&amp;quot;&lt;br /&gt;
**&amp;quot;train-auto-brake&amp;quot; (i.e. trainbrake_lever&#039;)&lt;br /&gt;
**&amp;quot;train-lap-brake&amp;quot;&lt;br /&gt;
**&amp;quot;script-brake-pressure&amp;quot; - A script-only brake pressure which does not correspond to any real brake device, specified in kPa. This may be used by interior scripts for implementing custom cab-mode braking behaviour, and is intended to be directly mapped from the cab controls rather than updated on a regular frame-by-frame basis from script. Native brake controls should be used where possible to avoid significant performance problems.&lt;br /&gt;
*Some apply to steam locomotives only.&lt;br /&gt;
*From personal experience: the settings for the electric locomotive are set in whole numbers (&amp;quot;dynamic-brake&amp;quot; 0-1-2; &amp;quot;reverser&amp;quot; 0-1-2 and so on).&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetHasDriver===&lt;br /&gt;
{{MethodHeader|public native void SetHasDriver(bool hasDriver)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;hasDriver&#039;&#039;&#039; = If true the locomotive has an assigned driver, if false it does not.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetHasDriver(true);&lt;br /&gt;
;Notes&lt;br /&gt;
*Only one locomotive in a train may have a driver. &lt;br /&gt;
*If you attempt to place a driver in this loco, any other driver on the train will be removed. &lt;br /&gt;
*The consist name and id will always stay with the driver.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Code Examples==&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Related Methods==&lt;br /&gt;
[[Class Train#GetFrontmostLocomotive|Train.GetFrontmostLocomotive()]]&amp;lt;br&amp;gt;&lt;br /&gt;
[[Class Train#GetVehicles|Train.GetVehicles()]]&amp;lt;br&amp;gt;&lt;br /&gt;
[[Class World#GetVehicleList|World.GetVehicleList()]]&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Categories==&lt;br /&gt;
[[Category:Script Class]]&lt;/div&gt;</summary>
		<author><name>Ciceronmt</name></author>
	</entry>
	<entry>
		<id>https://wiki.trainzsimulator.com/index.php?title=List_of_Standard_Messages&amp;diff=21344</id>
		<title>List of Standard Messages</title>
		<link rel="alternate" type="text/html" href="https://wiki.trainzsimulator.com/index.php?title=List_of_Standard_Messages&amp;diff=21344"/>
		<updated>2019-09-14T13:43:20Z</updated>

		<summary type="html">&lt;p&gt;Ciceronmt: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;*[[TrainzScript Language Reference|API Hierarchy]]&lt;br /&gt;
&lt;br /&gt;
*This list is a first step towards documenting Trainz use of messages. It has been generated by scanning one or two copies of jetlog.txt from TC, together with the TC scripts folder and the TRS2006 copy of index.chm. There are probably many standard messages missing and there are some obscure ones listed. Please add anything that is missing. I will progressively link and document the list. &lt;br /&gt;
__NOTOC__ __NOEDITSECTION__&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{|rules=&amp;quot;rows&amp;quot; cellpadding=&amp;quot;2&amp;quot; cellspacing=&amp;quot;2&amp;quot; width=&amp;quot;95%&amp;quot; style=&amp;quot;border-collapse:collapse;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|width=&amp;quot;15&amp;quot;|&lt;br /&gt;
|width=&amp;quot;250&amp;quot;|Message&lt;br /&gt;
|width=&amp;quot;165&amp;quot;|Source &amp;amp; Destination&lt;br /&gt;
|Purpose&lt;br /&gt;
|&lt;br /&gt;
{{IndexSplit|A}}&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Animation-Event Message|Animation-Event,&#039;&#039;eventname&#039;&#039;]]&lt;br /&gt;
|meshobject &amp;gt; meshobject&lt;br /&gt;
|Sent when an animation triggers an event. These events are included in *.kin files generated by Max when the &#039;Query for Event&#039; box is checked during animation export.  They are used to enable code to be executed in sync with animations.&lt;br /&gt;
{{IndexSplit|B}}&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|BaseIndustry,LoadComplete&lt;br /&gt;
|industry &amp;gt; industry&lt;br /&gt;
|Sent when an industry loading operation has completed&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Browser Messages|Browser-Closed,&#039;&#039;null&#039;&#039;]]&lt;br /&gt;
|browser &amp;gt; broadcast&lt;br /&gt;
|Sent when any in game browser is closed.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|Browser-Key,ScriptObjectives&lt;br /&gt;
|? &amp;gt; ?&lt;br /&gt;
|Sent by Trainz in response to a ScriptObjectives hotkey press. Obsolete?&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Browser Messages|Browser-URL,&#039;&#039;live://linkname&#039;&#039;]]&lt;br /&gt;
|browser &amp;gt; broadcast&lt;br /&gt;
|Sent when the user clicks in a link in a custom browser&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|Build,Cancelled&lt;br /&gt;
|? &amp;gt; buildable&lt;br /&gt;
|Not generally used. Intended for RTS-style gameplay where individual industries (etc) start in an unbuilt state and can be built at some resource cost during gameplay.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|Build,Completed&lt;br /&gt;
|? &amp;gt; buildable&lt;br /&gt;
|Not generally used. Intended for RTS-style gameplay where individual industries (etc) start in an unbuilt state and can be built at some resource cost during gameplay.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|Build,Started&lt;br /&gt;
|? &amp;gt; buildable&lt;br /&gt;
|Not generally used. Intended for RTS-style gameplay where individual industries (etc) start in an unbuilt state and can be built at some resource cost during gameplay.&lt;br /&gt;
{{IndexSplit|C}}&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Camera Messages|Camera,Interior-Changed]]&lt;br /&gt;
|new train? &amp;gt; broadcast&lt;br /&gt;
|Sent when a different train is selected.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Camera Messages|Camera,Target-Changed]]&lt;br /&gt;
|new target? &amp;gt; broadcast&lt;br /&gt;
|Sent when the camera selects a different target, may not be a train.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Camera Messages|Camera,External-View]]&lt;br /&gt;
|? &amp;gt; broadcast&lt;br /&gt;
|Sent when the camera mode is changed.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Camera Messages|Camera,Internal-View]]&lt;br /&gt;
|? &amp;gt; Broadcast&lt;br /&gt;
|Sent when the camera mode is changed.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Camera Messages|Camera,Roaming-View]]&lt;br /&gt;
|? &amp;gt; broadcast&lt;br /&gt;
|Sent when the camera mode is changed.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Camera Messages|Camera,Tracking-View]]&lt;br /&gt;
|? &amp;gt; broadcast&lt;br /&gt;
|Sent when the camera mode is changed.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|Check,Speed&lt;br /&gt;
|vehicle &amp;gt; vehicle&lt;br /&gt;
|Sent continuously to ensure that jetlog isn&#039;t allowed to remain legible :-)&lt;br /&gt;
{{IndexSplit|D}}&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|DriverCharacter,BoardedTrain&lt;br /&gt;
|driver &amp;gt; broadcast&lt;br /&gt;
|Sent when a driver boards a train&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|DriverCharacter,Created&lt;br /&gt;
|driver &amp;gt; broadcast&lt;br /&gt;
|Sent when a driver character is initialised&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|DriverCharacter,LeftTrain&lt;br /&gt;
|driver &amp;gt; broadcast&lt;br /&gt;
|Sent when a driver leaves a train&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|DriverDisplay,ResetTripMeter&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Interface Messages|DriverModule,DCC-Panel-Created]]&lt;br /&gt;
|? &amp;gt; broadcast&lt;br /&gt;
|Sent when driver selection widget has been created&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|DriverSetup,CharactersDone&lt;br /&gt;
|? &amp;gt; broadcast&lt;br /&gt;
|Sent when driver characters have been initialised&lt;br /&gt;
{{IndexSplit|G}}&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|GenericIndustry,LoadComplete&lt;br /&gt;
|industry &amp;gt; industry&lt;br /&gt;
|Sent when an industry loading operation has completed&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|GenericIndustry,ProcessComplete&lt;br /&gt;
|industry &amp;gt; industry&lt;br /&gt;
|Sent when an industry process has completed&lt;br /&gt;
{{IndexSplit|H}}&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|HandleTrain,Release&lt;br /&gt;
|industry &amp;gt; train&lt;br /&gt;
|Sent when an industry loading operation has completed&lt;br /&gt;
{{IndexSplit|I}}&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Interface Messages|Interface,ClickSystemButton]]&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Interface Messages|Interface-Event,MapViewOff]]&lt;br /&gt;
|? &amp;gt; broadcast&lt;br /&gt;
|Sent when the minimap is opened&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Interface Messages|Interface-Event,MapViewOn]]&lt;br /&gt;
|? &amp;gt; broadcast&lt;br /&gt;
|Sent when the minimap is closed&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Interface Messages|Interface-Event,Minimap-Mouse-Enter]]&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Interface Messages|Interface-Event,Minimap-Mouse-Leave]]&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Interface Messages|Interface-Event,New-Driver-Message]]&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Interface Messages|Interface-Event,Mouse-Enter]]&lt;br /&gt;
|object &amp;gt; broadcast&lt;br /&gt;
|Sent on mouseover an object&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Interface Messages|Interface-Event,Mouse-Leave]]&lt;br /&gt;
|? &amp;gt; broadcast&lt;br /&gt;
|Sent on mouseout of an object&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Interface Messages|Interface-Event,Set-Metric-Mode]]&lt;br /&gt;
|? &amp;gt; broadcast&lt;br /&gt;
|Sent when the interface units are changed&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Interface Messages|Interface-Event,Toggle-Interface]]&lt;br /&gt;
|? &amp;gt; broadcast&lt;br /&gt;
|Sent when the main HUD is turned on or off&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Interface Messages|Interface-Event,Toggle-ButtonBar]]&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Interface Messages|Interface-Event,Toggle-CustomHUD]]&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Interface Messages|Interface-Event,Toggle-VehicleControls]]&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Interface Messages|Interface-Event,Left-Click]]&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Interface Messages|Interface-Event,Surveyor-Left-Click]]&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
{{IndexSplit|J}}&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Object Messages|Junction,Enter]]&lt;br /&gt;
|junction &amp;gt; train&lt;br /&gt;
|Sent when a train enters a junction&#039;s outer area&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Object Messages|Junction,InnerEnter]]&lt;br /&gt;
|junction &amp;gt; train&lt;br /&gt;
|Sent when a train enters a junction&#039;s inner area&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Object Messages|Junction,InnerLeave]]&lt;br /&gt;
|junction &amp;gt; train&lt;br /&gt;
|Sent when a train leaves a junction&#039;s inner area&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Object Messages|Junction,Leave]]&lt;br /&gt;
|junction &amp;gt; train&lt;br /&gt;
|Sent when a train leaves a junction&#039;s outer area&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Object Messages|Junction,Stopped]]&lt;br /&gt;
|junction &amp;gt; train&lt;br /&gt;
|Sent when a train stops in a junction trigger area&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|Junction,Toggled&lt;br /&gt;
|junction &amp;gt; broadcast&lt;br /&gt;
|Sent when a junctionbase object is toggled&lt;br /&gt;
{{IndexSplit|M}}&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[MapObject Messages|MapObject,View-Details]]&lt;br /&gt;
|? &amp;gt; object&lt;br /&gt;
|Sent when the user right-clicks an object and selects &#039;View Details&#039; from the resulting menu, some assets provide a built-in browser in response to this message.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[MapObject Messages|MapObject,View-Schedule]]&lt;br /&gt;
|? &amp;gt; ?&lt;br /&gt;
|Sent when the user right-clicks an object and selects &#039;View Schedule&#039; from the resulting menu. The vehicle must have a timetable for this menu item to be displayed.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|MeshObject-Click,*&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
{{IndexSplit|O}}&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Object Messages|Object,Enter]]&lt;br /&gt;
|crossing &amp;gt; crossing&lt;br /&gt;
|Train has entered crossing trigger area&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Object Messages|Object,Leave]]&lt;br /&gt;
|crossing &amp;gt; crossing&lt;br /&gt;
|Train has left crossing trigger area&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Object Messages|Object,Enter]]&lt;br /&gt;
|train &amp;gt; junction&lt;br /&gt;
|Sent when a train enters a junction&#039;s outer area&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Object Messages|Object,InnerEnter]]&lt;br /&gt;
|train &amp;gt; junction&lt;br /&gt;
|Sent when a train enters a junction&#039;s inner area&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Object Messages|Object,InnerLeave]]&lt;br /&gt;
|train &amp;gt; junction&lt;br /&gt;
|Sent when a train leaves a junction&#039;s inner area&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Object Messages|Object,Leave]]&lt;br /&gt;
|train &amp;gt; junction&lt;br /&gt;
|Sent when a train leaves a junction&#039;s outer area&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Object Messages|Object,Stopped]]&lt;br /&gt;
|train &amp;gt; junction&lt;br /&gt;
|Sent when a train stops in a junction trigger area&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Object Messages|Object,Enter]]&lt;br /&gt;
|train &amp;gt; trackmark&lt;br /&gt;
|Sent when a train enters a trackmark&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Object Messages|Object,Leave]]&lt;br /&gt;
|train &amp;gt; trackmark&lt;br /&gt;
|Sent when a train leaves a trackmark&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Object Messages|Object,Stopped]]&lt;br /&gt;
|train &amp;gt; trackmark&lt;br /&gt;
|Sent when a train stops at a trackmark&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Object Messages|Object,Enter]]&lt;br /&gt;
|train &amp;gt; trigger&lt;br /&gt;
|Sent when a train enters a trigger&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Object Messages|Object,Leave]]&lt;br /&gt;
|train &amp;gt; trigger&lt;br /&gt;
|Sent when a train leaves a trigger&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Object Messages|Object,Stopped]]&lt;br /&gt;
|train &amp;gt; trigger&lt;br /&gt;
|Sent when a train stops at a trigger&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Object Messages|Object,Enter]]&lt;br /&gt;
|vehicle &amp;gt; scenerywithtrack&lt;br /&gt;
|Sent when a vehicle enters a scenery trigger&#039;s outer area&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Object Messages|Object,InnerEnter]]&lt;br /&gt;
|vehicle &amp;gt; scenerywithtrack&lt;br /&gt;
|Sent when a vehicle enters a scenery trigger&#039;s inner area&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Object Messages|Object,InnerLeave]]&lt;br /&gt;
|vehicle &amp;gt; scenerywithtrack&lt;br /&gt;
|Sent when a vehicle leaves a scenery trigger&#039;s inner area&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Object Messages|Object,Leave]]&lt;br /&gt;
|vehicle &amp;gt; scenerywithtrack&lt;br /&gt;
|Sent when a vehicle leaves a scenery trigger&#039;s outer area&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Object Messages|Object,Stopped]]&lt;br /&gt;
|vehicle &amp;gt; scenerywithtrack&lt;br /&gt;
|Sent when a train stops in a scenery trigger&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|OnlineAccess,ReceiveMessage&lt;br /&gt;
|? &amp;gt; onlineaccess&lt;br /&gt;
|Message awaiting collection&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|OnlineAccess,StatusChange&lt;br /&gt;
|? &amp;gt; onlineaccess&lt;br /&gt;
|Network status change&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|OnlineGroup,StatusChange&lt;br /&gt;
|? &amp;gt; onlinegroup&lt;br /&gt;
|Network status change&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|OnlineGroup,UsersChange&lt;br /&gt;
|? &amp;gt; onlinegroup&lt;br /&gt;
|Network users change&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|OnlineGroup.UserRemoved,*&lt;br /&gt;
|? &amp;gt; onlinegroup&lt;br /&gt;
|Network users change&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|OnlineGroup.UserAdded,*&lt;br /&gt;
|? &amp;gt; onlinegroup&lt;br /&gt;
|Network users change&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|OnlineGroup.UserStatus,*&lt;br /&gt;
|? &amp;gt; onlinegroup&lt;br /&gt;
|Network users change&lt;br /&gt;
{{IndexSplit|P}}&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|Permit,Granted&lt;br /&gt;
|? &amp;gt; objectrequesting&lt;br /&gt;
|Sent when a track or junction permit is granted&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|PortalTunnel,EmitTrain&lt;br /&gt;
|portal &amp;gt; portal&lt;br /&gt;
|Sent when a portal produces a train&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[pfx Message|pfx,&#039;&#039;particledata&#039;&#039;]]&lt;br /&gt;
|script &amp;gt; object&lt;br /&gt;
|Sent by script to control particle effects&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|Process-Start,&#039;&#039;processname&#039;&#039;&lt;br /&gt;
|industry &amp;gt; industry&lt;br /&gt;
|Sent when an industry process has started&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|Process-Stop,&#039;&#039;processname&#039;&#039;&lt;br /&gt;
|industry &amp;gt; industry&lt;br /&gt;
|Sent when an industry process has completed&lt;br /&gt;
{{IndexSplit|S}}&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|Scenario,KillMonitor&lt;br /&gt;
|? &amp;gt; ?&lt;br /&gt;
|Sent to terminate a scenario thread&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|Scenario,Quit&lt;br /&gt;
|? &amp;gt; ?&lt;br /&gt;
|Sent to terminate a scenario&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|ScenarioBehaviour,Touch&lt;br /&gt;
|? &amp;gt; ?&lt;br /&gt;
|Called on a parent rule when the child rule completes. May also indicate other state changes.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Object Messages|SceneryTrigger,Enter]]&lt;br /&gt;
|scenerywithtrack &amp;gt; vehicle&lt;br /&gt;
|Sent when a vehicle enters a scenery trigger&#039;s outer area&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Object Messages|SceneryTrigger,InnerEnter]]&lt;br /&gt;
|scenerywithtrack &amp;gt; vehicle&lt;br /&gt;
|Sent when a vehicle enters a scenery trigger&#039;s inner area&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Object Messages|SceneryTrigger,InnerLeave]]&lt;br /&gt;
|scenerywithtrack &amp;gt; vehicle&lt;br /&gt;
|Sent when a vehicle leaves a scenery trigger&#039;s inner area&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Object Messages|SceneryTrigger,Leave]]&lt;br /&gt;
|scenerywithtrack &amp;gt; vehicle&lt;br /&gt;
|Sent when a vehicle leaves a scenery trigger&#039;s outer area&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Object Messages|SceneryTrigger,Stopped]]&lt;br /&gt;
|scenerywithtrack &amp;gt; vehicle&lt;br /&gt;
|Sent when a train stops in a scenery trigger&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|Schedule,Abort&lt;br /&gt;
|train &amp;gt; train&lt;br /&gt;
|Sent when a command schedule is abandoned&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|Schedule,Complete&lt;br /&gt;
|train &amp;gt; broadcast&lt;br /&gt;
|Sent when a command schedule is completed&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|Schedule,Touch&lt;br /&gt;
|train &amp;gt; train&lt;br /&gt;
|Sent when a Train&#039;s AI schedule state is modified (see Train.StopSchedule()) and sniffed by DriverCharacter to implement DriverCommand support.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Signal Messages|Signal,StateChanged]]&lt;br /&gt;
|signal &amp;gt; broadcast&lt;br /&gt;
|Signal aspect has changed&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|StationMain.Timer,Tick&lt;br /&gt;
|station &amp;gt; station&lt;br /&gt;
|Sent by stations to initiate a periodic update&lt;br /&gt;
{{IndexSplit|T}}&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|Timer,Tick&lt;br /&gt;
|? &amp;gt; ?&lt;br /&gt;
|A common custom message used by various scripts to implement timed polling.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|Timetable,&lt;br /&gt;
|? &amp;gt; ?&lt;br /&gt;
|?&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Object Messages|Trackmark,Enter]]&lt;br /&gt;
|trackmark &amp;gt; train&lt;br /&gt;
|Sent when a train enters a trackmark&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Object Messages|Trackmark,Leave]]&lt;br /&gt;
|trackmark &amp;gt; train&lt;br /&gt;
|Sent when a train leaves a trackmark&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Object Messages|Trackmark,Stopped]]&lt;br /&gt;
|trackmark &amp;gt; train&lt;br /&gt;
|Sent when a train stops at a trackmark&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Signal Messages|Train,Entered red signal]]&lt;br /&gt;
|signal &amp;gt; train&lt;br /&gt;
|Train has entered signal&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Signal Messages|Train,Entered red signal notify]]&lt;br /&gt;
|train &amp;gt; broadcast&lt;br /&gt;
|Train has entered signal&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Signal Messages|Train,Passed Signal]]&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Train Messages|Train,Over speed limit]]&lt;br /&gt;
|train &amp;gt; broadcast&lt;br /&gt;
|Sent when a train exceeds the current speed limit.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Train Messages|Train,Under speed limit]]&lt;br /&gt;
|train &amp;gt; broadcast&lt;br /&gt;
|Sent when a train slows below the current speed limit.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Train Messages|Train,Over advisory speed limit]]&lt;br /&gt;
|train &amp;gt; broadcast&lt;br /&gt;
|Sent when a train exceeds the current advisory speed limit.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Train Messages|Train,Under advisory speed limit]]&lt;br /&gt;
|train &amp;gt; broadcast&lt;br /&gt;
|Sent when a train slows below the current advisory speed limit.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Train Messages|Train,Over floating speed limit]]&lt;br /&gt;
|train &amp;gt; broadcast&lt;br /&gt;
|Sent when a train exceeds the floating speed limit.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Train Messages|Train,Under floating speed limit]]&lt;br /&gt;
|train &amp;gt; broadcast&lt;br /&gt;
|Sent when a train slows below the floating speed limit.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Train Messages|Train,Cleanup]]&lt;br /&gt;
|? &amp;gt; ?&lt;br /&gt;
|Sent immediately prior to the destruction of a Train object, to allow certain scripts to clean up their state.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Train Messages|Train,Deleted]]&lt;br /&gt;
|train &amp;gt; ?&lt;br /&gt;
|Sent when a train is deleted from the train list. This will also occur when two trains couple to form a new train.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|Train,ThreadAITrainStoppedMovingFailed&lt;br /&gt;
|train &amp;gt; train&lt;br /&gt;
|Internal Train.gs implementation- sent when the AI fails to enter the expected junction.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|Train,CommandCoupleVehicleTimer&lt;br /&gt;
|train &amp;gt; train&lt;br /&gt;
|Internal Train.gs implementation- sent when the AI fails to couple in a two-second window.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|Train,CommandReverseTrain.Pulse&lt;br /&gt;
|train &amp;gt; train&lt;br /&gt;
|Internal Train.gs implementation- sent when the AI fails to take permits to reverse a train within a 20-second window.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Train Messages|Train,DriverBoarded]]&lt;br /&gt;
|train &amp;gt; driver&lt;br /&gt;
|Sent when a driver boards a train&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|Train,NotifyBell&lt;br /&gt;
|train &amp;gt; train&lt;br /&gt;
|Sent when the interface bell button is clicked.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|Train,BrakeLightChanged&lt;br /&gt;
|train &amp;gt; ?&lt;br /&gt;
|Sent if the train&#039;s brake is moved to Modes 0 or from Modes 0.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|Train,ThrottleChanged&lt;br /&gt;
|train &amp;gt; ?&lt;br /&gt;
|Sent if throttle position changes.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|Train,NotifyHeadlights&lt;br /&gt;
|train &amp;gt; train&lt;br /&gt;
|Sent when the interface headlight button is clicked.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|Train,NotifyHorn&lt;br /&gt;
|train &amp;gt; train&lt;br /&gt;
|Sent when the interface horn button is clicked&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|Train,NotifyPantographs&lt;br /&gt;
|train &amp;gt; train&lt;br /&gt;
|Sent when the interface pantograph button is clicked.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|Train,NotifySanding&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|Train,TurnAround&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Train Messages|Train,ReachedTarget]]&lt;br /&gt;
|? &amp;gt; ?&lt;br /&gt;
|Sent by Trainz when a train reaches the specified Autopilot Target Position.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Train Messages|Train,SlowingForTarget]]&lt;br /&gt;
|train &amp;gt; train&lt;br /&gt;
|Sent by Trainz when the train begins to slow on approach to a specified Autopilot Target Position.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Train Messages|Train,Handbrake-Apply]]&lt;br /&gt;
|&lt;br /&gt;
|It works?&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Train Messages|Train,Handbrake-Release]]&lt;br /&gt;
|&lt;br /&gt;
|It works?&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Train Messages|Train,StartedMoving]]&lt;br /&gt;
|train &amp;gt; train&lt;br /&gt;
|Sent when a train starts to move&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Train Messages|Train,StoppedMoving]]&lt;br /&gt;
|train &amp;gt; train&lt;br /&gt;
|Sent when a train stops&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|Train,Tick&lt;br /&gt;
|train &amp;gt; train&lt;br /&gt;
|?&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Object Messages|Train,EnterTrack]]&lt;br /&gt;
|track &amp;gt; train&lt;br /&gt;
|Sent when a train enters a track section&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Object Messages|Train,InnerEnterTrack]]&lt;br /&gt;
|track &amp;gt; train&lt;br /&gt;
|?&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Object Messages|Train,InnerLeaveTrack]]&lt;br /&gt;
|track &amp;gt; train&lt;br /&gt;
|?&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Object Messages|Train,LeaveTrack]]&lt;br /&gt;
|track &amp;gt; train&lt;br /&gt;
|Sent when a train leaves a track section&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|Train.ThreadAITrainStuck,Touch&lt;br /&gt;
|train &amp;gt; train&lt;br /&gt;
|?&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|TrainTimetable,Touch&lt;br /&gt;
|? &amp;gt; ?&lt;br /&gt;
|?&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Object Messages|Trigger,Enter]]&lt;br /&gt;
|trigger &amp;gt; train&lt;br /&gt;
|Sent when a train enters a trigger&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Object Messages|Trigger,Leave]]&lt;br /&gt;
|trigger &amp;gt; train&lt;br /&gt;
|Sent when a train leaves a trigger&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Object Messages|Trigger,Stopped]]&lt;br /&gt;
|trigger &amp;gt; train&lt;br /&gt;
|Sent when a train stops at a trigger&lt;br /&gt;
{{IndexSplit|V}}&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Vehicle Messages|Vehicle,BadCouple]]&lt;br /&gt;
|vehicle &amp;gt; broadcast&lt;br /&gt;
|Sent when a vehicle couples at excessive speed&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Vehicle Messages|Vehicle,Collided]]&lt;br /&gt;
|vehicle &amp;gt; broadcast&lt;br /&gt;
|Sent on a collision between vehicles&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Vehicle Messages|Vehicle,Coupled]]&lt;br /&gt;
|vehicle &amp;gt; broadcast&lt;br /&gt;
|Sent when a vehicle couples to another&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Vehicle Messages|Vehicle,Decoupled]]&lt;br /&gt;
|vehicle &amp;gt; broadcast&lt;br /&gt;
|Sent when a vehicle uncouples from another&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Vehicle Messages|Vehicle,Derailed]]&lt;br /&gt;
|vehicle &amp;gt; broadcast&lt;br /&gt;
|Sent when a vehicle is derailed&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|Vehicle,LoadComplete&lt;br /&gt;
|industry &amp;gt; vehicle&lt;br /&gt;
|Sent when loading of a vehicle from an industry is complete&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|Vehicle,Coupler breakage&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|Vehicle,Coupler breakage notify&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|Vehicle,Coupler Repaired&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
{{IndexSplit|W}}&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Interface Messages|WaybillManager,WaybillsWindowShown]]&lt;br /&gt;
|waybillmanager &amp;gt; broadcast&lt;br /&gt;
|?&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Interface Messages|WaybillManager,WaybillsWindowHidden]]&lt;br /&gt;
|waybillmanager &amp;gt; broadcast&lt;br /&gt;
|?&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[ModuleInit Message|World,ModuleInit]]&lt;br /&gt;
|? &amp;gt; broadcast&lt;br /&gt;
|Sent whenever TRS switches to Driver, Surveyor or Railyard modes&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|World,Paused&lt;br /&gt;
|? &amp;gt; broadcast&lt;br /&gt;
|?&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|World,Unpaused&lt;br /&gt;
|? &amp;gt; broadcast&lt;br /&gt;
|?&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|World,Day&lt;br /&gt;
|? &amp;gt; broadcast&lt;br /&gt;
|Sent 1.) at ca. 05:45 ~ 0.739409 Gametime 2.) sometimes when TS starts Driver&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|World,Night&lt;br /&gt;
|? &amp;gt; broadcast&lt;br /&gt;
|Sent 1.) at ca. 18:15 ~ 0.260611 GameTime 2.) whenever TS starts Driver or Surveyor and Playtime is beween 18:15 and 05:45 3.) sometimes when TS switched to Driver or Surveyor&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Ciceronmt</name></author>
	</entry>
	<entry>
		<id>https://wiki.trainzsimulator.com/index.php?title=List_of_Standard_Messages&amp;diff=21342</id>
		<title>List of Standard Messages</title>
		<link rel="alternate" type="text/html" href="https://wiki.trainzsimulator.com/index.php?title=List_of_Standard_Messages&amp;diff=21342"/>
		<updated>2019-09-14T12:23:43Z</updated>

		<summary type="html">&lt;p&gt;Ciceronmt: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;*[[TrainzScript Language Reference|API Hierarchy]]&lt;br /&gt;
&lt;br /&gt;
*This list is a first step towards documenting Trainz use of messages. It has been generated by scanning one or two copies of jetlog.txt from TC, together with the TC scripts folder and the TRS2006 copy of index.chm. There are probably many standard messages missing and there are some obscure ones listed. Please add anything that is missing. I will progressively link and document the list. &lt;br /&gt;
__NOTOC__ __NOEDITSECTION__&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{|rules=&amp;quot;rows&amp;quot; cellpadding=&amp;quot;2&amp;quot; cellspacing=&amp;quot;2&amp;quot; width=&amp;quot;95%&amp;quot; style=&amp;quot;border-collapse:collapse;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|width=&amp;quot;15&amp;quot;|&lt;br /&gt;
|width=&amp;quot;250&amp;quot;|Message&lt;br /&gt;
|width=&amp;quot;165&amp;quot;|Source &amp;amp; Destination&lt;br /&gt;
|Purpose&lt;br /&gt;
|&lt;br /&gt;
{{IndexSplit|A}}&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Animation-Event Message|Animation-Event,&#039;&#039;eventname&#039;&#039;]]&lt;br /&gt;
|meshobject &amp;gt; meshobject&lt;br /&gt;
|Sent when an animation triggers an event. These events are included in *.kin files generated by Max when the &#039;Query for Event&#039; box is checked during animation export.  They are used to enable code to be executed in sync with animations.&lt;br /&gt;
{{IndexSplit|B}}&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|BaseIndustry,LoadComplete&lt;br /&gt;
|industry &amp;gt; industry&lt;br /&gt;
|Sent when an industry loading operation has completed&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Browser Messages|Browser-Closed,&#039;&#039;null&#039;&#039;]]&lt;br /&gt;
|browser &amp;gt; broadcast&lt;br /&gt;
|Sent when any in game browser is closed.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|Browser-Key,ScriptObjectives&lt;br /&gt;
|? &amp;gt; ?&lt;br /&gt;
|Sent by Trainz in response to a ScriptObjectives hotkey press. Obsolete?&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Browser Messages|Browser-URL,&#039;&#039;live://linkname&#039;&#039;]]&lt;br /&gt;
|browser &amp;gt; broadcast&lt;br /&gt;
|Sent when the user clicks in a link in a custom browser&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|Build,Cancelled&lt;br /&gt;
|? &amp;gt; buildable&lt;br /&gt;
|Not generally used. Intended for RTS-style gameplay where individual industries (etc) start in an unbuilt state and can be built at some resource cost during gameplay.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|Build,Completed&lt;br /&gt;
|? &amp;gt; buildable&lt;br /&gt;
|Not generally used. Intended for RTS-style gameplay where individual industries (etc) start in an unbuilt state and can be built at some resource cost during gameplay.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|Build,Started&lt;br /&gt;
|? &amp;gt; buildable&lt;br /&gt;
|Not generally used. Intended for RTS-style gameplay where individual industries (etc) start in an unbuilt state and can be built at some resource cost during gameplay.&lt;br /&gt;
{{IndexSplit|C}}&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Camera Messages|Camera,Interior-Changed]]&lt;br /&gt;
|new train? &amp;gt; broadcast&lt;br /&gt;
|Sent when a different train is selected.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Camera Messages|Camera,Target-Changed]]&lt;br /&gt;
|new target? &amp;gt; broadcast&lt;br /&gt;
|Sent when the camera selects a different target, may not be a train.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Camera Messages|Camera,External-View]]&lt;br /&gt;
|? &amp;gt; broadcast&lt;br /&gt;
|Sent when the camera mode is changed.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Camera Messages|Camera,Internal-View]]&lt;br /&gt;
|? &amp;gt; Broadcast&lt;br /&gt;
|Sent when the camera mode is changed.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Camera Messages|Camera,Roaming-View]]&lt;br /&gt;
|? &amp;gt; broadcast&lt;br /&gt;
|Sent when the camera mode is changed.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Camera Messages|Camera,Tracking-View]]&lt;br /&gt;
|? &amp;gt; broadcast&lt;br /&gt;
|Sent when the camera mode is changed.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|Check,Speed&lt;br /&gt;
|vehicle &amp;gt; vehicle&lt;br /&gt;
|Sent continuously to ensure that jetlog isn&#039;t allowed to remain legible :-)&lt;br /&gt;
{{IndexSplit|D}}&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|DriverCharacter,BoardedTrain&lt;br /&gt;
|driver &amp;gt; broadcast&lt;br /&gt;
|Sent when a driver boards a train&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|DriverCharacter,Created&lt;br /&gt;
|driver &amp;gt; broadcast&lt;br /&gt;
|Sent when a driver character is initialised&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|DriverCharacter,LeftTrain&lt;br /&gt;
|driver &amp;gt; broadcast&lt;br /&gt;
|Sent when a driver leaves a train&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|DriverDisplay,ResetTripMeter&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Interface Messages|DriverModule,DCC-Panel-Created]]&lt;br /&gt;
|? &amp;gt; broadcast&lt;br /&gt;
|Sent when driver selection widget has been created&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|DriverSetup,CharactersDone&lt;br /&gt;
|? &amp;gt; broadcast&lt;br /&gt;
|Sent when driver characters have been initialised&lt;br /&gt;
{{IndexSplit|G}}&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|GenericIndustry,LoadComplete&lt;br /&gt;
|industry &amp;gt; industry&lt;br /&gt;
|Sent when an industry loading operation has completed&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|GenericIndustry,ProcessComplete&lt;br /&gt;
|industry &amp;gt; industry&lt;br /&gt;
|Sent when an industry process has completed&lt;br /&gt;
{{IndexSplit|H}}&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|HandleTrain,Release&lt;br /&gt;
|industry &amp;gt; train&lt;br /&gt;
|Sent when an industry loading operation has completed&lt;br /&gt;
{{IndexSplit|I}}&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Interface Messages|Interface,ClickSystemButton]]&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Interface Messages|Interface-Event,MapViewOff]]&lt;br /&gt;
|? &amp;gt; broadcast&lt;br /&gt;
|Sent when the minimap is opened&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Interface Messages|Interface-Event,MapViewOn]]&lt;br /&gt;
|? &amp;gt; broadcast&lt;br /&gt;
|Sent when the minimap is closed&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Interface Messages|Interface-Event,Minimap-Mouse-Enter]]&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Interface Messages|Interface-Event,Minimap-Mouse-Leave]]&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Interface Messages|Interface-Event,New-Driver-Message]]&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Interface Messages|Interface-Event,Mouse-Enter]]&lt;br /&gt;
|object &amp;gt; broadcast&lt;br /&gt;
|Sent on mouseover an object&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Interface Messages|Interface-Event,Mouse-Leave]]&lt;br /&gt;
|? &amp;gt; broadcast&lt;br /&gt;
|Sent on mouseout of an object&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Interface Messages|Interface-Event,Set-Metric-Mode]]&lt;br /&gt;
|? &amp;gt; broadcast&lt;br /&gt;
|Sent when the interface units are changed&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Interface Messages|Interface-Event,Toggle-Interface]]&lt;br /&gt;
|? &amp;gt; broadcast&lt;br /&gt;
|Sent when the main HUD is turned on or off&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Interface Messages|Interface-Event,Toggle-ButtonBar]]&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Interface Messages|Interface-Event,Toggle-CustomHUD]]&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Interface Messages|Interface-Event,Toggle-VehicleControls]]&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Interface Messages|Interface-Event,Left-Click]]&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Interface Messages|Interface-Event,Surveyor-Left-Click]]&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
{{IndexSplit|J}}&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Object Messages|Junction,Enter]]&lt;br /&gt;
|junction &amp;gt; train&lt;br /&gt;
|Sent when a train enters a junction&#039;s outer area&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Object Messages|Junction,InnerEnter]]&lt;br /&gt;
|junction &amp;gt; train&lt;br /&gt;
|Sent when a train enters a junction&#039;s inner area&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Object Messages|Junction,InnerLeave]]&lt;br /&gt;
|junction &amp;gt; train&lt;br /&gt;
|Sent when a train leaves a junction&#039;s inner area&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Object Messages|Junction,Leave]]&lt;br /&gt;
|junction &amp;gt; train&lt;br /&gt;
|Sent when a train leaves a junction&#039;s outer area&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Object Messages|Junction,Stopped]]&lt;br /&gt;
|junction &amp;gt; train&lt;br /&gt;
|Sent when a train stops in a junction trigger area&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|Junction,Toggled&lt;br /&gt;
|junction &amp;gt; broadcast&lt;br /&gt;
|Sent when a junctionbase object is toggled&lt;br /&gt;
{{IndexSplit|M}}&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[MapObject Messages|MapObject,View-Details]]&lt;br /&gt;
|? &amp;gt; object&lt;br /&gt;
|Sent when the user right-clicks an object and selects &#039;View Details&#039; from the resulting menu, some assets provide a built-in browser in response to this message.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[MapObject Messages|MapObject,View-Schedule]]&lt;br /&gt;
|? &amp;gt; ?&lt;br /&gt;
|Sent when the user right-clicks an object and selects &#039;View Schedule&#039; from the resulting menu. The vehicle must have a timetable for this menu item to be displayed.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|MeshObject-Click,*&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
{{IndexSplit|O}}&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Object Messages|Object,Enter]]&lt;br /&gt;
|crossing &amp;gt; crossing&lt;br /&gt;
|Train has entered crossing trigger area&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Object Messages|Object,Leave]]&lt;br /&gt;
|crossing &amp;gt; crossing&lt;br /&gt;
|Train has left crossing trigger area&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Object Messages|Object,Enter]]&lt;br /&gt;
|train &amp;gt; junction&lt;br /&gt;
|Sent when a train enters a junction&#039;s outer area&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Object Messages|Object,InnerEnter]]&lt;br /&gt;
|train &amp;gt; junction&lt;br /&gt;
|Sent when a train enters a junction&#039;s inner area&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Object Messages|Object,InnerLeave]]&lt;br /&gt;
|train &amp;gt; junction&lt;br /&gt;
|Sent when a train leaves a junction&#039;s inner area&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Object Messages|Object,Leave]]&lt;br /&gt;
|train &amp;gt; junction&lt;br /&gt;
|Sent when a train leaves a junction&#039;s outer area&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Object Messages|Object,Stopped]]&lt;br /&gt;
|train &amp;gt; junction&lt;br /&gt;
|Sent when a train stops in a junction trigger area&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Object Messages|Object,Enter]]&lt;br /&gt;
|train &amp;gt; trackmark&lt;br /&gt;
|Sent when a train enters a trackmark&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Object Messages|Object,Leave]]&lt;br /&gt;
|train &amp;gt; trackmark&lt;br /&gt;
|Sent when a train leaves a trackmark&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Object Messages|Object,Stopped]]&lt;br /&gt;
|train &amp;gt; trackmark&lt;br /&gt;
|Sent when a train stops at a trackmark&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Object Messages|Object,Enter]]&lt;br /&gt;
|train &amp;gt; trigger&lt;br /&gt;
|Sent when a train enters a trigger&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Object Messages|Object,Leave]]&lt;br /&gt;
|train &amp;gt; trigger&lt;br /&gt;
|Sent when a train leaves a trigger&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Object Messages|Object,Stopped]]&lt;br /&gt;
|train &amp;gt; trigger&lt;br /&gt;
|Sent when a train stops at a trigger&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Object Messages|Object,Enter]]&lt;br /&gt;
|vehicle &amp;gt; scenerywithtrack&lt;br /&gt;
|Sent when a vehicle enters a scenery trigger&#039;s outer area&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Object Messages|Object,InnerEnter]]&lt;br /&gt;
|vehicle &amp;gt; scenerywithtrack&lt;br /&gt;
|Sent when a vehicle enters a scenery trigger&#039;s inner area&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Object Messages|Object,InnerLeave]]&lt;br /&gt;
|vehicle &amp;gt; scenerywithtrack&lt;br /&gt;
|Sent when a vehicle leaves a scenery trigger&#039;s inner area&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Object Messages|Object,Leave]]&lt;br /&gt;
|vehicle &amp;gt; scenerywithtrack&lt;br /&gt;
|Sent when a vehicle leaves a scenery trigger&#039;s outer area&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Object Messages|Object,Stopped]]&lt;br /&gt;
|vehicle &amp;gt; scenerywithtrack&lt;br /&gt;
|Sent when a train stops in a scenery trigger&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|OnlineAccess,ReceiveMessage&lt;br /&gt;
|? &amp;gt; onlineaccess&lt;br /&gt;
|Message awaiting collection&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|OnlineAccess,StatusChange&lt;br /&gt;
|? &amp;gt; onlineaccess&lt;br /&gt;
|Network status change&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|OnlineGroup,StatusChange&lt;br /&gt;
|? &amp;gt; onlinegroup&lt;br /&gt;
|Network status change&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|OnlineGroup,UsersChange&lt;br /&gt;
|? &amp;gt; onlinegroup&lt;br /&gt;
|Network users change&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|OnlineGroup.UserRemoved,*&lt;br /&gt;
|? &amp;gt; onlinegroup&lt;br /&gt;
|Network users change&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|OnlineGroup.UserAdded,*&lt;br /&gt;
|? &amp;gt; onlinegroup&lt;br /&gt;
|Network users change&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|OnlineGroup.UserStatus,*&lt;br /&gt;
|? &amp;gt; onlinegroup&lt;br /&gt;
|Network users change&lt;br /&gt;
{{IndexSplit|P}}&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|Permit,Granted&lt;br /&gt;
|? &amp;gt; objectrequesting&lt;br /&gt;
|Sent when a track or junction permit is granted&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|PortalTunnel,EmitTrain&lt;br /&gt;
|portal &amp;gt; portal&lt;br /&gt;
|Sent when a portal produces a train&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[pfx Message|pfx,&#039;&#039;particledata&#039;&#039;]]&lt;br /&gt;
|script &amp;gt; object&lt;br /&gt;
|Sent by script to control particle effects&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|Process-Start,&#039;&#039;processname&#039;&#039;&lt;br /&gt;
|industry &amp;gt; industry&lt;br /&gt;
|Sent when an industry process has started&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|Process-Stop,&#039;&#039;processname&#039;&#039;&lt;br /&gt;
|industry &amp;gt; industry&lt;br /&gt;
|Sent when an industry process has completed&lt;br /&gt;
{{IndexSplit|S}}&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|Scenario,KillMonitor&lt;br /&gt;
|? &amp;gt; ?&lt;br /&gt;
|Sent to terminate a scenario thread&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|Scenario,Quit&lt;br /&gt;
|? &amp;gt; ?&lt;br /&gt;
|Sent to terminate a scenario&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|ScenarioBehaviour,Touch&lt;br /&gt;
|? &amp;gt; ?&lt;br /&gt;
|Called on a parent rule when the child rule completes. May also indicate other state changes.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Object Messages|SceneryTrigger,Enter]]&lt;br /&gt;
|scenerywithtrack &amp;gt; vehicle&lt;br /&gt;
|Sent when a vehicle enters a scenery trigger&#039;s outer area&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Object Messages|SceneryTrigger,InnerEnter]]&lt;br /&gt;
|scenerywithtrack &amp;gt; vehicle&lt;br /&gt;
|Sent when a vehicle enters a scenery trigger&#039;s inner area&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Object Messages|SceneryTrigger,InnerLeave]]&lt;br /&gt;
|scenerywithtrack &amp;gt; vehicle&lt;br /&gt;
|Sent when a vehicle leaves a scenery trigger&#039;s inner area&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Object Messages|SceneryTrigger,Leave]]&lt;br /&gt;
|scenerywithtrack &amp;gt; vehicle&lt;br /&gt;
|Sent when a vehicle leaves a scenery trigger&#039;s outer area&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Object Messages|SceneryTrigger,Stopped]]&lt;br /&gt;
|scenerywithtrack &amp;gt; vehicle&lt;br /&gt;
|Sent when a train stops in a scenery trigger&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|Schedule,Abort&lt;br /&gt;
|train &amp;gt; train&lt;br /&gt;
|Sent when a command schedule is abandoned&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|Schedule,Complete&lt;br /&gt;
|train &amp;gt; broadcast&lt;br /&gt;
|Sent when a command schedule is completed&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|Schedule,Touch&lt;br /&gt;
|train &amp;gt; train&lt;br /&gt;
|Sent when a Train&#039;s AI schedule state is modified (see Train.StopSchedule()) and sniffed by DriverCharacter to implement DriverCommand support.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Signal Messages|Signal,StateChanged]]&lt;br /&gt;
|signal &amp;gt; broadcast&lt;br /&gt;
|Signal aspect has changed&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|StationMain.Timer,Tick&lt;br /&gt;
|station &amp;gt; station&lt;br /&gt;
|Sent by stations to initiate a periodic update&lt;br /&gt;
{{IndexSplit|T}}&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|Timer,Tick&lt;br /&gt;
|? &amp;gt; ?&lt;br /&gt;
|A common custom message used by various scripts to implement timed polling.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|Timetable,&lt;br /&gt;
|? &amp;gt; ?&lt;br /&gt;
|?&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Object Messages|Trackmark,Enter]]&lt;br /&gt;
|trackmark &amp;gt; train&lt;br /&gt;
|Sent when a train enters a trackmark&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Object Messages|Trackmark,Leave]]&lt;br /&gt;
|trackmark &amp;gt; train&lt;br /&gt;
|Sent when a train leaves a trackmark&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Object Messages|Trackmark,Stopped]]&lt;br /&gt;
|trackmark &amp;gt; train&lt;br /&gt;
|Sent when a train stops at a trackmark&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Signal Messages|Train,Entered red signal]]&lt;br /&gt;
|signal &amp;gt; train&lt;br /&gt;
|Train has entered signal&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Signal Messages|Train,Entered red signal notify]]&lt;br /&gt;
|train &amp;gt; broadcast&lt;br /&gt;
|Train has entered signal&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Signal Messages|Train,Passed Signal]]&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Train Messages|Train,Over speed limit]]&lt;br /&gt;
|train &amp;gt; broadcast&lt;br /&gt;
|Sent when a train exceeds the current speed limit.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Train Messages|Train,Under speed limit]]&lt;br /&gt;
|train &amp;gt; broadcast&lt;br /&gt;
|Sent when a train slows below the current speed limit.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Train Messages|Train,Over advisory speed limit]]&lt;br /&gt;
|train &amp;gt; broadcast&lt;br /&gt;
|Sent when a train exceeds the current advisory speed limit.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Train Messages|Train,Under advisory speed limit]]&lt;br /&gt;
|train &amp;gt; broadcast&lt;br /&gt;
|Sent when a train slows below the current advisory speed limit.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Train Messages|Train,Over floating speed limit]]&lt;br /&gt;
|train &amp;gt; broadcast&lt;br /&gt;
|Sent when a train exceeds the floating speed limit.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Train Messages|Train,Under floating speed limit]]&lt;br /&gt;
|train &amp;gt; broadcast&lt;br /&gt;
|Sent when a train slows below the floating speed limit.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Train Messages|Train,Cleanup]]&lt;br /&gt;
|? &amp;gt; ?&lt;br /&gt;
|Sent immediately prior to the destruction of a Train object, to allow certain scripts to clean up their state.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Train Messages|Train,Deleted]]&lt;br /&gt;
|train &amp;gt; ?&lt;br /&gt;
|Sent when a train is deleted from the train list. This will also occur when two trains couple to form a new train.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|Train,ThreadAITrainStoppedMovingFailed&lt;br /&gt;
|train &amp;gt; train&lt;br /&gt;
|Internal Train.gs implementation- sent when the AI fails to enter the expected junction.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|Train,CommandCoupleVehicleTimer&lt;br /&gt;
|train &amp;gt; train&lt;br /&gt;
|Internal Train.gs implementation- sent when the AI fails to couple in a two-second window.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|Train,CommandReverseTrain.Pulse&lt;br /&gt;
|train &amp;gt; train&lt;br /&gt;
|Internal Train.gs implementation- sent when the AI fails to take permits to reverse a train within a 20-second window.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Train Messages|Train,DriverBoarded]]&lt;br /&gt;
|train &amp;gt; driver&lt;br /&gt;
|Sent when a driver boards a train&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|Train,NotifyBell&lt;br /&gt;
|train &amp;gt; train&lt;br /&gt;
|Sent when the interface bell button is clicked.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|Train,BrakeLightChanged&lt;br /&gt;
|train &amp;gt; ?&lt;br /&gt;
|Sent when the interface train brake button is clicked.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|Train,ThrottleChanged&lt;br /&gt;
|train &amp;gt; ?&lt;br /&gt;
|Sent when the interface throttle button is clicked.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|Train,NotifyHeadlights&lt;br /&gt;
|train &amp;gt; train&lt;br /&gt;
|Sent when the interface headlight button is clicked.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|Train,NotifyHorn&lt;br /&gt;
|train &amp;gt; train&lt;br /&gt;
|Sent when the interface horn button is clicked&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|Train,NotifyPantographs&lt;br /&gt;
|train &amp;gt; train&lt;br /&gt;
|Sent when the interface pantograph button is clicked.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|Train,NotifySanding&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|Train,TurnAround&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Train Messages|Train,ReachedTarget]]&lt;br /&gt;
|? &amp;gt; ?&lt;br /&gt;
|Sent by Trainz when a train reaches the specified Autopilot Target Position.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Train Messages|Train,SlowingForTarget]]&lt;br /&gt;
|train &amp;gt; train&lt;br /&gt;
|Sent by Trainz when the train begins to slow on approach to a specified Autopilot Target Position.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Train Messages|Train,Handbrake-Apply]]&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Train Messages|Train,Handbrake-Release]]&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Train Messages|Train,StartedMoving]]&lt;br /&gt;
|train &amp;gt; train&lt;br /&gt;
|Sent when a train starts to move&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Train Messages|Train,StoppedMoving]]&lt;br /&gt;
|train &amp;gt; train&lt;br /&gt;
|Sent when a train stops&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Train Messages|Train,ThrottleChanged]]&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|Train,Tick&lt;br /&gt;
|train &amp;gt; train&lt;br /&gt;
|?&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Object Messages|Train,EnterTrack]]&lt;br /&gt;
|track &amp;gt; train&lt;br /&gt;
|Sent when a train enters a track section&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Object Messages|Train,InnerEnterTrack]]&lt;br /&gt;
|track &amp;gt; train&lt;br /&gt;
|?&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Object Messages|Train,InnerLeaveTrack]]&lt;br /&gt;
|track &amp;gt; train&lt;br /&gt;
|?&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Object Messages|Train,LeaveTrack]]&lt;br /&gt;
|track &amp;gt; train&lt;br /&gt;
|Sent when a train leaves a track section&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|Train.ThreadAITrainStuck,Touch&lt;br /&gt;
|train &amp;gt; train&lt;br /&gt;
|?&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|TrainTimetable,Touch&lt;br /&gt;
|? &amp;gt; ?&lt;br /&gt;
|?&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Object Messages|Trigger,Enter]]&lt;br /&gt;
|trigger &amp;gt; train&lt;br /&gt;
|Sent when a train enters a trigger&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Object Messages|Trigger,Leave]]&lt;br /&gt;
|trigger &amp;gt; train&lt;br /&gt;
|Sent when a train leaves a trigger&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Object Messages|Trigger,Stopped]]&lt;br /&gt;
|trigger &amp;gt; train&lt;br /&gt;
|Sent when a train stops at a trigger&lt;br /&gt;
{{IndexSplit|V}}&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Vehicle Messages|Vehicle,BadCouple]]&lt;br /&gt;
|vehicle &amp;gt; broadcast&lt;br /&gt;
|Sent when a vehicle couples at excessive speed&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Vehicle Messages|Vehicle,Collided]]&lt;br /&gt;
|vehicle &amp;gt; broadcast&lt;br /&gt;
|Sent on a collision between vehicles&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Vehicle Messages|Vehicle,Coupled]]&lt;br /&gt;
|vehicle &amp;gt; broadcast&lt;br /&gt;
|Sent when a vehicle couples to another&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Vehicle Messages|Vehicle,Decoupled]]&lt;br /&gt;
|vehicle &amp;gt; broadcast&lt;br /&gt;
|Sent when a vehicle uncouples from another&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Vehicle Messages|Vehicle,Derailed]]&lt;br /&gt;
|vehicle &amp;gt; broadcast&lt;br /&gt;
|Sent when a vehicle is derailed&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|Vehicle,LoadComplete&lt;br /&gt;
|industry &amp;gt; vehicle&lt;br /&gt;
|Sent when loading of a vehicle from an industry is complete&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|Vehicle,Coupler breakage&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|Vehicle,Coupler breakage notify&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|Vehicle,Coupler Repaired&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
{{IndexSplit|W}}&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Interface Messages|WaybillManager,WaybillsWindowShown]]&lt;br /&gt;
|waybillmanager &amp;gt; broadcast&lt;br /&gt;
|?&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Interface Messages|WaybillManager,WaybillsWindowHidden]]&lt;br /&gt;
|waybillmanager &amp;gt; broadcast&lt;br /&gt;
|?&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[ModuleInit Message|World,ModuleInit]]&lt;br /&gt;
|? &amp;gt; broadcast&lt;br /&gt;
|Sent whenever TRS switches to Driver, Surveyor or Railyard modes&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|World,Paused&lt;br /&gt;
|? &amp;gt; broadcast&lt;br /&gt;
|?&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|World,Unpaused&lt;br /&gt;
|? &amp;gt; broadcast&lt;br /&gt;
|?&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|World,Day&lt;br /&gt;
|? &amp;gt; broadcast&lt;br /&gt;
|Sent 1.) at ca. 05:45 ~ 0.739409 Gametime 2.) sometimes when TS starts Driver&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|World,Night&lt;br /&gt;
|? &amp;gt; broadcast&lt;br /&gt;
|Sent 1.) at ca. 18:15 ~ 0.260611 GameTime 2.) whenever TS starts Driver or Surveyor and Playtime is beween 18:15 and 05:45 3.) sometimes when TS switched to Driver or Surveyor&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Ciceronmt</name></author>
	</entry>
	<entry>
		<id>https://wiki.trainzsimulator.com/index.php?title=List_of_Standard_Messages&amp;diff=21340</id>
		<title>List of Standard Messages</title>
		<link rel="alternate" type="text/html" href="https://wiki.trainzsimulator.com/index.php?title=List_of_Standard_Messages&amp;diff=21340"/>
		<updated>2019-09-14T11:58:42Z</updated>

		<summary type="html">&lt;p&gt;Ciceronmt: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;*[[TrainzScript Language Reference|API Hierarchy]]&lt;br /&gt;
&lt;br /&gt;
*This list is a first step towards documenting Trainz use of messages. It has been generated by scanning one or two copies of jetlog.txt from TC, together with the TC scripts folder and the TRS2006 copy of index.chm. There are probably many standard messages missing and there are some obscure ones listed. Please add anything that is missing. I will progressively link and document the list. &lt;br /&gt;
__NOTOC__ __NOEDITSECTION__&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{|rules=&amp;quot;rows&amp;quot; cellpadding=&amp;quot;2&amp;quot; cellspacing=&amp;quot;2&amp;quot; width=&amp;quot;95%&amp;quot; style=&amp;quot;border-collapse:collapse;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|width=&amp;quot;15&amp;quot;|&lt;br /&gt;
|width=&amp;quot;250&amp;quot;|Message&lt;br /&gt;
|width=&amp;quot;165&amp;quot;|Source &amp;amp; Destination&lt;br /&gt;
|Purpose&lt;br /&gt;
|&lt;br /&gt;
{{IndexSplit|A}}&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Animation-Event Message|Animation-Event,&#039;&#039;eventname&#039;&#039;]]&lt;br /&gt;
|meshobject &amp;gt; meshobject&lt;br /&gt;
|Sent when an animation triggers an event. These events are included in *.kin files generated by Max when the &#039;Query for Event&#039; box is checked during animation export.  They are used to enable code to be executed in sync with animations.&lt;br /&gt;
{{IndexSplit|B}}&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|BaseIndustry,LoadComplete&lt;br /&gt;
|industry &amp;gt; industry&lt;br /&gt;
|Sent when an industry loading operation has completed&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Browser Messages|Browser-Closed,&#039;&#039;null&#039;&#039;]]&lt;br /&gt;
|browser &amp;gt; broadcast&lt;br /&gt;
|Sent when any in game browser is closed.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|Browser-Key,ScriptObjectives&lt;br /&gt;
|? &amp;gt; ?&lt;br /&gt;
|Sent by Trainz in response to a ScriptObjectives hotkey press. Obsolete?&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Browser Messages|Browser-URL,&#039;&#039;live://linkname&#039;&#039;]]&lt;br /&gt;
|browser &amp;gt; broadcast&lt;br /&gt;
|Sent when the user clicks in a link in a custom browser&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|Build,Cancelled&lt;br /&gt;
|? &amp;gt; buildable&lt;br /&gt;
|Not generally used. Intended for RTS-style gameplay where individual industries (etc) start in an unbuilt state and can be built at some resource cost during gameplay.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|Build,Completed&lt;br /&gt;
|? &amp;gt; buildable&lt;br /&gt;
|Not generally used. Intended for RTS-style gameplay where individual industries (etc) start in an unbuilt state and can be built at some resource cost during gameplay.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|Build,Started&lt;br /&gt;
|? &amp;gt; buildable&lt;br /&gt;
|Not generally used. Intended for RTS-style gameplay where individual industries (etc) start in an unbuilt state and can be built at some resource cost during gameplay.&lt;br /&gt;
{{IndexSplit|C}}&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Camera Messages|Camera,Interior-Changed]]&lt;br /&gt;
|new train? &amp;gt; broadcast&lt;br /&gt;
|Sent when a different train is selected.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Camera Messages|Camera,Target-Changed]]&lt;br /&gt;
|new target? &amp;gt; broadcast&lt;br /&gt;
|Sent when the camera selects a different target, may not be a train.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Camera Messages|Camera,External-View]]&lt;br /&gt;
|? &amp;gt; broadcast&lt;br /&gt;
|Sent when the camera mode is changed.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Camera Messages|Camera,Internal-View]]&lt;br /&gt;
|? &amp;gt; Broadcast&lt;br /&gt;
|Sent when the camera mode is changed.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Camera Messages|Camera,Roaming-View]]&lt;br /&gt;
|? &amp;gt; broadcast&lt;br /&gt;
|Sent when the camera mode is changed.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Camera Messages|Camera,Tracking-View]]&lt;br /&gt;
|? &amp;gt; broadcast&lt;br /&gt;
|Sent when the camera mode is changed.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|Check,Speed&lt;br /&gt;
|vehicle &amp;gt; vehicle&lt;br /&gt;
|Sent continuously to ensure that jetlog isn&#039;t allowed to remain legible :-)&lt;br /&gt;
{{IndexSplit|D}}&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|DriverCharacter,BoardedTrain&lt;br /&gt;
|driver &amp;gt; broadcast&lt;br /&gt;
|Sent when a driver boards a train&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|DriverCharacter,Created&lt;br /&gt;
|driver &amp;gt; broadcast&lt;br /&gt;
|Sent when a driver character is initialised&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|DriverCharacter,LeftTrain&lt;br /&gt;
|driver &amp;gt; broadcast&lt;br /&gt;
|Sent when a driver leaves a train&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|DriverDisplay,ResetTripMeter&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Interface Messages|DriverModule,DCC-Panel-Created]]&lt;br /&gt;
|? &amp;gt; broadcast&lt;br /&gt;
|Sent when driver selection widget has been created&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|DriverSetup,CharactersDone&lt;br /&gt;
|? &amp;gt; broadcast&lt;br /&gt;
|Sent when driver characters have been initialised&lt;br /&gt;
{{IndexSplit|G}}&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|GenericIndustry,LoadComplete&lt;br /&gt;
|industry &amp;gt; industry&lt;br /&gt;
|Sent when an industry loading operation has completed&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|GenericIndustry,ProcessComplete&lt;br /&gt;
|industry &amp;gt; industry&lt;br /&gt;
|Sent when an industry process has completed&lt;br /&gt;
{{IndexSplit|H}}&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|HandleTrain,Release&lt;br /&gt;
|industry &amp;gt; train&lt;br /&gt;
|Sent when an industry loading operation has completed&lt;br /&gt;
{{IndexSplit|I}}&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Interface Messages|Interface,ClickSystemButton]]&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Interface Messages|Interface-Event,MapViewOff]]&lt;br /&gt;
|? &amp;gt; broadcast&lt;br /&gt;
|Sent when the minimap is opened&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Interface Messages|Interface-Event,MapViewOn]]&lt;br /&gt;
|? &amp;gt; broadcast&lt;br /&gt;
|Sent when the minimap is closed&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Interface Messages|Interface-Event,Minimap-Mouse-Enter]]&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Interface Messages|Interface-Event,Minimap-Mouse-Leave]]&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Interface Messages|Interface-Event,New-Driver-Message]]&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Interface Messages|Interface-Event,Mouse-Enter]]&lt;br /&gt;
|object &amp;gt; broadcast&lt;br /&gt;
|Sent on mouseover an object&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Interface Messages|Interface-Event,Mouse-Leave]]&lt;br /&gt;
|? &amp;gt; broadcast&lt;br /&gt;
|Sent on mouseout of an object&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Interface Messages|Interface-Event,Set-Metric-Mode]]&lt;br /&gt;
|? &amp;gt; broadcast&lt;br /&gt;
|Sent when the interface units are changed&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Interface Messages|Interface-Event,Toggle-Interface]]&lt;br /&gt;
|? &amp;gt; broadcast&lt;br /&gt;
|Sent when the main HUD is turned on or off&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Interface Messages|Interface-Event,Toggle-ButtonBar]]&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Interface Messages|Interface-Event,Toggle-CustomHUD]]&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Interface Messages|Interface-Event,Toggle-VehicleControls]]&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Interface Messages|Interface-Event,Left-Click]]&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Interface Messages|Interface-Event,Surveyor-Left-Click]]&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
{{IndexSplit|J}}&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Object Messages|Junction,Enter]]&lt;br /&gt;
|junction &amp;gt; train&lt;br /&gt;
|Sent when a train enters a junction&#039;s outer area&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Object Messages|Junction,InnerEnter]]&lt;br /&gt;
|junction &amp;gt; train&lt;br /&gt;
|Sent when a train enters a junction&#039;s inner area&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Object Messages|Junction,InnerLeave]]&lt;br /&gt;
|junction &amp;gt; train&lt;br /&gt;
|Sent when a train leaves a junction&#039;s inner area&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Object Messages|Junction,Leave]]&lt;br /&gt;
|junction &amp;gt; train&lt;br /&gt;
|Sent when a train leaves a junction&#039;s outer area&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Object Messages|Junction,Stopped]]&lt;br /&gt;
|junction &amp;gt; train&lt;br /&gt;
|Sent when a train stops in a junction trigger area&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|Junction,Toggled&lt;br /&gt;
|junction &amp;gt; broadcast&lt;br /&gt;
|Sent when a junctionbase object is toggled&lt;br /&gt;
{{IndexSplit|M}}&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[MapObject Messages|MapObject,View-Details]]&lt;br /&gt;
|? &amp;gt; object&lt;br /&gt;
|Sent when the user right-clicks an object and selects &#039;View Details&#039; from the resulting menu, some assets provide a built-in browser in response to this message.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[MapObject Messages|MapObject,View-Schedule]]&lt;br /&gt;
|? &amp;gt; ?&lt;br /&gt;
|Sent when the user right-clicks an object and selects &#039;View Schedule&#039; from the resulting menu. The vehicle must have a timetable for this menu item to be displayed.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|MeshObject-Click,*&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
{{IndexSplit|O}}&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Object Messages|Object,Enter]]&lt;br /&gt;
|crossing &amp;gt; crossing&lt;br /&gt;
|Train has entered crossing trigger area&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Object Messages|Object,Leave]]&lt;br /&gt;
|crossing &amp;gt; crossing&lt;br /&gt;
|Train has left crossing trigger area&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Object Messages|Object,Enter]]&lt;br /&gt;
|train &amp;gt; junction&lt;br /&gt;
|Sent when a train enters a junction&#039;s outer area&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Object Messages|Object,InnerEnter]]&lt;br /&gt;
|train &amp;gt; junction&lt;br /&gt;
|Sent when a train enters a junction&#039;s inner area&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Object Messages|Object,InnerLeave]]&lt;br /&gt;
|train &amp;gt; junction&lt;br /&gt;
|Sent when a train leaves a junction&#039;s inner area&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Object Messages|Object,Leave]]&lt;br /&gt;
|train &amp;gt; junction&lt;br /&gt;
|Sent when a train leaves a junction&#039;s outer area&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Object Messages|Object,Stopped]]&lt;br /&gt;
|train &amp;gt; junction&lt;br /&gt;
|Sent when a train stops in a junction trigger area&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Object Messages|Object,Enter]]&lt;br /&gt;
|train &amp;gt; trackmark&lt;br /&gt;
|Sent when a train enters a trackmark&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Object Messages|Object,Leave]]&lt;br /&gt;
|train &amp;gt; trackmark&lt;br /&gt;
|Sent when a train leaves a trackmark&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Object Messages|Object,Stopped]]&lt;br /&gt;
|train &amp;gt; trackmark&lt;br /&gt;
|Sent when a train stops at a trackmark&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Object Messages|Object,Enter]]&lt;br /&gt;
|train &amp;gt; trigger&lt;br /&gt;
|Sent when a train enters a trigger&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Object Messages|Object,Leave]]&lt;br /&gt;
|train &amp;gt; trigger&lt;br /&gt;
|Sent when a train leaves a trigger&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Object Messages|Object,Stopped]]&lt;br /&gt;
|train &amp;gt; trigger&lt;br /&gt;
|Sent when a train stops at a trigger&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Object Messages|Object,Enter]]&lt;br /&gt;
|vehicle &amp;gt; scenerywithtrack&lt;br /&gt;
|Sent when a vehicle enters a scenery trigger&#039;s outer area&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Object Messages|Object,InnerEnter]]&lt;br /&gt;
|vehicle &amp;gt; scenerywithtrack&lt;br /&gt;
|Sent when a vehicle enters a scenery trigger&#039;s inner area&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Object Messages|Object,InnerLeave]]&lt;br /&gt;
|vehicle &amp;gt; scenerywithtrack&lt;br /&gt;
|Sent when a vehicle leaves a scenery trigger&#039;s inner area&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Object Messages|Object,Leave]]&lt;br /&gt;
|vehicle &amp;gt; scenerywithtrack&lt;br /&gt;
|Sent when a vehicle leaves a scenery trigger&#039;s outer area&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Object Messages|Object,Stopped]]&lt;br /&gt;
|vehicle &amp;gt; scenerywithtrack&lt;br /&gt;
|Sent when a train stops in a scenery trigger&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|OnlineAccess,ReceiveMessage&lt;br /&gt;
|? &amp;gt; onlineaccess&lt;br /&gt;
|Message awaiting collection&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|OnlineAccess,StatusChange&lt;br /&gt;
|? &amp;gt; onlineaccess&lt;br /&gt;
|Network status change&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|OnlineGroup,StatusChange&lt;br /&gt;
|? &amp;gt; onlinegroup&lt;br /&gt;
|Network status change&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|OnlineGroup,UsersChange&lt;br /&gt;
|? &amp;gt; onlinegroup&lt;br /&gt;
|Network users change&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|OnlineGroup.UserRemoved,*&lt;br /&gt;
|? &amp;gt; onlinegroup&lt;br /&gt;
|Network users change&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|OnlineGroup.UserAdded,*&lt;br /&gt;
|? &amp;gt; onlinegroup&lt;br /&gt;
|Network users change&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|OnlineGroup.UserStatus,*&lt;br /&gt;
|? &amp;gt; onlinegroup&lt;br /&gt;
|Network users change&lt;br /&gt;
{{IndexSplit|P}}&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|Permit,Granted&lt;br /&gt;
|? &amp;gt; objectrequesting&lt;br /&gt;
|Sent when a track or junction permit is granted&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|PortalTunnel,EmitTrain&lt;br /&gt;
|portal &amp;gt; portal&lt;br /&gt;
|Sent when a portal produces a train&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[pfx Message|pfx,&#039;&#039;particledata&#039;&#039;]]&lt;br /&gt;
|script &amp;gt; object&lt;br /&gt;
|Sent by script to control particle effects&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|Process-Start,&#039;&#039;processname&#039;&#039;&lt;br /&gt;
|industry &amp;gt; industry&lt;br /&gt;
|Sent when an industry process has started&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|Process-Stop,&#039;&#039;processname&#039;&#039;&lt;br /&gt;
|industry &amp;gt; industry&lt;br /&gt;
|Sent when an industry process has completed&lt;br /&gt;
{{IndexSplit|S}}&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|Scenario,KillMonitor&lt;br /&gt;
|? &amp;gt; ?&lt;br /&gt;
|Sent to terminate a scenario thread&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|Scenario,Quit&lt;br /&gt;
|? &amp;gt; ?&lt;br /&gt;
|Sent to terminate a scenario&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|ScenarioBehaviour,Touch&lt;br /&gt;
|? &amp;gt; ?&lt;br /&gt;
|Called on a parent rule when the child rule completes. May also indicate other state changes.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Object Messages|SceneryTrigger,Enter]]&lt;br /&gt;
|scenerywithtrack &amp;gt; vehicle&lt;br /&gt;
|Sent when a vehicle enters a scenery trigger&#039;s outer area&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Object Messages|SceneryTrigger,InnerEnter]]&lt;br /&gt;
|scenerywithtrack &amp;gt; vehicle&lt;br /&gt;
|Sent when a vehicle enters a scenery trigger&#039;s inner area&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Object Messages|SceneryTrigger,InnerLeave]]&lt;br /&gt;
|scenerywithtrack &amp;gt; vehicle&lt;br /&gt;
|Sent when a vehicle leaves a scenery trigger&#039;s inner area&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Object Messages|SceneryTrigger,Leave]]&lt;br /&gt;
|scenerywithtrack &amp;gt; vehicle&lt;br /&gt;
|Sent when a vehicle leaves a scenery trigger&#039;s outer area&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Object Messages|SceneryTrigger,Stopped]]&lt;br /&gt;
|scenerywithtrack &amp;gt; vehicle&lt;br /&gt;
|Sent when a train stops in a scenery trigger&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|Schedule,Abort&lt;br /&gt;
|train &amp;gt; train&lt;br /&gt;
|Sent when a command schedule is abandoned&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|Schedule,Complete&lt;br /&gt;
|train &amp;gt; broadcast&lt;br /&gt;
|Sent when a command schedule is completed&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|Schedule,Touch&lt;br /&gt;
|train &amp;gt; train&lt;br /&gt;
|Sent when a Train&#039;s AI schedule state is modified (see Train.StopSchedule()) and sniffed by DriverCharacter to implement DriverCommand support.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Signal Messages|Signal,StateChanged]]&lt;br /&gt;
|signal &amp;gt; broadcast&lt;br /&gt;
|Signal aspect has changed&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|StationMain.Timer,Tick&lt;br /&gt;
|station &amp;gt; station&lt;br /&gt;
|Sent by stations to initiate a periodic update&lt;br /&gt;
{{IndexSplit|T}}&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|Timer,Tick&lt;br /&gt;
|? &amp;gt; ?&lt;br /&gt;
|A common custom message used by various scripts to implement timed polling.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|Timetable,&lt;br /&gt;
|? &amp;gt; ?&lt;br /&gt;
|?&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Object Messages|Trackmark,Enter]]&lt;br /&gt;
|trackmark &amp;gt; train&lt;br /&gt;
|Sent when a train enters a trackmark&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Object Messages|Trackmark,Leave]]&lt;br /&gt;
|trackmark &amp;gt; train&lt;br /&gt;
|Sent when a train leaves a trackmark&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Object Messages|Trackmark,Stopped]]&lt;br /&gt;
|trackmark &amp;gt; train&lt;br /&gt;
|Sent when a train stops at a trackmark&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Signal Messages|Train,Entered red signal]]&lt;br /&gt;
|signal &amp;gt; train&lt;br /&gt;
|Train has entered signal&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Signal Messages|Train,Entered red signal notify]]&lt;br /&gt;
|train &amp;gt; broadcast&lt;br /&gt;
|Train has entered signal&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Signal Messages|Train,Passed Signal]]&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Train Messages|Train,Over speed limit]]&lt;br /&gt;
|train &amp;gt; broadcast&lt;br /&gt;
|Sent when a train exceeds the current speed limit.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Train Messages|Train,Under speed limit]]&lt;br /&gt;
|train &amp;gt; broadcast&lt;br /&gt;
|Sent when a train slows below the current speed limit.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Train Messages|Train,Over advisory speed limit]]&lt;br /&gt;
|train &amp;gt; broadcast&lt;br /&gt;
|Sent when a train exceeds the current advisory speed limit.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Train Messages|Train,Under advisory speed limit]]&lt;br /&gt;
|train &amp;gt; broadcast&lt;br /&gt;
|Sent when a train slows below the current advisory speed limit.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Train Messages|Train,Over floating speed limit]]&lt;br /&gt;
|train &amp;gt; broadcast&lt;br /&gt;
|Sent when a train exceeds the floating speed limit.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Train Messages|Train,Under floating speed limit]]&lt;br /&gt;
|train &amp;gt; broadcast&lt;br /&gt;
|Sent when a train slows below the floating speed limit.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Train Messages|Train,Cleanup]]&lt;br /&gt;
|? &amp;gt; ?&lt;br /&gt;
|Sent immediately prior to the destruction of a Train object, to allow certain scripts to clean up their state.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Train Messages|Train,Deleted]]&lt;br /&gt;
|train &amp;gt; ?&lt;br /&gt;
|Sent when a train is deleted from the train list. This will also occur when two trains couple to form a new train.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|Train,ThreadAITrainStoppedMovingFailed&lt;br /&gt;
|train &amp;gt; train&lt;br /&gt;
|Internal Train.gs implementation- sent when the AI fails to enter the expected junction.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|Train,CommandCoupleVehicleTimer&lt;br /&gt;
|train &amp;gt; train&lt;br /&gt;
|Internal Train.gs implementation- sent when the AI fails to couple in a two-second window.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|Train,CommandReverseTrain.Pulse&lt;br /&gt;
|train &amp;gt; train&lt;br /&gt;
|Internal Train.gs implementation- sent when the AI fails to take permits to reverse a train within a 20-second window.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Train Messages|Train,DriverBoarded]]&lt;br /&gt;
|train &amp;gt; driver&lt;br /&gt;
|Sent when a driver boards a train&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|Train,NotifyBell&lt;br /&gt;
|train &amp;gt; train&lt;br /&gt;
|Sent when the interface bell button is clicked.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|Train,NotifyHeadlights&lt;br /&gt;
|train &amp;gt; train&lt;br /&gt;
|Sent when the interface headlight button is clicked.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|Train,NotifyHorn&lt;br /&gt;
|train &amp;gt; train&lt;br /&gt;
|Sent when the interface horn button is clicked&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|Train,NotifyPantographs&lt;br /&gt;
|train &amp;gt; train&lt;br /&gt;
|Sent when the interface pantograph button is clicked.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|Train,NotifySanding&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|Train,TurnAround&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Train Messages|Train,ReachedTarget]]&lt;br /&gt;
|? &amp;gt; ?&lt;br /&gt;
|Sent by Trainz when a train reaches the specified Autopilot Target Position.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Train Messages|Train,SlowingForTarget]]&lt;br /&gt;
|train &amp;gt; train&lt;br /&gt;
|Sent by Trainz when the train begins to slow on approach to a specified Autopilot Target Position.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Train Messages|Train,Handbrake-Apply]]&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Train Messages|Train,Handbrake-Release]]&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Train Messages|Train,StartedMoving]]&lt;br /&gt;
|train &amp;gt; train&lt;br /&gt;
|Sent when a train starts to move&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Train Messages|Train,StoppedMoving]]&lt;br /&gt;
|train &amp;gt; train&lt;br /&gt;
|Sent when a train stops&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Train Messages|Train,ThrottleChanged]]&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|Train,Tick&lt;br /&gt;
|train &amp;gt; train&lt;br /&gt;
|?&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Object Messages|Train,EnterTrack]]&lt;br /&gt;
|track &amp;gt; train&lt;br /&gt;
|Sent when a train enters a track section&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Object Messages|Train,InnerEnterTrack]]&lt;br /&gt;
|track &amp;gt; train&lt;br /&gt;
|?&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Object Messages|Train,InnerLeaveTrack]]&lt;br /&gt;
|track &amp;gt; train&lt;br /&gt;
|?&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Object Messages|Train,LeaveTrack]]&lt;br /&gt;
|track &amp;gt; train&lt;br /&gt;
|Sent when a train leaves a track section&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|Train.ThreadAITrainStuck,Touch&lt;br /&gt;
|train &amp;gt; train&lt;br /&gt;
|?&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|TrainTimetable,Touch&lt;br /&gt;
|? &amp;gt; ?&lt;br /&gt;
|?&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Object Messages|Trigger,Enter]]&lt;br /&gt;
|trigger &amp;gt; train&lt;br /&gt;
|Sent when a train enters a trigger&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Object Messages|Trigger,Leave]]&lt;br /&gt;
|trigger &amp;gt; train&lt;br /&gt;
|Sent when a train leaves a trigger&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Object Messages|Trigger,Stopped]]&lt;br /&gt;
|trigger &amp;gt; train&lt;br /&gt;
|Sent when a train stops at a trigger&lt;br /&gt;
{{IndexSplit|V}}&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Vehicle Messages|Vehicle,BadCouple]]&lt;br /&gt;
|vehicle &amp;gt; broadcast&lt;br /&gt;
|Sent when a vehicle couples at excessive speed&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Vehicle Messages|Vehicle,Collided]]&lt;br /&gt;
|vehicle &amp;gt; broadcast&lt;br /&gt;
|Sent on a collision between vehicles&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Vehicle Messages|Vehicle,Coupled]]&lt;br /&gt;
|vehicle &amp;gt; broadcast&lt;br /&gt;
|Sent when a vehicle couples to another&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Vehicle Messages|Vehicle,Decoupled]]&lt;br /&gt;
|vehicle &amp;gt; broadcast&lt;br /&gt;
|Sent when a vehicle uncouples from another&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Vehicle Messages|Vehicle,Derailed]]&lt;br /&gt;
|vehicle &amp;gt; broadcast&lt;br /&gt;
|Sent when a vehicle is derailed&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|Vehicle,LoadComplete&lt;br /&gt;
|industry &amp;gt; vehicle&lt;br /&gt;
|Sent when loading of a vehicle from an industry is complete&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|Vehicle,Coupler breakage&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|Vehicle,Coupler breakage notify&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|Vehicle,Coupler Repaired&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
{{IndexSplit|W}}&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Interface Messages|WaybillManager,WaybillsWindowShown]]&lt;br /&gt;
|waybillmanager &amp;gt; broadcast&lt;br /&gt;
|?&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Interface Messages|WaybillManager,WaybillsWindowHidden]]&lt;br /&gt;
|waybillmanager &amp;gt; broadcast&lt;br /&gt;
|?&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[ModuleInit Message|World,ModuleInit]]&lt;br /&gt;
|? &amp;gt; broadcast&lt;br /&gt;
|Sent whenever TRS switches to Driver, Surveyor or Railyard modes&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|World,Paused&lt;br /&gt;
|? &amp;gt; broadcast&lt;br /&gt;
|?&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|World,Unpaused&lt;br /&gt;
|? &amp;gt; broadcast&lt;br /&gt;
|?&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|World,Day&lt;br /&gt;
|? &amp;gt; broadcast&lt;br /&gt;
|Sent 1.) at ca. 05:45 ~ 0.739409 Gametime 2.) sometimes when TS starts Driver&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|World,Night&lt;br /&gt;
|? &amp;gt; broadcast&lt;br /&gt;
|Sent 1.) at ca. 18:15 ~ 0.260611 GameTime 2.) whenever TS starts Driver or Surveyor and Playtime is beween 18:15 and 05:45 3.) sometimes when TS switched to Driver or Surveyor&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Ciceronmt</name></author>
	</entry>
	<entry>
		<id>https://wiki.trainzsimulator.com/index.php?title=List_of_Standard_Messages&amp;diff=21336</id>
		<title>List of Standard Messages</title>
		<link rel="alternate" type="text/html" href="https://wiki.trainzsimulator.com/index.php?title=List_of_Standard_Messages&amp;diff=21336"/>
		<updated>2019-09-14T11:20:45Z</updated>

		<summary type="html">&lt;p&gt;Ciceronmt: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;*[[TrainzScript Language Reference|API Hierarchy]]&lt;br /&gt;
&lt;br /&gt;
*This list is a first step towards documenting Trainz use of messages. It has been generated by scanning one or two copies of jetlog.txt from TC, together with the TC scripts folder and the TRS2006 copy of index.chm. There are probably many standard messages missing and there are some obscure ones listed. Please add anything that is missing. I will progressively link and document the list. &lt;br /&gt;
__NOTOC__ __NOEDITSECTION__&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{|rules=&amp;quot;rows&amp;quot; cellpadding=&amp;quot;2&amp;quot; cellspacing=&amp;quot;2&amp;quot; width=&amp;quot;95%&amp;quot; style=&amp;quot;border-collapse:collapse;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|width=&amp;quot;15&amp;quot;|&lt;br /&gt;
|width=&amp;quot;250&amp;quot;|Message&lt;br /&gt;
|width=&amp;quot;165&amp;quot;|Source &amp;amp; Destination&lt;br /&gt;
|Purpose&lt;br /&gt;
|&lt;br /&gt;
{{IndexSplit|A}}&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Animation-Event Message|Animation-Event,&#039;&#039;eventname&#039;&#039;]]&lt;br /&gt;
|meshobject &amp;gt; meshobject&lt;br /&gt;
|Sent when an animation triggers an event. These events are included in *.kin files generated by Max when the &#039;Query for Event&#039; box is checked during animation export.  They are used to enable code to be executed in sync with animations.&lt;br /&gt;
{{IndexSplit|B}}&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|BaseIndustry,LoadComplete&lt;br /&gt;
|industry &amp;gt; industry&lt;br /&gt;
|Sent when an industry loading operation has completed&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Browser Messages|Browser-Closed,&#039;&#039;null&#039;&#039;]]&lt;br /&gt;
|browser &amp;gt; broadcast&lt;br /&gt;
|Sent when any in game browser is closed.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|Browser-Key,ScriptObjectives&lt;br /&gt;
|? &amp;gt; ?&lt;br /&gt;
|Sent by Trainz in response to a ScriptObjectives hotkey press. Obsolete?&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Browser Messages|Browser-URL,&#039;&#039;live://linkname&#039;&#039;]]&lt;br /&gt;
|browser &amp;gt; broadcast&lt;br /&gt;
|Sent when the user clicks in a link in a custom browser&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|Build,Cancelled&lt;br /&gt;
|? &amp;gt; buildable&lt;br /&gt;
|Not generally used. Intended for RTS-style gameplay where individual industries (etc) start in an unbuilt state and can be built at some resource cost during gameplay.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|Build,Completed&lt;br /&gt;
|? &amp;gt; buildable&lt;br /&gt;
|Not generally used. Intended for RTS-style gameplay where individual industries (etc) start in an unbuilt state and can be built at some resource cost during gameplay.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|Build,Started&lt;br /&gt;
|? &amp;gt; buildable&lt;br /&gt;
|Not generally used. Intended for RTS-style gameplay where individual industries (etc) start in an unbuilt state and can be built at some resource cost during gameplay.&lt;br /&gt;
{{IndexSplit|C}}&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Camera Messages|Camera,Interior-Changed]]&lt;br /&gt;
|new train? &amp;gt; broadcast&lt;br /&gt;
|Sent when a different train is selected.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Camera Messages|Camera,Target-Changed]]&lt;br /&gt;
|new target? &amp;gt; broadcast&lt;br /&gt;
|Sent when the camera selects a different target, may not be a train.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Camera Messages|Camera,External-View]]&lt;br /&gt;
|? &amp;gt; broadcast&lt;br /&gt;
|Sent when the camera mode is changed.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Camera Messages|Camera,Internal-View]]&lt;br /&gt;
|? &amp;gt; Broadcast&lt;br /&gt;
|Sent when the camera mode is changed.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Camera Messages|Camera,Roaming-View]]&lt;br /&gt;
|? &amp;gt; broadcast&lt;br /&gt;
|Sent when the camera mode is changed.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Camera Messages|Camera,Tracking-View]]&lt;br /&gt;
|? &amp;gt; broadcast&lt;br /&gt;
|Sent when the camera mode is changed.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|Check,Speed&lt;br /&gt;
|vehicle &amp;gt; vehicle&lt;br /&gt;
|Sent continuously to ensure that jetlog isn&#039;t allowed to remain legible :-)&lt;br /&gt;
{{IndexSplit|D}}&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|DriverCharacter,BoardedTrain&lt;br /&gt;
|driver &amp;gt; broadcast&lt;br /&gt;
|Sent when a driver boards a train&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|DriverCharacter,Created&lt;br /&gt;
|driver &amp;gt; broadcast&lt;br /&gt;
|Sent when a driver character is initialised&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|DriverCharacter,LeftTrain&lt;br /&gt;
|driver &amp;gt; broadcast&lt;br /&gt;
|Sent when a driver leaves a train&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|DriverDisplay,ResetTripMeter&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Interface Messages|DriverModule,DCC-Panel-Created]]&lt;br /&gt;
|? &amp;gt; broadcast&lt;br /&gt;
|Sent when driver selection widget has been created&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|DriverSetup,CharactersDone&lt;br /&gt;
|? &amp;gt; broadcast&lt;br /&gt;
|Sent when driver characters have been initialised&lt;br /&gt;
{{IndexSplit|G}}&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|GenericIndustry,LoadComplete&lt;br /&gt;
|industry &amp;gt; industry&lt;br /&gt;
|Sent when an industry loading operation has completed&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|GenericIndustry,ProcessComplete&lt;br /&gt;
|industry &amp;gt; industry&lt;br /&gt;
|Sent when an industry process has completed&lt;br /&gt;
{{IndexSplit|H}}&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|HandleTrain,Release&lt;br /&gt;
|industry &amp;gt; train&lt;br /&gt;
|Sent when an industry loading operation has completed&lt;br /&gt;
{{IndexSplit|I}}&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Interface Messages|Interface,ClickSystemButton]]&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Interface Messages|Interface-Event,MapViewOff]]&lt;br /&gt;
|? &amp;gt; broadcast&lt;br /&gt;
|Sent when the minimap is opened&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Interface Messages|Interface-Event,MapViewOn]]&lt;br /&gt;
|? &amp;gt; broadcast&lt;br /&gt;
|Sent when the minimap is closed&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Interface Messages|Interface-Event,Minimap-Mouse-Enter]]&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Interface Messages|Interface-Event,Minimap-Mouse-Leave]]&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Interface Messages|Interface-Event,New-Driver-Message]]&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Interface Messages|Interface-Event,Mouse-Enter]]&lt;br /&gt;
|object &amp;gt; broadcast&lt;br /&gt;
|Sent on mouseover an object&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Interface Messages|Interface-Event,Mouse-Leave]]&lt;br /&gt;
|? &amp;gt; broadcast&lt;br /&gt;
|Sent on mouseout of an object&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Interface Messages|Interface-Event,Set-Metric-Mode]]&lt;br /&gt;
|? &amp;gt; broadcast&lt;br /&gt;
|Sent when the interface units are changed&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Interface Messages|Interface-Event,Toggle-Interface]]&lt;br /&gt;
|? &amp;gt; broadcast&lt;br /&gt;
|Sent when the main HUD is turned on or off&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Interface Messages|Interface-Event,Toggle-ButtonBar]]&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Interface Messages|Interface-Event,Toggle-CustomHUD]]&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Interface Messages|Interface-Event,Toggle-VehicleControls]]&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Interface Messages|Interface-Event,Left-Click]]&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Interface Messages|Interface-Event,Surveyor-Left-Click]]&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
{{IndexSplit|J}}&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Object Messages|Junction,Enter]]&lt;br /&gt;
|junction &amp;gt; train&lt;br /&gt;
|Sent when a train enters a junction&#039;s outer area&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Object Messages|Junction,InnerEnter]]&lt;br /&gt;
|junction &amp;gt; train&lt;br /&gt;
|Sent when a train enters a junction&#039;s inner area&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Object Messages|Junction,InnerLeave]]&lt;br /&gt;
|junction &amp;gt; train&lt;br /&gt;
|Sent when a train leaves a junction&#039;s inner area&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Object Messages|Junction,Leave]]&lt;br /&gt;
|junction &amp;gt; train&lt;br /&gt;
|Sent when a train leaves a junction&#039;s outer area&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Object Messages|Junction,Stopped]]&lt;br /&gt;
|junction &amp;gt; train&lt;br /&gt;
|Sent when a train stops in a junction trigger area&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|Junction,Toggled&lt;br /&gt;
|junction &amp;gt; broadcast&lt;br /&gt;
|Sent when a junctionbase object is toggled&lt;br /&gt;
{{IndexSplit|M}}&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[MapObject Messages|MapObject,View-Details]]&lt;br /&gt;
|? &amp;gt; object&lt;br /&gt;
|Sent when the user right-clicks an object and selects &#039;View Details&#039; from the resulting menu, some assets provide a built-in browser in response to this message.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[MapObject Messages|MapObject,View-Schedule]]&lt;br /&gt;
|? &amp;gt; ?&lt;br /&gt;
|Sent when the user right-clicks an object and selects &#039;View Schedule&#039; from the resulting menu. The vehicle must have a timetable for this menu item to be displayed.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|MeshObject-Click,*&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
{{IndexSplit|O}}&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Object Messages|Object,Enter]]&lt;br /&gt;
|crossing &amp;gt; crossing&lt;br /&gt;
|Train has entered crossing trigger area&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Object Messages|Object,Leave]]&lt;br /&gt;
|crossing &amp;gt; crossing&lt;br /&gt;
|Train has left crossing trigger area&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Object Messages|Object,Enter]]&lt;br /&gt;
|train &amp;gt; junction&lt;br /&gt;
|Sent when a train enters a junction&#039;s outer area&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Object Messages|Object,InnerEnter]]&lt;br /&gt;
|train &amp;gt; junction&lt;br /&gt;
|Sent when a train enters a junction&#039;s inner area&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Object Messages|Object,InnerLeave]]&lt;br /&gt;
|train &amp;gt; junction&lt;br /&gt;
|Sent when a train leaves a junction&#039;s inner area&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Object Messages|Object,Leave]]&lt;br /&gt;
|train &amp;gt; junction&lt;br /&gt;
|Sent when a train leaves a junction&#039;s outer area&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Object Messages|Object,Stopped]]&lt;br /&gt;
|train &amp;gt; junction&lt;br /&gt;
|Sent when a train stops in a junction trigger area&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Object Messages|Object,Enter]]&lt;br /&gt;
|train &amp;gt; trackmark&lt;br /&gt;
|Sent when a train enters a trackmark&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Object Messages|Object,Leave]]&lt;br /&gt;
|train &amp;gt; trackmark&lt;br /&gt;
|Sent when a train leaves a trackmark&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Object Messages|Object,Stopped]]&lt;br /&gt;
|train &amp;gt; trackmark&lt;br /&gt;
|Sent when a train stops at a trackmark&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Object Messages|Object,Enter]]&lt;br /&gt;
|train &amp;gt; trigger&lt;br /&gt;
|Sent when a train enters a trigger&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Object Messages|Object,Leave]]&lt;br /&gt;
|train &amp;gt; trigger&lt;br /&gt;
|Sent when a train leaves a trigger&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Object Messages|Object,Stopped]]&lt;br /&gt;
|train &amp;gt; trigger&lt;br /&gt;
|Sent when a train stops at a trigger&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Object Messages|Object,Enter]]&lt;br /&gt;
|vehicle &amp;gt; scenerywithtrack&lt;br /&gt;
|Sent when a vehicle enters a scenery trigger&#039;s outer area&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Object Messages|Object,InnerEnter]]&lt;br /&gt;
|vehicle &amp;gt; scenerywithtrack&lt;br /&gt;
|Sent when a vehicle enters a scenery trigger&#039;s inner area&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Object Messages|Object,InnerLeave]]&lt;br /&gt;
|vehicle &amp;gt; scenerywithtrack&lt;br /&gt;
|Sent when a vehicle leaves a scenery trigger&#039;s inner area&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Object Messages|Object,Leave]]&lt;br /&gt;
|vehicle &amp;gt; scenerywithtrack&lt;br /&gt;
|Sent when a vehicle leaves a scenery trigger&#039;s outer area&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Object Messages|Object,Stopped]]&lt;br /&gt;
|vehicle &amp;gt; scenerywithtrack&lt;br /&gt;
|Sent when a train stops in a scenery trigger&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|OnlineAccess,ReceiveMessage&lt;br /&gt;
|? &amp;gt; onlineaccess&lt;br /&gt;
|Message awaiting collection&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|OnlineAccess,StatusChange&lt;br /&gt;
|? &amp;gt; onlineaccess&lt;br /&gt;
|Network status change&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|OnlineGroup,StatusChange&lt;br /&gt;
|? &amp;gt; onlinegroup&lt;br /&gt;
|Network status change&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|OnlineGroup,UsersChange&lt;br /&gt;
|? &amp;gt; onlinegroup&lt;br /&gt;
|Network users change&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|OnlineGroup.UserRemoved,*&lt;br /&gt;
|? &amp;gt; onlinegroup&lt;br /&gt;
|Network users change&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|OnlineGroup.UserAdded,*&lt;br /&gt;
|? &amp;gt; onlinegroup&lt;br /&gt;
|Network users change&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|OnlineGroup.UserStatus,*&lt;br /&gt;
|? &amp;gt; onlinegroup&lt;br /&gt;
|Network users change&lt;br /&gt;
{{IndexSplit|P}}&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|Permit,Granted&lt;br /&gt;
|? &amp;gt; objectrequesting&lt;br /&gt;
|Sent when a track or junction permit is granted&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|PortalTunnel,EmitTrain&lt;br /&gt;
|portal &amp;gt; portal&lt;br /&gt;
|Sent when a portal produces a train&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[pfx Message|pfx,&#039;&#039;particledata&#039;&#039;]]&lt;br /&gt;
|script &amp;gt; object&lt;br /&gt;
|Sent by script to control particle effects&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|Process-Start,&#039;&#039;processname&#039;&#039;&lt;br /&gt;
|industry &amp;gt; industry&lt;br /&gt;
|Sent when an industry process has started&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|Process-Stop,&#039;&#039;processname&#039;&#039;&lt;br /&gt;
|industry &amp;gt; industry&lt;br /&gt;
|Sent when an industry process has completed&lt;br /&gt;
{{IndexSplit|S}}&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|Scenario,KillMonitor&lt;br /&gt;
|? &amp;gt; ?&lt;br /&gt;
|Sent to terminate a scenario thread&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|Scenario,Quit&lt;br /&gt;
|? &amp;gt; ?&lt;br /&gt;
|Sent to terminate a scenario&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|ScenarioBehaviour,Touch&lt;br /&gt;
|? &amp;gt; ?&lt;br /&gt;
|Called on a parent rule when the child rule completes. May also indicate other state changes.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Object Messages|SceneryTrigger,Enter]]&lt;br /&gt;
|scenerywithtrack &amp;gt; vehicle&lt;br /&gt;
|Sent when a vehicle enters a scenery trigger&#039;s outer area&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Object Messages|SceneryTrigger,InnerEnter]]&lt;br /&gt;
|scenerywithtrack &amp;gt; vehicle&lt;br /&gt;
|Sent when a vehicle enters a scenery trigger&#039;s inner area&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Object Messages|SceneryTrigger,InnerLeave]]&lt;br /&gt;
|scenerywithtrack &amp;gt; vehicle&lt;br /&gt;
|Sent when a vehicle leaves a scenery trigger&#039;s inner area&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Object Messages|SceneryTrigger,Leave]]&lt;br /&gt;
|scenerywithtrack &amp;gt; vehicle&lt;br /&gt;
|Sent when a vehicle leaves a scenery trigger&#039;s outer area&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Object Messages|SceneryTrigger,Stopped]]&lt;br /&gt;
|scenerywithtrack &amp;gt; vehicle&lt;br /&gt;
|Sent when a train stops in a scenery trigger&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|Schedule,Abort&lt;br /&gt;
|train &amp;gt; train&lt;br /&gt;
|Sent when a command schedule is abandoned&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|Schedule,Complete&lt;br /&gt;
|train &amp;gt; broadcast&lt;br /&gt;
|Sent when a command schedule is completed&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|Schedule,Touch&lt;br /&gt;
|train &amp;gt; train&lt;br /&gt;
|Sent when a Train&#039;s AI schedule state is modified (see Train.StopSchedule()) and sniffed by DriverCharacter to implement DriverCommand support.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Signal Messages|Signal,StateChanged]]&lt;br /&gt;
|signal &amp;gt; broadcast&lt;br /&gt;
|Signal aspect has changed&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|StationMain.Timer,Tick&lt;br /&gt;
|station &amp;gt; station&lt;br /&gt;
|Sent by stations to initiate a periodic update&lt;br /&gt;
{{IndexSplit|T}}&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|Timer,Tick&lt;br /&gt;
|? &amp;gt; ?&lt;br /&gt;
|A common custom message used by various scripts to implement timed polling.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|Timetable,&lt;br /&gt;
|? &amp;gt; ?&lt;br /&gt;
|?&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Object Messages|Trackmark,Enter]]&lt;br /&gt;
|trackmark &amp;gt; train&lt;br /&gt;
|Sent when a train enters a trackmark&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Object Messages|Trackmark,Leave]]&lt;br /&gt;
|trackmark &amp;gt; train&lt;br /&gt;
|Sent when a train leaves a trackmark&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Object Messages|Trackmark,Stopped]]&lt;br /&gt;
|trackmark &amp;gt; train&lt;br /&gt;
|Sent when a train stops at a trackmark&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Signal Messages|Train,Entered red signal]]&lt;br /&gt;
|signal &amp;gt; train&lt;br /&gt;
|Train has entered signal&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Signal Messages|Train,Entered red signal notify]]&lt;br /&gt;
|train &amp;gt; broadcast&lt;br /&gt;
|Train has entered signal&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Signal Messages|Train,Passed Signal]]&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Train Messages|Train,Over speed limit]]&lt;br /&gt;
|train &amp;gt; broadcast&lt;br /&gt;
|Sent when a train exceeds the current speed limit.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Train Messages|Train,Under speed limit]]&lt;br /&gt;
|train &amp;gt; broadcast&lt;br /&gt;
|Sent when a train slows below the current speed limit.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Train Messages|Train,Over advisory speed limit]]&lt;br /&gt;
|train &amp;gt; broadcast&lt;br /&gt;
|Sent when a train exceeds the current advisory speed limit.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Train Messages|Train,Under advisory speed limit]]&lt;br /&gt;
|train &amp;gt; broadcast&lt;br /&gt;
|Sent when a train slows below the current advisory speed limit.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Train Messages|Train,Over floating speed limit]]&lt;br /&gt;
|train &amp;gt; broadcast&lt;br /&gt;
|Sent when a train exceeds the floating speed limit.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Train Messages|Train,Under floating speed limit]]&lt;br /&gt;
|train &amp;gt; broadcast&lt;br /&gt;
|Sent when a train slows below the floating speed limit.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Train Messages|Train,Cleanup]]&lt;br /&gt;
|? &amp;gt; ?&lt;br /&gt;
|Sent immediately prior to the destruction of a Train object, to allow certain scripts to clean up their state.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Train Messages|Train,Deleted]]&lt;br /&gt;
|train &amp;gt; ?&lt;br /&gt;
|Sent when a train is deleted from the train list. This will also occur when two trains couple to form a new train.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|Train,ThreadAITrainStoppedMovingFailed&lt;br /&gt;
|train &amp;gt; train&lt;br /&gt;
|Internal Train.gs implementation- sent when the AI fails to enter the expected junction.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|Train,CommandCoupleVehicleTimer&lt;br /&gt;
|train &amp;gt; train&lt;br /&gt;
|Internal Train.gs implementation- sent when the AI fails to couple in a two-second window.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|Train,CommandReverseTrain.Pulse&lt;br /&gt;
|train &amp;gt; train&lt;br /&gt;
|Internal Train.gs implementation- sent when the AI fails to take permits to reverse a train within a 20-second window.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Train Messages|Train,DriverBoarded]]&lt;br /&gt;
|train &amp;gt; driver&lt;br /&gt;
|Sent when a driver boards a train&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|Train,NotifyBell&lt;br /&gt;
|train &amp;gt; train&lt;br /&gt;
|Sent when the interface bell button is clicked.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|Train,NotifyHeadlights&lt;br /&gt;
|train &amp;gt; train&lt;br /&gt;
|Sent when the interface headlight button is clicked.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|Train,NotifyHorn&lt;br /&gt;
|train &amp;gt; train&lt;br /&gt;
|Sent when the interface horn button is clicked&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|Train,NotifyPantographs&lt;br /&gt;
|train &amp;gt; train&lt;br /&gt;
|Sent when the interface pantograph button is clicked.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|Train,NotifySanding&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|Train,TurnAround&lt;br /&gt;
|&lt;br /&gt;
|Does not work since build 4.3&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Train Messages|Train,ReachedTarget]]&lt;br /&gt;
|? &amp;gt; ?&lt;br /&gt;
|Sent by Trainz when a train reaches the specified Autopilot Target Position.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Train Messages|Train,SlowingForTarget]]&lt;br /&gt;
|train &amp;gt; train&lt;br /&gt;
|Sent by Trainz when the train begins to slow on approach to a specified Autopilot Target Position.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Train Messages|Train,Handbrake-Apply]]&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Train Messages|Train,Handbrake-Release]]&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Train Messages|Train,StartedMoving]]&lt;br /&gt;
|train &amp;gt; train&lt;br /&gt;
|Sent when a train starts to move&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Train Messages|Train,StoppedMoving]]&lt;br /&gt;
|train &amp;gt; train&lt;br /&gt;
|Sent when a train stops&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Train Messages|Train,ThrottleChanged]]&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|Train,Tick&lt;br /&gt;
|train &amp;gt; train&lt;br /&gt;
|?&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Object Messages|Train,EnterTrack]]&lt;br /&gt;
|track &amp;gt; train&lt;br /&gt;
|Sent when a train enters a track section&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Object Messages|Train,InnerEnterTrack]]&lt;br /&gt;
|track &amp;gt; train&lt;br /&gt;
|?&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Object Messages|Train,InnerLeaveTrack]]&lt;br /&gt;
|track &amp;gt; train&lt;br /&gt;
|?&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Object Messages|Train,LeaveTrack]]&lt;br /&gt;
|track &amp;gt; train&lt;br /&gt;
|Sent when a train leaves a track section&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|Train.ThreadAITrainStuck,Touch&lt;br /&gt;
|train &amp;gt; train&lt;br /&gt;
|?&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|TrainTimetable,Touch&lt;br /&gt;
|? &amp;gt; ?&lt;br /&gt;
|?&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Object Messages|Trigger,Enter]]&lt;br /&gt;
|trigger &amp;gt; train&lt;br /&gt;
|Sent when a train enters a trigger&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Object Messages|Trigger,Leave]]&lt;br /&gt;
|trigger &amp;gt; train&lt;br /&gt;
|Sent when a train leaves a trigger&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Object Messages|Trigger,Stopped]]&lt;br /&gt;
|trigger &amp;gt; train&lt;br /&gt;
|Sent when a train stops at a trigger&lt;br /&gt;
{{IndexSplit|V}}&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Vehicle Messages|Vehicle,BadCouple]]&lt;br /&gt;
|vehicle &amp;gt; broadcast&lt;br /&gt;
|Sent when a vehicle couples at excessive speed&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Vehicle Messages|Vehicle,Collided]]&lt;br /&gt;
|vehicle &amp;gt; broadcast&lt;br /&gt;
|Sent on a collision between vehicles&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Vehicle Messages|Vehicle,Coupled]]&lt;br /&gt;
|vehicle &amp;gt; broadcast&lt;br /&gt;
|Sent when a vehicle couples to another&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Vehicle Messages|Vehicle,Decoupled]]&lt;br /&gt;
|vehicle &amp;gt; broadcast&lt;br /&gt;
|Sent when a vehicle uncouples from another&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Vehicle Messages|Vehicle,Derailed]]&lt;br /&gt;
|vehicle &amp;gt; broadcast&lt;br /&gt;
|Sent when a vehicle is derailed&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|Vehicle,LoadComplete&lt;br /&gt;
|industry &amp;gt; vehicle&lt;br /&gt;
|Sent when loading of a vehicle from an industry is complete&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|Vehicle,Coupler breakage&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|Vehicle,Coupler breakage notify&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|Vehicle,Coupler Repaired&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
{{IndexSplit|W}}&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Interface Messages|WaybillManager,WaybillsWindowShown]]&lt;br /&gt;
|waybillmanager &amp;gt; broadcast&lt;br /&gt;
|?&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Interface Messages|WaybillManager,WaybillsWindowHidden]]&lt;br /&gt;
|waybillmanager &amp;gt; broadcast&lt;br /&gt;
|?&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[ModuleInit Message|World,ModuleInit]]&lt;br /&gt;
|? &amp;gt; broadcast&lt;br /&gt;
|Sent whenever TRS switches to Driver, Surveyor or Railyard modes&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|World,Paused&lt;br /&gt;
|? &amp;gt; broadcast&lt;br /&gt;
|?&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|World,Unpaused&lt;br /&gt;
|? &amp;gt; broadcast&lt;br /&gt;
|?&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|World,Day&lt;br /&gt;
|? &amp;gt; broadcast&lt;br /&gt;
|Sent 1.) at ca. 05:45 ~ 0.739409 Gametime 2.) sometimes when TS starts Driver&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|World,Night&lt;br /&gt;
|? &amp;gt; broadcast&lt;br /&gt;
|Sent 1.) at ca. 18:15 ~ 0.260611 GameTime 2.) whenever TS starts Driver or Surveyor and Playtime is beween 18:15 and 05:45 3.) sometimes when TS switched to Driver or Surveyor&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Ciceronmt</name></author>
	</entry>
	<entry>
		<id>https://wiki.trainzsimulator.com/index.php?title=Class_Locomotive&amp;diff=21280</id>
		<title>Class Locomotive</title>
		<link rel="alternate" type="text/html" href="https://wiki.trainzsimulator.com/index.php?title=Class_Locomotive&amp;diff=21280"/>
		<updated>2019-09-11T18:56:51Z</updated>

		<summary type="html">&lt;p&gt;Ciceronmt: /* SetCompressorEfficiency */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;*[[TrainzScript Language Reference|API Hierarchy]]&lt;br /&gt;
**[[Class GSObject|GSObject]] *&lt;br /&gt;
***[[Class GameObject|GameObject]]&lt;br /&gt;
****[[Class TrainzGameObject|TrainzGameObject]]&lt;br /&gt;
****[[Class PropertyObject|PropertyObject]] *&lt;br /&gt;
*****[[Class MeshObject|MeshObject]]&lt;br /&gt;
******[[Class MapObject|MapObject]]&lt;br /&gt;
*******[[Class Trackside|Trackside]]&lt;br /&gt;
********[[Class Vehicle|Vehicle]]&lt;br /&gt;
*********Locomotive&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*A Locomotive is a specialised instance of a vehicle.&lt;br /&gt;
*In practice many of the methods in [[Class Vehicle]] apply to powered vehicles.&lt;br /&gt;
*A locomotive is always part of a train, if a locomotive is decoupled and left alone TRS will create a new consist to include it.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Methods==&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
===GetCabinData===&lt;br /&gt;
{{MethodHeader|public CabinData GetCabinData(void)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*None&lt;br /&gt;
;Returned Value&lt;br /&gt;
*A reference to a data object which stores the state of the locomotive&#039;s cabin.&lt;br /&gt;
;Syntax&lt;br /&gt;
 MyCabinData = loco.GetCabinData();&lt;br /&gt;
;Notes&lt;br /&gt;
*See [[Class CabinData]]&lt;br /&gt;
*The data object refers to an internal private CabinData object in this class that represents the state of the cabin&#039;s controls.&lt;br /&gt;
*This is usually maintained by the Cabin.Attach() and Cabin.Update() methods of the Cabin script.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetEngineSetting===&lt;br /&gt;
{{MethodHeader|public native float GetEngineSetting(string setting)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;setting&#039;&#039;&#039; = The name of the setting to retrieve.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*The value of the named setting.&lt;br /&gt;
;Syntax&lt;br /&gt;
 float throttle = GetEngineSetting(&amp;quot;throttle&amp;quot;);&lt;br /&gt;
;Notes&lt;br /&gt;
*See [[#SetEngineSetting|SetEngineSetting()]] for details of the values which can be used for the &#039;&#039;setting&#039;&#039; parameter.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetBrokenReverser===&lt;br /&gt;
{{MethodHeader|public native void SetBrokenReverser(bool broken)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;broken&#039;&#039;&#039; = If true the reverser will not function, a value of false will reactivate it.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetBrokenReverser(true); &lt;br /&gt;
;Notes&lt;br /&gt;
*When broken the reverser lever can still be used by the player but it will have no effect on the locomotive.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetBrokenThrottle===&lt;br /&gt;
{{MethodHeader|public native void SetBrokenThrottle(bool broken)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;broken&#039;&#039;&#039; = If true the throttle will not function, a value of false will reactivate it.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetBrokenThrottle(true);&lt;br /&gt;
;Notes&lt;br /&gt;
*When broken the throttle lever can still be used by the player but it will have no effect on the locomotive.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetCabinData===&lt;br /&gt;
{{MethodHeader|public void SetCabinData(CabinData data)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;data&#039;&#039;&#039; = A reference to the data object used to store details of the locomotive&#039;s cabin controls.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetCabinData(MyCabinData);&lt;br /&gt;
;Notes&lt;br /&gt;
*See [[Class CabinData]]&lt;br /&gt;
*The data object refers to an internal private CabinData object in this class that represents the state of the cabin&#039;s controls.&lt;br /&gt;
*This is usually maintained by the Cabin.Attach() and Cabin.Update() methods of the Cabin script.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetCompressorEfficiency===&lt;br /&gt;
{{MethodHeader|public native void SetCompressorEfficiency(float efficiency)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;efficiency&#039;&#039;&#039; = Efficiency of the compressor in the range 0.0 .. 1.0&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetCompressorEfficiency(0.5);&lt;br /&gt;
;Notes&lt;br /&gt;
*From personal experience: for a slow increase in pressure of the main reservoir, the optimal value is 0.01-0.1&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetEngineSetting===&lt;br /&gt;
{{MethodHeader|public native void SetEngineSetting(string setting, float value)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;setting&#039;&#039;&#039; = The name of the setting to save.&lt;br /&gt;
*&#039;&#039;&#039;value&#039;&#039;&#039; = The value of the named setting.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetEngineSetting(&amp;quot;regulator&amp;quot;,0.5);&lt;br /&gt;
;Notes&lt;br /&gt;
*Settings you can write to with this method are:&lt;br /&gt;
**&amp;quot;dynamic-brake&amp;quot;&lt;br /&gt;
**&amp;quot;headlight&amp;quot;&lt;br /&gt;
**&amp;quot;injector&amp;quot;&lt;br /&gt;
**&amp;quot;loco-auto-brake&amp;quot; (i.e independantbrake_lever)&lt;br /&gt;
**&amp;quot;pantograph&amp;quot;&lt;br /&gt;
**&amp;quot;regulator&amp;quot;&lt;br /&gt;
**&amp;quot;reverser&amp;quot;&lt;br /&gt;
**&amp;quot;steam-blower&amp;quot;&lt;br /&gt;
**&amp;quot;throttle&amp;quot;&lt;br /&gt;
**&amp;quot;train-auto-brake&amp;quot; (i.e. trainbrake_lever&#039;)&lt;br /&gt;
**&amp;quot;train-lap-brake&amp;quot;&lt;br /&gt;
**&amp;quot;script-brake-pressure&amp;quot; - A script-only brake pressure which does not correspond to any real brake device, specified in kPa. This may be used by interior scripts for implementing custom cab-mode braking behaviour, and is intended to be directly mapped from the cab controls rather than updated on a regular frame-by-frame basis from script. Native brake controls should be used where possible to avoid significant performance problems.&lt;br /&gt;
*Some apply to steam locomotives only.&lt;br /&gt;
*From personal experience: the settings for the electric locomotive are set in whole numbers (&amp;quot;dynamic-brake&amp;quot; 0-1-2; &amp;quot;reverser&amp;quot; 0-1-2 and so on).&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetHasDriver===&lt;br /&gt;
{{MethodHeader|public native void SetHasDriver(bool hasDriver)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;hasDriver&#039;&#039;&#039; = If true the locomotive has an assigned driver, if false it does not.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetHasDriver(true);&lt;br /&gt;
;Notes&lt;br /&gt;
*Only one locomotive in a train may have a driver. &lt;br /&gt;
*If you attempt to place a driver in this loco, any other driver on the train will be removed. &lt;br /&gt;
*The consist name and id will always stay with the driver.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Code Examples==&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Related Methods==&lt;br /&gt;
[[Class Train#GetFrontmostLocomotive|Train.GetFrontmostLocomotive()]]&amp;lt;br&amp;gt;&lt;br /&gt;
[[Class Train#GetVehicles|Train.GetVehicles()]]&amp;lt;br&amp;gt;&lt;br /&gt;
[[Class World#GetVehicleList|World.GetVehicleList()]]&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Categories==&lt;br /&gt;
[[Category:Script Class]]&lt;/div&gt;</summary>
		<author><name>Ciceronmt</name></author>
	</entry>
	<entry>
		<id>https://wiki.trainzsimulator.com/index.php?title=Class_Locomotive&amp;diff=21279</id>
		<title>Class Locomotive</title>
		<link rel="alternate" type="text/html" href="https://wiki.trainzsimulator.com/index.php?title=Class_Locomotive&amp;diff=21279"/>
		<updated>2019-09-11T18:45:21Z</updated>

		<summary type="html">&lt;p&gt;Ciceronmt: /* SetEngineSetting */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;*[[TrainzScript Language Reference|API Hierarchy]]&lt;br /&gt;
**[[Class GSObject|GSObject]] *&lt;br /&gt;
***[[Class GameObject|GameObject]]&lt;br /&gt;
****[[Class TrainzGameObject|TrainzGameObject]]&lt;br /&gt;
****[[Class PropertyObject|PropertyObject]] *&lt;br /&gt;
*****[[Class MeshObject|MeshObject]]&lt;br /&gt;
******[[Class MapObject|MapObject]]&lt;br /&gt;
*******[[Class Trackside|Trackside]]&lt;br /&gt;
********[[Class Vehicle|Vehicle]]&lt;br /&gt;
*********Locomotive&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*A Locomotive is a specialised instance of a vehicle.&lt;br /&gt;
*In practice many of the methods in [[Class Vehicle]] apply to powered vehicles.&lt;br /&gt;
*A locomotive is always part of a train, if a locomotive is decoupled and left alone TRS will create a new consist to include it.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Methods==&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
===GetCabinData===&lt;br /&gt;
{{MethodHeader|public CabinData GetCabinData(void)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*None&lt;br /&gt;
;Returned Value&lt;br /&gt;
*A reference to a data object which stores the state of the locomotive&#039;s cabin.&lt;br /&gt;
;Syntax&lt;br /&gt;
 MyCabinData = loco.GetCabinData();&lt;br /&gt;
;Notes&lt;br /&gt;
*See [[Class CabinData]]&lt;br /&gt;
*The data object refers to an internal private CabinData object in this class that represents the state of the cabin&#039;s controls.&lt;br /&gt;
*This is usually maintained by the Cabin.Attach() and Cabin.Update() methods of the Cabin script.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetEngineSetting===&lt;br /&gt;
{{MethodHeader|public native float GetEngineSetting(string setting)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;setting&#039;&#039;&#039; = The name of the setting to retrieve.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*The value of the named setting.&lt;br /&gt;
;Syntax&lt;br /&gt;
 float throttle = GetEngineSetting(&amp;quot;throttle&amp;quot;);&lt;br /&gt;
;Notes&lt;br /&gt;
*See [[#SetEngineSetting|SetEngineSetting()]] for details of the values which can be used for the &#039;&#039;setting&#039;&#039; parameter.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetBrokenReverser===&lt;br /&gt;
{{MethodHeader|public native void SetBrokenReverser(bool broken)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;broken&#039;&#039;&#039; = If true the reverser will not function, a value of false will reactivate it.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetBrokenReverser(true); &lt;br /&gt;
;Notes&lt;br /&gt;
*When broken the reverser lever can still be used by the player but it will have no effect on the locomotive.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetBrokenThrottle===&lt;br /&gt;
{{MethodHeader|public native void SetBrokenThrottle(bool broken)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;broken&#039;&#039;&#039; = If true the throttle will not function, a value of false will reactivate it.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetBrokenThrottle(true);&lt;br /&gt;
;Notes&lt;br /&gt;
*When broken the throttle lever can still be used by the player but it will have no effect on the locomotive.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetCabinData===&lt;br /&gt;
{{MethodHeader|public void SetCabinData(CabinData data)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;data&#039;&#039;&#039; = A reference to the data object used to store details of the locomotive&#039;s cabin controls.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetCabinData(MyCabinData);&lt;br /&gt;
;Notes&lt;br /&gt;
*See [[Class CabinData]]&lt;br /&gt;
*The data object refers to an internal private CabinData object in this class that represents the state of the cabin&#039;s controls.&lt;br /&gt;
*This is usually maintained by the Cabin.Attach() and Cabin.Update() methods of the Cabin script.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetCompressorEfficiency===&lt;br /&gt;
{{MethodHeader|public native void SetCompressorEfficiency(float efficiency)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;efficiency&#039;&#039;&#039; = Efficiency of the compressor in the range 0.0 .. 1.0&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetCompressorEfficiency(0.5);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetEngineSetting===&lt;br /&gt;
{{MethodHeader|public native void SetEngineSetting(string setting, float value)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;setting&#039;&#039;&#039; = The name of the setting to save.&lt;br /&gt;
*&#039;&#039;&#039;value&#039;&#039;&#039; = The value of the named setting.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetEngineSetting(&amp;quot;regulator&amp;quot;,0.5);&lt;br /&gt;
;Notes&lt;br /&gt;
*Settings you can write to with this method are:&lt;br /&gt;
**&amp;quot;dynamic-brake&amp;quot;&lt;br /&gt;
**&amp;quot;headlight&amp;quot;&lt;br /&gt;
**&amp;quot;injector&amp;quot;&lt;br /&gt;
**&amp;quot;loco-auto-brake&amp;quot; (i.e independantbrake_lever)&lt;br /&gt;
**&amp;quot;pantograph&amp;quot;&lt;br /&gt;
**&amp;quot;regulator&amp;quot;&lt;br /&gt;
**&amp;quot;reverser&amp;quot;&lt;br /&gt;
**&amp;quot;steam-blower&amp;quot;&lt;br /&gt;
**&amp;quot;throttle&amp;quot;&lt;br /&gt;
**&amp;quot;train-auto-brake&amp;quot; (i.e. trainbrake_lever&#039;)&lt;br /&gt;
**&amp;quot;train-lap-brake&amp;quot;&lt;br /&gt;
**&amp;quot;script-brake-pressure&amp;quot; - A script-only brake pressure which does not correspond to any real brake device, specified in kPa. This may be used by interior scripts for implementing custom cab-mode braking behaviour, and is intended to be directly mapped from the cab controls rather than updated on a regular frame-by-frame basis from script. Native brake controls should be used where possible to avoid significant performance problems.&lt;br /&gt;
*Some apply to steam locomotives only.&lt;br /&gt;
*From personal experience: the settings for the electric locomotive are set in whole numbers (&amp;quot;dynamic-brake&amp;quot; 0-1-2; &amp;quot;reverser&amp;quot; 0-1-2 and so on).&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetHasDriver===&lt;br /&gt;
{{MethodHeader|public native void SetHasDriver(bool hasDriver)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;hasDriver&#039;&#039;&#039; = If true the locomotive has an assigned driver, if false it does not.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetHasDriver(true);&lt;br /&gt;
;Notes&lt;br /&gt;
*Only one locomotive in a train may have a driver. &lt;br /&gt;
*If you attempt to place a driver in this loco, any other driver on the train will be removed. &lt;br /&gt;
*The consist name and id will always stay with the driver.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Code Examples==&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Related Methods==&lt;br /&gt;
[[Class Train#GetFrontmostLocomotive|Train.GetFrontmostLocomotive()]]&amp;lt;br&amp;gt;&lt;br /&gt;
[[Class Train#GetVehicles|Train.GetVehicles()]]&amp;lt;br&amp;gt;&lt;br /&gt;
[[Class World#GetVehicleList|World.GetVehicleList()]]&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Categories==&lt;br /&gt;
[[Category:Script Class]]&lt;/div&gt;</summary>
		<author><name>Ciceronmt</name></author>
	</entry>
	<entry>
		<id>https://wiki.trainzsimulator.com/index.php?title=Class_Vehicle&amp;diff=21278</id>
		<title>Class Vehicle</title>
		<link rel="alternate" type="text/html" href="https://wiki.trainzsimulator.com/index.php?title=Class_Vehicle&amp;diff=21278"/>
		<updated>2019-09-10T15:23:38Z</updated>

		<summary type="html">&lt;p&gt;Ciceronmt: /* GetEngineParam */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;*[[TrainzScript Language Reference|API Hierarchy]]&lt;br /&gt;
**[[Class GSObject|GSObject]] *&lt;br /&gt;
***[[Class GameObject|GameObject]]&lt;br /&gt;
****[[Class TrainzGameObject|TrainzGameObject]]&lt;br /&gt;
****[[Class PropertyObject|PropertyObject]] *&lt;br /&gt;
*****[[Class MeshObject|MeshObject]]&lt;br /&gt;
******[[Class MapObject|MapObject]]&lt;br /&gt;
*******[[Class Trackside|Trackside]]&lt;br /&gt;
********Vehicle&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*A vehicle is a single piece of rolling stock including locomotives and tenders.&lt;br /&gt;
*A vehicle is always part of a train, if a vehicle is decoupled and left alone Trainz will create a new consist to include it.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Related Messages==&lt;br /&gt;
*Messages sent to and from Vehicle objects are listed below:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
{{TableHeader|width=75%|margin=15px}}&lt;br /&gt;
|-&lt;br /&gt;
|bgcolor=&amp;quot;#EEEEEE&amp;quot;|&#039;&#039;&#039;Major&#039;&#039;&#039;||bgcolor=&amp;quot;#EEEEEE&amp;quot;|&#039;&#039;&#039;Minor&#039;&#039;&#039;||bgcolor=&amp;quot;#EEEEEE&amp;quot;|&#039;&#039;&#039;Source&#039;&#039;&#039;||bgcolor=&amp;quot;#EEEEEE&amp;quot; |&#039;&#039;&#039;Destination&#039;&#039;&#039;||bgcolor=&amp;quot;#EEEEEE&amp;quot; |&lt;br /&gt;
|-&lt;br /&gt;
|[[Vehicle Messages|Vehicle]]||Derailed||Vehicle||Broadcast||Vehicle has derailed and can no longer be used. &lt;br /&gt;
|-&lt;br /&gt;
|[[Vehicle Messages|Vehicle]]||Coupled||Vehicle||Broadcast||Vehicle has coupled up with another vehicle. &lt;br /&gt;
|-&lt;br /&gt;
|[[Vehicle Messages|Vehicle]]||Decoupled||Vehicle||Broadcast||Vehicle has decoupled from another vehicle. &lt;br /&gt;
|-&lt;br /&gt;
|[[Vehicle Messages|Vehicle]]||Bad Couple||Vehicle||Broadcast||Vehicle has coupled with another vehicle at too high a velocity. &lt;br /&gt;
|-&lt;br /&gt;
|[[Vehicle Messages|Vehicle]]||Collided||Vehicle||Broadcast||Vehicle has collided with another vehicle.&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Constants==&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
===Coupler Flags===&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
{{TableHeader|width=95%|margin=15px}}&lt;br /&gt;
|width=425|public define int  COUPLE_NONE = 0||Neither coupler.&lt;br /&gt;
|-&lt;br /&gt;
|public define int COUPLE_FRONT = 1||Front coupler.&lt;br /&gt;
|-&lt;br /&gt;
|public define int COUPLE_BACK = 2||Back coupler.&lt;br /&gt;
|-&lt;br /&gt;
|public define int COUPLE_BOTH = COUPLE_FRONT &amp;amp;#166; COUPLE_BACK||Both couplers.&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Direction Relationships===&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
{{TableHeader|width=95%|margin=15px}}&lt;br /&gt;
|width=425|public define int  DIRECTION_NONE = 0||No known relationship.&lt;br /&gt;
|-&lt;br /&gt;
|public define int DIRECTION_FORWARD = 1||Forward, facing in the same direction.&lt;br /&gt;
|-&lt;br /&gt;
|public define int DIRECTION_BACKWARD = -1||Backward, facing in opposite directions.&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Engine Types===&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
{{TableHeader|width=95%|margin=15px}}&lt;br /&gt;
|width=425|public define int ENGINE_NONE = 0||Not a powered vehicle.&lt;br /&gt;
|-&lt;br /&gt;
|public define int ENGINE_STANDARD = 1||Diesel, Diesel-Electric, Electric.&lt;br /&gt;
|-&lt;br /&gt;
|public define int ENGINE_STEAM = 2||Steam powered.&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Vehicle Type Flags===&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
{{TableHeader|width=95%|margin=15px}}&lt;br /&gt;
|width=425|public define int TYPE_LOCOMOTIVE = 1||Vehicle is a powered locomotive.&lt;br /&gt;
|-&lt;br /&gt;
|public define int TYPE_TENDER = 2||Vehicle carries fuel for a locomotive.&lt;br /&gt;
|-&lt;br /&gt;
|public define int TYPE_HAS_INTERIOR = 4||Vehicle has an interior. This does not necessarily mean that it is a lcomotive.&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;pre style=&amp;quot;color: red&amp;quot;&amp;gt;&lt;br /&gt;
Having tested these values with the associated function &#039;GetVehicleTypeFlags&#039;, it seems that the &#039;Vehicle Type Flag&#039; for a loco is &#039;5&#039; and not &#039;1&#039;&lt;br /&gt;
vincentrh&lt;br /&gt;
&lt;br /&gt;
Perhaps they are bit flags?  Therefore a value of 1 (loco) and 4 (has interior) would result in 5 being returned for a loco with an interior.  i.e. 1 and 4 &amp;quot;OR&amp;quot;ed together.&lt;br /&gt;
PCAS1986&lt;br /&gt;
&amp;lt;/pre&amp;gt;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Members==&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
{{TableHeader|width=95%|margin=15px}}&lt;br /&gt;
|width=425|&amp;lt;b&amp;gt;public IndustryProductInfoCollection  vehicleProductInfoCollection&amp;lt;/b&amp;gt;||A data object that allows tracking of products and associated assets &amp;amp; queues.&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Methods==&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===BeginLoad===&lt;br /&gt;
{{MethodHeader|float BeginLoad(LoadingReport report)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;report&#039;&#039;&#039; = Report on the current state of the loading operation.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*The time required, in seconds, for the activity to complete.&lt;br /&gt;
;Syntax&lt;br /&gt;
 float BeginLoad(LoadingReport report) {&lt;br /&gt;
    DoStuff(report);&lt;br /&gt;
    return 10.0;&lt;br /&gt;
 }&lt;br /&gt;
;Notes&lt;br /&gt;
*This is a callback method which should be overridden by the script writer to perform customised activities before loading at an industry.&lt;br /&gt;
*These include such operations as particle effects and animations.&lt;br /&gt;
*The report parameter provides details of the industries and vehicles involved and of their spatial relationship. &lt;br /&gt;
*It is the responsibility of the script writer to determine the time required for these activities and to return this in the method result.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===BeginUnload===&lt;br /&gt;
{{MethodHeader|float BeginUnload(LoadingReport report)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;report&#039;&#039;&#039; = Report on the current state of the loading operation.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*The time required, in seconds, for the activity to complete.&lt;br /&gt;
;Syntax&lt;br /&gt;
 float BeginLoad(LoadingReport report) {&lt;br /&gt;
    DoStuff(report);&lt;br /&gt;
    return 10.0;&lt;br /&gt;
 }&lt;br /&gt;
;Notes&lt;br /&gt;
*This is a callback method which should be overridden by the script writer to perform customised activities before loading at an industry.&lt;br /&gt;
*These include such operations as particle effects and animations.&lt;br /&gt;
*The report parameter provides details of the industries and vehicles involved and of their spatial relationship. &lt;br /&gt;
*It is the responsibility of the script writer to determine the time required for these activities and to return this in the method result.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===CanLoadProductFromQueue===&lt;br /&gt;
{{MethodHeader|public bool CanLoadProductFromQueue(ProductQueue queue)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;queue&#039;&#039;&#039; = The queue to be queried.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*True if the vehicle and queue are compatible and the queue can be used to load the vehicle, false otherwise.&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 if (CanLoadProductFromQueue(industryOutQueue)) {&lt;br /&gt;
    DoTheProcess();&lt;br /&gt;
 }&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===CanUnloadProductToQueue===&lt;br /&gt;
{{MethodHeader|public bool CanUnloadProductToQueue(ProductQueue queue)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;queue&#039;&#039;&#039; = The queue to be queried.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*True if the vehicle and queue are compatible and the queue can be used to unload the vehicle, false otherwise.&lt;br /&gt;
;Syntax&lt;br /&gt;
 if (CanUnloadProductToQueue(industryOutQueue)) {&lt;br /&gt;
    DoTheProcess();&lt;br /&gt;
 }&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Couple===&lt;br /&gt;
{{MethodHeader|public native bool Couple(Vehicle other)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;other&#039;&#039;&#039; = Adjacent vehicle to couple to.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*True if the operation was successfully completed, fale otherwise.&lt;br /&gt;
;Syntax&lt;br /&gt;
 if (Couple(vehicle2)) Interface.Print(&amp;quot;Success!&amp;quot;);&lt;br /&gt;
;Notes&lt;br /&gt;
*Couples this vehicle to the given vehicle which must already be adjacent. &lt;br /&gt;
*When a vehicle is decoupled from another, the couplers are left in an unlocked state, even though the vehicles are flush against each other.&lt;br /&gt;
*This state will remain until the vehicles move a small distance apart. &lt;br /&gt;
*Sometimes you may wish to cause them to couple again and that is the intended use of this method. &lt;br /&gt;
*If the two vehicles involved are not adjacent then this method will have no effect.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===EndLoad===&lt;br /&gt;
{{MethodHeader|float EndLoad(LoadingReport report)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;report&#039;&#039;&#039; = Report on the current state of the loading operation.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*The time required, in seconds, for the activity to complete.&lt;br /&gt;
;Syntax&lt;br /&gt;
 float EndLoad(LoadingReport report) {&lt;br /&gt;
    DoStuff(report);&lt;br /&gt;
    return 10.0;&lt;br /&gt;
 }&lt;br /&gt;
;Notes&lt;br /&gt;
*This is a callback method which should be overridden by the script writer to perform customised activities after loading at an industry.&lt;br /&gt;
*These include such operations as particle effects and animations.&lt;br /&gt;
*The report parameter provides details of the industries and vehicles involved and of their spatial relationship. &lt;br /&gt;
*It is the responsibility of the script writer to determine the time required for these activities and to return this in the method result.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===EndUnload===&lt;br /&gt;
{{MethodHeader|float EndUnload(LoadingReport report)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;report&#039;&#039;&#039; = Report on the current state of the loading operation.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*The time required, in seconds, for the activity to complete.&lt;br /&gt;
;Syntax&lt;br /&gt;
 float EndUnload(LoadingReport report) {&lt;br /&gt;
    DoStuff(report);&lt;br /&gt;
    return 10.0;&lt;br /&gt;
 }&lt;br /&gt;
;Notes&lt;br /&gt;
*This is a callback method which should be overridden by the script writer to perform customised activities after unloading at an industry.&lt;br /&gt;
*These include such operations as particle effects and animations.&lt;br /&gt;
*The report parameter provides details of the industries and vehicles involved and of their spatial relationship. &lt;br /&gt;
*It is the responsibility of the script writer to determine the time required for these activities and to return this in the method result.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetAuxReservoirPressure===&lt;br /&gt;
{{MethodHeader|public native float GetAuxReservoirPressure(void)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*None&lt;br /&gt;
;Returned Value&lt;br /&gt;
*The current auxiliary reservoir pressure of this vehicle.&lt;br /&gt;
;Syntax&lt;br /&gt;
 float ARP = GetAuxReservoirPressure();&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetBogeyList===&lt;br /&gt;
{{MethodHeader|public native Bogey[ ] GetBogeyList(void)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*None&lt;br /&gt;
;Returned Value&lt;br /&gt;
*An array containing references to all the Bogey objects attached to this vehicle.&lt;br /&gt;
;Syntax&lt;br /&gt;
 Bogey[] bogies = GetBogeyList();&lt;br /&gt;
;Notes&lt;br /&gt;
*Bogies are indexed in the same numerical order as they are listed in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
*Invisible bogies etc. are included.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetBrakeCylinderPressure===&lt;br /&gt;
{{MethodHeader|public native float GetBrakeCylinderPressure(void)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*None&lt;br /&gt;
;Returned Value&lt;br /&gt;
*The current brake cylinder pressure of this vehicle. &lt;br /&gt;
;Syntax&lt;br /&gt;
 float BCP = GetBrakeCylinderPressure();&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetBrakePipePressure===&lt;br /&gt;
{{MethodHeader|public native float GetBrakePipePressure(void)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*None&lt;br /&gt;
;Returned Value&lt;br /&gt;
*The current brake pipe pressure of this vehicle.&lt;br /&gt;
;Syntax&lt;br /&gt;
 float BPP = GetBrakePipePressure();&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetCabinSwayAmount===&lt;br /&gt;
{{MethodHeader|public native float GetCabinSwayAmount(void)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*None&lt;br /&gt;
;Returned Value&lt;br /&gt;
*The cabin sway amount for this vehicle.&lt;br /&gt;
;Syntax&lt;br /&gt;
 float CSA = GetCabinSwayAmount();&lt;br /&gt;
;Notes&lt;br /&gt;
*Higher positive values indicate higher levels of cabin sway while a 0.0 indicates no cabin sway.&lt;br /&gt;
*See also [[#SetCabinSwayAmount|SetCabinSwayAmount()]].&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetCouplerBreakageEnabled===&lt;br /&gt;
{{MethodHeader|public native bool GetCouplerBreakageEnabled(void)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*None&lt;br /&gt;
;Returned Value&lt;br /&gt;
*True if coupler breakages are enabled on this vehicle, false otherwise.&lt;br /&gt;
;Syntax&lt;br /&gt;
 if (GetCouplerBreakageEnabled()) Interface.Print(&amp;quot;Drive carefully to avoid breaking the couplers&amp;quot;);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetCouplingDirection===&lt;br /&gt;
{{MethodHeader|public native int GetCouplingDirection(Vehicle other)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;other&#039;&#039;&#039; = Adjacent vehicle to couple to.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*One of the [[#Direction Relationships|Direction Relationship]] constants indicating the direction of a neighbouring vehicle, relative to the direction of the caller.&lt;br /&gt;
;Syntax&lt;br /&gt;
 bool direction = GetCouplingDirection(vehicle2);&lt;br /&gt;
;Notes&lt;br /&gt;
*If the result is DIRECTION_FORWARD then both vehicles have the same orientation.&lt;br /&gt;
*If the result is DIRECTION_BACKWARD then the two vehicles face in opposite directions.&lt;br /&gt;
*The fact that this method returns a value does not mean that it is possible for the two vehicles to couple.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetCouplingStress===&lt;br /&gt;
{{MethodHeader|public native float GetCouplingStress(Vehicle other)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;other&#039;&#039;&#039; = Other vehicle in the same consist to query.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*The calculated coupling stress between the two vehicles in newtons (N);&lt;br /&gt;
;Syntax&lt;br /&gt;
 float kn = GetCouplingStress(vehicle2);&lt;br /&gt;
;Notes&lt;br /&gt;
*&amp;lt;float color=red&amp;gt;Must the two vehicles be adjacent?&amp;lt;/font&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetDefaultCabinSwayAmount===&lt;br /&gt;
{{MethodHeader|public native float GetDefaultCabinSwayAmount(void)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*None&lt;br /&gt;
;Returned Value&lt;br /&gt;
*The default cabin sway amount for this vehicle as defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
;Syntax&lt;br /&gt;
 float CSA = GetCabinSwayAmount();&lt;br /&gt;
;Notes&lt;br /&gt;
*Higher positive values indicate higher levels of cabin sway while a 0.0 indicates no cabin sway.&lt;br /&gt;
*See also [[#SetCabinSwayAmount|SetCabinSwayAmount()]].&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetDefaultMaximumCouplerCompressionStress===&lt;br /&gt;
{{MethodHeader|publc native float GetDefaultMaximumCouplerCompressionStress(void)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*None&lt;br /&gt;
;Returned Value&lt;br /&gt;
*The default maximum coupler compression stress value for this vehicle in newtons (N), as defined in &#039;&#039;config.txt&#039;&#039;. &lt;br /&gt;
;Syntax&lt;br /&gt;
 float DMCS = GetDefaultMaximumCouplerCompressionStress();&lt;br /&gt;
;Notes&lt;br /&gt;
*See [[#SetMaximumCouplerCompressionStress|SetMaximumCouplerCompressionStress()]].&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetDefaultMaximumCouplerExpansionStress===&lt;br /&gt;
{{MethodHeader|public native float GetDefaultMaximumCouplerExpansionStress(void)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*None&lt;br /&gt;
;Returned Value&lt;br /&gt;
*The default maximum coupler expansion stress value for this vehicle in newtons (N), as defined in &#039;&#039;config.txt&#039;&#039;. &lt;br /&gt;
;Syntax&lt;br /&gt;
 float DMCE = GetDefaultMaximumCouplerExpansionStress();&lt;br /&gt;
;Notes&lt;br /&gt;
*See [[#SetMaximumCouplerExpansionStress|SetMaximumCouplerExpansionStress()]].&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetDefaultMaximumCoupleVelocity===&lt;br /&gt;
{{MethodHeader|public native float GetDefaultMaximumCoupleVelocity(void)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*None&lt;br /&gt;
;Returned Value&lt;br /&gt;
*The default maximum speed at which this vehicle can be coupled to without breaking the coupler, as defined in &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
;Syntax&lt;br /&gt;
 float DMCV = GetDefaultMaximumCoupleVelocity();&lt;br /&gt;
;Notes&lt;br /&gt;
*See [[#SetMaximumCoupleVelocity|SetMaximumCoupleVelocity()]].&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetDefaultMaximumTractiveEffort===&lt;br /&gt;
{{MethodHeader|GetDefaultMaximumTractiveEffort()}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*None&lt;br /&gt;
;Returned Value&lt;br /&gt;
*The default maximum tractive effort of this vehicle from its configuration in newtons (N), as defined in &#039;&#039;config.txt&#039;&#039;. &lt;br /&gt;
;Syntax&lt;br /&gt;
 float DMTE = GetDefaultMaximumTractiveEffort();&lt;br /&gt;
;Notes&lt;br /&gt;
*See [[#SetMaximumTractiveEffort|SetMaximumTractiveEffort()]].&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetDirectionRelativeToTrain===&lt;br /&gt;
{{MethodHeader|public native bool GetDirectionRelativeToTrain(void)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*None&lt;br /&gt;
;Returned Value&lt;br /&gt;
*True if this vehicle faces in the same direction as the train&#039;s current heading, false otherwise.&lt;br /&gt;
;Syntax&lt;br /&gt;
 bool vehicleToTrain = GetDirectionRelativeToTrain();&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetEngineParam===&lt;br /&gt;
{{MethodHeader|public native float GetEngineParam(string param)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;param&#039;&#039;&#039; = One of the engine parameter strings listed below.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*The current value of the given engine parameter.&lt;br /&gt;
;Syntax&lt;br /&gt;
 float pressure = GetEngineParam(&amp;quot;steam-boiler-pressure&amp;quot;);&lt;br /&gt;
;Notes&lt;br /&gt;
*Engine parameter strings you can use with this method are:&lt;br /&gt;
**&amp;quot;applied-force&amp;quot;&lt;br /&gt;
**&amp;quot;brake-cylinder-pressure&amp;quot;&lt;br /&gt;
**&amp;quot;brake-pipe-pressure&amp;quot;&lt;br /&gt;
**&amp;quot;current-drawn&amp;quot;&lt;br /&gt;
**&amp;quot;equaliser-pressure&amp;quot;&lt;br /&gt;
**&amp;quot;flow&amp;quot;&lt;br /&gt;
**&amp;quot;horn&amp;quot;&lt;br /&gt;
**&amp;quot;main-reservoir-pressure&amp;quot;&lt;br /&gt;
**&amp;quot;max-te&amp;quot;&lt;br /&gt;
**&amp;quot;no3-pipe-pressure&amp;quot;&lt;br /&gt;
**&amp;quot;wheelslip&amp;quot;&lt;br /&gt;
*values refer only to steam engines:&lt;br /&gt;
**&amp;quot;coal-mass&amp;quot;&lt;br /&gt;
**&amp;quot;engine-force&amp;quot;&lt;br /&gt;
**&amp;quot;fire-temperature&amp;quot;&lt;br /&gt;
**&amp;quot;max-coal-mass&amp;quot;&lt;br /&gt;
**&amp;quot;max-fire-temperature&amp;quot;&lt;br /&gt;
**&amp;quot;steam-boiler-liquid-percent&amp;quot;&lt;br /&gt;
**&amp;quot;steam-boiler-pressure&amp;quot;&lt;br /&gt;
**&amp;quot;steam-piston-cycle&amp;quot;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetEngineType===&lt;br /&gt;
{{MethodHeader|public native int GetEngineType(void)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*None&lt;br /&gt;
;Returned Value&lt;br /&gt;
*One of the [[#Engine Types|Engine Type]] constants describing the engine type of this vehicle.&lt;br /&gt;
;Syntax&lt;br /&gt;
 int eType = GetEngineType();&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetLength===&lt;br /&gt;
{{MethodHeader|public native float GetLength(void)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*None&lt;br /&gt;
;Returned Value&lt;br /&gt;
*The length of this vehicle in metres.&lt;br /&gt;
;Syntax&lt;br /&gt;
 float length = GetLength();&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetLoadTime===&lt;br /&gt;
{{MethodHeader|float GetLoadTime(LoadingReport report)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;report&#039;&#039;&#039; = Report on the current state of the loading operation.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*The time required, in seconds, for the activity to complete.&lt;br /&gt;
;Syntax&lt;br /&gt;
 float GetLoadTime(LoadingReport report) {&lt;br /&gt;
    DoStuff(report);&lt;br /&gt;
    return 10.0;&lt;br /&gt;
 }&lt;br /&gt;
;Notes&lt;br /&gt;
*This is a callback method which informs the game engine of the time needed to load this vehicle.&lt;br /&gt;
*The method may be use to perform customised activities during the loading operation.&lt;br /&gt;
*These include such operations as particle effects and animations.&lt;br /&gt;
*The report parameter provides details of the industries and vehicles involved and of their spatial relationship. &lt;br /&gt;
*It is the responsibility of the script writer to determine the time required for these activities and to return this in the method result.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetMass===&lt;br /&gt;
{{MethodHeader|public native float GetMass(void)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*None&lt;br /&gt;
;Returned Value&lt;br /&gt;
*The mass of the vehicle in kilograms.&lt;br /&gt;
;Syntax&lt;br /&gt;
 float mass = GetMass();&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetMaximumCouplerCompressionStress===&lt;br /&gt;
{{MethodHeader|publc native float GetMaximumCouplerCompressionStress(void)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*None&lt;br /&gt;
;Returned Value&lt;br /&gt;
*The maximum coupler compression stress value for this vehicle in newtons (N).&lt;br /&gt;
;Syntax&lt;br /&gt;
 float MCS = GetMaximumCouplerCompressionStress();&lt;br /&gt;
;Notes&lt;br /&gt;
*See [[#SetMaximumCouplerCompressionStress|SetMaximumCouplerCompressionStress()]].&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetMaximumCouplerExpansionStress===&lt;br /&gt;
{{MethodHeader|public native float GetMaximumCouplerExpansionStress(void)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*None&lt;br /&gt;
;Returned Value&lt;br /&gt;
*The maximum coupler expansion stress value for this vehicle in newtons (N).&lt;br /&gt;
;Syntax&lt;br /&gt;
 float DMCE = GetMaximumCouplerExpansionStress();&lt;br /&gt;
;Notes&lt;br /&gt;
*See [[#SetMaximumCouplerExpansionStress|SetMaximumCouplerExpansionStress()]].&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetMaximumCoupleVelocity===&lt;br /&gt;
{{MethodHeader|public native float GetMaximumCoupleVelocity(void)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*None&lt;br /&gt;
;Returned Value&lt;br /&gt;
*The  maximum speed at which this vehicle can be coupled to without breaking the coupler.&lt;br /&gt;
;Syntax&lt;br /&gt;
 float MCV = GetMaximumCoupleVelocity();&lt;br /&gt;
;Notes&lt;br /&gt;
*See [[#SetMaximumCoupleVelocity|SetMaximumCoupleVelocity()]].&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetMaximumTractiveEffort===&lt;br /&gt;
{{MethodHeader|GetMaximumTractiveEffort()}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*None&lt;br /&gt;
;Returned Value&lt;br /&gt;
*The maximum tractive effort of this vehicle from its configuration in newtons (N). &lt;br /&gt;
;Syntax&lt;br /&gt;
 float MTE = GetMaximumTractiveEffort();&lt;br /&gt;
;Notes&lt;br /&gt;
*See [[#SetMaximumTractiveEffort|SetMaximumTractiveEffort()]].&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetMyTrain===&lt;br /&gt;
{{MethodHeader|public native Train GetMyTrain(void)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*None&lt;br /&gt;
;Returned Value&lt;br /&gt;
*A reference to the train of which this vehicle is part.&lt;br /&gt;
;Syntax&lt;br /&gt;
 Train train = GetMyTrain();&lt;br /&gt;
;Notes&lt;br /&gt;
*All vehicles belong to a Train consist, even if a vehicle is not coupled to any other vehicle.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetOdometerDistance===&lt;br /&gt;
{{MethodHeader|public native Train GetOdometerDistance(void)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*None&lt;br /&gt;
;Returned Value&lt;br /&gt;
*The number of meters that this Vehicle has moved.&lt;br /&gt;
;Syntax&lt;br /&gt;
 float distance = GetOdometerDistance();&lt;br /&gt;
;Notes&lt;br /&gt;
*Returns the total distance that this Vehicle has moved. No assumptions should be made regarding the starting value of the odometer as this may change between vehicles, sessions, or Trainz versions. This value is continuous under normal operation, however calls to SetOdometerDistance() may arbitrarily adjust the current value.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetProductRestriction===&lt;br /&gt;
{{MethodHeader|public ProductFilter GetProductRestriction(void)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*None&lt;br /&gt;
;Returned Value&lt;br /&gt;
*The current product restriction filter if any, null otherwise.&lt;br /&gt;
;Syntax&lt;br /&gt;
 ProductFilter filter = GetProductRestriction();&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetRelationToTrack===&lt;br /&gt;
{{MethodHeader|public native int GetRelationToTrack(Buildable obj, string trackName)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;obj&#039;&#039;&#039; = Reference to a Buildable object.&lt;br /&gt;
*&#039;&#039;&#039;trackName&#039;&#039;&#039; = String representing the name of a track as defined in the Buildable&#039;s &#039;&#039;config.txt&#039;&#039;.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*One of the [[#Direction Relationships|Direction Relationship]] constants indicating the direction of the vehicle, relative to the Buildable&#039;s attached track.&lt;br /&gt;
;Syntax&lt;br /&gt;
*This method will return either DIRECTION_FORWARD or DIRECTION_BACKWARD if the vehicle is on the track as specified by the arguments or on a directly neighboring track, otherwise DIRECTION_NONE will be returned.&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetRunningNumber===&lt;br /&gt;
{{MethodHeader|public native string GetRunningNumber(void)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*None&lt;br /&gt;
;Returned Value&lt;br /&gt;
*The running (fleet identification) number of the vehicle.&lt;br /&gt;
;Syntax&lt;br /&gt;
 string fleetId = GetRunningNumber();&lt;br /&gt;
;Notes&lt;br /&gt;
*This value is set using [[#SetRunningNumber|SetRunningNumber()]] and should be restricted to alphanumeric characters and paces.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetSandingTractionMultiplier===&lt;br /&gt;
{{MethodHeader|public native float GetSandingTractionMultiplier(void)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*None&lt;br /&gt;
;Returned Value&lt;br /&gt;
*A wheelslip traction multiplier to apply when sand is in use.&lt;br /&gt;
;Syntax&lt;br /&gt;
 float slipFactor = GetSandingTractionMultiplier();&lt;br /&gt;
;Notes&lt;br /&gt;
*The returned value will be greater than or equal to 1.0.&lt;br /&gt;
*See [[#SetSandingTractionMultiplier|SetSandingTractionMultiplier()]];&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetTrackGradient===&lt;br /&gt;
{{MethodHeader|public native float GetTrackGradient(void)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*None&lt;br /&gt;
;Returned Value&lt;br /&gt;
*The current track gradient as a percentage.&lt;br /&gt;
;Syntax&lt;br /&gt;
 float gradient = GetTrackGradient();&lt;br /&gt;
;Notes&lt;br /&gt;
*The sign of the gradient is determined by the direction of this vehicle relative to the gradient.&lt;br /&gt;
*A negative sign indicates that the vehicle is facing down a gradient while a positive sign indicates the vehicle is facing up a gradient. &lt;br /&gt;
*The vehicle&#039;s direction may not match that of the train so the value returned here may not be what you expect.&lt;br /&gt;
*Use [[#GetDirectionRelativeToTrain|GetDirectionRelativeToTrain()]] to check this.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetUnloadTime===&lt;br /&gt;
{{MethodHeader|float GetUnloadTime(LoadingReport report)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;report&#039;&#039;&#039; = Report on the current state of the loading operation.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*The time required, in seconds, for the activity to complete.&lt;br /&gt;
;Syntax&lt;br /&gt;
 float GetUnloadTime(LoadingReport report) {&lt;br /&gt;
    DoStuff(report);&lt;br /&gt;
    return 10.0;&lt;br /&gt;
 }&lt;br /&gt;
;Notes&lt;br /&gt;
*This is a callback method which informs the game engine of the time needed to unload this vehicle.&lt;br /&gt;
*The method may be use to perform customised activities during the unloading operation.&lt;br /&gt;
*These include such operations as particle effects and animations.&lt;br /&gt;
*The report parameter provides details of the industries and vehicles involved and of their spatial relationship. &lt;br /&gt;
*It is the responsibility of the script writer to determine the time required for these activities and to return this in the method result.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetVehicleTypeFlags===&lt;br /&gt;
{{MethodHeader|public native int GetVehicleTypeFlags(void)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*None&lt;br /&gt;
;Returned Value&lt;br /&gt;
*One of the [[#Vehicle Type Flags|Vehicle Type Flags]] representing what kind of vehicle the current object is. &lt;br /&gt;
;Syntax&lt;br /&gt;
 int flags = GetVehicleTypeFlags();&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetVelocity===&lt;br /&gt;
{{MethodHeader|public native float GetVelocity(void)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*None&lt;br /&gt;
;Returned Value&lt;br /&gt;
*The current instantaneous velocity of the train in metres per second.&lt;br /&gt;
;Syntax&lt;br /&gt;
 float speed = GetVelocity();&lt;br /&gt;
;Notes&lt;br /&gt;
*Use the [[Class Train#Measurement Conversion Multipliers|Measurement Conversion Multiplier]] constants for conversion to other units.&lt;br /&gt;
*For human consumption [[Class Train#GetSmoothedVelocity|Train.GetSmoothedVelocity()]] may be preferable.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetWheelslipTractionMultiplier===&lt;br /&gt;
{{MethodHeader|public native float GetWheelslipTractionMultiplier(void)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*None&lt;br /&gt;
;Returned Value&lt;br /&gt;
*The current wheelslip traction multiplier value.&lt;br /&gt;
;Syntax&lt;br /&gt;
 float slip = GetWheelslipTractionMultiplier();&lt;br /&gt;
;Notes&lt;br /&gt;
*The returned value will be greater than or equal to 1.0.&lt;br /&gt;
*See [[#SetWheelslipTractionMultiplier|SetWheelslipTractionMultiplier()]];&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===IsInTunnel===&lt;br /&gt;
{{MethodHeader|public native bool IsInTunnel(void)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*None&lt;br /&gt;
;Returned Value&lt;br /&gt;
*True if this vehicle is in a tunnel, false otherwise.&lt;br /&gt;
;Syntax&lt;br /&gt;
 bool underground = IsInTunnel();&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===IsOnBridge===&lt;br /&gt;
{{MethodHeader|public native void IsOnBridge(void)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*None&lt;br /&gt;
;Returned Value&lt;br /&gt;
*True if this vehicle is on a bridge, false otherwise.&lt;br /&gt;
;Syntax&lt;br /&gt;
 bool onBridge = IsOnBridge();&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===LoadProduct===&lt;br /&gt;
{{MethodHeader|public bool LoadProduct(LoadingReport report)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;report&#039;&#039;&#039; = Report on the current state of the loading operation.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*True if the loading operation was successful, false otherwise.&lt;br /&gt;
;Syntax&lt;br /&gt;
 LoadProduct(report);&lt;br /&gt;
;Notes&lt;br /&gt;
*Loads products into this vehicle as defined by the given report. &lt;br /&gt;
*This method works by attempting to transfer products to this vehicle&#039;s queues if possible from the industry queue specified in report. &lt;br /&gt;
*The sequence of events for a loading operation as performed by this method is:&lt;br /&gt;
**Verify that an loading operation is possible with this vehicle by calling [[#CanLoadProductFromQueue|CanLoadProductFromQueue()]].&lt;br /&gt;
**[[#BeginLoad|BeginLoad()]] on this vehicle and [[Class Industry#BeginLoad|Industry.BeginLoad()]] on the industry specified in the report are called to perform any pre-loading events like animation or particle effects on the vehicle and industry respectively. &lt;br /&gt;
**Both of these methods return the amount of time required for a load operation and the LoadProduct() method sleeps for which ever of these times is the longer.&lt;br /&gt;
**The actual product transfer from the industry to the vehicle is performed by calling ProductQueue.TransferProductFrom() on this vehicle&#039;s queue(s).&lt;br /&gt;
**[[#GetLoadTime|GetLoadTime()]] on this vehicle and [[Class Industry#GetLoadTime|Industry.GetLoadTime()]] are called. Again, LoadProduct() sleeps for which ever is the longer of the times returned.&lt;br /&gt;
**[[#EndLoad|EndLoad()]] and [[Class Industry#EndLoad|Industry.EndLoad()]] are called to perform any post-loading events. As before LoadProduct() sleeps for the longer time.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Reposition===&lt;br /&gt;
{{MethodHeader|public native bool Reposition(Train train, int myCoupleDir, int otherCoupleDir)&amp;lt;br&amp;gt;public native bool Reposition(Vehicle vehicle, int myCoupleDir, int otherCoupleDir)&amp;lt;br&amp;gt;public native bool Reposition(TrackMark mark, bool direction)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;train&#039;&#039;&#039; = Train to attach the vehicle to.&lt;br /&gt;
*&#039;&#039;&#039;vehicle&#039;&#039;&#039; = Vehicle to attach the vehicle to.&lt;br /&gt;
*&#039;&#039;&#039;myCoupleDir&#039;&#039;&#039; = The end of the current vehicle that will be coupled, use either COUPLE_FRONT or COUPLE_BACK.&lt;br /&gt;
*&#039;&#039;&#039;otherCoupleDir&#039;&#039;&#039; = The end of the target vehicle that will be coupled to, use either COUPLE_FRONT or COUPLE_BACK. &lt;br /&gt;
*&#039;&#039;&#039;mark&#039;&#039;&#039; = Trackmark to move this vehicle to.&lt;br /&gt;
*&#039;&#039;&#039;direction&#039;&#039;&#039; = Direction for the vehicle, relative to the TrackMark.&lt;br /&gt;
*None&lt;br /&gt;
;Returned Value&lt;br /&gt;
*True if the operation was successfully completed, false otherwise.&lt;br /&gt;
;Syntax&lt;br /&gt;
 Reposition(Train3,COUPLE_FRONT,COUPLE_BACK);&lt;br /&gt;
 Reposition(Vehicle5,COUPLE_FRONT,COUPLE_BACK);&lt;br /&gt;
 Reposition(Mark9,true);&lt;br /&gt;
;Notes&lt;br /&gt;
*Variant 1 moves the current vehicle and couples it to the specified train using the specified vehicle ends.&lt;br /&gt;
*Variant 2 moves the current vehicle and couples it to the specified vehicle using the specified vehicle ends.&lt;br /&gt;
*Variant 3 moves the current vehicle from its train to the specified trackmark, normally creating a new consist.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Reverse===&lt;br /&gt;
{{MethodHeader|public native bool Reverse(void)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*None&lt;br /&gt;
;Returned Value&lt;br /&gt;
*True if the operation was successfully completed, false otherwise.&lt;br /&gt;
;Syntax&lt;br /&gt;
 if (Reverse()) Interface.Print(&amp;quot;Direction of &amp;quot; + GetName() + &amp;quot; reversed&amp;quot;);&lt;br /&gt;
;Notes&lt;br /&gt;
*This method reverses the direction of the current vehicle in relation to its consist. &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetBrakePipeEfficiency===&lt;br /&gt;
{{MethodHeader|public native void SetBrakePipeEfficiency(float efficiency)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;efficiency&#039;&#039;&#039; = A Normalised value in the range 0.0 .. 1.0 representing the efficiency of the brake pipe.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetBrakePipeEfficiency(0.5);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetBrokenBrakes===&lt;br /&gt;
{{MethodHeader|public native void SetBrokenBrakes(bool broken)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;broken&#039;&#039;&#039; = True to render the brakes non operational, false to repair them.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetBrokenBrakes(true);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetCabinSwayAmount===&lt;br /&gt;
{{MethodHeader|public native void SetCabinSwayAmount(float amount)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;amount&#039;&#039;&#039; = Cabin sway value greater than or equal to zero.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetCabinSwayAmount(2.5);&lt;br /&gt;
;Notes&lt;br /&gt;
*A value of zero removes all sway.&lt;br /&gt;
*Higher positive values increase the effect.&lt;br /&gt;
*The method is only of relevance to vehicles with interior views.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetCouplerBreakageEnabled===&lt;br /&gt;
{{MethodHeader|public native void SetCouplerBreakageEnabled(bool enabled)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;enabled&#039;&#039;&#039; = True enables simulation of coupler breakage.&lt;br /&gt;
*None&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetCouplerBreakageEnabled(true);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetCouplingMask===&lt;br /&gt;
{{MethodHeader|public native void SetCouplingMask(int mask)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;mask&#039;&#039;&#039; = A mask specifying which of the vehilce&#039;s couplers are allowed to couple. &lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetCouplingMask(COUPLE_NONE); // prevents this vehicle from coupling to another in Driver mode.&lt;br /&gt;
;Notes&lt;br /&gt;
*The mask can be built using the [[#Coupler Flags|Coupler Flag]] constants.&lt;br /&gt;
*This method will not prevent vehicles from coupling in Surveyor, but takes effect in Driver mode. &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetDecouplingMask===&lt;br /&gt;
{{MethodHeader|public native void SetDecouplingMask(int mask)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;mask&#039;&#039;&#039; = A mask specifying which of the vehilce&#039;s couplers are allowed to couple. &lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetDecouplingMask(COUPLE_NONE); // prevents this vehicle from uncoupling in Driver mode.&lt;br /&gt;
;Notes&lt;br /&gt;
*The mask can be built using the [[#Coupler Flags|Coupler Flag]] constants.&lt;br /&gt;
*This method will not prevent vehicles from uncoupling in Surveyor, but takes effect in Driver mode. &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetHandbrake===&lt;br /&gt;
{{MethodHeader|public native void SetHandBrake(bool applied)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;applied&#039;&#039;&#039; = If true the handbrake is applied, if false the handbrake is released.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetHandBrake(true);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetHeadlightColor===&lt;br /&gt;
{{MethodHeader|SetHeadlightColor(float red, float blue, float green)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;red, blue, green&#039;&#039;&#039; = RGB components of selected colour, expressed as normalised values.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetHeadlightColour(0.5,1.0,0.5); // sets colour to RGB:128,255,128&lt;br /&gt;
;Notes&lt;br /&gt;
*This method controls the color of the illumination produced by the headlights.&lt;br /&gt;
*It does not affect the &amp;quot;diffuse&amp;quot; component of illumination (this component remains white). Works correctly with ground and bump-mapped meshes only.&lt;br /&gt;
*It does not affect the color of the headlight coronas.&lt;br /&gt;
*This should method not be used to &amp;quot;turn off&amp;quot; the headlights, as even a black light will consume CPU time with lighting calculations.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetMaximumCouplerCompressionStress===&lt;br /&gt;
{{MethodHeader|public native void SetMaximumCouplerCompressionStress(float stress)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;stress&#039;&#039;&#039; = Maximum compression stress in newtons (N). Use 0.0 for no breakage.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetMaximumCouplerCompressionStress(1500000.0);&lt;br /&gt;
;Notes&lt;br /&gt;
*Sets the maximum coupler compression stress value for this vehicle. &lt;br /&gt;
*This value refers to the maximum compression stress which this vehicle&#039;s couplers need to experience before they break.&lt;br /&gt;
*This is effectively the stress that a coupler can withstand before it breaks.&lt;br /&gt;
*As a point of reference, a typical modern knuckle-type coupler can handle approximately 2500 kN of force before breaking.&lt;br /&gt;
*This is roughly equivalent to the weight of 2.5 million apples.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetMaximumCouplerExpansionStress===&lt;br /&gt;
{{MethodHeader|public native void SetMaximumCouplerExpansionStress(float stress)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;stress&#039;&#039;&#039; = Maximum expansion stress in newtons (N), Use 0.0 for no breakage.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetMaximumCouplerExpansionStress(1000000.0);&lt;br /&gt;
;Notes&lt;br /&gt;
*Sets the maximum coupler expansion stress value for this vehicle. &lt;br /&gt;
*This value refers to the maximum expansion stress which this vehicle&#039;s couplers need to experience before they break.&lt;br /&gt;
*This is effectively the stress that a coupler can withstand before it breaks.&lt;br /&gt;
*As a point of reference, a typical modern knuckle-type coupler can handle approximately 2500 kN of force before breaking.&lt;br /&gt;
*This is roughly equivalent to the weight of 2.5 million apples.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetMaximumCoupleVelocity===&lt;br /&gt;
{{MethodHeader|public native void SetMaximumCoupleVelocity(float velocity)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;velocity&#039;&#039;&#039; = The maximum speed in metres per second at which this vehicle can be coupled to without breaking a coupler. &lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetMaximumCoupleVelocity(10);&lt;br /&gt;
;Notes&lt;br /&gt;
*&amp;quot;Vehicle&amp;quot;,&amp;quot;BadCouple&amp;quot; are broadcast if this speed is exceeded.&lt;br /&gt;
*If a value of zero is used &amp;quot;Vehicle&amp;quot;,&amp;quot;BadCouple&amp;quot; messages will not be issued.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetMaximumTractiveEffort===&lt;br /&gt;
{{MethodHeader|public native void SetMaximumTractiveEffort(float maxTE)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;maxTE&#039;&#039;&#039; = The maximum tractive effort of this vehicle in newtons (N). &lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetMaximumTractiveEffort(185000.0);&lt;br /&gt;
;Notes&lt;br /&gt;
*The maximum tractive effort of a vehicle refers to its maximum traction or pulling power measured in newtons.&lt;br /&gt;
*This value is initially defined in the configuration of a vehicle asset but can be altered with this method. &lt;br /&gt;
*Generally, only locomotives will have tractive effort.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetPitchBasedOnSpeed===&lt;br /&gt;
{{MethodHeader|public native void SetPitchBasedOnSpeed(float factor)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;factor&#039;&#039;&#039; = An arbitrary value used to vary the pitch of the train with its velocity.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetPitchBasedOnSpeed(2.5);&lt;br /&gt;
;Notes&lt;br /&gt;
*Pitch is rotation about an axis at right angles to the track direction.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetPitchBasedOnTrack===&lt;br /&gt;
{{MethodHeader|public native void SetPitchBasedOnTrack(bool pitch)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;pitch&#039;&#039;&#039; = True to enable the effect, false to disable.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetPitchBasedOnTrack(true);&lt;br /&gt;
;Notes&lt;br /&gt;
*Pitch is rotation about an axis at right angles to the track direction.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetProductDisabled===&lt;br /&gt;
{{MethodHeader|public native void SetProductDisabled(void)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*None&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetProductDisabled();&lt;br /&gt;
;Notes&lt;br /&gt;
*Disables the loading or unloading of any product, overriding any previous calls to SetProductRestriction().&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetProductRestriction===&lt;br /&gt;
{{MethodHeader|public native bool SetProductRestriction(Asset product)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;product&#039;&#039;&#039; = Asset to which this vehicle&#039;s load is to be restricted.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*True if successful, false otherwise.&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetProductRestriction(coal);&lt;br /&gt;
;Notes&lt;br /&gt;
*Restricts this vehicle to only allow the given product. &lt;br /&gt;
*When a product restriction is in effect, only that product may be either loaded or unloaded. &lt;br /&gt;
*This method overrides any previous call to SetProductDisabled().&lt;br /&gt;
*If the product parameter is null, any product compatible with this vehicle can be loaded/unloaded. &lt;br /&gt;
*If it is a product that is not compatible with this vehicle, no restriction is set and false will be returned. &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetQueueInitialCount===&lt;br /&gt;
{{MethodHeader|public void SetQueueInitialCount(ProductQueue queue, Asset product, int amount)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;queue&#039;&#039;&#039; = Queue to use, any existing products in this queue will be destroyed.&lt;br /&gt;
*&#039;&#039;&#039;product&#039;&#039;&#039; = Asset of product to use.&lt;br /&gt;
*&#039;&#039;&#039;amount&#039;&#039;&#039; = Amount of product to use.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetQueueInitialCount(passengerQueue,passengers,20);&lt;br /&gt;
;Notes&lt;br /&gt;
*Fills the given queue with the specified quantity of product.&lt;br /&gt;
*This method sets the amount of products in the given queue.&lt;br /&gt;
*It is a utility method that works on the given queue which need not be a queue from this vehicle.&lt;br /&gt;
*The product filter provided with queue will be used to check if the queue can take products of type asset.&lt;br /&gt;
*If it can&#039;t, the filter will be modified to suit as this method is forceful in that regard. &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetRollBasedOnTrack===&lt;br /&gt;
{{MethodHeader|public native void SetRollBasedOnTrack(float factor)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;factor&#039;&#039;&#039; = Arbitrary value used to control the amount of roll.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetRollBasedOnTrack(2.0);&lt;br /&gt;
;Notes&lt;br /&gt;
*Roll is a rotation about an axis parallel to the track direction.&lt;br /&gt;
*Use a positive value to lean &#039;into&#039; the curve, a negative value to lean out.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetRunningNumber===&lt;br /&gt;
{{MethodHeader|public native void SetRunningNumber(string number)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;number&#039;&#039;&#039; = The running (fleet identification) number of the vehicle.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetRunningNumber(&amp;quot;21C1&amp;quot;);&lt;br /&gt;
 SetRunningNumber(&amp;quot;4472&amp;quot;);&lt;br /&gt;
;Notes&lt;br /&gt;
*This value is retrieved using [[#GetRunningNumber|GetRunningNumber()]] and should be restricted to alphanumeric characters and spaces.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetSandingTractionMultiplier===&lt;br /&gt;
{{MethodHeader|public native void SetSandingTractionMultiplier(float factor)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;factor&#039;&#039;&#039; = A multiplier value of 1.0 or more defining the increase in this vehicle&#039;s tractive effort when sand is in use.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetSandingTractionMultiplier(1.5); // allow sanding to increase tractive effort by 50%&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetWheelslipTractionMultiplier===&lt;br /&gt;
{{MethodHeader|public native void SetWheelslipTractionMultiplier(float factor)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;factor&#039;&#039;&#039; = A multiplier value of 1.0 or less to apply to decrease this vehicle&#039;s traction when wheelslip occurs.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetWheelslipTractionMultiplier(0.25); // wheelslip reduces tractive effort to 25% of normal.&lt;br /&gt;
;Notes&lt;br /&gt;
* A multiplier value of 1.0 disables the wheelspin sound.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Uncouple===&lt;br /&gt;
{{MethodHeader|public native void Uncouple(int end)&amp;lt;br&amp;gt;public native void Uncouple(Vehicle other)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;end&#039;&#039;&#039; = One of the [[#Direction Relationships|Direction Relationship]] constants indicating at which end of the current vehicle the uncoupling is to occur.&lt;br /&gt;
*&#039;&#039;&#039;other&#039;&#039;&#039; = A reference to the other vehicle form which the caller is to be uncoupled.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 Uncouple(DIRECTION_FORWARD);  // uncouple at the current vehicle&#039;s front end&lt;br /&gt;
 Uncouple(vehicle1);           // uncouple from the specified vehicle&lt;br /&gt;
;Notes&lt;br /&gt;
*This method will always cause another Train object to be created.&lt;br /&gt;
*The current Train reference will remain on the section of the previous train with the most drivers declared.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===UnloadProduct===&lt;br /&gt;
{{MethodHeader|public bool UnloadProduct(LoadingReport report)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;report&#039;&#039;&#039; = Report on the current state of the loading operation.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*True if the unloading operation was successful, false otherwise.&lt;br /&gt;
;Syntax&lt;br /&gt;
 UnloadProduct(report);&lt;br /&gt;
;Notes&lt;br /&gt;
*Unloads products into this vehicle as defined by the given report. &lt;br /&gt;
*This method works by attempting to transfer products from this vehicle&#039;s queues to the industry queue specified in report. &lt;br /&gt;
*The sequence of events for an unloading operation as performed by this method is:&lt;br /&gt;
**Verify that an unloading operation is possible with this vehicle by calling [[#CanUnloadProductToQueue|CanUnloadProductToQueue()]].&lt;br /&gt;
**[[#BeginUnload|BeginUnload()]] on this vehicle and [[Class Industry#BeginUnload|Industry.BeginUnload()]] on the industry specified in the report are called to perform any pre-unloading events like animation or particle effects on the vehicle and industry respectively. &lt;br /&gt;
**Both of these methods return the amount of time required for an unloading operation and the UnloadProduct() method sleeps for which ever of these times is the longer.&lt;br /&gt;
**The actual product transfer to the industry from the vehicle is performed by calling ProductQueue.TransferProductFrom() on the industry queue(s).&lt;br /&gt;
**[[#GetUnloadTime|GetUnloadTime()]] on this vehicle and [[Class Industry#GetUnloadTime|Industry.GetUnloadTime()]] are called. Again, UnloadProduct() sleeps for which ever is the longer of the times returned.&lt;br /&gt;
**[[#EndUnload|EndUnload()]] and [[Class Industry#EndUnload|Industry.EndUnload()]] are called to perform any post-loading events. As before UnloadProduct() sleeps for the longer time.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===UpdateViewDetails===&lt;br /&gt;
{{MethodHeader|void UpdateViewDetails(Message msg)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;msg&#039;&#039;&#039; = Message object which triggers this handler.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Notes&lt;br /&gt;
*Update the view details window for this vehicle (from the train). &lt;br /&gt;
*This method is setup by Init() as a handler method for a message of type &amp;quot;Vehicle&amp;quot;,&amp;quot;LoadComplete&amp;quot;.&lt;br /&gt;
*Such a message indicates that the load or queue of the vehicle have changed and the view details window of the train will need to be updated. &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===ViewDetails===&lt;br /&gt;
{{MethodHeader|void ViewDetails(Message msg)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;msg&#039;&#039;&#039; = Message object which triggers this handler.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Notes&lt;br /&gt;
*View details window for this vehicle using the Train&#039;s output.&lt;br /&gt;
*This method is setup by Init() as a handler method for a message of type &amp;quot;MapObject&amp;quot;,&amp;quot;ViewDetails&amp;quot;.object. &lt;br /&gt;
*Such a message indicates that the user has opened the right-click menu of the vehicle and selected the &amp;quot;View Details&amp;quot; menu item. &lt;br /&gt;
*This method will call the ViewDetails() method of this vehicle&#039;s train so that a Browser window describing the entire train can be displayed to the user. &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===ViewSchedule===&lt;br /&gt;
{{MethodHeader|void ViewSchedule(Message msg)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;msg&#039;&#039;&#039; = Message object which triggers this handler.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Notes&lt;br /&gt;
*View the schedule window for this vehicle from the train.&lt;br /&gt;
*This method is setup by Init() as a handler method for a message of type &amp;quot;MapObject&amp;quot;,&amp;quot;View-Schedule&amp;quot;. &lt;br /&gt;
*Such a message indicates that the schedule of the vehicle or train is to be displayed for the user.&lt;br /&gt;
*This method calls through to Train.UpdateScheduleWindow(). &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===NotifyTrainChanged===&lt;br /&gt;
{{MethodHeader|public void NotifyTrainChanged(Train prevTrain, Train nextTrain)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;prevTrain&#039;&#039;&#039; = The train to which this Vehicle was previously attached.&lt;br /&gt;
*&#039;&#039;&#039;nextTrain&#039;&#039;&#039; = The train to which this Vehicle is now attached.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Notes&lt;br /&gt;
*In ts12 only.&lt;br /&gt;
*Override this function as required, but don&#039;t forget to call the inherited version in case it does something in the future.&lt;br /&gt;
*Attempting to manipulate the makeup or positioning of any Train from within this function is illegal behavior. If you need to do that, trigger a delayed action using a message or a thread.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Code Examples==&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Related Methods==&lt;br /&gt;
[[Class Train#GetVehicles|Train.GetVehicles()]]&amp;lt;br&amp;gt;&lt;br /&gt;
[[Class World#GetVehicleList|World.GetVehicleList()]]&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Categories==&lt;br /&gt;
[[Category:Script Class]]&lt;/div&gt;</summary>
		<author><name>Ciceronmt</name></author>
	</entry>
	<entry>
		<id>https://wiki.trainzsimulator.com/index.php?title=Class_Train&amp;diff=21264</id>
		<title>Class Train</title>
		<link rel="alternate" type="text/html" href="https://wiki.trainzsimulator.com/index.php?title=Class_Train&amp;diff=21264"/>
		<updated>2019-09-09T15:37:24Z</updated>

		<summary type="html">&lt;p&gt;Ciceronmt: /* GetSmoothedVelocity */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;*[[TrainzScript Language Reference|API Hierarchy]]&lt;br /&gt;
**[[Class GSObject|GSObject]] *&lt;br /&gt;
***[[Class GameObject|GameObject]]&lt;br /&gt;
****Train&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
*A train is a collection of vehicles in TRS.&lt;br /&gt;
*They act as a single entity and may be controlled using this class.&lt;br /&gt;
*A train is placed on a track in script by using [[Class World#CreateTrain|World.CreateTrain()]] or [[Class TrainUtil#CreateTrainFromSoup|TrainUtil.CreateTrainFromSoup()]]. &lt;br /&gt;
*Trainz will automatically create a Train object for each consist that appears in the game.&lt;br /&gt;
*When an existing train is uncoupled and split up into two separate consists a new train object is created.&lt;br /&gt;
*Similarly when two trains couple one of the train objects is destroyed.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Messages==&lt;br /&gt;
*Messages sent to and from Train objects are listed below:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
{{TableHeader|width=50%|margin=15px}}&lt;br /&gt;
|-&lt;br /&gt;
|bgcolor=&amp;quot;#EEEEEE&amp;quot;|&#039;&#039;&#039;Major&#039;&#039;&#039;||bgcolor=&amp;quot;#EEEEEE&amp;quot;|&#039;&#039;&#039;Minor&#039;&#039;&#039;||bgcolor=&amp;quot;#EEEEEE&amp;quot;|&#039;&#039;&#039;Source&#039;&#039;&#039;||bgcolor=&amp;quot;#EEEEEE&amp;quot; |&#039;&#039;&#039;Destination&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|Schedule||Abort||Train||Train  &lt;br /&gt;
|-&lt;br /&gt;
|Schedule||Complete||Train||Broadcast  &lt;br /&gt;
|-&lt;br /&gt;
|Schedule||Touch||Train||Train  &lt;br /&gt;
|-&lt;br /&gt;
|[[Train Messages|Train]]||Deleted||Train||&lt;br /&gt;
|-&lt;br /&gt;
|[[Signal Messages|Train]]||Entered red signal notify||Train||Broadcast  &lt;br /&gt;
|-&lt;br /&gt;
|[[Signal Messages|Train]]||Entered red signal||Signal||Train  &lt;br /&gt;
|-&lt;br /&gt;
|[[Object Messages|Train]]||EnterTrack||Track||Train  &lt;br /&gt;
|-&lt;br /&gt;
|[[Object Messages|Train]]||InnerEnterTrack||Track||Train  &lt;br /&gt;
|-&lt;br /&gt;
|[[Object Messages|Train]]||InnerLeaveTrack||Track||Train  &lt;br /&gt;
|-&lt;br /&gt;
|[[Object Messages|Train]]||LeaveTrack||Track||Train  &lt;br /&gt;
|-&lt;br /&gt;
|[[Train Messages|Train]]||Over advisory speed limit||Train||Broadcast  &lt;br /&gt;
|-&lt;br /&gt;
|[[Train Messages|Train]]||Over floating speed limit||Train||Broadcast  &lt;br /&gt;
|-&lt;br /&gt;
|[[Train Messages|Train]]||Over speed limit||Train||Broadcast  &lt;br /&gt;
|-&lt;br /&gt;
|[[Train Messages|Train]]||ReachedTarget||Train||Train&lt;br /&gt;
|-&lt;br /&gt;
|[[Train Messages|Train]]||SlowingForTarget||Train||Train  &lt;br /&gt;
|-&lt;br /&gt;
|[[Train Messages|Train]]||StartedMoving||Train||Train  &lt;br /&gt;
|-&lt;br /&gt;
|[[Train Messages|Train]]||StoppedMoving||Train||Train  &lt;br /&gt;
|-&lt;br /&gt;
|[[Train Messages|Train]]||Under advisory speed limit||Train||Broadcast  &lt;br /&gt;
|-&lt;br /&gt;
|[[Train Messages|Train]]||Under floating speed limit||Train||Broadcast  &lt;br /&gt;
|-&lt;br /&gt;
|[[Train Messages|Train]]||Under speed limit||Train||Broadcast  &lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Constants==&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
===Train Control Modes===&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
{{TableHeader|width=95%|margin=15px}}&lt;br /&gt;
|width=375|public define int CONTROL_MANUAL = 1||User controls train, script can change settings.&lt;br /&gt;
|-&lt;br /&gt;
|public define int CONTROL_AUTOPILOT = 2||Autopilot controls train.&lt;br /&gt;
|-&lt;br /&gt;
|public define int CONTROL_AUTOMANUAL = 3||User controls train, autopilot takes over when train is not currently &#039;focused&#039;.&lt;br /&gt;
|-&lt;br /&gt;
|public define int CONTROL_SCRIPT = 4||Only the script can control the train.&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
===Reverser Traction Modes===&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
{{TableHeader|width=95%|margin=15px}}&lt;br /&gt;
|width=375|public define int TRACTION_FORWARD = 2||Reverse is in forward setting.&lt;br /&gt;
|-&lt;br /&gt;
|public define int TRACTION_NEUTRAL = 1||Reverser is in neutral.&lt;br /&gt;
|-&lt;br /&gt;
|public define int TRACTION_REVERSE = 0||Reverser is in reverse.&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
===Train Brake Modes===&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
{{TableHeader|width=95%|margin=15px}}&lt;br /&gt;
|width=375|public define float  TRAIN_BRAKE_RELEASE = 0.0||Train brakes are released.&lt;br /&gt;
|-&lt;br /&gt;
|public define float  TRAIN_BRAKE_INITIAL = 1.0||Train brakes are in initial mode.&lt;br /&gt;
|-&lt;br /&gt;
|public define float  TRAIN_BRAKE_APPLICATION = 2.0||Train brakes are applied.&lt;br /&gt;
|-&lt;br /&gt;
|public define float  TRAIN_BRAKE_HANDLE_OFF = 3.0||Train brake handle is off.&lt;br /&gt;
|-&lt;br /&gt;
|public define float  TRAIN_BRAKE_EMERGENCY = 4.0||Train brakes are in emergency stop position.&lt;br /&gt;
|-&lt;br /&gt;
|public define float  TRAIN_BRAKE_LAP = 5.0||Train brakes are in the lap position, not available for all trains.&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
===Dynamic Brake States===&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
{{TableHeader|width=95%|margin=15px}}&lt;br /&gt;
|width=375|public define int  DYNAMIC_BRAKE_TRACTION = 0||Dynamic brakes in traction mode.&lt;br /&gt;
|-&lt;br /&gt;
|public define int  DYNAMIC_BRAKE_NEUTRAL = 1 ||Dynamic brakes in neutral.&lt;br /&gt;
|-&lt;br /&gt;
|public define int  DYNAMIC_BRAKE_BRAKE = 2 ||Dynamic brakes are on.&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Found Results===&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
{{TableHeader|width=95%|margin=15px}}&lt;br /&gt;
|width=375|public define int  RESULT_NONE = 0||Item not found.&lt;br /&gt;
|-&lt;br /&gt;
|public define int  RESULT_FORWARD = 1||Item is in front of train.&lt;br /&gt;
|-&lt;br /&gt;
|public define int  RESULT_INSIDE = 2||Item is within the train, ie between the front and the rear limits.&lt;br /&gt;
|-&lt;br /&gt;
|public define int  RESULT_BACKWARD = 3||Item is behind the train.&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
===Measurement Conversion Multipliers===&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
{{TableHeader|width=95%|margin=15px}}&lt;br /&gt;
|width=375|public define float  KPH_TO_MPS = 0.278||Kilometres per hour -&amp;gt; Metres per second.&lt;br /&gt;
|-&lt;br /&gt;
|public define float  MPH_TO_MPS = 0.447||Miles per hour -&amp;gt; Metres per second.&lt;br /&gt;
|-&lt;br /&gt;
|public define float  MPH_TO_KPH = 1.609||Miles per hour -&amp;gt; Kilometres per hour.&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
==Members==&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
{{TableHeader|width=95%|margin=15px}}&lt;br /&gt;
|width=375|&amp;lt;b&amp;gt;public Browser timeTableInfo&amp;lt;/b&amp;gt;||A publicly accessible Browser object for timetable information.&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
==Methods==&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===AddVelocity===&lt;br /&gt;
{{MethodHeader|public native void AddVelocity(float velocity)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;velocity&#039;&#039;&#039; = Velocity to add to the current speed of the train.		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None	&lt;br /&gt;
;Syntax&lt;br /&gt;
 train.AddVelocity(5.0);	&lt;br /&gt;
;Notes&lt;br /&gt;
*Velocity parameter must be in metres per second and may be negative.&lt;br /&gt;
*Use the [[#Measurement Conversion Multipliers|Measurement Conversion Multipliers]] to convert from other units.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===ClearTrainTimetable===&lt;br /&gt;
{{MethodHeader|public void ClearTrainTimetable(ScenarioBehavior rule)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;rule&#039;&#039;&#039; = rule that called [[#SetTrainTimetable|SetTrainTimetable()]] on this train.		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None	&lt;br /&gt;
;Syntax&lt;br /&gt;
 train.ClearTimeTable(timetableRule);	&lt;br /&gt;
;Notes&lt;br /&gt;
*Clears the train timetable of this train. 	&lt;br /&gt;
*Having cleared the TrainTimetable, it is now safe again to set another TrainTimetable for this train through [[#SetTrainTimetable|SetTrainTimetable()]].&lt;br /&gt;
*This method must only be called by the rule which called SetTrainTimetable() in the first place. &lt;br /&gt;
*It is the responsibility of the caller to post a (TrainTimetable, Touch) message after calling this function.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===DecTrainBusy===&lt;br /&gt;
{{MethodHeader|public void DecTrainBusy(void)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*None		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None	&lt;br /&gt;
;Syntax&lt;br /&gt;
 train.DecTrainBusy();	&lt;br /&gt;
;Notes&lt;br /&gt;
*Decrements this train&#039;s busy count.&lt;br /&gt;
*See [[#IsTrainBusy|IsTrainBusy()]] for further details.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Derail===&lt;br /&gt;
{{MethodHeader|public native void Derail(void)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*None		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None	&lt;br /&gt;
;Syntax&lt;br /&gt;
 train.Derail();	&lt;br /&gt;
;Notes&lt;br /&gt;
*Deliberately derails the train.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===EnablePhysics===&lt;br /&gt;
{{MethodHeader|public native void EnablePhysics(bool enable)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;enable&#039;&#039;&#039; = True to enable physics calculations for this train, false to disable		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None	&lt;br /&gt;
;Syntax&lt;br /&gt;
 train.EnablePhysics(false);		&lt;br /&gt;
;Notes&lt;br /&gt;
*Turning physics off for scenic rolling stock that the player cannot interact with can boost performance.&lt;br /&gt;
*There is no point in doing physic calculations for idle rollingstock.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetActiveDriver===&lt;br /&gt;
{{MethodHeader|public native DriverCharacter GetActiveDriver(void)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*None		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*The active driver of this train, null if there is no driver assigned.&lt;br /&gt;
;Syntax&lt;br /&gt;
 DriverCharacter driver = train.GetActiveDriver();		&lt;br /&gt;
;Notes&lt;br /&gt;
*There may be more than one driver on a train but there is only one active driver and an individual Locomotive may only have one driver assigned.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetAdvisoryLimit===&lt;br /&gt;
{{MethodHeader|public native float GetAdvisoryLimit(void)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*None		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*The current advisory speed limit set by script.		&lt;br /&gt;
;Syntax&lt;br /&gt;
 float speed = train.GetAdvisoryLimit();		&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetAllowsUserContol===&lt;br /&gt;
{{MethodHeader|public native bool GetAllowsUserControl(void)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*None		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*True if this train allows the user to control it directly through DCC or Cabin interfaces, false otherwise.&lt;br /&gt;
;Syntax&lt;br /&gt;
 bool canDrive =train.getAllowsUserControl();		&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetAutopilotMode===&lt;br /&gt;
{{MethodHeader|public native int GetAutopilot Mode(void)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*None		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*One of the [[#Train Control Modes|Train Control Mode]] constants defining the method by which the train is currently controlled.&lt;br /&gt;
;Syntax&lt;br /&gt;
 int controlMode = train.GetAutopilotMode();		&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetAutopilotStopJunctionBase===&lt;br /&gt;
{{MethodHeader|public native JunctionBase GetAutopilotStopJunctionBase(void)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*None		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*The junction object that is preventing the autopilot from taking this train any further, null if the train is not stopped by a junction.		&lt;br /&gt;
;Syntax&lt;br /&gt;
 JunctionBase junction = train GetAutopilotStopJunctionBase();		&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetAutopilotStopTrain===&lt;br /&gt;
{{MethodHeader|public native Train GetAutopilotStopTrain(void)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*None		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*The train that is preventing the autopilot from taking this train any further, null if the train is not being held up by another train.		&lt;br /&gt;
;Syntax&lt;br /&gt;
 Train otherTrain = train.GetAutopilotStopTrain();		&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetAutopilotTargetSlowing===&lt;br /&gt;
{{MethodHeader|public native bool GetAutopilotTargetSlowing(void)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*None		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*True if the autopilot is slowing down for its target destination, false otherwise.		&lt;br /&gt;
;Syntax&lt;br /&gt;
 bool isSlowing = train.GetAutopilotTargetSlowing();		&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetDCCThrottle===&lt;br /&gt;
{{MethodHeader|public native float GetDCCThrottle(void)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*None		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*The DCC throttle setting for this train when using DCC physics.		&lt;br /&gt;
;Syntax&lt;br /&gt;
 float throttle = GetDCCThrottle();		&lt;br /&gt;
;Notes&lt;br /&gt;
*The returned value will be in the range [-1.0 .. 1.0] where -1.0 is full throttle in reverse, 0.0 is stationary and 1.0 is full throttle forward.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetFrontmostLocomotive===&lt;br /&gt;
{{MethodHeader|public native Locomotive GetFrontmostLocomotive(void)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*None		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*Returns a reference to the frontmost locomotive in the train.	&lt;br /&gt;
;Syntax&lt;br /&gt;
 Loco = Train.GetFrontmostLocomotive();	&lt;br /&gt;
;Notes&lt;br /&gt;
*&amp;lt;font color=red&amp;gt;The &#039;&#039;front&#039;&#039; of the train is defined relative to the train&#039;s current heading.??&amp;lt;/font&amp;gt;	&lt;br /&gt;
*The train&#039;s heading may not correspond to its physical appearance and can change during game play.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetHeadlightState===&lt;br /&gt;
{{MethodHeader|public native bool GetHeadlightState(void)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*None		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*True if headlights are turned on, false otherwise.		&lt;br /&gt;
;Syntax&lt;br /&gt;
 bool lights = train.GetHeadlightState();		&lt;br /&gt;
;Notes&lt;br /&gt;
*Only the frontmost locomotive will display headlighs.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetLastVisitedBuildable===&lt;br /&gt;
{{MethodHeader|public Buildable GetLastVisitedBuildable(void)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*None		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*The last [[Class Buildable|Buildable]] object visited by this train, null if there have been no such visits.&lt;br /&gt;
;Syntax&lt;br /&gt;
 Buildable buildable = train.GetLastVisitedBuildable();		&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetLastVisitedIndustry===&lt;br /&gt;
{{MethodHeader|public Industry GetLastVisitedIndustry(void)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*None		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*The last Industry object visited by this train, null if there have been no such visits.		&lt;br /&gt;
;Syntax&lt;br /&gt;
 Industry industry = train.GetLastVisitedIndustry();		&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetLastVisitedTrack===&lt;br /&gt;
{{MethodHeader|public Track GetLastVisitedTrack(void)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*None		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*The last track segment visited by this train.		&lt;br /&gt;
;Syntax&lt;br /&gt;
 Track track = train.GetLastVisitedTrack();		&lt;br /&gt;
;Notes&lt;br /&gt;
*Note that the returned value may be null. &amp;lt;font color=red&amp;gt;How is that possible?&amp;lt;/font&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetHighBeams===&lt;br /&gt;
{{MethodHeader|public bool GetHighBeams(void)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*None		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*True if the frontmost locomotive&#039;s high beams are on, false otherwise.		&lt;br /&gt;
;Syntax&lt;br /&gt;
 bool High_Lights = train.GetHighBeams();		&lt;br /&gt;
;Notes&lt;br /&gt;
*See also [[Class Vehicle#GetHighBeams|Vehicle.GetHighBeams()]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetMaximumCouplingStressVehicle===&lt;br /&gt;
{{MethodHeader|public native Vehicle GetMaximumCouplingStressVehicle(void)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*None		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*The Vehicle in this consist that is experiencing the greatest level of coupling stress.		&lt;br /&gt;
;Syntax&lt;br /&gt;
 Vehicle vehicle = GetMaximumCouplingStressVehicle();		&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetPantographState===&lt;br /&gt;
{{MethodHeader|public native int GetPantographState(void)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*None		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*The state of the pantographs of the electric locomotives in this train.		&lt;br /&gt;
;Syntax&lt;br /&gt;
 int pantoState = train.GetPantographState();		&lt;br /&gt;
;Notes&lt;br /&gt;
*The returned value will be in the range [0..3] where:&lt;br /&gt;
**0 = Both pantographs down.&lt;br /&gt;
**1 = Front pantograph up.&lt;br /&gt;
**2 = Rear pantograph up.&lt;br /&gt;
**3 = Both pantographs up.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetPhysicsModel===&lt;br /&gt;
{{MethodHeader|public native int GetPhysicsModel(void)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*None		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*The mode of control chosen by the player to drive the locomotive		&lt;br /&gt;
;Syntax&lt;br /&gt;
 int Mode = train.GetPhysicsModel();		&lt;br /&gt;
;Notes&lt;br /&gt;
*The returned value will be :&lt;br /&gt;
**2 = CabinControl&lt;br /&gt;
**1 = DCCMode&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===GetSmoothedVelocity===&lt;br /&gt;
{{MethodHeader|public native float GetSmoothedVelocity(void)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*None		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*Returns a smoothed velocity, intended for human consumption.		&lt;br /&gt;
;Syntax&lt;br /&gt;
 float speed = train.GetSmoothedVelocity();		&lt;br /&gt;
;Notes&lt;br /&gt;
*If you require an accurate velocity readout for physics operations, use [[#GetVelocity|GetVelocity()]].&lt;br /&gt;
*&#039;&#039;In practice, even when the train stops completely, it does not report an absolute zero.&#039;&#039;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetSpeedLimit===&lt;br /&gt;
{{MethodHeader|public native float GetSpeedLimit(void)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*None		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*The current sign posted speed limit. 		&lt;br /&gt;
;Syntax&lt;br /&gt;
 float permittedSpeed = train.GetSpeedLimit();		&lt;br /&gt;
;Notes&lt;br /&gt;
*The speed limit is dependent on trackside signs placed in Surveyor as well as the direction of the train.&lt;br /&gt;
*A default value applies to track that isn&#039;t sign posted.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetTrackmarkDirection===&lt;br /&gt;
{{MethodHeader|public native int GetTrackmarkDirection(TrackMark mark)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;mark&#039;&#039;&#039; = A reference to the Trackmark to search for.&lt;br /&gt;
;Returned Value&lt;br /&gt;
* One of the [[#Found Results|Found Result]] values representing the location of the given track mark relative to this train.			&lt;br /&gt;
;Syntax&lt;br /&gt;
 int location = train.GetTrackmarkDirection(trackmark);		&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetTrainBrakes===&lt;br /&gt;
{{MethodHeader|public native float GetTrainBrakes(void)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*None		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*One of the [[#Train Brake Modes|Train Brake mode]] constants indicating the current state of this train&#039;s brakes.		&lt;br /&gt;
;Syntax&lt;br /&gt;
 float brakeState = train.GetTrainBrakes();		&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetTrainDisplayName===&lt;br /&gt;
{{MethodHeader|public native string GetTrainDisplayName(void)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*None		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*A localised display name for this train. 		&lt;br /&gt;
;Syntax&lt;br /&gt;
 string trainName = train.GetTrainDisplayName();		&lt;br /&gt;
;Notes&lt;br /&gt;
*This will be a name Trainz has created for the consist such as &amp;quot;Consist 0&amp;quot; and will match the description shown in the Minimap view. &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetTrainPriorityNumber===&lt;br /&gt;
{{MethodHeader|public native int GetTrainPriorityNumber(void)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*None		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*Train priority value in the range [1 .. 3]		&lt;br /&gt;
;Syntax&lt;br /&gt;
 int priority = train.GetTrainPriorityNumber();&lt;br /&gt;
;Notes&lt;br /&gt;
*See [[#SetTrainPriority|SetTrainPriority()]] for further details.		&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetTrainTimetable===&lt;br /&gt;
{{MethodHeader|public TrainTimetable GetTrainTimetable(void)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*None		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*The TrainTimetable that the train is currently using, null if there is none.&lt;br /&gt;
;Syntax&lt;br /&gt;
  TrainTimetable timetable = train.GetTrainTimetable();		&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetTrainVelocity===&lt;br /&gt;
{{MethodHeader|public native float GetTrainVelocity(void)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*None		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*The train&#039;s current velocity in metres per second.&lt;br /&gt;
;Syntax&lt;br /&gt;
  float speed = train.GetTrainVelocity();		&lt;br /&gt;
;Notes&lt;br /&gt;
* This function provides the instantaneous velocity for vehicles in this train, which is good for physics calculations but not good for human-readable display.  If you want human-readable display, use [[#GetSmoothedVelocity|GetSmoothedVelocity()]] instead.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===GetVehicles===&lt;br /&gt;
{{MethodHeader|public native Vehicle[ ] GetVehicles(void)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*None		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*Returns an array consisting of all the vehicles making up this train.	&lt;br /&gt;
;Syntax&lt;br /&gt;
 Vehicle[] vehicles = train.GetVehicles();	&lt;br /&gt;
;Notes&lt;br /&gt;
 *GetVehicles[0] is always the front vehicle of the train relative to the train&#039;s current heading.	&lt;br /&gt;
*The train&#039;s heading may not correspond to its physical appearance and can change during game play.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetVelocity===&lt;br /&gt;
{{MethodHeader|public native float GetVelocity(void)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*None		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*The train&#039;s current velocity.		&lt;br /&gt;
;Syntax&lt;br /&gt;
 float speed = train.GetVelocity();		&lt;br /&gt;
;Notes&lt;br /&gt;
*Warning!  The TS10 and TS12 Train.gs scripts advise this method is buggy and to use [[#GetSmoothedVelocity|GetSmoothedVelocity()]] or [[#GetTrainVelocity|GetTrainVelocity()]] instead.&lt;br /&gt;
*This function provides the instantaneous velocity for vehicles in this train, which is good for physics calculations but not good for human-readable display.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===HasReachedInnerJunctionRadius===&lt;br /&gt;
{{MethodHeader|public bool HasReachedJunctionInnerJunctionRadius(JunctionBase junction)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;junction&#039;&#039;&#039; = JunctionBase object to query.			&lt;br /&gt;
;Returned Value&lt;br /&gt;
*True if this train is within the inner radius of the given junction, false otherwise.		&lt;br /&gt;
;Syntax&lt;br /&gt;
 bool arrived = train.HasReachedInnerJunctionRadius(junction10);		&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===HasTrainTimetable===&lt;br /&gt;
{{MethodHeader|public bool HasTrainTimetable(void)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*None		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*True if this train has an attached TrainTimetable, false otherwise.		&lt;br /&gt;
;Syntax&lt;br /&gt;
 bool timed = train.HasTrainTimetable();		&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===IsScheduleRunning===&lt;br /&gt;
{{MethodHeader|public bool IsScheduleRunning(void)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*None		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*True if this train is currently running to a Schedule, false otherwise.		&lt;br /&gt;
;Syntax&lt;br /&gt;
 bool scheduled = train.IsScheduleRunning();		&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===IsScheduleWindowVisible===&lt;br /&gt;
{{MethodHeader|public bool IsScheduleWindowVisible(void)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*None		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*True if the schedule window for this train is currently open, false otherwise.		&lt;br /&gt;
;Syntax&lt;br /&gt;
 bool windowOpen = IsScheduleWindowVisible();		&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===IsStillInJunction===&lt;br /&gt;
{{MethodHeader|public bool IsStillInJunction(JunctionBase junction)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;junction&#039;&#039;&#039; = JunctionBase object to query.			&lt;br /&gt;
;Returned Value&lt;br /&gt;
*True if the train holds a Permit for the given junction, flse otherwise.		&lt;br /&gt;
;Syntax&lt;br /&gt;
 bool inJunction = train.IsStillInJunction(junction10);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===IsStopped===&lt;br /&gt;
{{MethodHeader|public native bool IsStopped(void)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*None		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*True if the train is currently stationary, false if it is in motion.		&lt;br /&gt;
;Syntax&lt;br /&gt;
 bool moving=train.IsStopped();		&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===IsTrainBusy===&lt;br /&gt;
{{MethodHeader|public bool IsTrainBusy(void)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*None		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*True if the train&#039;s &#039;busy&#039; count is greater than zero, false otherwise.		&lt;br /&gt;
;Syntax&lt;br /&gt;
 bool busy = train.IsTrainBusy();		&lt;br /&gt;
;Notes&lt;br /&gt;
*Using the [[#IncTrainBusy|IncTrainBusy()]] method, any piece of script code can tag a train being busy. &lt;br /&gt;
*The train can be untagged later by calling DecTrainBusy(). &lt;br /&gt;
*This mechanism is mainly used by industries that are doing something with the train. &lt;br /&gt;
*A train can be tagged as being busy more than once by calling IncTrainBusy() multiple times so different industries can tag the train. &lt;br /&gt;
*Each time IncTrainBusy() is called, an internal busy count is incremented and if that busy count is greater than zero, the train is considered busy.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===IsViewDetailsVisible===&lt;br /&gt;
{{MethodHeader|public bool IsViewDetailsVisible(void)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*None		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*true if the ViewDetails window for this train is visible, false otherwise.		&lt;br /&gt;
;Syntax&lt;br /&gt;
 bool visible = train.IsViewDetailsVisible();		&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===MapObjectIsInFront===&lt;br /&gt;
{{MethodHeader|public bool MapObjectIsInFront(MapObject obj, float range)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;obj&#039;&#039;&#039; = MapObject to search for.&lt;br /&gt;
*&#039;&#039;&#039;range&#039;&#039;&#039; = Maximum search distance.			&lt;br /&gt;
;Returned Value&lt;br /&gt;
*True if the object is found within the specified distance and in front of the train, false otherwise.		&lt;br /&gt;
;Syntax&lt;br /&gt;
 bool isClose = train.MapObjectIsInFront(terminus,100.0);		&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===ReleaseTrackPermits===&lt;br /&gt;
{{MethodHeader|public void ReleaseTrackPermits(Permit[ ] permitList)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;permitList&#039;&#039;&#039; = Permit array containing a list of permits to release.		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None	&lt;br /&gt;
;Syntax&lt;br /&gt;
 train.ReleaseTrackPermits(permitList);		&lt;br /&gt;
;Notes&lt;br /&gt;
*This method will release any permits from the &#039;&#039;permitList&#039;&#039; array that are currently held by this train.&lt;br /&gt;
*Any other permits in the array that are not held by this train will be ignored.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===RunSchedule===&lt;br /&gt;
{{MethodHeader|public thread void RunSchedule(Schedule schedule, bool loop, float delay)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;schedule&#039;&#039;&#039; = The Schedule that the train is to follow.&lt;br /&gt;
*&#039;&#039;&#039;loop&#039;&#039;&#039; = False to run the schedule once, True to repeat it continuously.&lt;br /&gt;
*&#039;&#039;&#039;delay&#039;&#039;&#039; = Time in seconds to wait before starting the schedule.			&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None	&lt;br /&gt;
;Syntax&lt;br /&gt;
 train.RunSchedule(schedule,false,10.0);		&lt;br /&gt;
;Notes&lt;br /&gt;
*See [[Class Schedule|Schedule]] for information on how to build a schedule.&lt;br /&gt;
*Only one schedule may run on a train at a time and the user cannot control the train when it is running a schedule.&lt;br /&gt;
*This method is a thread, so the calling code does not need to wait for it to finish and return before executing other code.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetAdvisoryLimit===&lt;br /&gt;
{{MethodHeader|public native void SetAdvisoryLimit(float speed)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;speed&#039;&#039;&#039; = Speed limit to set in &amp;lt;del&amp;gt;KPH&amp;lt;/del&amp;gt; metres/second.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None	&lt;br /&gt;
;Syntax&lt;br /&gt;
 train.SetAdvisoryLimit(60.0);&lt;br /&gt;
;Notes&lt;br /&gt;
*Sets an advisory speed limit for a script controlled train.&lt;br /&gt;
*Use zero in the speed parameter to clear any previously imposed limit.&lt;br /&gt;
*&amp;lt;font color=red&amp;gt;Does this really use KPH, most similar methods use MPS&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=red&amp;gt;Experimental evidence confirms that it&#039;s in m/s not kph or mph&amp;lt;/font&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetAutopilotMode===&lt;br /&gt;
{{MethodHeader|public native void SetAutopilotMode(int mode)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;mode&#039;&#039;&#039; = One of the [[#Train Control Modes|Train Control Mode]] constants specifying the method by which this train is controlled.		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None	&lt;br /&gt;
;Syntax&lt;br /&gt;
 train.SetAutopilotMode(Train.CONTROL_AUTOMANUAL);		&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetAutopilotTarget===&lt;br /&gt;
{{MethodHeader|public native void SetAutopilotTarget(Buildable buildable, string trigger)&amp;lt;br&amp;gt;public native void SetAutopilotTarget(Trackside trackside)&amp;lt;br&amp;gt;public native void SetAutopilotTarget(Track track)&amp;lt;br&amp;gt;public native void SetAutopilotTarget(JunctionBase junction)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;buildable&#039;&#039;&#039; = Buildable object to use as a destination.&lt;br /&gt;
*&#039;&#039;&#039;trigger&#039;&#039;&#039; = Attached trigger within the buildable, specified by name.&lt;br /&gt;
*&#039;&#039;&#039;trackside&#039;&#039;&#039; =  Trackside object to use as a destination.&lt;br /&gt;
*&#039;&#039;&#039;track&#039;&#039;&#039; = Track segment to use as a destination.&lt;br /&gt;
*&#039;&#039;&#039;junction&#039;&#039;&#039; = JunctionBase object to use as a destination.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None	&lt;br /&gt;
;Syntax&lt;br /&gt;
 train.SetAutopilotTarget(&amp;quot;Kings Cross Station&amp;quot;,&amp;quot;trigger1&amp;quot;);		&lt;br /&gt;
;Notes&lt;br /&gt;
*This method sets a destination for the autopilot to take this train to.&lt;br /&gt;
*Objects from respective child classes such as industries, signals and trackmarks may be specified.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetAutopilotTargetMinimumDistance===&lt;br /&gt;
{{MethodHeader|public native void SetAutopilotTargetMinimumDistance(float distance)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;distance&#039;&#039;&#039; = The minimum distance in metres, between the train and the autopilot target, to be reached before the train will start to slow down.			&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None	&lt;br /&gt;
;Syntax&lt;br /&gt;
 train SetAutopilotTargetMinimumDistance(100.0);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetAutoPilotTargetMinimumSpeed===&lt;br /&gt;
{{MethodHeader|public native void SetAutopilotTargetMinimumSpeed(float speed)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;speed&#039;&#039;&#039; = Minimum speed, in metres per second, that the train should be travelling at when it reaches the Autopilot target.			&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None	&lt;br /&gt;
;Syntax&lt;br /&gt;
 train.SetAutoPilotTargetMinimumSpeed(20.0);		&lt;br /&gt;
;Notes&lt;br /&gt;
*&amp;lt;font color=red&amp;gt;The documentation seems to mean that the train should be going at 20.0 OR MORE.  Shouldn&#039;t it be MaximumSpeed???&amp;lt;/font&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetBail===&lt;br /&gt;
{{MethodHeader|public native void SetBail(void)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*None		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None	&lt;br /&gt;
;Syntax&lt;br /&gt;
 train.SetBail();		&lt;br /&gt;
;Notes&lt;br /&gt;
*Depresses the bail control for a short period.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetCouplingMask===&lt;br /&gt;
{{MethodHeader|public void SetCouplingMask(int mask)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;mask&#039;&#039;&#039; = A mask specifying which of the trains exposed couplers are allowed to couple.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None	&lt;br /&gt;
;Syntax&lt;br /&gt;
 train.SetCouplingMask(Vehicle.COUPLE_NONE); // prevents this train from coupling to another in Driver mode.&lt;br /&gt;
;Notes&lt;br /&gt;
*The mask can be built using the [[Class Vehicle#Coupler Flags|Coupler Flag]] constants defined in [[Class Vehicle]].&lt;br /&gt;
*This method will not prevent vehicles or trains from coupling in Surveyor, but takes effect in Driver mode.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetDCCThrottle===&lt;br /&gt;
{{MethodHeader|public native void SetDCCThrottle(float throttle)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;throttle&#039;&#039;&#039; = Float value in the range -1.0 .. 1.0 defining the throttle setting for the train when using DCC physics.			&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None	&lt;br /&gt;
;Syntax&lt;br /&gt;
 train.SetDCCThrottle(0.0); //sets the throttle to neutral.		&lt;br /&gt;
;Notes&lt;br /&gt;
*Full speed ahead is 1.0&lt;br /&gt;
*Maximum in reverse is -1.0&lt;br /&gt;
*Neutral is 0.0&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetDecouplingMask===&lt;br /&gt;
{{MethodHeader|public void SetDecouplingMask(int mask)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;mask&#039;&#039;&#039; = A mask specifying which of the couplers are allowed to couple, applies to all of the vehicles in the train.			&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None	&lt;br /&gt;
;Syntax&lt;br /&gt;
 train.SetDecouplingMask(Vehicle.COUPLE_FRONT|Vehicle.COUPLE_BACK); // prevents vehicles being uncoupled from the train in Driver mode.&lt;br /&gt;
;Notes&lt;br /&gt;
*The mask can be built using the [[Class Vehicle#Coupler Flags|Coupler Flag]] constants defined in [[Class Vehicle]].&lt;br /&gt;
*This method will not prevent vehicles or trains from being uncoupled in Surveyor, but takes effect in Driver mode.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetDynamicBrakeMode===&lt;br /&gt;
{{MethodHeader|public native void SetDynamicBrakeMode(int mode)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*One of the [[#Dynamic Brake States|Dynamic Brake State]] constants indicating the current state of this train&#039;s brakes.			&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None	&lt;br /&gt;
;Syntax&lt;br /&gt;
 train.SetDynamicBrakeMode(Train.DYNAMIC_BRAKE_TRACTION);		&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetFloatingLimit===&lt;br /&gt;
{{MethodHeader|public native void SetFloatingLimit(float delta, bool enable)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;delta&#039;&#039;&#039; = Tolerance allowed from the posted limit in metres per second.&lt;br /&gt;
*&#039;&#039;&#039;enable&#039;&#039;&#039; = Use true to enable messages related to floating limits, false to disable.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None	&lt;br /&gt;
;Syntax&lt;br /&gt;
 train.SetFloatingLimit(5.0,true);		&lt;br /&gt;
;Notes&lt;br /&gt;
*Sets the floating speed limit level above the sign posted limit.&lt;br /&gt;
*The floating limit is an amount of tolerance above the current speed limit. &lt;br /&gt;
*Messages for floating speed violations are not to be confused with regular speed limit messages.&lt;br /&gt;
*The floating limit is monitored by the Scenario.Monitor() thread, and may be used for point deduction when speeding. It should therefore be reserved for player trains.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetHandBrake===&lt;br /&gt;
{{MethodHeader|public void SetHandBrake(bool state)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;state&#039;&#039;&#039; = Use true to apply the handbrake to all vehicles in this train which are not Locomotives, false to release the handbrake.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None	&lt;br /&gt;
;Syntax&lt;br /&gt;
 train.SetHandBrake(true);		&lt;br /&gt;
;Notes &#039;&#039;The use of this function did not reveal any effect on the physics of trains.&#039;&#039;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetHeadlightState===&lt;br /&gt;
{{MethodHeader|public native void SetHeadlightState(bool lightsOn)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;lightsOn&#039;&#039;&#039; = True to turn the headlights on, false to turn them off.			&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None	&lt;br /&gt;
;Syntax&lt;br /&gt;
 train.SetHeadlightState(true);		&lt;br /&gt;
;Notes&lt;br /&gt;
*This method affects only the headlights on the frontmost locomotive.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetHighBeams===&lt;br /&gt;
{{MethodHeader|public void SetHighBeams(bool value)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;value&#039;&#039;&#039; = True to turn on high beams, false to turn them off.		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 train.SetHighBeams(true);		&lt;br /&gt;
;Notes&lt;br /&gt;
*See also [[Class Vehicle#SetHighBeams|Vehicle.SetHighColor()]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetLastVisitedBuildable===&lt;br /&gt;
{{MethodHeader|public void SetLastVisitedBuildable(Buildable buildable)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;buildable&#039;&#039;&#039; = Sets the last visited buildable to the given object.			&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None	&lt;br /&gt;
;Syntax&lt;br /&gt;
 train.SetLastVisitedBuildable(KingsCrossStation);		&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetManualThrottle===&lt;br /&gt;
{{MethodHeader|public native void SetManualThrottle(int notch)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;notch&#039;&#039;&#039; = Value in the range 0 .. 8 to set the throttle.			&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None	&lt;br /&gt;
;Syntax&lt;br /&gt;
 train.SetManualThrottle(5);		&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetPantogaphState===&lt;br /&gt;
{{MethodHeader|public native void SetPantographState(int state)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;state&#039;&#039;&#039; = Value in the range 0 .. 3 to set the pantographs if this train has them.			&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None	&lt;br /&gt;
;Syntax&lt;br /&gt;
 train.SetPantographState(3);		&lt;br /&gt;
;Notes&lt;br /&gt;
*Use one of these values for &#039;&#039;state&#039;&#039;:&lt;br /&gt;
**0 = Both pantographs down.&lt;br /&gt;
**1 = Front pantograph up.&lt;br /&gt;
**2 = Rear pantograph up.&lt;br /&gt;
**3 = Both pantographs up.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetReverser===&lt;br /&gt;
{{MethodHeader|public native void SetReverser(int mode)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;mode&#039;&#039;&#039; = One of the [[#Reverser Traction Modes|Reverser Traction Mode]] constants defining the required state of the train&#039;s reverser lever.			&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None	&lt;br /&gt;
;Syntax&lt;br /&gt;
 train.SetReverser(Train.TRACTION_REVERSE);		&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetTrainBrakes===&lt;br /&gt;
{{MethodHeader|public native void SetTrainBrakes(float mode)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;mode&#039;&#039;&#039; = One of the [[#Train Brake States|Train Brake State]] constants defining the required state of the train&#039;s brakes.			&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None	&lt;br /&gt;
;Syntax&lt;br /&gt;
 train.SetTrainBrakes(Train.TRAIN_BRAKE_EMERGENCY);		&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetTrainPriorityNumber===&lt;br /&gt;
{{MethodHeader|public native void SetTrainPriority Number(int priority)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;priority&#039;&#039;&#039; = Priority value in the range 1 .. 3.			&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None	&lt;br /&gt;
;Syntax&lt;br /&gt;
 train.SetTrainPriorityNumber(2);		&lt;br /&gt;
;Notes&lt;br /&gt;
*All trains and track sections can be assigned a priority value in the range of [1 - 3] with the default value being 2.&lt;br /&gt;
*The priority value is not a numerical scale of precedence, but a value for the AI driver to attempt to match.&lt;br /&gt;
*This means the driver will &#039;&#039;prefer&#039;&#039; track sections that have a priority equal to that of the train.&lt;br /&gt;
*Changing the priority of the train only takes affect when the driver restarts a new schedule.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetTrainTimetable===&lt;br /&gt;
{{MethodHeader|public void SetTrainTimetable(TrainTimetable timetable)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;timetable&#039;&#039;&#039; = Assigns the specified timetable to this train.			&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None	&lt;br /&gt;
;Syntax&lt;br /&gt;
 train.SetTrainTimetable(timetable);&lt;br /&gt;
;Notes&lt;br /&gt;
*This train must not already have a TrainTimetable assigned.&lt;br /&gt;
*To ensure that this proviso is met, use [[#ClearTrainTimetabel|ClearTrainTimetable()]] prior to calling this method.&lt;br /&gt;
*It is the responsibility of the caller to post a &amp;quot;TrainTimetable&amp;quot;,&amp;quot;Touch&amp;quot; message after calling this function.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetVelocity===&lt;br /&gt;
{{MethodHeader|public native void SetVelocity(float velocity)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;velocity&#039;&#039;&#039; = Velocity to apply to the train, in metres per second.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None	&lt;br /&gt;
;Syntax&lt;br /&gt;
 train.SetVelocity(0.0); // stops the train, subject to braking performance.		&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===ShowInConsistMenu===&lt;br /&gt;
{{MethodHeader|public native void ShowInConsistMenu(bool show)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;show&#039;&#039;&#039; = True to make this train visible to the in-game consist menu, false to hide it.			&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None	&lt;br /&gt;
;Syntax&lt;br /&gt;
 train.ShowInConsistMenu(false);		&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SoundHorn===&lt;br /&gt;
{{MethodHeader|public native void SoundHorn(void)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*None		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None	&lt;br /&gt;
;Syntax&lt;br /&gt;
 train.SoundHorn();		&lt;br /&gt;
;Notes&lt;br /&gt;
*Sounds the horn or whictle for all locomotives in this train.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===StopSchedule===&lt;br /&gt;
{{MethodHeader|public void StopSchedule(void)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*None		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None	&lt;br /&gt;
;Syntax&lt;br /&gt;
 train.StopSchedule();		&lt;br /&gt;
;Notes&lt;br /&gt;
*This method stops the Schedule this train is currently running (if any).&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===StopScheduleAndWait===&lt;br /&gt;
{{MethodHeader|public void StopSchedule(void)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*None		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None	&lt;br /&gt;
;Syntax&lt;br /&gt;
 train.StopSchedule();		&lt;br /&gt;
;Notes&lt;br /&gt;
*This method stops the Schedule this train is currently running (if any) and waits until the train&#039;s schedule actually stops before returning. &lt;br /&gt;
*If the train is not running a schedule, the method returns after broadcasting a &amp;quot;Schedule&amp;quot;,&amp;quot;Touch&amp;quot; message, in case someone is listening for schedule messages.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===StopTrainGently===&lt;br /&gt;
{{MethodHeader|public native void StopTrainGently(void)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*None		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None	&lt;br /&gt;
;Syntax&lt;br /&gt;
 train.StopTrainGently();		&lt;br /&gt;
;Notes&lt;br /&gt;
*Brings the train to a halt over a short time period.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===TakePermitOnTrack===&lt;br /&gt;
{{MethodHeader|public Permit[ ] TakePermitOnTrack(bool direction)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;direction&#039;&#039;&#039; = Direction relative to the train in which to take out permits.			&lt;br /&gt;
;Returned Value&lt;br /&gt;
*An array including any permits taken which have not yet been granted to this train. Some of these permits may not yet have been granted. 		&lt;br /&gt;
;Syntax&lt;br /&gt;
 Permit[] permits = train.TakePermitOnTrack(true);		&lt;br /&gt;
;Notes&lt;br /&gt;
*Gets permits on the current track in the given direction.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===TestTrackPermit===&lt;br /&gt;
{{MethodHeader|public native bool TestTrackPermit(Permit permit, bool innerOnly)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;permit&#039;&#039;&#039; = An existing Permit object.&lt;br /&gt;
*&#039;&#039;&#039;innerOnly&#039;&#039;&#039; = If true the method will test only the inner radius, if false the default radius of 150 metres will be used.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*True if this train is within the track controlled by &#039;&#039;permit&#039;&#039;, false otherwise. 		&lt;br /&gt;
;Syntax&lt;br /&gt;
 bool ownPermit = train.TestTrackPermit(permit1,false);		&lt;br /&gt;
;Notes&lt;br /&gt;
*The method generates an exception if the &#039;&#039;permit&#039;&#039; parameter does not refer to a track.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===ToggleScheduleWindow===&lt;br /&gt;
{{MethodHeader|public void ToggleScheduleWindow(void)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*None		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None	&lt;br /&gt;
;Syntax&lt;br /&gt;
 train.ToggleScheduleWindow();		&lt;br /&gt;
;Notes&lt;br /&gt;
*If the schedule window is already open/visible, this method will destroy it.&lt;br /&gt;
*Otherwise if the view details window is not visible, UpdateScheduleWindow() is called to create it for display.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===ToggleViewDetailsWindow===&lt;br /&gt;
{{MethodHeader|public void ToggleViewDetailsWindow(void)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*None		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None	&lt;br /&gt;
;Syntax&lt;br /&gt;
 train.ToggleViewDetailsWindow();		&lt;br /&gt;
;Notes&lt;br /&gt;
*If the ViewDetails window is already open/visible, this method will destroy it.&lt;br /&gt;
*Otherwise if the view details window is not visible, ViewDetails() is called to create it for display.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===TrackSearch===&lt;br /&gt;
{{MethodHeader|public native MapObject[ ] TrackSearch(bool direction, float distance)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;direction&#039;&#039;&#039; = Direction to search relative to the train&#039;s heading, true for forwards, false for backwards.&lt;br /&gt;
*&#039;&#039;&#039;distance&#039;&#039;&#039; = Maximum search distance in metres.			&lt;br /&gt;
;Returned Value&lt;br /&gt;
*An array of objects found along the track in the defined search direction, the array might be empty.		&lt;br /&gt;
;Syntax&lt;br /&gt;
 MapObject[] objects = train.TrackSearch(true,5000.0) // searches 5km forwards along the track.		&lt;br /&gt;
;Notes&lt;br /&gt;
*Gets all of the Trackside and SceneryWithTrack objects on a length of track that is either in front of or behind this train. &lt;br /&gt;
*Descendants of these classes are also returned.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===TracksideIsInFront===&lt;br /&gt;
{{MethodHeader|public bool TracksideIsInFront(Trackside obj, float range)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;obj&#039;&#039;&#039; = Trackside object to search for.&lt;br /&gt;
*&#039;&#039;&#039;range&#039;&#039;&#039; = Mximum search distance.			&lt;br /&gt;
;Returned Value&lt;br /&gt;
*True if the object is logically forward of this train, false otherwise.		&lt;br /&gt;
;Syntax&lt;br /&gt;
 bool found = train.TracksideIsInFront(signal1,500.0);		&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Turnaround===&lt;br /&gt;
{{MethodHeader|public native void Turnaround(void)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*None		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None	&lt;br /&gt;
;Syntax&lt;br /&gt;
 train.Turnaround();		&lt;br /&gt;
;Notes&lt;br /&gt;
*Reverses the logical direction of the train, ie changes its heading.&lt;br /&gt;
*The physical direction of the vehicles is not altered but the throttle direction is reversed.&lt;br /&gt;
*If the camera is focused on the train in tracking view when this method is called the camera&#039;s direction of view (relative to the map) will alter through 180 degrees.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===UpdateScheduleWindow===&lt;br /&gt;
{{MethodHeader|public void UpdateScheduleWindow(string vehicleName)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;vehicleName&#039;&#039;&#039; = Name of vehicle within the train.			&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None	&lt;br /&gt;
;Syntax&lt;br /&gt;
 train.UpdateScheduleWindow(&amp;quot;brake2&amp;quot;);		&lt;br /&gt;
;Notes&lt;br /&gt;
*Updates the schedule window from the given vehicle.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===UpdateViewDetails===&lt;br /&gt;
{{MethodHeader|public void UpdateViewDetails(Vehicle vehicle)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;vehicle&#039;&#039;&#039; = Reference to a vehicle within the train.			&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None	&lt;br /&gt;
;Syntax&lt;br /&gt;
 train.UpdateViewDetails(vehicle);&lt;br /&gt;
;Notes&lt;br /&gt;
*Called by Vehicle.UpdateViewDetails() when a vehicle&#039;s load has changed so that the train&#039;s detail window can be amended.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===UpdateViewDetailsLocomotive===&lt;br /&gt;
{{MethodHeader|public void UpdateViewDetailsLocomotive(void)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*None&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None	&lt;br /&gt;
;Syntax&lt;br /&gt;
 train.UpdateViewDetailsLocomotive(vehicle);&lt;br /&gt;
;Notes&lt;br /&gt;
*Called by Locomotive.UpdateViewDetails() when any of the Locomotive&#039;s operating parameters have changed so that the train&#039;s detail window can be amended.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===ViewDetails===&lt;br /&gt;
{{MethodHeader|public void ViewDetails(Vehicle vehicle)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;vehicle&#039;&#039;&#039; = Reference to a vehicle within the train.			&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None	&lt;br /&gt;
;Syntax&lt;br /&gt;
 train.ViewDetails(vehicle);		&lt;br /&gt;
;Notes&lt;br /&gt;
*This method is called by Vehicle.ViewDetails() when the user has requested to view the details of the consist.&lt;br /&gt;
*It will create a Browser window listing information about the train including who the driver character is and the loads of all vehicles.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===WasRunScheduleSuccessful===&lt;br /&gt;
{{MethodHeader|public bool WasRunScheduleSuccessful(void)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*None		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*True if the most recently run schedule was successfully, false otherwise. 		&lt;br /&gt;
;Syntax&lt;br /&gt;
 train.WasRunScheduleSuccessful();		&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Code Examples==&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Related Methods==&lt;br /&gt;
[[Class TrainUtil#AreInTrain|TrainUtil.AreInTrain()]]&amp;lt;br&amp;gt;&lt;br /&gt;
[[Class TrainUtil#CreateTrainFromSoup|TrainUtil.CreateTrainFromSoup()]]&amp;lt;br&amp;gt;&lt;br /&gt;
[[Class TrainUtil#IsInTrain|TrainUtil.IsInTrain()]]&amp;lt;br&amp;gt;&lt;br /&gt;
[[Class World#CreateTrain|World.CreateTrain()]]&amp;lt;br&amp;gt;&lt;br /&gt;
[[Class World#DeleteTrain|World.DeleteTrain()]]&amp;lt;br&amp;gt;&lt;br /&gt;
[[Class World#GetTrainList|World.GetTrainList()]]&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Categories==&lt;br /&gt;
[[Category:Script Class]]&lt;/div&gt;</summary>
		<author><name>Ciceronmt</name></author>
	</entry>
	<entry>
		<id>https://wiki.trainzsimulator.com/index.php?title=Class_Train&amp;diff=21246</id>
		<title>Class Train</title>
		<link rel="alternate" type="text/html" href="https://wiki.trainzsimulator.com/index.php?title=Class_Train&amp;diff=21246"/>
		<updated>2019-09-09T08:30:39Z</updated>

		<summary type="html">&lt;p&gt;Ciceronmt: /* SetHandBrake */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;*[[TrainzScript Language Reference|API Hierarchy]]&lt;br /&gt;
**[[Class GSObject|GSObject]] *&lt;br /&gt;
***[[Class GameObject|GameObject]]&lt;br /&gt;
****Train&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
*A train is a collection of vehicles in TRS.&lt;br /&gt;
*They act as a single entity and may be controlled using this class.&lt;br /&gt;
*A train is placed on a track in script by using [[Class World#CreateTrain|World.CreateTrain()]] or [[Class TrainUtil#CreateTrainFromSoup|TrainUtil.CreateTrainFromSoup()]]. &lt;br /&gt;
*Trainz will automatically create a Train object for each consist that appears in the game.&lt;br /&gt;
*When an existing train is uncoupled and split up into two separate consists a new train object is created.&lt;br /&gt;
*Similarly when two trains couple one of the train objects is destroyed.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Messages==&lt;br /&gt;
*Messages sent to and from Train objects are listed below:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
{{TableHeader|width=50%|margin=15px}}&lt;br /&gt;
|-&lt;br /&gt;
|bgcolor=&amp;quot;#EEEEEE&amp;quot;|&#039;&#039;&#039;Major&#039;&#039;&#039;||bgcolor=&amp;quot;#EEEEEE&amp;quot;|&#039;&#039;&#039;Minor&#039;&#039;&#039;||bgcolor=&amp;quot;#EEEEEE&amp;quot;|&#039;&#039;&#039;Source&#039;&#039;&#039;||bgcolor=&amp;quot;#EEEEEE&amp;quot; |&#039;&#039;&#039;Destination&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|Schedule||Abort||Train||Train  &lt;br /&gt;
|-&lt;br /&gt;
|Schedule||Complete||Train||Broadcast  &lt;br /&gt;
|-&lt;br /&gt;
|Schedule||Touch||Train||Train  &lt;br /&gt;
|-&lt;br /&gt;
|[[Train Messages|Train]]||Deleted||Train||&lt;br /&gt;
|-&lt;br /&gt;
|[[Signal Messages|Train]]||Entered red signal notify||Train||Broadcast  &lt;br /&gt;
|-&lt;br /&gt;
|[[Signal Messages|Train]]||Entered red signal||Signal||Train  &lt;br /&gt;
|-&lt;br /&gt;
|[[Object Messages|Train]]||EnterTrack||Track||Train  &lt;br /&gt;
|-&lt;br /&gt;
|[[Object Messages|Train]]||InnerEnterTrack||Track||Train  &lt;br /&gt;
|-&lt;br /&gt;
|[[Object Messages|Train]]||InnerLeaveTrack||Track||Train  &lt;br /&gt;
|-&lt;br /&gt;
|[[Object Messages|Train]]||LeaveTrack||Track||Train  &lt;br /&gt;
|-&lt;br /&gt;
|[[Train Messages|Train]]||Over advisory speed limit||Train||Broadcast  &lt;br /&gt;
|-&lt;br /&gt;
|[[Train Messages|Train]]||Over floating speed limit||Train||Broadcast  &lt;br /&gt;
|-&lt;br /&gt;
|[[Train Messages|Train]]||Over speed limit||Train||Broadcast  &lt;br /&gt;
|-&lt;br /&gt;
|[[Train Messages|Train]]||ReachedTarget||Train||Train&lt;br /&gt;
|-&lt;br /&gt;
|[[Train Messages|Train]]||SlowingForTarget||Train||Train  &lt;br /&gt;
|-&lt;br /&gt;
|[[Train Messages|Train]]||StartedMoving||Train||Train  &lt;br /&gt;
|-&lt;br /&gt;
|[[Train Messages|Train]]||StoppedMoving||Train||Train  &lt;br /&gt;
|-&lt;br /&gt;
|[[Train Messages|Train]]||Under advisory speed limit||Train||Broadcast  &lt;br /&gt;
|-&lt;br /&gt;
|[[Train Messages|Train]]||Under floating speed limit||Train||Broadcast  &lt;br /&gt;
|-&lt;br /&gt;
|[[Train Messages|Train]]||Under speed limit||Train||Broadcast  &lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Constants==&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
===Train Control Modes===&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
{{TableHeader|width=95%|margin=15px}}&lt;br /&gt;
|width=375|public define int CONTROL_MANUAL = 1||User controls train, script can change settings.&lt;br /&gt;
|-&lt;br /&gt;
|public define int CONTROL_AUTOPILOT = 2||Autopilot controls train.&lt;br /&gt;
|-&lt;br /&gt;
|public define int CONTROL_AUTOMANUAL = 3||User controls train, autopilot takes over when train is not currently &#039;focused&#039;.&lt;br /&gt;
|-&lt;br /&gt;
|public define int CONTROL_SCRIPT = 4||Only the script can control the train.&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
===Reverser Traction Modes===&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
{{TableHeader|width=95%|margin=15px}}&lt;br /&gt;
|width=375|public define int TRACTION_FORWARD = 2||Reverse is in forward setting.&lt;br /&gt;
|-&lt;br /&gt;
|public define int TRACTION_NEUTRAL = 1||Reverser is in neutral.&lt;br /&gt;
|-&lt;br /&gt;
|public define int TRACTION_REVERSE = 0||Reverser is in reverse.&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
===Train Brake Modes===&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
{{TableHeader|width=95%|margin=15px}}&lt;br /&gt;
|width=375|public define float  TRAIN_BRAKE_RELEASE = 0.0||Train brakes are released.&lt;br /&gt;
|-&lt;br /&gt;
|public define float  TRAIN_BRAKE_INITIAL = 1.0||Train brakes are in initial mode.&lt;br /&gt;
|-&lt;br /&gt;
|public define float  TRAIN_BRAKE_APPLICATION = 2.0||Train brakes are applied.&lt;br /&gt;
|-&lt;br /&gt;
|public define float  TRAIN_BRAKE_HANDLE_OFF = 3.0||Train brake handle is off.&lt;br /&gt;
|-&lt;br /&gt;
|public define float  TRAIN_BRAKE_EMERGENCY = 4.0||Train brakes are in emergency stop position.&lt;br /&gt;
|-&lt;br /&gt;
|public define float  TRAIN_BRAKE_LAP = 5.0||Train brakes are in the lap position, not available for all trains.&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
===Dynamic Brake States===&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
{{TableHeader|width=95%|margin=15px}}&lt;br /&gt;
|width=375|public define int  DYNAMIC_BRAKE_TRACTION = 0||Dynamic brakes in traction mode.&lt;br /&gt;
|-&lt;br /&gt;
|public define int  DYNAMIC_BRAKE_NEUTRAL = 1 ||Dynamic brakes in neutral.&lt;br /&gt;
|-&lt;br /&gt;
|public define int  DYNAMIC_BRAKE_BRAKE = 2 ||Dynamic brakes are on.&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Found Results===&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
{{TableHeader|width=95%|margin=15px}}&lt;br /&gt;
|width=375|public define int  RESULT_NONE = 0||Item not found.&lt;br /&gt;
|-&lt;br /&gt;
|public define int  RESULT_FORWARD = 1||Item is in front of train.&lt;br /&gt;
|-&lt;br /&gt;
|public define int  RESULT_INSIDE = 2||Item is within the train, ie between the front and the rear limits.&lt;br /&gt;
|-&lt;br /&gt;
|public define int  RESULT_BACKWARD = 3||Item is behind the train.&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
===Measurement Conversion Multipliers===&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
{{TableHeader|width=95%|margin=15px}}&lt;br /&gt;
|width=375|public define float  KPH_TO_MPS = 0.278||Kilometres per hour -&amp;gt; Metres per second.&lt;br /&gt;
|-&lt;br /&gt;
|public define float  MPH_TO_MPS = 0.447||Miles per hour -&amp;gt; Metres per second.&lt;br /&gt;
|-&lt;br /&gt;
|public define float  MPH_TO_KPH = 1.609||Miles per hour -&amp;gt; Kilometres per hour.&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
==Members==&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
{{TableHeader|width=95%|margin=15px}}&lt;br /&gt;
|width=375|&amp;lt;b&amp;gt;public Browser timeTableInfo&amp;lt;/b&amp;gt;||A publicly accessible Browser object for timetable information.&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
==Methods==&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===AddVelocity===&lt;br /&gt;
{{MethodHeader|public native void AddVelocity(float velocity)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;velocity&#039;&#039;&#039; = Velocity to add to the current speed of the train.		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None	&lt;br /&gt;
;Syntax&lt;br /&gt;
 train.AddVelocity(5.0);	&lt;br /&gt;
;Notes&lt;br /&gt;
*Velocity parameter must be in metres per second and may be negative.&lt;br /&gt;
*Use the [[#Measurement Conversion Multipliers|Measurement Conversion Multipliers]] to convert from other units.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===ClearTrainTimetable===&lt;br /&gt;
{{MethodHeader|public void ClearTrainTimetable(ScenarioBehavior rule)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;rule&#039;&#039;&#039; = rule that called [[#SetTrainTimetable|SetTrainTimetable()]] on this train.		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None	&lt;br /&gt;
;Syntax&lt;br /&gt;
 train.ClearTimeTable(timetableRule);	&lt;br /&gt;
;Notes&lt;br /&gt;
*Clears the train timetable of this train. 	&lt;br /&gt;
*Having cleared the TrainTimetable, it is now safe again to set another TrainTimetable for this train through [[#SetTrainTimetable|SetTrainTimetable()]].&lt;br /&gt;
*This method must only be called by the rule which called SetTrainTimetable() in the first place. &lt;br /&gt;
*It is the responsibility of the caller to post a (TrainTimetable, Touch) message after calling this function.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===DecTrainBusy===&lt;br /&gt;
{{MethodHeader|public void DecTrainBusy(void)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*None		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None	&lt;br /&gt;
;Syntax&lt;br /&gt;
 train.DecTrainBusy();	&lt;br /&gt;
;Notes&lt;br /&gt;
*Decrements this train&#039;s busy count.&lt;br /&gt;
*See [[#IsTrainBusy|IsTrainBusy()]] for further details.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Derail===&lt;br /&gt;
{{MethodHeader|public native void Derail(void)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*None		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None	&lt;br /&gt;
;Syntax&lt;br /&gt;
 train.Derail();	&lt;br /&gt;
;Notes&lt;br /&gt;
*Deliberately derails the train.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===EnablePhysics===&lt;br /&gt;
{{MethodHeader|public native void EnablePhysics(bool enable)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;enable&#039;&#039;&#039; = True to enable physics calculations for this train, false to disable		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None	&lt;br /&gt;
;Syntax&lt;br /&gt;
 train.EnablePhysics(false);		&lt;br /&gt;
;Notes&lt;br /&gt;
*Turning physics off for scenic rolling stock that the player cannot interact with can boost performance.&lt;br /&gt;
*There is no point in doing physic calculations for idle rollingstock.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetActiveDriver===&lt;br /&gt;
{{MethodHeader|public native DriverCharacter GetActiveDriver(void)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*None		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*The active driver of this train, null if there is no driver assigned.&lt;br /&gt;
;Syntax&lt;br /&gt;
 DriverCharacter driver = train.GetActiveDriver();		&lt;br /&gt;
;Notes&lt;br /&gt;
*There may be more than one driver on a train but there is only one active driver and an individual Locomotive may only have one driver assigned.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetAdvisoryLimit===&lt;br /&gt;
{{MethodHeader|public native float GetAdvisoryLimit(void)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*None		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*The current advisory speed limit set by script.		&lt;br /&gt;
;Syntax&lt;br /&gt;
 float speed = train.GetAdvisoryLimit();		&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetAllowsUserContol===&lt;br /&gt;
{{MethodHeader|public native bool GetAllowsUserControl(void)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*None		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*True if this train allows the user to control it directly through DCC or Cabin interfaces, false otherwise.&lt;br /&gt;
;Syntax&lt;br /&gt;
 bool canDrive =train.getAllowsUserControl();		&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetAutopilotMode===&lt;br /&gt;
{{MethodHeader|public native int GetAutopilot Mode(void)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*None		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*One of the [[#Train Control Modes|Train Control Mode]] constants defining the method by which the train is currently controlled.&lt;br /&gt;
;Syntax&lt;br /&gt;
 int controlMode = train.GetAutopilotMode();		&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetAutopilotStopJunctionBase===&lt;br /&gt;
{{MethodHeader|public native JunctionBase GetAutopilotStopJunctionBase(void)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*None		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*The junction object that is preventing the autopilot from taking this train any further, null if the train is not stopped by a junction.		&lt;br /&gt;
;Syntax&lt;br /&gt;
 JunctionBase junction = train GetAutopilotStopJunctionBase();		&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetAutopilotStopTrain===&lt;br /&gt;
{{MethodHeader|public native Train GetAutopilotStopTrain(void)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*None		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*The train that is preventing the autopilot from taking this train any further, null if the train is not being held up by another train.		&lt;br /&gt;
;Syntax&lt;br /&gt;
 Train otherTrain = train.GetAutopilotStopTrain();		&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetAutopilotTargetSlowing===&lt;br /&gt;
{{MethodHeader|public native bool GetAutopilotTargetSlowing(void)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*None		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*True if the autopilot is slowing down for its target destination, false otherwise.		&lt;br /&gt;
;Syntax&lt;br /&gt;
 bool isSlowing = train.GetAutopilotTargetSlowing();		&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetDCCThrottle===&lt;br /&gt;
{{MethodHeader|public native float GetDCCThrottle(void)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*None		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*The DCC throttle setting for this train when using DCC physics.		&lt;br /&gt;
;Syntax&lt;br /&gt;
 float throttle = GetDCCThrottle();		&lt;br /&gt;
;Notes&lt;br /&gt;
*The returned value will be in the range [-1.0 .. 1.0] where -1.0 is full throttle in reverse, 0.0 is stationary and 1.0 is full throttle forward.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetFrontmostLocomotive===&lt;br /&gt;
{{MethodHeader|public native Locomotive GetFrontmostLocomotive(void)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*None		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*Returns a reference to the frontmost locomotive in the train.	&lt;br /&gt;
;Syntax&lt;br /&gt;
 Loco = Train.GetFrontmostLocomotive();	&lt;br /&gt;
;Notes&lt;br /&gt;
*&amp;lt;font color=red&amp;gt;The &#039;&#039;front&#039;&#039; of the train is defined relative to the train&#039;s current heading.??&amp;lt;/font&amp;gt;	&lt;br /&gt;
*The train&#039;s heading may not correspond to its physical appearance and can change during game play.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetHeadlightState===&lt;br /&gt;
{{MethodHeader|public native bool GetHeadlightState(void)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*None		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*True if headlights are turned on, false otherwise.		&lt;br /&gt;
;Syntax&lt;br /&gt;
 bool lights = train.GetHeadlightState();		&lt;br /&gt;
;Notes&lt;br /&gt;
*Only the frontmost locomotive will display headlighs.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetLastVisitedBuildable===&lt;br /&gt;
{{MethodHeader|public Buildable GetLastVisitedBuildable(void)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*None		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*The last [[Class Buildable|Buildable]] object visited by this train, null if there have been no such visits.&lt;br /&gt;
;Syntax&lt;br /&gt;
 Buildable buildable = train.GetLastVisitedBuildable();		&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetLastVisitedIndustry===&lt;br /&gt;
{{MethodHeader|public Industry GetLastVisitedIndustry(void)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*None		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*The last Industry object visited by this train, null if there have been no such visits.		&lt;br /&gt;
;Syntax&lt;br /&gt;
 Industry industry = train.GetLastVisitedIndustry();		&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetLastVisitedTrack===&lt;br /&gt;
{{MethodHeader|public Track GetLastVisitedTrack(void)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*None		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*The last track segment visited by this train.		&lt;br /&gt;
;Syntax&lt;br /&gt;
 Track track = train.GetLastVisitedTrack();		&lt;br /&gt;
;Notes&lt;br /&gt;
*Note that the returned value may be null. &amp;lt;font color=red&amp;gt;How is that possible?&amp;lt;/font&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetHighBeams===&lt;br /&gt;
{{MethodHeader|public bool GetHighBeams(void)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*None		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*True if the frontmost locomotive&#039;s high beams are on, false otherwise.		&lt;br /&gt;
;Syntax&lt;br /&gt;
 bool High_Lights = train.GetHighBeams();		&lt;br /&gt;
;Notes&lt;br /&gt;
*See also [[Class Vehicle#GetHighBeams|Vehicle.GetHighBeams()]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetMaximumCouplingStressVehicle===&lt;br /&gt;
{{MethodHeader|public native Vehicle GetMaximumCouplingStressVehicle(void)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*None		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*The Vehicle in this consist that is experiencing the greatest level of coupling stress.		&lt;br /&gt;
;Syntax&lt;br /&gt;
 Vehicle vehicle = GetMaximumCouplingStressVehicle();		&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetPantographState===&lt;br /&gt;
{{MethodHeader|public native int GetPantographState(void)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*None		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*The state of the pantographs of the electric locomotives in this train.		&lt;br /&gt;
;Syntax&lt;br /&gt;
 int pantoState = train.GetPantographState();		&lt;br /&gt;
;Notes&lt;br /&gt;
*The returned value will be in the range [0..3] where:&lt;br /&gt;
**0 = Both pantographs down.&lt;br /&gt;
**1 = Front pantograph up.&lt;br /&gt;
**2 = Rear pantograph up.&lt;br /&gt;
**3 = Both pantographs up.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetPhysicsModel===&lt;br /&gt;
{{MethodHeader|public native int GetPhysicsModel(void)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*None		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*The mode of control chosen by the player to drive the locomotive		&lt;br /&gt;
;Syntax&lt;br /&gt;
 int Mode = train.GetPhysicsModel();		&lt;br /&gt;
;Notes&lt;br /&gt;
*The returned value will be :&lt;br /&gt;
**2 = CabinControl&lt;br /&gt;
**1 = DCCMode&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===GetSmoothedVelocity===&lt;br /&gt;
{{MethodHeader|public native float GetSmoothedVelocity(void)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*None		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*Returns a smoothed velocity, intended for human consumption.		&lt;br /&gt;
;Syntax&lt;br /&gt;
 float speed = train.GetSmoothedVelocity();		&lt;br /&gt;
;Notes&lt;br /&gt;
*If you require an accurate velocity readout for physics operations, use [[#GetVelocity|GetVelocity()]]. &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetSpeedLimit===&lt;br /&gt;
{{MethodHeader|public native float GetSpeedLimit(void)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*None		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*The current sign posted speed limit. 		&lt;br /&gt;
;Syntax&lt;br /&gt;
 float permittedSpeed = train.GetSpeedLimit();		&lt;br /&gt;
;Notes&lt;br /&gt;
*The speed limit is dependent on trackside signs placed in Surveyor as well as the direction of the train.&lt;br /&gt;
*A default value applies to track that isn&#039;t sign posted.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetTrackmarkDirection===&lt;br /&gt;
{{MethodHeader|public native int GetTrackmarkDirection(TrackMark mark)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;mark&#039;&#039;&#039; = A reference to the Trackmark to search for.&lt;br /&gt;
;Returned Value&lt;br /&gt;
* One of the [[#Found Results|Found Result]] values representing the location of the given track mark relative to this train.			&lt;br /&gt;
;Syntax&lt;br /&gt;
 int location = train.GetTrackmarkDirection(trackmark);		&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetTrainBrakes===&lt;br /&gt;
{{MethodHeader|public native float GetTrainBrakes(void)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*None		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*One of the [[#Train Brake Modes|Train Brake mode]] constants indicating the current state of this train&#039;s brakes.		&lt;br /&gt;
;Syntax&lt;br /&gt;
 float brakeState = train.GetTrainBrakes();		&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetTrainDisplayName===&lt;br /&gt;
{{MethodHeader|public native string GetTrainDisplayName(void)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*None		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*A localised display name for this train. 		&lt;br /&gt;
;Syntax&lt;br /&gt;
 string trainName = train.GetTrainDisplayName();		&lt;br /&gt;
;Notes&lt;br /&gt;
*This will be a name Trainz has created for the consist such as &amp;quot;Consist 0&amp;quot; and will match the description shown in the Minimap view. &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetTrainPriorityNumber===&lt;br /&gt;
{{MethodHeader|public native int GetTrainPriorityNumber(void)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*None		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*Train priority value in the range [1 .. 3]		&lt;br /&gt;
;Syntax&lt;br /&gt;
 int priority = train.GetTrainPriorityNumber();&lt;br /&gt;
;Notes&lt;br /&gt;
*See [[#SetTrainPriority|SetTrainPriority()]] for further details.		&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetTrainTimetable===&lt;br /&gt;
{{MethodHeader|public TrainTimetable GetTrainTimetable(void)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*None		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*The TrainTimetable that the train is currently using, null if there is none.&lt;br /&gt;
;Syntax&lt;br /&gt;
  TrainTimetable timetable = train.GetTrainTimetable();		&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetTrainVelocity===&lt;br /&gt;
{{MethodHeader|public native float GetTrainVelocity(void)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*None		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*The train&#039;s current velocity in metres per second.&lt;br /&gt;
;Syntax&lt;br /&gt;
  float speed = train.GetTrainVelocity();		&lt;br /&gt;
;Notes&lt;br /&gt;
* This function provides the instantaneous velocity for vehicles in this train, which is good for physics calculations but not good for human-readable display.  If you want human-readable display, use [[#GetSmoothedVelocity|GetSmoothedVelocity()]] instead.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===GetVehicles===&lt;br /&gt;
{{MethodHeader|public native Vehicle[ ] GetVehicles(void)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*None		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*Returns an array consisting of all the vehicles making up this train.	&lt;br /&gt;
;Syntax&lt;br /&gt;
 Vehicle[] vehicles = train.GetVehicles();	&lt;br /&gt;
;Notes&lt;br /&gt;
 *GetVehicles[0] is always the front vehicle of the train relative to the train&#039;s current heading.	&lt;br /&gt;
*The train&#039;s heading may not correspond to its physical appearance and can change during game play.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetVelocity===&lt;br /&gt;
{{MethodHeader|public native float GetVelocity(void)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*None		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*The train&#039;s current velocity.		&lt;br /&gt;
;Syntax&lt;br /&gt;
 float speed = train.GetVelocity();		&lt;br /&gt;
;Notes&lt;br /&gt;
*Warning!  The TS10 and TS12 Train.gs scripts advise this method is buggy and to use [[#GetSmoothedVelocity|GetSmoothedVelocity()]] or [[#GetTrainVelocity|GetTrainVelocity()]] instead.&lt;br /&gt;
*This function provides the instantaneous velocity for vehicles in this train, which is good for physics calculations but not good for human-readable display.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===HasReachedInnerJunctionRadius===&lt;br /&gt;
{{MethodHeader|public bool HasReachedJunctionInnerJunctionRadius(JunctionBase junction)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;junction&#039;&#039;&#039; = JunctionBase object to query.			&lt;br /&gt;
;Returned Value&lt;br /&gt;
*True if this train is within the inner radius of the given junction, false otherwise.		&lt;br /&gt;
;Syntax&lt;br /&gt;
 bool arrived = train.HasReachedInnerJunctionRadius(junction10);		&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===HasTrainTimetable===&lt;br /&gt;
{{MethodHeader|public bool HasTrainTimetable(void)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*None		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*True if this train has an attached TrainTimetable, false otherwise.		&lt;br /&gt;
;Syntax&lt;br /&gt;
 bool timed = train.HasTrainTimetable();		&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===IsScheduleRunning===&lt;br /&gt;
{{MethodHeader|public bool IsScheduleRunning(void)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*None		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*True if this train is currently running to a Schedule, false otherwise.		&lt;br /&gt;
;Syntax&lt;br /&gt;
 bool scheduled = train.IsScheduleRunning();		&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===IsScheduleWindowVisible===&lt;br /&gt;
{{MethodHeader|public bool IsScheduleWindowVisible(void)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*None		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*True if the schedule window for this train is currently open, false otherwise.		&lt;br /&gt;
;Syntax&lt;br /&gt;
 bool windowOpen = IsScheduleWindowVisible();		&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===IsStillInJunction===&lt;br /&gt;
{{MethodHeader|public bool IsStillInJunction(JunctionBase junction)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;junction&#039;&#039;&#039; = JunctionBase object to query.			&lt;br /&gt;
;Returned Value&lt;br /&gt;
*True if the train holds a Permit for the given junction, flse otherwise.		&lt;br /&gt;
;Syntax&lt;br /&gt;
 bool inJunction = train.IsStillInJunction(junction10);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===IsStopped===&lt;br /&gt;
{{MethodHeader|public native bool IsStopped(void)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*None		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*True if the train is currently stationary, false if it is in motion.		&lt;br /&gt;
;Syntax&lt;br /&gt;
 bool moving=train.IsStopped();		&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===IsTrainBusy===&lt;br /&gt;
{{MethodHeader|public bool IsTrainBusy(void)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*None		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*True if the train&#039;s &#039;busy&#039; count is greater than zero, false otherwise.		&lt;br /&gt;
;Syntax&lt;br /&gt;
 bool busy = train.IsTrainBusy();		&lt;br /&gt;
;Notes&lt;br /&gt;
*Using the [[#IncTrainBusy|IncTrainBusy()]] method, any piece of script code can tag a train being busy. &lt;br /&gt;
*The train can be untagged later by calling DecTrainBusy(). &lt;br /&gt;
*This mechanism is mainly used by industries that are doing something with the train. &lt;br /&gt;
*A train can be tagged as being busy more than once by calling IncTrainBusy() multiple times so different industries can tag the train. &lt;br /&gt;
*Each time IncTrainBusy() is called, an internal busy count is incremented and if that busy count is greater than zero, the train is considered busy.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===IsViewDetailsVisible===&lt;br /&gt;
{{MethodHeader|public bool IsViewDetailsVisible(void)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*None		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*true if the ViewDetails window for this train is visible, false otherwise.		&lt;br /&gt;
;Syntax&lt;br /&gt;
 bool visible = train.IsViewDetailsVisible();		&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===MapObjectIsInFront===&lt;br /&gt;
{{MethodHeader|public bool MapObjectIsInFront(MapObject obj, float range)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;obj&#039;&#039;&#039; = MapObject to search for.&lt;br /&gt;
*&#039;&#039;&#039;range&#039;&#039;&#039; = Maximum search distance.			&lt;br /&gt;
;Returned Value&lt;br /&gt;
*True if the object is found within the specified distance and in front of the train, false otherwise.		&lt;br /&gt;
;Syntax&lt;br /&gt;
 bool isClose = train.MapObjectIsInFront(terminus,100.0);		&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===ReleaseTrackPermits===&lt;br /&gt;
{{MethodHeader|public void ReleaseTrackPermits(Permit[ ] permitList)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;permitList&#039;&#039;&#039; = Permit array containing a list of permits to release.		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None	&lt;br /&gt;
;Syntax&lt;br /&gt;
 train.ReleaseTrackPermits(permitList);		&lt;br /&gt;
;Notes&lt;br /&gt;
*This method will release any permits from the &#039;&#039;permitList&#039;&#039; array that are currently held by this train.&lt;br /&gt;
*Any other permits in the array that are not held by this train will be ignored.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===RunSchedule===&lt;br /&gt;
{{MethodHeader|public thread void RunSchedule(Schedule schedule, bool loop, float delay)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;schedule&#039;&#039;&#039; = The Schedule that the train is to follow.&lt;br /&gt;
*&#039;&#039;&#039;loop&#039;&#039;&#039; = False to run the schedule once, True to repeat it continuously.&lt;br /&gt;
*&#039;&#039;&#039;delay&#039;&#039;&#039; = Time in seconds to wait before starting the schedule.			&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None	&lt;br /&gt;
;Syntax&lt;br /&gt;
 train.RunSchedule(schedule,false,10.0);		&lt;br /&gt;
;Notes&lt;br /&gt;
*See [[Class Schedule|Schedule]] for information on how to build a schedule.&lt;br /&gt;
*Only one schedule may run on a train at a time and the user cannot control the train when it is running a schedule.&lt;br /&gt;
*This method is a thread, so the calling code does not need to wait for it to finish and return before executing other code.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetAdvisoryLimit===&lt;br /&gt;
{{MethodHeader|public native void SetAdvisoryLimit(float speed)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;speed&#039;&#039;&#039; = Speed limit to set in &amp;lt;del&amp;gt;KPH&amp;lt;/del&amp;gt; metres/second.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None	&lt;br /&gt;
;Syntax&lt;br /&gt;
 train.SetAdvisoryLimit(60.0);&lt;br /&gt;
;Notes&lt;br /&gt;
*Sets an advisory speed limit for a script controlled train.&lt;br /&gt;
*Use zero in the speed parameter to clear any previously imposed limit.&lt;br /&gt;
*&amp;lt;font color=red&amp;gt;Does this really use KPH, most similar methods use MPS&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=red&amp;gt;Experimental evidence confirms that it&#039;s in m/s not kph or mph&amp;lt;/font&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetAutopilotMode===&lt;br /&gt;
{{MethodHeader|public native void SetAutopilotMode(int mode)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;mode&#039;&#039;&#039; = One of the [[#Train Control Modes|Train Control Mode]] constants specifying the method by which this train is controlled.		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None	&lt;br /&gt;
;Syntax&lt;br /&gt;
 train.SetAutopilotMode(Train.CONTROL_AUTOMANUAL);		&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetAutopilotTarget===&lt;br /&gt;
{{MethodHeader|public native void SetAutopilotTarget(Buildable buildable, string trigger)&amp;lt;br&amp;gt;public native void SetAutopilotTarget(Trackside trackside)&amp;lt;br&amp;gt;public native void SetAutopilotTarget(Track track)&amp;lt;br&amp;gt;public native void SetAutopilotTarget(JunctionBase junction)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;buildable&#039;&#039;&#039; = Buildable object to use as a destination.&lt;br /&gt;
*&#039;&#039;&#039;trigger&#039;&#039;&#039; = Attached trigger within the buildable, specified by name.&lt;br /&gt;
*&#039;&#039;&#039;trackside&#039;&#039;&#039; =  Trackside object to use as a destination.&lt;br /&gt;
*&#039;&#039;&#039;track&#039;&#039;&#039; = Track segment to use as a destination.&lt;br /&gt;
*&#039;&#039;&#039;junction&#039;&#039;&#039; = JunctionBase object to use as a destination.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None	&lt;br /&gt;
;Syntax&lt;br /&gt;
 train.SetAutopilotTarget(&amp;quot;Kings Cross Station&amp;quot;,&amp;quot;trigger1&amp;quot;);		&lt;br /&gt;
;Notes&lt;br /&gt;
*This method sets a destination for the autopilot to take this train to.&lt;br /&gt;
*Objects from respective child classes such as industries, signals and trackmarks may be specified.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetAutopilotTargetMinimumDistance===&lt;br /&gt;
{{MethodHeader|public native void SetAutopilotTargetMinimumDistance(float distance)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;distance&#039;&#039;&#039; = The minimum distance in metres, between the train and the autopilot target, to be reached before the train will start to slow down.			&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None	&lt;br /&gt;
;Syntax&lt;br /&gt;
 train SetAutopilotTargetMinimumDistance(100.0);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetAutoPilotTargetMinimumSpeed===&lt;br /&gt;
{{MethodHeader|public native void SetAutopilotTargetMinimumSpeed(float speed)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;speed&#039;&#039;&#039; = Minimum speed, in metres per second, that the train should be travelling at when it reaches the Autopilot target.			&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None	&lt;br /&gt;
;Syntax&lt;br /&gt;
 train.SetAutoPilotTargetMinimumSpeed(20.0);		&lt;br /&gt;
;Notes&lt;br /&gt;
*&amp;lt;font color=red&amp;gt;The documentation seems to mean that the train should be going at 20.0 OR MORE.  Shouldn&#039;t it be MaximumSpeed???&amp;lt;/font&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetBail===&lt;br /&gt;
{{MethodHeader|public native void SetBail(void)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*None		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None	&lt;br /&gt;
;Syntax&lt;br /&gt;
 train.SetBail();		&lt;br /&gt;
;Notes&lt;br /&gt;
*Depresses the bail control for a short period.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetCouplingMask===&lt;br /&gt;
{{MethodHeader|public void SetCouplingMask(int mask)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;mask&#039;&#039;&#039; = A mask specifying which of the trains exposed couplers are allowed to couple.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None	&lt;br /&gt;
;Syntax&lt;br /&gt;
 train.SetCouplingMask(Vehicle.COUPLE_NONE); // prevents this train from coupling to another in Driver mode.&lt;br /&gt;
;Notes&lt;br /&gt;
*The mask can be built using the [[Class Vehicle#Coupler Flags|Coupler Flag]] constants defined in [[Class Vehicle]].&lt;br /&gt;
*This method will not prevent vehicles or trains from coupling in Surveyor, but takes effect in Driver mode.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetDCCThrottle===&lt;br /&gt;
{{MethodHeader|public native void SetDCCThrottle(float throttle)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;throttle&#039;&#039;&#039; = Float value in the range -1.0 .. 1.0 defining the throttle setting for the train when using DCC physics.			&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None	&lt;br /&gt;
;Syntax&lt;br /&gt;
 train.SetDCCThrottle(0.0); //sets the throttle to neutral.		&lt;br /&gt;
;Notes&lt;br /&gt;
*Full speed ahead is 1.0&lt;br /&gt;
*Maximum in reverse is -1.0&lt;br /&gt;
*Neutral is 0.0&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetDecouplingMask===&lt;br /&gt;
{{MethodHeader|public void SetDecouplingMask(int mask)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;mask&#039;&#039;&#039; = A mask specifying which of the couplers are allowed to couple, applies to all of the vehicles in the train.			&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None	&lt;br /&gt;
;Syntax&lt;br /&gt;
 train.SetDecouplingMask(Vehicle.COUPLE_FRONT|Vehicle.COUPLE_BACK); // prevents vehicles being uncoupled from the train in Driver mode.&lt;br /&gt;
;Notes&lt;br /&gt;
*The mask can be built using the [[Class Vehicle#Coupler Flags|Coupler Flag]] constants defined in [[Class Vehicle]].&lt;br /&gt;
*This method will not prevent vehicles or trains from being uncoupled in Surveyor, but takes effect in Driver mode.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetDynamicBrakeMode===&lt;br /&gt;
{{MethodHeader|public native void SetDynamicBrakeMode(int mode)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*One of the [[#Dynamic Brake States|Dynamic Brake State]] constants indicating the current state of this train&#039;s brakes.			&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None	&lt;br /&gt;
;Syntax&lt;br /&gt;
 train.SetDynamicBrakeMode(Train.DYNAMIC_BRAKE_TRACTION);		&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetFloatingLimit===&lt;br /&gt;
{{MethodHeader|public native void SetFloatingLimit(float delta, bool enable)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;delta&#039;&#039;&#039; = Tolerance allowed from the posted limit in metres per second.&lt;br /&gt;
*&#039;&#039;&#039;enable&#039;&#039;&#039; = Use true to enable messages related to floating limits, false to disable.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None	&lt;br /&gt;
;Syntax&lt;br /&gt;
 train.SetFloatingLimit(5.0,true);		&lt;br /&gt;
;Notes&lt;br /&gt;
*Sets the floating speed limit level above the sign posted limit.&lt;br /&gt;
*The floating limit is an amount of tolerance above the current speed limit. &lt;br /&gt;
*Messages for floating speed violations are not to be confused with regular speed limit messages.&lt;br /&gt;
*The floating limit is monitored by the Scenario.Monitor() thread, and may be used for point deduction when speeding. It should therefore be reserved for player trains.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetHandBrake===&lt;br /&gt;
{{MethodHeader|public void SetHandBrake(bool state)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;state&#039;&#039;&#039; = Use true to apply the handbrake to all vehicles in this train which are not Locomotives, false to release the handbrake.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None	&lt;br /&gt;
;Syntax&lt;br /&gt;
 train.SetHandBrake(true);		&lt;br /&gt;
;Notes &#039;&#039;The use of this function did not reveal any effect on the physics of trains.&#039;&#039;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetHeadlightState===&lt;br /&gt;
{{MethodHeader|public native void SetHeadlightState(bool lightsOn)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;lightsOn&#039;&#039;&#039; = True to turn the headlights on, false to turn them off.			&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None	&lt;br /&gt;
;Syntax&lt;br /&gt;
 train.SetHeadlightState(true);		&lt;br /&gt;
;Notes&lt;br /&gt;
*This method affects only the headlights on the frontmost locomotive.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetHighBeams===&lt;br /&gt;
{{MethodHeader|public void SetHighBeams(bool value)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;value&#039;&#039;&#039; = True to turn on high beams, false to turn them off.		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 train.SetHighBeams(true);		&lt;br /&gt;
;Notes&lt;br /&gt;
*See also [[Class Vehicle#SetHighBeams|Vehicle.SetHighColor()]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetLastVisitedBuildable===&lt;br /&gt;
{{MethodHeader|public void SetLastVisitedBuildable(Buildable buildable)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;buildable&#039;&#039;&#039; = Sets the last visited buildable to the given object.			&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None	&lt;br /&gt;
;Syntax&lt;br /&gt;
 train.SetLastVisitedBuildable(KingsCrossStation);		&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetManualThrottle===&lt;br /&gt;
{{MethodHeader|public native void SetManualThrottle(int notch)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;notch&#039;&#039;&#039; = Value in the range 0 .. 8 to set the throttle.			&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None	&lt;br /&gt;
;Syntax&lt;br /&gt;
 train.SetManualThrottle(5);		&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetPantogaphState===&lt;br /&gt;
{{MethodHeader|public native void SetPantographState(int state)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;state&#039;&#039;&#039; = Value in the range 0 .. 3 to set the pantographs if this train has them.			&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None	&lt;br /&gt;
;Syntax&lt;br /&gt;
 train.SetPantographState(3);		&lt;br /&gt;
;Notes&lt;br /&gt;
*Use one of these values for &#039;&#039;state&#039;&#039;:&lt;br /&gt;
**0 = Both pantographs down.&lt;br /&gt;
**1 = Front pantograph up.&lt;br /&gt;
**2 = Rear pantograph up.&lt;br /&gt;
**3 = Both pantographs up.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetReverser===&lt;br /&gt;
{{MethodHeader|public native void SetReverser(int mode)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;mode&#039;&#039;&#039; = One of the [[#Reverser Traction Modes|Reverser Traction Mode]] constants defining the required state of the train&#039;s reverser lever.			&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None	&lt;br /&gt;
;Syntax&lt;br /&gt;
 train.SetReverser(Train.TRACTION_REVERSE);		&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetTrainBrakes===&lt;br /&gt;
{{MethodHeader|public native void SetTrainBrakes(float mode)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;mode&#039;&#039;&#039; = One of the [[#Train Brake States|Train Brake State]] constants defining the required state of the train&#039;s brakes.			&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None	&lt;br /&gt;
;Syntax&lt;br /&gt;
 train.SetTrainBrakes(Train.TRAIN_BRAKE_EMERGENCY);		&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetTrainPriorityNumber===&lt;br /&gt;
{{MethodHeader|public native void SetTrainPriority Number(int priority)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;priority&#039;&#039;&#039; = Priority value in the range 1 .. 3.			&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None	&lt;br /&gt;
;Syntax&lt;br /&gt;
 train.SetTrainPriorityNumber(2);		&lt;br /&gt;
;Notes&lt;br /&gt;
*All trains and track sections can be assigned a priority value in the range of [1 - 3] with the default value being 2.&lt;br /&gt;
*The priority value is not a numerical scale of precedence, but a value for the AI driver to attempt to match.&lt;br /&gt;
*This means the driver will &#039;&#039;prefer&#039;&#039; track sections that have a priority equal to that of the train.&lt;br /&gt;
*Changing the priority of the train only takes affect when the driver restarts a new schedule.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetTrainTimetable===&lt;br /&gt;
{{MethodHeader|public void SetTrainTimetable(TrainTimetable timetable)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;timetable&#039;&#039;&#039; = Assigns the specified timetable to this train.			&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None	&lt;br /&gt;
;Syntax&lt;br /&gt;
 train.SetTrainTimetable(timetable);&lt;br /&gt;
;Notes&lt;br /&gt;
*This train must not already have a TrainTimetable assigned.&lt;br /&gt;
*To ensure that this proviso is met, use [[#ClearTrainTimetabel|ClearTrainTimetable()]] prior to calling this method.&lt;br /&gt;
*It is the responsibility of the caller to post a &amp;quot;TrainTimetable&amp;quot;,&amp;quot;Touch&amp;quot; message after calling this function.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetVelocity===&lt;br /&gt;
{{MethodHeader|public native void SetVelocity(float velocity)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;velocity&#039;&#039;&#039; = Velocity to apply to the train, in metres per second.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None	&lt;br /&gt;
;Syntax&lt;br /&gt;
 train.SetVelocity(0.0); // stops the train, subject to braking performance.		&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===ShowInConsistMenu===&lt;br /&gt;
{{MethodHeader|public native void ShowInConsistMenu(bool show)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;show&#039;&#039;&#039; = True to make this train visible to the in-game consist menu, false to hide it.			&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None	&lt;br /&gt;
;Syntax&lt;br /&gt;
 train.ShowInConsistMenu(false);		&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SoundHorn===&lt;br /&gt;
{{MethodHeader|public native void SoundHorn(void)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*None		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None	&lt;br /&gt;
;Syntax&lt;br /&gt;
 train.SoundHorn();		&lt;br /&gt;
;Notes&lt;br /&gt;
*Sounds the horn or whictle for all locomotives in this train.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===StopSchedule===&lt;br /&gt;
{{MethodHeader|public void StopSchedule(void)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*None		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None	&lt;br /&gt;
;Syntax&lt;br /&gt;
 train.StopSchedule();		&lt;br /&gt;
;Notes&lt;br /&gt;
*This method stops the Schedule this train is currently running (if any).&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===StopScheduleAndWait===&lt;br /&gt;
{{MethodHeader|public void StopSchedule(void)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*None		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None	&lt;br /&gt;
;Syntax&lt;br /&gt;
 train.StopSchedule();		&lt;br /&gt;
;Notes&lt;br /&gt;
*This method stops the Schedule this train is currently running (if any) and waits until the train&#039;s schedule actually stops before returning. &lt;br /&gt;
*If the train is not running a schedule, the method returns after broadcasting a &amp;quot;Schedule&amp;quot;,&amp;quot;Touch&amp;quot; message, in case someone is listening for schedule messages.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===StopTrainGently===&lt;br /&gt;
{{MethodHeader|public native void StopTrainGently(void)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*None		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None	&lt;br /&gt;
;Syntax&lt;br /&gt;
 train.StopTrainGently();		&lt;br /&gt;
;Notes&lt;br /&gt;
*Brings the train to a halt over a short time period.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===TakePermitOnTrack===&lt;br /&gt;
{{MethodHeader|public Permit[ ] TakePermitOnTrack(bool direction)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;direction&#039;&#039;&#039; = Direction relative to the train in which to take out permits.			&lt;br /&gt;
;Returned Value&lt;br /&gt;
*An array including any permits taken which have not yet been granted to this train. Some of these permits may not yet have been granted. 		&lt;br /&gt;
;Syntax&lt;br /&gt;
 Permit[] permits = train.TakePermitOnTrack(true);		&lt;br /&gt;
;Notes&lt;br /&gt;
*Gets permits on the current track in the given direction.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===TestTrackPermit===&lt;br /&gt;
{{MethodHeader|public native bool TestTrackPermit(Permit permit, bool innerOnly)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;permit&#039;&#039;&#039; = An existing Permit object.&lt;br /&gt;
*&#039;&#039;&#039;innerOnly&#039;&#039;&#039; = If true the method will test only the inner radius, if false the default radius of 150 metres will be used.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*True if this train is within the track controlled by &#039;&#039;permit&#039;&#039;, false otherwise. 		&lt;br /&gt;
;Syntax&lt;br /&gt;
 bool ownPermit = train.TestTrackPermit(permit1,false);		&lt;br /&gt;
;Notes&lt;br /&gt;
*The method generates an exception if the &#039;&#039;permit&#039;&#039; parameter does not refer to a track.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===ToggleScheduleWindow===&lt;br /&gt;
{{MethodHeader|public void ToggleScheduleWindow(void)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*None		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None	&lt;br /&gt;
;Syntax&lt;br /&gt;
 train.ToggleScheduleWindow();		&lt;br /&gt;
;Notes&lt;br /&gt;
*If the schedule window is already open/visible, this method will destroy it.&lt;br /&gt;
*Otherwise if the view details window is not visible, UpdateScheduleWindow() is called to create it for display.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===ToggleViewDetailsWindow===&lt;br /&gt;
{{MethodHeader|public void ToggleViewDetailsWindow(void)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*None		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None	&lt;br /&gt;
;Syntax&lt;br /&gt;
 train.ToggleViewDetailsWindow();		&lt;br /&gt;
;Notes&lt;br /&gt;
*If the ViewDetails window is already open/visible, this method will destroy it.&lt;br /&gt;
*Otherwise if the view details window is not visible, ViewDetails() is called to create it for display.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===TrackSearch===&lt;br /&gt;
{{MethodHeader|public native MapObject[ ] TrackSearch(bool direction, float distance)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;direction&#039;&#039;&#039; = Direction to search relative to the train&#039;s heading, true for forwards, false for backwards.&lt;br /&gt;
*&#039;&#039;&#039;distance&#039;&#039;&#039; = Maximum search distance in metres.			&lt;br /&gt;
;Returned Value&lt;br /&gt;
*An array of objects found along the track in the defined search direction, the array might be empty.		&lt;br /&gt;
;Syntax&lt;br /&gt;
 MapObject[] objects = train.TrackSearch(true,5000.0) // searches 5km forwards along the track.		&lt;br /&gt;
;Notes&lt;br /&gt;
*Gets all of the Trackside and SceneryWithTrack objects on a length of track that is either in front of or behind this train. &lt;br /&gt;
*Descendants of these classes are also returned.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===TracksideIsInFront===&lt;br /&gt;
{{MethodHeader|public bool TracksideIsInFront(Trackside obj, float range)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;obj&#039;&#039;&#039; = Trackside object to search for.&lt;br /&gt;
*&#039;&#039;&#039;range&#039;&#039;&#039; = Mximum search distance.			&lt;br /&gt;
;Returned Value&lt;br /&gt;
*True if the object is logically forward of this train, false otherwise.		&lt;br /&gt;
;Syntax&lt;br /&gt;
 bool found = train.TracksideIsInFront(signal1,500.0);		&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Turnaround===&lt;br /&gt;
{{MethodHeader|public native void Turnaround(void)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*None		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None	&lt;br /&gt;
;Syntax&lt;br /&gt;
 train.Turnaround();		&lt;br /&gt;
;Notes&lt;br /&gt;
*Reverses the logical direction of the train, ie changes its heading.&lt;br /&gt;
*The physical direction of the vehicles is not altered but the throttle direction is reversed.&lt;br /&gt;
*If the camera is focused on the train in tracking view when this method is called the camera&#039;s direction of view (relative to the map) will alter through 180 degrees.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===UpdateScheduleWindow===&lt;br /&gt;
{{MethodHeader|public void UpdateScheduleWindow(string vehicleName)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;vehicleName&#039;&#039;&#039; = Name of vehicle within the train.			&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None	&lt;br /&gt;
;Syntax&lt;br /&gt;
 train.UpdateScheduleWindow(&amp;quot;brake2&amp;quot;);		&lt;br /&gt;
;Notes&lt;br /&gt;
*Updates the schedule window from the given vehicle.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===UpdateViewDetails===&lt;br /&gt;
{{MethodHeader|public void UpdateViewDetails(Vehicle vehicle)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;vehicle&#039;&#039;&#039; = Reference to a vehicle within the train.			&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None	&lt;br /&gt;
;Syntax&lt;br /&gt;
 train.UpdateViewDetails(vehicle);&lt;br /&gt;
;Notes&lt;br /&gt;
*Called by Vehicle.UpdateViewDetails() when a vehicle&#039;s load has changed so that the train&#039;s detail window can be amended.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===UpdateViewDetailsLocomotive===&lt;br /&gt;
{{MethodHeader|public void UpdateViewDetailsLocomotive(void)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*None&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None	&lt;br /&gt;
;Syntax&lt;br /&gt;
 train.UpdateViewDetailsLocomotive(vehicle);&lt;br /&gt;
;Notes&lt;br /&gt;
*Called by Locomotive.UpdateViewDetails() when any of the Locomotive&#039;s operating parameters have changed so that the train&#039;s detail window can be amended.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===ViewDetails===&lt;br /&gt;
{{MethodHeader|public void ViewDetails(Vehicle vehicle)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;vehicle&#039;&#039;&#039; = Reference to a vehicle within the train.			&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None	&lt;br /&gt;
;Syntax&lt;br /&gt;
 train.ViewDetails(vehicle);		&lt;br /&gt;
;Notes&lt;br /&gt;
*This method is called by Vehicle.ViewDetails() when the user has requested to view the details of the consist.&lt;br /&gt;
*It will create a Browser window listing information about the train including who the driver character is and the loads of all vehicles.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===WasRunScheduleSuccessful===&lt;br /&gt;
{{MethodHeader|public bool WasRunScheduleSuccessful(void)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*None		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*True if the most recently run schedule was successfully, false otherwise. 		&lt;br /&gt;
;Syntax&lt;br /&gt;
 train.WasRunScheduleSuccessful();		&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Code Examples==&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Related Methods==&lt;br /&gt;
[[Class TrainUtil#AreInTrain|TrainUtil.AreInTrain()]]&amp;lt;br&amp;gt;&lt;br /&gt;
[[Class TrainUtil#CreateTrainFromSoup|TrainUtil.CreateTrainFromSoup()]]&amp;lt;br&amp;gt;&lt;br /&gt;
[[Class TrainUtil#IsInTrain|TrainUtil.IsInTrain()]]&amp;lt;br&amp;gt;&lt;br /&gt;
[[Class World#CreateTrain|World.CreateTrain()]]&amp;lt;br&amp;gt;&lt;br /&gt;
[[Class World#DeleteTrain|World.DeleteTrain()]]&amp;lt;br&amp;gt;&lt;br /&gt;
[[Class World#GetTrainList|World.GetTrainList()]]&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Categories==&lt;br /&gt;
[[Category:Script Class]]&lt;/div&gt;</summary>
		<author><name>Ciceronmt</name></author>
	</entry>
	<entry>
		<id>https://wiki.trainzsimulator.com/index.php?title=%22Soundscript%22_container&amp;diff=21187</id>
		<title>&quot;Soundscript&quot; container</title>
		<link rel="alternate" type="text/html" href="https://wiki.trainzsimulator.com/index.php?title=%22Soundscript%22_container&amp;diff=21187"/>
		<updated>2019-09-07T06:21:38Z</updated>

		<summary type="html">&lt;p&gt;Ciceronmt: /* sound-asset */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{ORP-top}}&lt;br /&gt;
A container type tag for defining asset sounds.&lt;br /&gt;
&lt;br /&gt;
==Supported Tags==&lt;br /&gt;
Each soundscript subcontainer supports the following tags. Each tag is shown here with its default value.&lt;br /&gt;
&lt;br /&gt;
  repeat-delay  0,0&lt;br /&gt;
  distance      50,150&lt;br /&gt;
  ambient       0&lt;br /&gt;
  attachment    &amp;quot;&amp;quot;&lt;br /&gt;
  nostartdelay  0&lt;br /&gt;
  priority      1&lt;br /&gt;
  trigger       &amp;quot;&amp;quot;&lt;br /&gt;
  volume        1&lt;br /&gt;
  value-range   0,0&lt;br /&gt;
  sound-asset&lt;br /&gt;
  sound&lt;br /&gt;
  {&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
====ambient====&lt;br /&gt;
:Type: Boolean&lt;br /&gt;
:Default: 0&lt;br /&gt;
:Compulsory: No&lt;br /&gt;
:Desc: If true this is an &#039;ambient&#039; sound, ambient sounds are played in 2D and do not make use of 3D positioning in the world other than to affect volume. Unlike positional sounds, ambient sounds may be stereo.&lt;br /&gt;
&lt;br /&gt;
====attachment====&lt;br /&gt;
:Type: Attachment point&lt;br /&gt;
:Default: &amp;quot;&amp;quot;&lt;br /&gt;
:Compulsory: No&lt;br /&gt;
:Desc: Point to attach the sound source to. Attachment points are specified in the mesh file during creation.&lt;br /&gt;
&lt;br /&gt;
====distance====&lt;br /&gt;
:Type: Decimal Pair&lt;br /&gt;
:Default: 50,150&lt;br /&gt;
:Compulsory: No&lt;br /&gt;
:Desc: The minimum distance (first value, in meters) defines the radius within which the sound remains at 100% volume. Beyond that distance, the sound volume will begin to decay naturally. The maximum distance (second value, in meters) defines a radius beyond which the game need no longer play the sound. This does not mean that the sound will fade to zero by the maximum distance, but rather that the sound may cut off abruptly beyond that point. It is up to the content creator to choose an appropriate maximum distance - smaller is better for performance, but overly small values may result in the sound audibly cutting off. Many Trainz editions ignore the configured maximum distance value and instead perform their own optimized calculation of the appropriate value.&lt;br /&gt;
&lt;br /&gt;
====nostartdelay====&lt;br /&gt;
:Type: Boolean&lt;br /&gt;
:Default: 0&lt;br /&gt;
:Compulsory: No&lt;br /&gt;
:Desc: If added and true this tag specifies that the sound will play immediately once triggered. By default sounds have a random start delay between 0 &amp;amp; 4 seconds. Start delay should be left active in most cases, as turning it off may cause significant audio artifacts when several identical sounds are in proximity.&lt;br /&gt;
&lt;br /&gt;
====priority====&lt;br /&gt;
:Type: Integer&lt;br /&gt;
:Default: 1&lt;br /&gt;
:Compulsory: No&lt;br /&gt;
:Desc: Sets the priority of the sound, if their are not enough sound channels available higher priority sounds will be played first. Defaults to 1, can be negative.&lt;br /&gt;
&lt;br /&gt;
====repeat-delay====&lt;br /&gt;
:Type: Decimal Pair&lt;br /&gt;
:Default: 0,0&lt;br /&gt;
:Compulsory: No&lt;br /&gt;
:Desc: Time range (in seconds) to delay, after the sound finishes playing, before playing the sound again. To set a constant delay either set both these values the same or only provide one of them, otherwise a random value between them will be chosen. When used with a trigger event (see the &#039;trigger&#039; tag), a positive value indicates that the sound should not repeat, but should wait until triggered again.&lt;br /&gt;
&lt;br /&gt;
====sound====&lt;br /&gt;
:Type: Container&lt;br /&gt;
:Default: {}&lt;br /&gt;
:Compulsory: Yes&lt;br /&gt;
:Desc: Contains list of the sound files to play. If the list has more than one entry then one file will be picked at random from the list.  The value of each tag in this container is the filename of a WAV sound file.  Filenames are relative to the base directory of the asset, i.e. relative to the location of the config file.&lt;br /&gt;
&lt;br /&gt;
:Valid WAV files are:&lt;br /&gt;
:* Uncompressed.&lt;br /&gt;
:* 8 or 16 bit&lt;br /&gt;
:* Mono, Stereo or Surround&lt;br /&gt;
&lt;br /&gt;
:Sampling rate can be 22kHz (22,050Hz) or 44kHz (44,100Hz).  The higher sampling rate doubles the size of the file for no significant improvement in quality, and is not recommended.  For some purposes there are additional requirements - for instance directional sounds must be mono.&lt;br /&gt;
&lt;br /&gt;
====sound-asset====&lt;br /&gt;
:Type: KUID&lt;br /&gt;
:Compulsory: No&lt;br /&gt;
:Desc: The asset to source the sound files from. Allows the creation of &amp;quot;sound library&amp;quot; assets, so that sound files can be shared between multiple other assets. Defaults to the current asset. &#039;&#039;Unfortunately, it does not exist and is not supported.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
====trigger====&lt;br /&gt;
:Type: String&lt;br /&gt;
:Default: &amp;quot;&amp;quot;&lt;br /&gt;
:Compulsory: No&lt;br /&gt;
:Desc: The &#039;trigger&#039; tag gives your sound a name that can allow it to be played from [[Scripting|TrainzScript]] (see: Class MapObject), animations and certain predefined events. (At least one of these &amp;quot;predefined events&amp;quot; is to use the word &amp;quot;toggle&amp;quot; when including a soundscript container in the config.txt of a &amp;quot;MOjunction&amp;quot;.  This will make the sound fire each time the turnout is switched)&lt;br /&gt;
&lt;br /&gt;
====value-range====&lt;br /&gt;
:Type: Float pair&lt;br /&gt;
:Default: 0,0 (off)&lt;br /&gt;
:Compulsory: No&lt;br /&gt;
:Desc: 2 numbers, where the numbers are not the same, which set the start and end times for the sound to play. Midnight is 0.5, midday = 0.0 or 1.0. (TBD.  This is a bit vague.)&lt;br /&gt;
&lt;br /&gt;
====volume====&lt;br /&gt;
:Type: Decimal&lt;br /&gt;
:Default: 1&lt;br /&gt;
:Compulsory: No&lt;br /&gt;
:Desc: Specifies the volume gain of the sound. Defaults to 1 (100%).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Example Config.txt==&lt;br /&gt;
Sample [[config.txt file]] for a map asset that has a different day and night background sounds:&lt;br /&gt;
&lt;br /&gt;
  kind map&lt;br /&gt;
  kuid &amp;lt;KUID:0:0&amp;gt;&lt;br /&gt;
  soundscript&lt;br /&gt;
  {&lt;br /&gt;
    morning&lt;br /&gt;
    {&lt;br /&gt;
      ambient 1&lt;br /&gt;
      value-range 1, 0.1&lt;br /&gt;
      volume 0.3&lt;br /&gt;
      sound&lt;br /&gt;
      {&lt;br /&gt;
        0 &amp;quot;ctry_day_1.wav&amp;quot;&lt;br /&gt;
        1 &amp;quot;ctry_day_2.wav&amp;quot;&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
    night&lt;br /&gt;
    {&lt;br /&gt;
      ambient 1&lt;br /&gt;
      value-range 0, 0.9&lt;br /&gt;
      volume 0.3&lt;br /&gt;
      sound&lt;br /&gt;
      {&lt;br /&gt;
        0 &amp;quot;night_loop.wav&amp;quot;&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
==Categories==&lt;br /&gt;
[[Category:Config Container|Soundscript container]]&lt;br /&gt;
{{ORP-bot|Soundscript container}}&lt;/div&gt;</summary>
		<author><name>Ciceronmt</name></author>
	</entry>
	<entry>
		<id>https://wiki.trainzsimulator.com/index.php?title=%22Soundscript%22_container&amp;diff=21186</id>
		<title>&quot;Soundscript&quot; container</title>
		<link rel="alternate" type="text/html" href="https://wiki.trainzsimulator.com/index.php?title=%22Soundscript%22_container&amp;diff=21186"/>
		<updated>2019-09-07T06:20:51Z</updated>

		<summary type="html">&lt;p&gt;Ciceronmt: /* sound-asset */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{ORP-top}}&lt;br /&gt;
A container type tag for defining asset sounds.&lt;br /&gt;
&lt;br /&gt;
==Supported Tags==&lt;br /&gt;
Each soundscript subcontainer supports the following tags. Each tag is shown here with its default value.&lt;br /&gt;
&lt;br /&gt;
  repeat-delay  0,0&lt;br /&gt;
  distance      50,150&lt;br /&gt;
  ambient       0&lt;br /&gt;
  attachment    &amp;quot;&amp;quot;&lt;br /&gt;
  nostartdelay  0&lt;br /&gt;
  priority      1&lt;br /&gt;
  trigger       &amp;quot;&amp;quot;&lt;br /&gt;
  volume        1&lt;br /&gt;
  value-range   0,0&lt;br /&gt;
  sound-asset&lt;br /&gt;
  sound&lt;br /&gt;
  {&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
====ambient====&lt;br /&gt;
:Type: Boolean&lt;br /&gt;
:Default: 0&lt;br /&gt;
:Compulsory: No&lt;br /&gt;
:Desc: If true this is an &#039;ambient&#039; sound, ambient sounds are played in 2D and do not make use of 3D positioning in the world other than to affect volume. Unlike positional sounds, ambient sounds may be stereo.&lt;br /&gt;
&lt;br /&gt;
====attachment====&lt;br /&gt;
:Type: Attachment point&lt;br /&gt;
:Default: &amp;quot;&amp;quot;&lt;br /&gt;
:Compulsory: No&lt;br /&gt;
:Desc: Point to attach the sound source to. Attachment points are specified in the mesh file during creation.&lt;br /&gt;
&lt;br /&gt;
====distance====&lt;br /&gt;
:Type: Decimal Pair&lt;br /&gt;
:Default: 50,150&lt;br /&gt;
:Compulsory: No&lt;br /&gt;
:Desc: The minimum distance (first value, in meters) defines the radius within which the sound remains at 100% volume. Beyond that distance, the sound volume will begin to decay naturally. The maximum distance (second value, in meters) defines a radius beyond which the game need no longer play the sound. This does not mean that the sound will fade to zero by the maximum distance, but rather that the sound may cut off abruptly beyond that point. It is up to the content creator to choose an appropriate maximum distance - smaller is better for performance, but overly small values may result in the sound audibly cutting off. Many Trainz editions ignore the configured maximum distance value and instead perform their own optimized calculation of the appropriate value.&lt;br /&gt;
&lt;br /&gt;
====nostartdelay====&lt;br /&gt;
:Type: Boolean&lt;br /&gt;
:Default: 0&lt;br /&gt;
:Compulsory: No&lt;br /&gt;
:Desc: If added and true this tag specifies that the sound will play immediately once triggered. By default sounds have a random start delay between 0 &amp;amp; 4 seconds. Start delay should be left active in most cases, as turning it off may cause significant audio artifacts when several identical sounds are in proximity.&lt;br /&gt;
&lt;br /&gt;
====priority====&lt;br /&gt;
:Type: Integer&lt;br /&gt;
:Default: 1&lt;br /&gt;
:Compulsory: No&lt;br /&gt;
:Desc: Sets the priority of the sound, if their are not enough sound channels available higher priority sounds will be played first. Defaults to 1, can be negative.&lt;br /&gt;
&lt;br /&gt;
====repeat-delay====&lt;br /&gt;
:Type: Decimal Pair&lt;br /&gt;
:Default: 0,0&lt;br /&gt;
:Compulsory: No&lt;br /&gt;
:Desc: Time range (in seconds) to delay, after the sound finishes playing, before playing the sound again. To set a constant delay either set both these values the same or only provide one of them, otherwise a random value between them will be chosen. When used with a trigger event (see the &#039;trigger&#039; tag), a positive value indicates that the sound should not repeat, but should wait until triggered again.&lt;br /&gt;
&lt;br /&gt;
====sound====&lt;br /&gt;
:Type: Container&lt;br /&gt;
:Default: {}&lt;br /&gt;
:Compulsory: Yes&lt;br /&gt;
:Desc: Contains list of the sound files to play. If the list has more than one entry then one file will be picked at random from the list.  The value of each tag in this container is the filename of a WAV sound file.  Filenames are relative to the base directory of the asset, i.e. relative to the location of the config file.&lt;br /&gt;
&lt;br /&gt;
:Valid WAV files are:&lt;br /&gt;
:* Uncompressed.&lt;br /&gt;
:* 8 or 16 bit&lt;br /&gt;
:* Mono, Stereo or Surround&lt;br /&gt;
&lt;br /&gt;
:Sampling rate can be 22kHz (22,050Hz) or 44kHz (44,100Hz).  The higher sampling rate doubles the size of the file for no significant improvement in quality, and is not recommended.  For some purposes there are additional requirements - for instance directional sounds must be mono.&lt;br /&gt;
&lt;br /&gt;
====sound-asset====&lt;br /&gt;
:Type: KUID&lt;br /&gt;
:Compulsory: No&lt;br /&gt;
:Desc: The asset to source the sound files from. Allows the creation of &amp;quot;sound library&amp;quot; assets, so that sound files can be shared between multiple other assets. Defaults to the current asset.&lt;br /&gt;
&#039;&#039;&#039;Unfortunately, it does not exist and is not supported.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
====trigger====&lt;br /&gt;
:Type: String&lt;br /&gt;
:Default: &amp;quot;&amp;quot;&lt;br /&gt;
:Compulsory: No&lt;br /&gt;
:Desc: The &#039;trigger&#039; tag gives your sound a name that can allow it to be played from [[Scripting|TrainzScript]] (see: Class MapObject), animations and certain predefined events. (At least one of these &amp;quot;predefined events&amp;quot; is to use the word &amp;quot;toggle&amp;quot; when including a soundscript container in the config.txt of a &amp;quot;MOjunction&amp;quot;.  This will make the sound fire each time the turnout is switched)&lt;br /&gt;
&lt;br /&gt;
====value-range====&lt;br /&gt;
:Type: Float pair&lt;br /&gt;
:Default: 0,0 (off)&lt;br /&gt;
:Compulsory: No&lt;br /&gt;
:Desc: 2 numbers, where the numbers are not the same, which set the start and end times for the sound to play. Midnight is 0.5, midday = 0.0 or 1.0. (TBD.  This is a bit vague.)&lt;br /&gt;
&lt;br /&gt;
====volume====&lt;br /&gt;
:Type: Decimal&lt;br /&gt;
:Default: 1&lt;br /&gt;
:Compulsory: No&lt;br /&gt;
:Desc: Specifies the volume gain of the sound. Defaults to 1 (100%).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Example Config.txt==&lt;br /&gt;
Sample [[config.txt file]] for a map asset that has a different day and night background sounds:&lt;br /&gt;
&lt;br /&gt;
  kind map&lt;br /&gt;
  kuid &amp;lt;KUID:0:0&amp;gt;&lt;br /&gt;
  soundscript&lt;br /&gt;
  {&lt;br /&gt;
    morning&lt;br /&gt;
    {&lt;br /&gt;
      ambient 1&lt;br /&gt;
      value-range 1, 0.1&lt;br /&gt;
      volume 0.3&lt;br /&gt;
      sound&lt;br /&gt;
      {&lt;br /&gt;
        0 &amp;quot;ctry_day_1.wav&amp;quot;&lt;br /&gt;
        1 &amp;quot;ctry_day_2.wav&amp;quot;&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
    night&lt;br /&gt;
    {&lt;br /&gt;
      ambient 1&lt;br /&gt;
      value-range 0, 0.9&lt;br /&gt;
      volume 0.3&lt;br /&gt;
      sound&lt;br /&gt;
      {&lt;br /&gt;
        0 &amp;quot;night_loop.wav&amp;quot;&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
==Categories==&lt;br /&gt;
[[Category:Config Container|Soundscript container]]&lt;br /&gt;
{{ORP-bot|Soundscript container}}&lt;/div&gt;</summary>
		<author><name>Ciceronmt</name></author>
	</entry>
	<entry>
		<id>https://wiki.trainzsimulator.com/index.php?title=Texture-Replacement_Effect&amp;diff=21159</id>
		<title>Texture-Replacement Effect</title>
		<link rel="alternate" type="text/html" href="https://wiki.trainzsimulator.com/index.php?title=Texture-Replacement_Effect&amp;diff=21159"/>
		<updated>2019-09-05T18:51:59Z</updated>

		<summary type="html">&lt;p&gt;Ciceronmt: /* Supported Tags */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The Texture-Replacement effect kind is a named effect container within a [[&amp;quot;mesh-table&amp;quot; Container]]. It can be used within the load subcontainer to provide alternative textures for bulk loads in wagons.  The following tags are supported: &lt;br /&gt;
&lt;br /&gt;
==Supported Tags==&lt;br /&gt;
Each texture-replacement subcontainer supports the following tags. &lt;br /&gt;
 kind &amp;quot;texture-replacement&amp;quot;&lt;br /&gt;
 texture &amp;quot;&amp;lt;texture name&amp;gt;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
The name of the texture-replacement effects subcontainer is selected by the content developer.  It may be used as a reference in a script file to identify a specific effect.&lt;br /&gt;
&lt;br /&gt;
===kind===&lt;br /&gt;
String. Required. No default.&lt;br /&gt;
&amp;quot;texture-replacement&amp;quot;&lt;br /&gt;
&lt;br /&gt;
===texture===&lt;br /&gt;
String. Required. No default.&lt;br /&gt;
The name of the texture that is to be replaced. This is the name of the texture file as used in the asset&#039;s config.txt, without the .txt extension.  For instance, if the texture to be replaced is identified in the &#039;load-map.texture.txt&#039; file, then the texture tag in the effect container is &amp;quot;load-map.texture&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
A texture-replacement effect is often used when the texture of an asset should be changed during game play.  For instance, when the load texture is to be replaced then this texture will be replaced by the texture contained in the product referenced in the current active product queue, as defined by the allowed-categories subcontainer in the queue.  For instance, if a coal hopper loads at an industry asset that produces a bulk-load other than its default load (eg woodchips at a lumbermill), then the woodchip product texture will replace the default coal product texture.&lt;br /&gt;
&lt;br /&gt;
A texture-replacement effect is also used when an asset is reskinned using an alias.  In this case the texture replacement occurs when the asset is created - the texture of the aliased asset is replaced with a texture from the reskin asset.&lt;br /&gt;
&lt;br /&gt;
==Example texture-replace subcontainer==&lt;br /&gt;
    effects {&lt;br /&gt;
      product-texture {&lt;br /&gt;
        kind      &amp;quot;texture-replacement&amp;quot;&lt;br /&gt;
        texture	  &amp;quot;load_map.texture&amp;quot;&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
==Performance Considerations==&lt;br /&gt;
&lt;br /&gt;
Texture-replacement can be used by content developers to achieve a range of interesting and novel scripted effects, though there are some considerations that should be noted. Whether performance will be adversely affected is dependant upon numerous variables. When it comes to predicting the performance impact of a particular texture-replacement implementation, the only reliable answer is: test it and see.&lt;br /&gt;
&lt;br /&gt;
===potential issues===&lt;br /&gt;
  &lt;br /&gt;
* it&#039;s likely to load both the original and the replacement textures, so you may pay twice the loading cost and twice the RAM cost.&lt;br /&gt;
&lt;br /&gt;
* in older versions of the game, you might end up with the game freezing while it loads in the replacement texture.&lt;br /&gt;
&lt;br /&gt;
* in newer versions of the game, it shouldn&#039;t freeze but it&#039;s feasible that you might end up with the old textures visible on screen until the new textures load.&lt;br /&gt;
&lt;br /&gt;
* it likely negates any texture preloading, so you&#039;re more likely to end up with low-res textures visible to the user.&lt;br /&gt;
&lt;br /&gt;
* it likely disables a bunch of shared-material optimisations, so if you have multiple copies of the same object around then you&#039;ll now be paying one cost per instance rather than one cost per the whole set.&lt;br /&gt;
&lt;br /&gt;
In newer versions some of that can be mitigated:&lt;br /&gt;
&lt;br /&gt;
* as long as all of the textures look fairly similar, swapping from one to another once already visible isn&#039;t a major concern as long as it happens at lower LODs, which it generally will during actual game play.&lt;br /&gt;
&lt;br /&gt;
* texture streaming makes it more likely that the double-texture costs will be minimal. You can probably further assist this by using smaller placeholder textures to start with i.e. the textures loaded as part of the mesh are kept to 32x32 or something small like that.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Config Container]]&lt;/div&gt;</summary>
		<author><name>Ciceronmt</name></author>
	</entry>
	<entry>
		<id>https://wiki.trainzsimulator.com/index.php?title=Texture-Replacement_Effect&amp;diff=21158</id>
		<title>Texture-Replacement Effect</title>
		<link rel="alternate" type="text/html" href="https://wiki.trainzsimulator.com/index.php?title=Texture-Replacement_Effect&amp;diff=21158"/>
		<updated>2019-09-05T18:51:26Z</updated>

		<summary type="html">&lt;p&gt;Ciceronmt: /* name */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The Texture-Replacement effect kind is a named effect container within a [[&amp;quot;mesh-table&amp;quot; Container]]. It can be used within the load subcontainer to provide alternative textures for bulk loads in wagons.  The following tags are supported: &lt;br /&gt;
&lt;br /&gt;
==Supported Tags==&lt;br /&gt;
Each texture-replacement subcontainer supports the following tags. &lt;br /&gt;
 kind &amp;quot;texture-replacement&amp;quot;&lt;br /&gt;
 name &amp;quot;&amp;quot;&lt;br /&gt;
 texture &amp;quot;&amp;lt;texture name&amp;gt;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
The name of the texture-replacement effects subcontainer is selected by the content developer.  It may be used as a reference in a script file to identify a specific effect.&lt;br /&gt;
&lt;br /&gt;
===kind===&lt;br /&gt;
String. Required. No default.&lt;br /&gt;
&amp;quot;texture-replacement&amp;quot;&lt;br /&gt;
&lt;br /&gt;
===texture===&lt;br /&gt;
String. Required. No default.&lt;br /&gt;
The name of the texture that is to be replaced. This is the name of the texture file as used in the asset&#039;s config.txt, without the .txt extension.  For instance, if the texture to be replaced is identified in the &#039;load-map.texture.txt&#039; file, then the texture tag in the effect container is &amp;quot;load-map.texture&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
A texture-replacement effect is often used when the texture of an asset should be changed during game play.  For instance, when the load texture is to be replaced then this texture will be replaced by the texture contained in the product referenced in the current active product queue, as defined by the allowed-categories subcontainer in the queue.  For instance, if a coal hopper loads at an industry asset that produces a bulk-load other than its default load (eg woodchips at a lumbermill), then the woodchip product texture will replace the default coal product texture.&lt;br /&gt;
&lt;br /&gt;
A texture-replacement effect is also used when an asset is reskinned using an alias.  In this case the texture replacement occurs when the asset is created - the texture of the aliased asset is replaced with a texture from the reskin asset. &lt;br /&gt;
&lt;br /&gt;
==Example texture-replace subcontainer==&lt;br /&gt;
    effects {&lt;br /&gt;
      product-texture {&lt;br /&gt;
        kind      &amp;quot;texture-replacement&amp;quot;&lt;br /&gt;
        texture	  &amp;quot;load_map.texture&amp;quot;&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
==Performance Considerations==&lt;br /&gt;
&lt;br /&gt;
Texture-replacement can be used by content developers to achieve a range of interesting and novel scripted effects, though there are some considerations that should be noted. Whether performance will be adversely affected is dependant upon numerous variables. When it comes to predicting the performance impact of a particular texture-replacement implementation, the only reliable answer is: test it and see.&lt;br /&gt;
&lt;br /&gt;
===potential issues===&lt;br /&gt;
  &lt;br /&gt;
* it&#039;s likely to load both the original and the replacement textures, so you may pay twice the loading cost and twice the RAM cost.&lt;br /&gt;
&lt;br /&gt;
* in older versions of the game, you might end up with the game freezing while it loads in the replacement texture.&lt;br /&gt;
&lt;br /&gt;
* in newer versions of the game, it shouldn&#039;t freeze but it&#039;s feasible that you might end up with the old textures visible on screen until the new textures load.&lt;br /&gt;
&lt;br /&gt;
* it likely negates any texture preloading, so you&#039;re more likely to end up with low-res textures visible to the user.&lt;br /&gt;
&lt;br /&gt;
* it likely disables a bunch of shared-material optimisations, so if you have multiple copies of the same object around then you&#039;ll now be paying one cost per instance rather than one cost per the whole set.&lt;br /&gt;
&lt;br /&gt;
In newer versions some of that can be mitigated:&lt;br /&gt;
&lt;br /&gt;
* as long as all of the textures look fairly similar, swapping from one to another once already visible isn&#039;t a major concern as long as it happens at lower LODs, which it generally will during actual game play.&lt;br /&gt;
&lt;br /&gt;
* texture streaming makes it more likely that the double-texture costs will be minimal. You can probably further assist this by using smaller placeholder textures to start with i.e. the textures loaded as part of the mesh are kept to 32x32 or something small like that.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Config Container]]&lt;/div&gt;</summary>
		<author><name>Ciceronmt</name></author>
	</entry>
	<entry>
		<id>https://wiki.trainzsimulator.com/index.php?title=Class_MeshObject&amp;diff=21157</id>
		<title>Class MeshObject</title>
		<link rel="alternate" type="text/html" href="https://wiki.trainzsimulator.com/index.php?title=Class_MeshObject&amp;diff=21157"/>
		<updated>2019-09-05T18:50:34Z</updated>

		<summary type="html">&lt;p&gt;Ciceronmt: /* SetFXTextureReplacement */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;*[[TrainzScript Language Reference|API Hierarchy]]&lt;br /&gt;
**[[Class GSObject|GSObject]]&lt;br /&gt;
***[[Class GameObject|GameObject]]&lt;br /&gt;
****[[Class PropertyObject|PropertyObject]]&lt;br /&gt;
****[[Class TrainzGameObject|TrainzGameObject]]&lt;br /&gt;
*****MeshObject&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is a base class for [[class Asset|Asset]] based game objects that have meshes, effects, animations and particles. Interface methods to deal with these are provided so things like showing or hiding a mesh, attaching a mesh to an attachment point or controlling an animation can be done from a script.&lt;br /&gt;
&lt;br /&gt;
For animation Trainz interpolates between key frames. This means an intermediate animation frame is calculated dynamically to be-in-synch with the game&#039;s framerate.&lt;br /&gt;
&lt;br /&gt;
Trainzscript is an interpreted scripting language intended to be used to monitor and react to events in the Trainz world, not to perform sophisticated real-time animation tasks. Using a script to start an animation in response to an event in a thread is reasonable. However trying to control animation tightly down to short intervals is likely to provide unsatisfactory results and to adversely affect overall performance of the game.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==MeshObject Messages==&lt;br /&gt;
Messages related to MeshObject assets:&lt;br /&gt;
*[[Animation-Event Message]]&lt;br /&gt;
*[[pfx Message]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==GetFXAttachment==&lt;br /&gt;
{{MethodHeader|public native MeshObject GetFXAttachment(string effect)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;effect&#039;&#039;&#039; = name of the mesh effect to query. &lt;br /&gt;
;Returned Value&lt;br /&gt;
*Returns a reference to the MeshObject currently attached to the named effect.&lt;br /&gt;
;Syntax&lt;br /&gt;
 MeshObject attachment = GetFXAttachment(&amp;quot;coupler&amp;quot;);&lt;br /&gt;
;Notes&lt;br /&gt;
*The method returns null if the effect is unoccupied.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==GetMeshAnimationFrame==&lt;br /&gt;
{{MethodHeader|public native float GetMeshAnimationFrame(string mesh)&#039;&#039;&#039;}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;mesh&#039;&#039;&#039; = the name of the mesh or submesh container which includes the animation file to be queried.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*Current fame of the animation file within the specified mesh container.&lt;br /&gt;
;Syntax&lt;br /&gt;
 float height = GetMeshAnimationFrame(&amp;quot;zPosition&amp;quot;)&lt;br /&gt;
;Notes&lt;br /&gt;
*Note that the returned value is likely to be an interpreted floating point value.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==GetMeshAnimationFrameCount==&lt;br /&gt;
{{MethodHeader|public native float GetMeshAnimationFrameCount(string mesh)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;mesh&#039;&#039;&#039; = the name of the mesh or submesh container which includes the animation file to be queried.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*The number of frames in the specified animation.&lt;br /&gt;
;Syntax&lt;br /&gt;
 float positions = GetMeshAnimationFrameCount(&amp;quot;lever&amp;quot;);&lt;br /&gt;
;Notes&lt;br /&gt;
*Note that the returned value is a float rather than an integer.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==GetTextureSelfIlluminationState==&lt;br /&gt;
{{MethodHeader|public native bool GetTextureSelfIlluminationState(string texture)&#039;&#039;&#039;}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;texture&#039;&#039;&#039; = root name of &#039;&#039;*.texture.text&#039;&#039; file to query.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*Returns true if the specified texture has self illumination set.&lt;br /&gt;
;Syntax&lt;br /&gt;
 bool isEmissive = GetTextureSelfIlluminationState(&amp;quot;texture&amp;quot;);&lt;br /&gt;
;Notes&lt;br /&gt;
*Compatibility warning: Use of this function is not recommended, it may become non-functional in future Trainz versions.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==HasMesh==&lt;br /&gt;
{{MethodHeader|public native bool HasMesh(string mesh)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;mesh&#039;&#039;&#039; = the name of the mesh or submesh to be queried.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 if (HasMesh(&amp;quot;ventilation&amp;quot;)) StartMeshAnimationLoop(&amp;quot;fans&amp;quot;);&lt;br /&gt;
;Notes&lt;br /&gt;
*&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==SetFXAnimationState==&lt;br /&gt;
{{MethodHeader|public native void SetFXAnimationState(string effect, bool state)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;effect&#039;&#039;&#039; = name of attached-animation effect containing the animation to play.&lt;br /&gt;
*&#039;&#039;&#039;state&#039;&#039;&#039; = true to start the animation loop, false to stop.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 if (gateClosed) SetFXAnimationState(&amp;quot;gate&amp;quot;,false);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==SetFXAttachment==&lt;br /&gt;
{{MethodHeader|public native MeshObject SetFXAttachment(string effect, Asset asset)&#039;&#039;&#039;}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;effect&#039;&#039;&#039; = effect containing the attachment to be manipulated.&lt;br /&gt;
*&#039;&#039;&#039;asset&#039;&#039;&#039; = mesh asset to attach to the effect. If asset is null any existing asset will be removed and nothing will be added.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*Returns a reference to the MeshObject which has been attached to the named effect. If the mesh asset isn&#039;t &amp;quot;kind mesh&amp;quot;, returns null.&lt;br /&gt;
;Syntax&lt;br /&gt;
 MeshObject lamp = SetFXAttachment(&amp;quot;lamp0&amp;quot;,redlamp);&lt;br /&gt;
;Notes&lt;br /&gt;
*Returns null if the effect is unoccupied when the method returns.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==SetFXCoronaTexture==&lt;br /&gt;
{{MethodHeader|public native void SetFXCoronaTexture(string effect, Asset texture)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;effect&#039;&#039;&#039; = effect containg the corona to be manipulated.&lt;br /&gt;
*&#039;&#039;&#039;asset&#039;&#039;&#039; = corona texture asset to attach to the effect. If asset is null the corona will be turned off.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetFXCoronaTexture(&amp;quot;stopLight&amp;quot;,redCorona);&lt;br /&gt;
;Notes&lt;br /&gt;
*Other corona parameters such as frequency and size are defined in &#039;&#039;config.txt&#039;&#039; and cannot be altered by script code.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==SetFXNameText==&lt;br /&gt;
{{MethodHeader|public native void SetFXNameText(string effect, string text)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;effect&#039;&#039;&#039; = effect containg the name effect to be changed.&lt;br /&gt;
*&#039;&#039;&#039;text&#039;&#039;&#039; = new string value.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetFXNameText(&amp;quot;home&amp;quot;,&amp;quot;Shangri-La&amp;quot;);&lt;br /&gt;
;Notes&lt;br /&gt;
*Method will not accept an empty string in the &#039;&#039;text&#039;&#039; parameter.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==SetFXTextureReplacement==&lt;br /&gt;
{{MethodHeader|public native void SetFXTextureReplacement(string effect, Asset textureGroup, int index)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;effect&#039;&#039;&#039; = texture-replacement effect to be changed.&lt;br /&gt;
*&#039;&#039;&#039;textureGroup&#039;&#039;&#039; = reference to texture group asset which is the source of the texture to be applied.&lt;br /&gt;
*&#039;&#039;&#039;index&#039;&#039;&#039; = index into &#039;&#039;textures&#039;&#039; table of texture-group indicating which texture to apply.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetFXTextureReplacement(&amp;quot;load&amp;quot;,loadTextures,5);   // applies texture 5 from texture-group&lt;br /&gt;
 SetFXTextureReplacement(&amp;quot;load&amp;quot;,null,0);             // clears the effect, reinstating the texture defined in the asset.&lt;br /&gt;
;Notes&lt;br /&gt;
*Use null in the textureGroup parameter to turn texture replacement off.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==SetMesh==&lt;br /&gt;
{{MethodHeader|public native void SetMesh(string mesh, float fadeDuration)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;mesh&#039;&#039;&#039; = the name of the mesh or submesh to be displayed.&lt;br /&gt;
*&#039;&#039;&#039;fadeDuration&#039;&#039;&#039; = period in seconds during which mesh visibility will be faded in or out.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetMesh(&amp;quot;default&amp;quot;,0.5);&lt;br /&gt;
;Notes&lt;br /&gt;
*Shows the specified mesh and hides all other meshes.&lt;br /&gt;
*If fadeDuration is 0.0 the mesh transition will be instantaneous.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==SetMeshAnimationFrame==&lt;br /&gt;
{{MethodHeader|public native void SetMeshAnimationFrame(string mesh, float frame)&amp;lt;br&amp;gt;&lt;br /&gt;
public native void SetMeshAnimationFrame(string mesh, float frame, float period)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;mesh&#039;&#039;&#039; = the name of the mesh or submesh container which includes the animation file to be manipulated.&lt;br /&gt;
*&#039;&#039;&#039;frame&#039;&#039;&#039; = the frame position to which the animation is to be moved, this may be an interpolated value.&lt;br /&gt;
*&#039;&#039;&#039;period&#039;&#039;&#039; = the period over which the animation will be moved from its current position to the newly specified point.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetMeshAnimationFrame(&amp;quot;default&amp;quot;,5.0);      // move the animation to frame 5 instantaneously&lt;br /&gt;
 SetMeshAnimationFrame(&amp;quot;default&amp;quot;,5.0,2.0);  // move the animation to frame 5 over 2 seconds&lt;br /&gt;
;Notes&lt;br /&gt;
*Moves the specified animation to the specified frame.&lt;br /&gt;
*For the first variant the transition is instant.&lt;br /&gt;
*For the second variant the transition will complete during the specified period.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==SetMeshAnimationSpeed==&lt;br /&gt;
{{MethodHeader|public native void SetMeshAnimationSpeed(string mesh, float speed)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;mesh&#039;&#039;&#039; = the name of the mesh or submesh container which includes the animation file to be manipulated.&lt;br /&gt;
*&#039;&#039;&#039;speed&#039;&#039;&#039; = multiplication factor to apply to the original animation speed.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetMeshAnimationSpeed(&amp;quot;fans&amp;quot;,2.0);   // run fans at double speed&lt;br /&gt;
 SetMeshAnimationSpeed(&amp;quot;fans&amp;quot;,-1.0);  // run fans backwards at original speed&lt;br /&gt;
;Notes&lt;br /&gt;
*Modifies the speed at which the animation is played.&lt;br /&gt;
*The original speed is multiplied by the new speed factor.&lt;br /&gt;
*Use negative values to make the animation run in reverse.&lt;br /&gt;
*It is &#039;&#039;not&#039;&#039; compatible with SetMeshAnimationState function for the same mesh. &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==SetMeshAnimationState==&lt;br /&gt;
{{MethodHeader|public native void SetMeshAnimationState(string mesh, bool state)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;mesh&#039;&#039;&#039; = the name of the mesh or submesh container which includes the animation file to be played.&lt;br /&gt;
*&#039;&#039;&#039;state&#039;&#039;&#039; = the direction in which the file is to be played, true for forwards, false for backwards.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetMeshAnimationState(&amp;quot;door&amp;quot;,true);    // opens the door&lt;br /&gt;
 SetMeshAnimationState(&amp;quot;door&amp;quot;,false);   // closes the door&lt;br /&gt;
;Notes&lt;br /&gt;
*This method plays animations and is best suited to those which have defined start and end points such as the opening and closing of a gate or door.&lt;br /&gt;
*If &#039;&#039;state&#039;&#039; is true the animation plays forwards from its current position to the last frame. If the current position is already at the last frame the call has no effect.&lt;br /&gt;
*If &#039;&#039;state&#039;&#039; is false the animation plays backwards from its current position to the first frame. If the current position is already at the first frame the call has no effect.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==SetMeshVisible==&lt;br /&gt;
{{MethodHeader|public native void SetMeshVisible(string mesh, bool visible, float fadeDuration)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;mesh&#039;&#039;&#039; = the name of the mesh or submesh to be displayed.&lt;br /&gt;
*&#039;&#039;&#039;visible&#039;&#039;&#039; = true to show the mesh, false to hide it.&lt;br /&gt;
*&#039;&#039;&#039;fadeDuration&#039;&#039;&#039; = period in seconds during which mesh visibility will be faded in or out.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetMeshVisible(&amp;quot;driver&amp;quot;, false, 1.0);&lt;br /&gt;
;Notes&lt;br /&gt;
*If fadeDuration is 0.0 the mesh transition will be instantaneous.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==SetTextureSelfIllumination==&lt;br /&gt;
{{MethodHeader|public native void SetTextureSelfIllumination(string texture, float r, float g, float b)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;texture&#039;&#039;&#039; = root name of &#039;&#039;*.texture.text&#039;&#039; file to query.&lt;br /&gt;
*&#039;&#039;&#039;r,g,b&#039;&#039;&#039; = red green and blue components of self illumination value to apply.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetTextureSelfIllumination(&amp;quot;interior&amp;quot;,0.5,0.5,0.5);&lt;br /&gt;
;Notes&lt;br /&gt;
*Applies a [[material emissive color]] to materials that use the texture, using the red, green and blue components specified.&lt;br /&gt;
*Compatibility warning: Use of this function is not recommended, it may become non-functional in future Trainz versions.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==StartMeshAnimationLoop==&lt;br /&gt;
{{MethodHeader|public native void StartMeshAnimationLoop(string mesh)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;mesh&#039;&#039;&#039; = the name of the mesh or submesh container which includes the animation file to be played.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 StartMeshAnimationLoop(&amp;quot;windmill&amp;quot;);&lt;br /&gt;
;Notes&lt;br /&gt;
*This method plays animations and is best suited to those which are designed to run in a continuous loop.&lt;br /&gt;
*The speed of the animation can be altered using [[#SetMeshAnimationSpeed|SetMeshAnimationSpeed()]]&lt;br /&gt;
*Using [[#SetMeshAnimationSpeed|SetMeshAnimationSpeed()]] with a negative value will cause the animation to play in reverse.&lt;br /&gt;
*[[#StopMeshAnimation|StopMeshAnimation()]] will halt the animation.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==StopMeshAnimation==&lt;br /&gt;
{{MethodHeader|public native void StopMeshAnimation(string mesh)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;mesh&#039;&#039;&#039; = the name of the mesh or submesh container which includes the animation file to be stopped.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 StopMeshAnimation(&amp;quot;default&amp;quot;);&lt;br /&gt;
;Notes&lt;br /&gt;
*Turns animation off for the specified mesh.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==SwapTextureOnMesh==&lt;br /&gt;
{{MethodHeader|public native void SwapTextureOnMesh(string mesh, string oldTexture, string newTexture)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;mesh&#039;&#039;&#039; = the name of the mesh or submesh container which includes the texture to be changed.&lt;br /&gt;
*&#039;&#039;&#039;oldTexture&#039;&#039;&#039; = the original &#039;&#039;*.texture.txt&#039;&#039; file to use as the source of the transition.&lt;br /&gt;
*&#039;&#039;&#039;newTexture&#039;&#039;&#039; = the new &#039;&#039;*.texture.txt&#039;&#039; file to apply.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SwapTextureOnMesh(&amp;quot;left-passenger-door&amp;quot;,&amp;quot;gwr&amp;quot;,&amp;quot;lms&amp;quot;);&lt;br /&gt;
;Notes&lt;br /&gt;
*&#039;&#039;&#039;Obsolete: Use SetFXTextureReplacementTexture instead.&#039;&#039;&#039;&lt;br /&gt;
*Swap one texture against another texture on specified mesh.&lt;br /&gt;
*Similar to texture-replacement effects, but without the need for an extra texture asset. &lt;br /&gt;
*&#039;&#039;&#039;possible bug&#039;&#039;&#039; Texture names in the .im file must be lower case for this function to work properly.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Code Examples==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Related Methods==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Categories==&lt;br /&gt;
[[Category:Script Class]]&lt;/div&gt;</summary>
		<author><name>Ciceronmt</name></author>
	</entry>
	<entry>
		<id>https://wiki.trainzsimulator.com/index.php?title=Texture-Replacement_Effect&amp;diff=21156</id>
		<title>Texture-Replacement Effect</title>
		<link rel="alternate" type="text/html" href="https://wiki.trainzsimulator.com/index.php?title=Texture-Replacement_Effect&amp;diff=21156"/>
		<updated>2019-09-05T18:16:02Z</updated>

		<summary type="html">&lt;p&gt;Ciceronmt: /* name */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The Texture-Replacement effect kind is a named effect container within a [[&amp;quot;mesh-table&amp;quot; Container]]. It can be used within the load subcontainer to provide alternative textures for bulk loads in wagons.  The following tags are supported: &lt;br /&gt;
&lt;br /&gt;
==Supported Tags==&lt;br /&gt;
Each texture-replacement subcontainer supports the following tags. &lt;br /&gt;
 kind &amp;quot;texture-replacement&amp;quot;&lt;br /&gt;
 name &amp;quot;&amp;quot;&lt;br /&gt;
 texture &amp;quot;&amp;lt;texture name&amp;gt;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
The name of the texture-replacement effects subcontainer is selected by the content developer.  It may be used as a reference in a script file to identify a specific effect.&lt;br /&gt;
&lt;br /&gt;
===kind===&lt;br /&gt;
String. Required. No default.&lt;br /&gt;
&amp;quot;texture-replacement&amp;quot;&lt;br /&gt;
&lt;br /&gt;
===name===&lt;br /&gt;
String.  Not required.  &lt;br /&gt;
This tag provides an accessible name for the container that can be used by scripts.  It may be left blank so that a script can use the tag for temporary storage. &lt;br /&gt;
&#039;&#039;Obsolete! Don&#039;t use.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===texture===&lt;br /&gt;
String. Required. No default.&lt;br /&gt;
The name of the texture that is to be replaced. This is the name of the texture file as used in the asset&#039;s config.txt, without the .txt extension.  For instance, if the texture to be replaced is identified in the &#039;load-map.texture.txt&#039; file, then the texture tag in the effect container is &amp;quot;load-map.texture&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
A texture-replacement effect is often used when the texture of an asset should be changed during game play.  For instance, when the load texture is to be replaced then this texture will be replaced by the texture contained in the product referenced in the current active product queue, as defined by the allowed-categories subcontainer in the queue.  For instance, if a coal hopper loads at an industry asset that produces a bulk-load other than its default load (eg woodchips at a lumbermill), then the woodchip product texture will replace the default coal product texture.&lt;br /&gt;
&lt;br /&gt;
A texture-replacement effect is also used when an asset is reskinned using an alias.  In this case the texture replacement occurs when the asset is created - the texture of the aliased asset is replaced with a texture from the reskin asset. &lt;br /&gt;
&lt;br /&gt;
==Example texture-replace subcontainer==&lt;br /&gt;
    effects {&lt;br /&gt;
      product-texture {&lt;br /&gt;
        kind      &amp;quot;texture-replacement&amp;quot;&lt;br /&gt;
        texture	  &amp;quot;load_map.texture&amp;quot;&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
==Performance Considerations==&lt;br /&gt;
&lt;br /&gt;
Texture-replacement can be used by content developers to achieve a range of interesting and novel scripted effects, though there are some considerations that should be noted. Whether performance will be adversely affected is dependant upon numerous variables. When it comes to predicting the performance impact of a particular texture-replacement implementation, the only reliable answer is: test it and see.&lt;br /&gt;
&lt;br /&gt;
===potential issues===&lt;br /&gt;
  &lt;br /&gt;
* it&#039;s likely to load both the original and the replacement textures, so you may pay twice the loading cost and twice the RAM cost.&lt;br /&gt;
&lt;br /&gt;
* in older versions of the game, you might end up with the game freezing while it loads in the replacement texture.&lt;br /&gt;
&lt;br /&gt;
* in newer versions of the game, it shouldn&#039;t freeze but it&#039;s feasible that you might end up with the old textures visible on screen until the new textures load.&lt;br /&gt;
&lt;br /&gt;
* it likely negates any texture preloading, so you&#039;re more likely to end up with low-res textures visible to the user.&lt;br /&gt;
&lt;br /&gt;
* it likely disables a bunch of shared-material optimisations, so if you have multiple copies of the same object around then you&#039;ll now be paying one cost per instance rather than one cost per the whole set.&lt;br /&gt;
&lt;br /&gt;
In newer versions some of that can be mitigated:&lt;br /&gt;
&lt;br /&gt;
* as long as all of the textures look fairly similar, swapping from one to another once already visible isn&#039;t a major concern as long as it happens at lower LODs, which it generally will during actual game play.&lt;br /&gt;
&lt;br /&gt;
* texture streaming makes it more likely that the double-texture costs will be minimal. You can probably further assist this by using smaller placeholder textures to start with i.e. the textures loaded as part of the mesh are kept to 32x32 or something small like that.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Config Container]]&lt;/div&gt;</summary>
		<author><name>Ciceronmt</name></author>
	</entry>
	<entry>
		<id>https://wiki.trainzsimulator.com/index.php?title=Texture-Replacement_Effect&amp;diff=21155</id>
		<title>Texture-Replacement Effect</title>
		<link rel="alternate" type="text/html" href="https://wiki.trainzsimulator.com/index.php?title=Texture-Replacement_Effect&amp;diff=21155"/>
		<updated>2019-09-05T18:15:28Z</updated>

		<summary type="html">&lt;p&gt;Ciceronmt: /* name */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The Texture-Replacement effect kind is a named effect container within a [[&amp;quot;mesh-table&amp;quot; Container]]. It can be used within the load subcontainer to provide alternative textures for bulk loads in wagons.  The following tags are supported: &lt;br /&gt;
&lt;br /&gt;
==Supported Tags==&lt;br /&gt;
Each texture-replacement subcontainer supports the following tags. &lt;br /&gt;
 kind &amp;quot;texture-replacement&amp;quot;&lt;br /&gt;
 name &amp;quot;&amp;quot;&lt;br /&gt;
 texture &amp;quot;&amp;lt;texture name&amp;gt;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
The name of the texture-replacement effects subcontainer is selected by the content developer.  It may be used as a reference in a script file to identify a specific effect.&lt;br /&gt;
&lt;br /&gt;
===kind===&lt;br /&gt;
String. Required. No default.&lt;br /&gt;
&amp;quot;texture-replacement&amp;quot;&lt;br /&gt;
&lt;br /&gt;
===name===&lt;br /&gt;
String.  Not required.  &lt;br /&gt;
This tag provides an accessible name for the container that can be used by scripts.  It may be left blank so that a script can use the tag for temporary storage. Obsolete! Don&#039;t use.&lt;br /&gt;
&lt;br /&gt;
===texture===&lt;br /&gt;
String. Required. No default.&lt;br /&gt;
The name of the texture that is to be replaced. This is the name of the texture file as used in the asset&#039;s config.txt, without the .txt extension.  For instance, if the texture to be replaced is identified in the &#039;load-map.texture.txt&#039; file, then the texture tag in the effect container is &amp;quot;load-map.texture&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
A texture-replacement effect is often used when the texture of an asset should be changed during game play.  For instance, when the load texture is to be replaced then this texture will be replaced by the texture contained in the product referenced in the current active product queue, as defined by the allowed-categories subcontainer in the queue.  For instance, if a coal hopper loads at an industry asset that produces a bulk-load other than its default load (eg woodchips at a lumbermill), then the woodchip product texture will replace the default coal product texture.&lt;br /&gt;
&lt;br /&gt;
A texture-replacement effect is also used when an asset is reskinned using an alias.  In this case the texture replacement occurs when the asset is created - the texture of the aliased asset is replaced with a texture from the reskin asset. &lt;br /&gt;
&lt;br /&gt;
==Example texture-replace subcontainer==&lt;br /&gt;
    effects {&lt;br /&gt;
      product-texture {&lt;br /&gt;
        kind      &amp;quot;texture-replacement&amp;quot;&lt;br /&gt;
        texture	  &amp;quot;load_map.texture&amp;quot;&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
==Performance Considerations==&lt;br /&gt;
&lt;br /&gt;
Texture-replacement can be used by content developers to achieve a range of interesting and novel scripted effects, though there are some considerations that should be noted. Whether performance will be adversely affected is dependant upon numerous variables. When it comes to predicting the performance impact of a particular texture-replacement implementation, the only reliable answer is: test it and see.&lt;br /&gt;
&lt;br /&gt;
===potential issues===&lt;br /&gt;
  &lt;br /&gt;
* it&#039;s likely to load both the original and the replacement textures, so you may pay twice the loading cost and twice the RAM cost.&lt;br /&gt;
&lt;br /&gt;
* in older versions of the game, you might end up with the game freezing while it loads in the replacement texture.&lt;br /&gt;
&lt;br /&gt;
* in newer versions of the game, it shouldn&#039;t freeze but it&#039;s feasible that you might end up with the old textures visible on screen until the new textures load.&lt;br /&gt;
&lt;br /&gt;
* it likely negates any texture preloading, so you&#039;re more likely to end up with low-res textures visible to the user.&lt;br /&gt;
&lt;br /&gt;
* it likely disables a bunch of shared-material optimisations, so if you have multiple copies of the same object around then you&#039;ll now be paying one cost per instance rather than one cost per the whole set.&lt;br /&gt;
&lt;br /&gt;
In newer versions some of that can be mitigated:&lt;br /&gt;
&lt;br /&gt;
* as long as all of the textures look fairly similar, swapping from one to another once already visible isn&#039;t a major concern as long as it happens at lower LODs, which it generally will during actual game play.&lt;br /&gt;
&lt;br /&gt;
* texture streaming makes it more likely that the double-texture costs will be minimal. You can probably further assist this by using smaller placeholder textures to start with i.e. the textures loaded as part of the mesh are kept to 32x32 or something small like that.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Config Container]]&lt;/div&gt;</summary>
		<author><name>Ciceronmt</name></author>
	</entry>
	<entry>
		<id>https://wiki.trainzsimulator.com/index.php?title=Class_Cabin&amp;diff=21154</id>
		<title>Class Cabin</title>
		<link rel="alternate" type="text/html" href="https://wiki.trainzsimulator.com/index.php?title=Class_Cabin&amp;diff=21154"/>
		<updated>2019-09-05T16:59:21Z</updated>

		<summary type="html">&lt;p&gt;Ciceronmt: /* SetCabLightIntensity */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;*[[TrainzScript Language Reference|API Hierarchy]]&lt;br /&gt;
**[[Class GSObject|GSObject]] *&lt;br /&gt;
***[[Class GameObject|GameObject]]&lt;br /&gt;
****[[Class TrainzGameObject|TrainzGameObject]]&lt;br /&gt;
****[[Class PropertyObject|PropertyObject]] *&lt;br /&gt;
*****[[Class MeshObject|MeshObject]]&lt;br /&gt;
******Bogey&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
*This class is the interface class used for cabins and interior assets in Trainz.&lt;br /&gt;
*From the scripting perspective, a Cabin is mainly a collection of controls. &lt;br /&gt;
*What controls the cabin has depends on the configuration of the asset. &lt;br /&gt;
*If a cabin asset is to have custom scripted features, it&#039;s script class will need to be derived from this one. &lt;br /&gt;
*The types of controls a cabin has is locomotive specific hence this class is the interface and not a cabin implementation.&lt;br /&gt;
*The DefaultLocomotiveCabin and DefaultSteamCabin classes provide basic default Cabin implementations.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Attach===&lt;br /&gt;
{{MethodHeader|public void Attach(GameObject owner)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;owner&#039;&#039;&#039; = GameObjet to which the cabin will be attached, normally a Locomotive.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Notes&lt;br /&gt;
*A callback method used by the game engine when it is about to attach this cabin to an object.&lt;br /&gt;
*A cabin is destroyed when it is no longer needed and re-created by Trainz later on if needed again.&lt;br /&gt;
*This method is where you should restore any saved cabin control settings.&lt;br /&gt;
*A Locomotive object has a cache of cabin control settings that can be saved to when the cabin is updated (see [[Class Locomotive#GetCabinData|Locomotive.GetCabinData()]])&lt;br /&gt;
*The programmer will need to update and make use of cabin settings in their implementation of this method.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===FireAddCoal===&lt;br /&gt;
{{MethodHeader|public native bool FireAddCoal(void)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*None&lt;br /&gt;
;Returned Value&lt;br /&gt;
*True if coal is added successfully, false otherwise.&lt;br /&gt;
;Syntax&lt;br /&gt;
 FireAddCoal();&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetControls===&lt;br /&gt;
{{MethodHeader|public native CabinControl[ ] GetControls(void)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*None&lt;br /&gt;
;Returned Value&lt;br /&gt;
*An array of the CabinControl objects applicable to the cabin.&lt;br /&gt;
;Syntax&lt;br /&gt;
 CabinControl[] controls = GetControls();&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetNamedControl===&lt;br /&gt;
{{MethodHeader|public native CabinControl GetNamedControl(string name)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;name&#039;&#039;&#039; = Name of control to return.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*A reference to the named control if it exists, null otherwise.&lt;br /&gt;
;Syntax&lt;br /&gt;
 CabinControl control = GetNamedControl(&amp;quot;brake&amp;quot;);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetParentObject===&lt;br /&gt;
{{MethodHeader|public native GameObject GetParentObject(void)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*None&lt;br /&gt;
;Returned Value&lt;br /&gt;
*A reference to the parent GameObject to which the cabin is attached, usually a Locomotive.&lt;br /&gt;
;Syntax&lt;br /&gt;
 Locomotive loco = cast&amp;lt;Locomotive&amp;gt;cabin.GetParentObject();&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===IsActive===&lt;br /&gt;
{{MethodHeader|public native bool IsActive(void)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*None&lt;br /&gt;
;Returned Value&lt;br /&gt;
*True if the cabin is currently active, false otherwise.&lt;br /&gt;
;Syntax&lt;br /&gt;
 bool cabinExists = cabin.IsActive();&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetCabLightIntensity===&lt;br /&gt;
{{MethodHeader|public native void SetCabLightIntensity(float intensity)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;intensity&#039;&#039;&#039; = A normalised lighting level in the range 0.0..1.0&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetCabLightIntensity(0.5);&lt;br /&gt;
;Notes &lt;br /&gt;
&#039;&#039;It works? In build 4.3 no changes are visible. Should the texture glow turn on?&#039;&#039;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Update===&lt;br /&gt;
{{MethodHeader|public void Update(void)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*None&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Notes&lt;br /&gt;
*This is a callback method used by Trainz to update the cabin object.&lt;br /&gt;
*This implementation is empty so the script programmer must implement it if they want their cabin&#039;s controls to be updated.&lt;br /&gt;
*If you want to keep the controls in the cabin up to date and to accurately reflect the current state of the locomotive, you will need to perform those updates from an overridden implementation of this method.&lt;br /&gt;
*This is mostly a case of querying the current status of the host locomotive and applying it to the matching control.&lt;br /&gt;
*The speedometer in the cab for instance should be updated based on the loco&#039;s current velocity.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===UserPressKey===&lt;br /&gt;
{{MethodHeader|public void UserPressKey(string keyName)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;keyName&#039;&#039;&#039; = The name of the key pressed.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Notes&lt;br /&gt;
*This is a callback method used by Trainz when the user presses a key.&lt;br /&gt;
*The default Cabin implementation does not handle any keystrokes. You must do so in your own overridden implementation.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===UserSetControl===&lt;br /&gt;
{{MethodHeader|public void UserSetControl(CabinControl control, float value)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;control&#039;&#039;&#039; = The control that the user has operated.&lt;br /&gt;
*&#039;&#039;&#039;value&#039;&#039;&#039; = The value to assign as a result of the user&#039;s action.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Notes&lt;br /&gt;
*This is a callback method used by Trainz when the user presses a key.&lt;br /&gt;
*You should override this method to apply the settings selected by the user.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Related Methods==&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Categories==&lt;br /&gt;
[[Category:Script Class]]&lt;/div&gt;</summary>
		<author><name>Ciceronmt</name></author>
	</entry>
	<entry>
		<id>https://wiki.trainzsimulator.com/index.php?title=Class_Cabin&amp;diff=21153</id>
		<title>Class Cabin</title>
		<link rel="alternate" type="text/html" href="https://wiki.trainzsimulator.com/index.php?title=Class_Cabin&amp;diff=21153"/>
		<updated>2019-09-05T16:58:30Z</updated>

		<summary type="html">&lt;p&gt;Ciceronmt: /* SetCabLightIntensity */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;*[[TrainzScript Language Reference|API Hierarchy]]&lt;br /&gt;
**[[Class GSObject|GSObject]] *&lt;br /&gt;
***[[Class GameObject|GameObject]]&lt;br /&gt;
****[[Class TrainzGameObject|TrainzGameObject]]&lt;br /&gt;
****[[Class PropertyObject|PropertyObject]] *&lt;br /&gt;
*****[[Class MeshObject|MeshObject]]&lt;br /&gt;
******Bogey&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
*This class is the interface class used for cabins and interior assets in Trainz.&lt;br /&gt;
*From the scripting perspective, a Cabin is mainly a collection of controls. &lt;br /&gt;
*What controls the cabin has depends on the configuration of the asset. &lt;br /&gt;
*If a cabin asset is to have custom scripted features, it&#039;s script class will need to be derived from this one. &lt;br /&gt;
*The types of controls a cabin has is locomotive specific hence this class is the interface and not a cabin implementation.&lt;br /&gt;
*The DefaultLocomotiveCabin and DefaultSteamCabin classes provide basic default Cabin implementations.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Attach===&lt;br /&gt;
{{MethodHeader|public void Attach(GameObject owner)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;owner&#039;&#039;&#039; = GameObjet to which the cabin will be attached, normally a Locomotive.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Notes&lt;br /&gt;
*A callback method used by the game engine when it is about to attach this cabin to an object.&lt;br /&gt;
*A cabin is destroyed when it is no longer needed and re-created by Trainz later on if needed again.&lt;br /&gt;
*This method is where you should restore any saved cabin control settings.&lt;br /&gt;
*A Locomotive object has a cache of cabin control settings that can be saved to when the cabin is updated (see [[Class Locomotive#GetCabinData|Locomotive.GetCabinData()]])&lt;br /&gt;
*The programmer will need to update and make use of cabin settings in their implementation of this method.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===FireAddCoal===&lt;br /&gt;
{{MethodHeader|public native bool FireAddCoal(void)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*None&lt;br /&gt;
;Returned Value&lt;br /&gt;
*True if coal is added successfully, false otherwise.&lt;br /&gt;
;Syntax&lt;br /&gt;
 FireAddCoal();&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetControls===&lt;br /&gt;
{{MethodHeader|public native CabinControl[ ] GetControls(void)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*None&lt;br /&gt;
;Returned Value&lt;br /&gt;
*An array of the CabinControl objects applicable to the cabin.&lt;br /&gt;
;Syntax&lt;br /&gt;
 CabinControl[] controls = GetControls();&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetNamedControl===&lt;br /&gt;
{{MethodHeader|public native CabinControl GetNamedControl(string name)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;name&#039;&#039;&#039; = Name of control to return.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*A reference to the named control if it exists, null otherwise.&lt;br /&gt;
;Syntax&lt;br /&gt;
 CabinControl control = GetNamedControl(&amp;quot;brake&amp;quot;);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetParentObject===&lt;br /&gt;
{{MethodHeader|public native GameObject GetParentObject(void)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*None&lt;br /&gt;
;Returned Value&lt;br /&gt;
*A reference to the parent GameObject to which the cabin is attached, usually a Locomotive.&lt;br /&gt;
;Syntax&lt;br /&gt;
 Locomotive loco = cast&amp;lt;Locomotive&amp;gt;cabin.GetParentObject();&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===IsActive===&lt;br /&gt;
{{MethodHeader|public native bool IsActive(void)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*None&lt;br /&gt;
;Returned Value&lt;br /&gt;
*True if the cabin is currently active, false otherwise.&lt;br /&gt;
;Syntax&lt;br /&gt;
 bool cabinExists = cabin.IsActive();&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetCabLightIntensity===&lt;br /&gt;
{{MethodHeader|public native void SetCabLightIntensity(float intensity)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;intensity&#039;&#039;&#039; = A normalised lighting level in the range 0.0..1.0&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 SetCabLightIntensity(0.5);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;It works? In build 4.3 no changes are visible. Should the texture glow turn on?&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Update===&lt;br /&gt;
{{MethodHeader|public void Update(void)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*None&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Notes&lt;br /&gt;
*This is a callback method used by Trainz to update the cabin object.&lt;br /&gt;
*This implementation is empty so the script programmer must implement it if they want their cabin&#039;s controls to be updated.&lt;br /&gt;
*If you want to keep the controls in the cabin up to date and to accurately reflect the current state of the locomotive, you will need to perform those updates from an overridden implementation of this method.&lt;br /&gt;
*This is mostly a case of querying the current status of the host locomotive and applying it to the matching control.&lt;br /&gt;
*The speedometer in the cab for instance should be updated based on the loco&#039;s current velocity.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===UserPressKey===&lt;br /&gt;
{{MethodHeader|public void UserPressKey(string keyName)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;keyName&#039;&#039;&#039; = The name of the key pressed.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Notes&lt;br /&gt;
*This is a callback method used by Trainz when the user presses a key.&lt;br /&gt;
*The default Cabin implementation does not handle any keystrokes. You must do so in your own overridden implementation.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===UserSetControl===&lt;br /&gt;
{{MethodHeader|public void UserSetControl(CabinControl control, float value)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;control&#039;&#039;&#039; = The control that the user has operated.&lt;br /&gt;
*&#039;&#039;&#039;value&#039;&#039;&#039; = The value to assign as a result of the user&#039;s action.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Notes&lt;br /&gt;
*This is a callback method used by Trainz when the user presses a key.&lt;br /&gt;
*You should override this method to apply the settings selected by the user.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Related Methods==&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Categories==&lt;br /&gt;
[[Category:Script Class]]&lt;/div&gt;</summary>
		<author><name>Ciceronmt</name></author>
	</entry>
	<entry>
		<id>https://wiki.trainzsimulator.com/index.php?title=Track_Part_Container&amp;diff=20885</id>
		<title>Track Part Container</title>
		<link rel="alternate" type="text/html" href="https://wiki.trainzsimulator.com/index.php?title=Track_Part_Container&amp;diff=20885"/>
		<updated>2019-08-25T15:30:40Z</updated>

		<summary type="html">&lt;p&gt;Ciceronmt: /* coordinate-transformation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A [[Track Part Container]] is a [[config.txt file]] entry used by the [[KIND Track]] content type. It does not correspond to a single specific tag, but rather is a format which is reused by several different tags.&lt;br /&gt;
&lt;br /&gt;
This page describes [[trainz-build]] 4.5.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Supported Tags==&lt;br /&gt;
The [[Track Part Container]] supports the following tags. Each tag is shown here with its default value. In some cases, the [[Track Part Container]] may inherit the values set on a parent container (excepting the track-lod-tree) rather than using these defaults; see the individual content type descriptions for additional details.&lt;br /&gt;
&lt;br /&gt;
 mesh-length 0.0&lt;br /&gt;
 adjust-height-to-ground-threshold -3.402823466e+38&lt;br /&gt;
 adjust-height-to-ground-offset 0.0&lt;br /&gt;
 adjust-cross-section-to-ground 1&lt;br /&gt;
 track-lod-tree&lt;br /&gt;
 {&lt;br /&gt;
 }&lt;br /&gt;
 coordinate-transformation &amp;quot;spline&amp;quot;&lt;br /&gt;
 follows-spline-gradient 0&lt;br /&gt;
 follows-ground-height-at-ends-of-mesh 0&lt;br /&gt;
 dont-scale-mesh-to-fit-length 0&lt;br /&gt;
 padding-length 0&lt;br /&gt;
 spacing-length-before 0&lt;br /&gt;
 spacing-length-after 0&lt;br /&gt;
 use-superelevation 0&lt;br /&gt;
 endcap-outside-spline 1&lt;br /&gt;
&lt;br /&gt;
====mesh-length====&lt;br /&gt;
The mesh-length value is a track distance in meters which defines the basic unit length of track that the track-lod-tree describes. The track-lod-tree may supply a single mesh of this length, or may subdivide the unit mesh-length into a number of smaller mesh pieces.&lt;br /&gt;
&lt;br /&gt;
====adjust-height-to-ground-threshold====&lt;br /&gt;
Any vertex with a model-space Z value less than this threshold number will be adjusted based on the height of the ground under that vertex.&lt;br /&gt;
&lt;br /&gt;
The math behind the adjustment is roughly as follows:&lt;br /&gt;
&lt;br /&gt;
 outputVertexPosition.z = modelVertexPosition.z + adjustHeightToGroundOffset + groundHeight&lt;br /&gt;
&lt;br /&gt;
Typically, this height adjustment is used when building a bridge or similar structure - the bulk of the model is maintained at the actual spline height, but the bottom vertices of the legs or supporting pillars are dropped to ground height.&lt;br /&gt;
&lt;br /&gt;
The offset and threshold values can be used where a spline consists of a base, which should always display at ground level at a fixed size, and a pylon or tower structure above the base with a height that varies with spline height above ground. Set the adjust-height-to-ground-threshold to a value that falls in the section of mesh that is above the base portion (the pylon) and set the adjust-height-to-ground-offset to the negative of the z-value of the lowest vertex of the base.  The base will be positioned at ground level, the vertices between the bottom vertex of the base and the threshold value will be positioned relative to the ground, and the vertices above the threshold will be positioned relative to the spline height.&lt;br /&gt;
&lt;br /&gt;
====adjust-height-to-ground-offset====&lt;br /&gt;
Provides an offset along the model-space Z axis that is used when a vertex is being adjusted to ground height. If set to the negative of the adjust-height-to-ground-threshold value, this will effectively cause any vertex at that height to be dropped to exactly ground level. Any vertex below that height will drop below ground level. Any vertex above that height will not be modified.&lt;br /&gt;
&lt;br /&gt;
By varying the offset, this allows vertices to float slightly above the actual ground height.&lt;br /&gt;
&lt;br /&gt;
====adjust-cross-section-to-ground====&lt;br /&gt;
If this boolean value is set (1), the track mesh is distorted across its X axis to follow the ground plane upon which it rests.&lt;br /&gt;
If clear (0) the mesh will assume the ground height from the center point.&lt;br /&gt;
This setting has no effect on vertices which are within the adjust-height-to-ground-threshold range.&lt;br /&gt;
&lt;br /&gt;
====track-lod-tree====&lt;br /&gt;
The [[&amp;quot;track-lod-tree&amp;quot; container]] is used to select appropriate meshes for runtime mesh stitching.&lt;br /&gt;
&lt;br /&gt;
====coordinate-transformation====&lt;br /&gt;
The coordinate-transformation setting determines how vertices from the model are mapped into the world. The following techniques are available:&lt;br /&gt;
&lt;br /&gt;
* &amp;quot;spline&amp;quot; (default) - this option gives the default, fit-to-spline behavior.&lt;br /&gt;
* &amp;quot;linear&amp;quot; - this option gives simple linear scaling. This will not attempt to shear the ends of the mesh to fit the neighbors.&lt;br /&gt;
* &amp;quot;shear&amp;quot; - this option gives simple linear scaling. This will &#039;shear&#039; (linear stretch) the ends of the mesh to fit the neighbors.&lt;br /&gt;
* &amp;quot;horizontal&amp;quot; - this option gives an effect similar to &#039;linear&#039; except that height is fixed throughout a given component mesh. This is useful if lack of vertical distortion is more important that meeting end-to-end with the next mesh.&lt;br /&gt;
* &amp;quot;horizontal-shear&amp;quot; - this option gives an effect similar to &#039;shear&#039; except that height is fixed throughout a given component mesh. This is useful if lack of vertical distortion is more important that meeting end-to-end with the next mesh.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
[[File:SplineOptions.tga|alt=Examples of a spline configured with different coordinate-transformation options.]]&lt;br /&gt;
&lt;br /&gt;
====follows-spline-gradient====&lt;br /&gt;
If this boolean value is set (1), the mesh is deformed to smoothly follow the height-gradient of the spline.&lt;br /&gt;
If clear (0), the mesh is instead deformed to follow the ground height along the centre-line of the spline (&amp;quot;adjust-cross-section-to-ground 1&amp;quot;) or under each vertex (&amp;quot;adjust-cross-section-to-ground 0&amp;quot;).&lt;br /&gt;
Certain in-game state, such as having set a height gradient onto the spline (yellow track vertices in Surveyor) or residing on a parent bridge spline, may override this option.&lt;br /&gt;
&lt;br /&gt;
====follows-ground-height-at-ends-of-mesh====&lt;br /&gt;
If this boolean value is set(1), the spline height is effectively deformed such that the end-points of each repeat of the mesh follow the ground height. Spline height throughout the mesh varies in a linear fashion.&lt;br /&gt;
If clear (0), the spline height is not affected.&lt;br /&gt;
Certain other options, such as (&amp;quot;follows-spline-gradient 0&amp;quot;) or (&amp;quot;coordinate-transformation spline&amp;quot;) may cause this option to be largely meaningless.&lt;br /&gt;
&lt;br /&gt;
====dont-scale-mesh-to-fit-length====&lt;br /&gt;
If this boolean value is clear (0), the length of each component mesh is scaled to fit the available area in the spline. Since the number of repeats and subdivisions is integer, spline meshes are typically stretched or contracted slightly to ensure that the mesh repeats end-to-end.&lt;br /&gt;
If set (1), the mesh is rendered at its natural length, even if this means that meshes will overlap or stretch apart and not touch each other. This might typically used where a spline represents a set of repeating poles or pylons, rather than a continuous beam.  It is also commonly used for the spline endcaps, which are often modelled to a fixed size and should not be stretched or contracted.&lt;br /&gt;
&lt;br /&gt;
====padding-length====&lt;br /&gt;
A distance (meters, float, default 0) to use for spline repeat padding. Padding meshes are intended to fill in for full-sized repeats at the start of a procedural track where the mesh-length does not divide evenly. This technique is complicated and may not work as intended; it is not recommended at the current time.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;This tag was introduced at trainz-build 4.2.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
====spacing-length-before====&lt;br /&gt;
A distance (meters, float, default 0) which is left empty within each mesh repeat before the geometry. This spacing exists within the &#039;mesh-length&#039; leaving less available space for the actual mesh.&lt;br /&gt;
&lt;br /&gt;
This value cannot be negative.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;This tag was introduced at trainz-build 4.2.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
====spacing-length-after====&lt;br /&gt;
A distance (meters, float, default 0) which is left empty within each mesh repeat after the geometry. This spacing exists within the &#039;mesh-length&#039; leaving less available space for the actual mesh.&lt;br /&gt;
&lt;br /&gt;
This value cannot be negative.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;This tag was introduced at trainz-build 4.2.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
====endcap-outside-spline====&lt;br /&gt;
If this boolean value is set (default, 1) on an endcap, then the endcap geometry exists beyond the spline. If this boolean value is clear (0) then the spline geometry is inset by the length of the endcap and the endcap resides within the spline.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;This tag was introduced at trainz-build 4.5.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category: Config Container]]&lt;/div&gt;</summary>
		<author><name>Ciceronmt</name></author>
	</entry>
	<entry>
		<id>https://wiki.trainzsimulator.com/index.php?title=Class_Train&amp;diff=20712</id>
		<title>Class Train</title>
		<link rel="alternate" type="text/html" href="https://wiki.trainzsimulator.com/index.php?title=Class_Train&amp;diff=20712"/>
		<updated>2019-08-21T20:14:12Z</updated>

		<summary type="html">&lt;p&gt;Ciceronmt: /* IsStopped */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;*[[TrainzScript Language Reference|API Hierarchy]]&lt;br /&gt;
**[[Class GSObject|GSObject]] *&lt;br /&gt;
***[[Class GameObject|GameObject]]&lt;br /&gt;
****Train&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
*A train is a collection of vehicles in TRS.&lt;br /&gt;
*They act as a single entity and may be controlled using this class.&lt;br /&gt;
*A train is placed on a track in script by using [[Class World#CreateTrain|World.CreateTrain()]] or [[Class TrainUtil#CreateTrainFromSoup|TrainUtil.CreateTrainFromSoup()]]. &lt;br /&gt;
*Trainz will automatically create a Train object for each consist that appears in the game.&lt;br /&gt;
*When an existing train is uncoupled and split up into two separate consists a new train object is created.&lt;br /&gt;
*Similarly when two trains couple one of the train objects is destroyed.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Messages==&lt;br /&gt;
*Messages sent to and from Train objects are listed below:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
{{TableHeader|width=50%|margin=15px}}&lt;br /&gt;
|-&lt;br /&gt;
|bgcolor=&amp;quot;#EEEEEE&amp;quot;|&#039;&#039;&#039;Major&#039;&#039;&#039;||bgcolor=&amp;quot;#EEEEEE&amp;quot;|&#039;&#039;&#039;Minor&#039;&#039;&#039;||bgcolor=&amp;quot;#EEEEEE&amp;quot;|&#039;&#039;&#039;Source&#039;&#039;&#039;||bgcolor=&amp;quot;#EEEEEE&amp;quot; |&#039;&#039;&#039;Destination&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|Schedule||Abort||Train||Train  &lt;br /&gt;
|-&lt;br /&gt;
|Schedule||Complete||Train||Broadcast  &lt;br /&gt;
|-&lt;br /&gt;
|Schedule||Touch||Train||Train  &lt;br /&gt;
|-&lt;br /&gt;
|[[Train Messages|Train]]||Deleted||Train||&lt;br /&gt;
|-&lt;br /&gt;
|[[Signal Messages|Train]]||Entered red signal notify||Train||Broadcast  &lt;br /&gt;
|-&lt;br /&gt;
|[[Signal Messages|Train]]||Entered red signal||Signal||Train  &lt;br /&gt;
|-&lt;br /&gt;
|[[Object Messages|Train]]||EnterTrack||Track||Train  &lt;br /&gt;
|-&lt;br /&gt;
|[[Object Messages|Train]]||InnerEnterTrack||Track||Train  &lt;br /&gt;
|-&lt;br /&gt;
|[[Object Messages|Train]]||InnerLeaveTrack||Track||Train  &lt;br /&gt;
|-&lt;br /&gt;
|[[Object Messages|Train]]||LeaveTrack||Track||Train  &lt;br /&gt;
|-&lt;br /&gt;
|[[Train Messages|Train]]||Over advisory speed limit||Train||Broadcast  &lt;br /&gt;
|-&lt;br /&gt;
|[[Train Messages|Train]]||Over floating speed limit||Train||Broadcast  &lt;br /&gt;
|-&lt;br /&gt;
|[[Train Messages|Train]]||Over speed limit||Train||Broadcast  &lt;br /&gt;
|-&lt;br /&gt;
|[[Train Messages|Train]]||ReachedTarget||Train||Train&lt;br /&gt;
|-&lt;br /&gt;
|[[Train Messages|Train]]||SlowingForTarget||Train||Train  &lt;br /&gt;
|-&lt;br /&gt;
|[[Train Messages|Train]]||StartedMoving||Train||Train  &lt;br /&gt;
|-&lt;br /&gt;
|[[Train Messages|Train]]||StoppedMoving||Train||Train  &lt;br /&gt;
|-&lt;br /&gt;
|[[Train Messages|Train]]||Under advisory speed limit||Train||Broadcast  &lt;br /&gt;
|-&lt;br /&gt;
|[[Train Messages|Train]]||Under floating speed limit||Train||Broadcast  &lt;br /&gt;
|-&lt;br /&gt;
|[[Train Messages|Train]]||Under speed limit||Train||Broadcast  &lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Constants==&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
===Train Control Modes===&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
{{TableHeader|width=95%|margin=15px}}&lt;br /&gt;
|width=375|public define int CONTROL_MANUAL = 1||User controls train, script can change settings.&lt;br /&gt;
|-&lt;br /&gt;
|public define int CONTROL_AUTOPILOT = 2||Autopilot controls train.&lt;br /&gt;
|-&lt;br /&gt;
|public define int CONTROL_AUTOMANUAL = 3||User controls train, autopilot takes over when train is not currently &#039;focused&#039;.&lt;br /&gt;
|-&lt;br /&gt;
|public define int CONTROL_SCRIPT = 4||Only the script can control the train.&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
===Reverser Traction Modes===&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
{{TableHeader|width=95%|margin=15px}}&lt;br /&gt;
|width=375|public define int TRACTION_FORWARD = 2||Reverse is in forward setting.&lt;br /&gt;
|-&lt;br /&gt;
|public define int TRACTION_NEUTRAL = 1||Reverser is in neutral.&lt;br /&gt;
|-&lt;br /&gt;
|public define int TRACTION_REVERSE = 0||Reverser is in reverse.&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
===Train Brake Modes===&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
{{TableHeader|width=95%|margin=15px}}&lt;br /&gt;
|width=375|public define float  TRAIN_BRAKE_RELEASE = 0.0||Train brakes are released.&lt;br /&gt;
|-&lt;br /&gt;
|public define float  TRAIN_BRAKE_INITIAL = 1.0||Train brakes are in initial mode.&lt;br /&gt;
|-&lt;br /&gt;
|public define float  TRAIN_BRAKE_APPLICATION = 2.0||Train brakes are applied.&lt;br /&gt;
|-&lt;br /&gt;
|public define float  TRAIN_BRAKE_HANDLE_OFF = 3.0||Train brake handle is off.&lt;br /&gt;
|-&lt;br /&gt;
|public define float  TRAIN_BRAKE_EMERGENCY = 4.0||Train brakes are in emergency stop position.&lt;br /&gt;
|-&lt;br /&gt;
|public define float  TRAIN_BRAKE_LAP = 5.0||Train brakes are in the lap position, not available for all trains.&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
===Dynamic Brake States===&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
{{TableHeader|width=95%|margin=15px}}&lt;br /&gt;
|width=375|public define int  DYNAMIC_BRAKE_TRACTION = 0||Dynamic brakes in traction mode.&lt;br /&gt;
|-&lt;br /&gt;
|public define int  DYNAMIC_BRAKE_NEUTRAL = 1 ||Dynamic brakes in neutral.&lt;br /&gt;
|-&lt;br /&gt;
|public define int  DYNAMIC_BRAKE_BRAKE = 2 ||Dynamic brakes are on.&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Found Results===&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
{{TableHeader|width=95%|margin=15px}}&lt;br /&gt;
|width=375|public define int  RESULT_NONE = 0||Item not found.&lt;br /&gt;
|-&lt;br /&gt;
|public define int  RESULT_FORWARD = 1||Item is in front of train.&lt;br /&gt;
|-&lt;br /&gt;
|public define int  RESULT_INSIDE = 2||Item is within the train, ie between the front and the rear limits.&lt;br /&gt;
|-&lt;br /&gt;
|public define int  RESULT_BACKWARD = 3||Item is behind the train.&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
===Measurement Conversion Multipliers===&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
{{TableHeader|width=95%|margin=15px}}&lt;br /&gt;
|width=375|public define float  KPH_TO_MPS = 0.278||Kilometres per hour -&amp;gt; Metres per second.&lt;br /&gt;
|-&lt;br /&gt;
|public define float  MPH_TO_MPS = 0.447||Miles per hour -&amp;gt; Metres per second.&lt;br /&gt;
|-&lt;br /&gt;
|public define float  MPH_TO_KPH = 1.609||Miles per hour -&amp;gt; Kilometres per hour.&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
==Members==&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
{{TableHeader|width=95%|margin=15px}}&lt;br /&gt;
|width=375|&amp;lt;b&amp;gt;public Browser timeTableInfo&amp;lt;/b&amp;gt;||A publicly accessible Browser object for timetable information.&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
==Methods==&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===AddVelocity===&lt;br /&gt;
{{MethodHeader|public native void AddVelocity(float velocity)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;velocity&#039;&#039;&#039; = Velocity to add to the current speed of the train.		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None	&lt;br /&gt;
;Syntax&lt;br /&gt;
 train.AddVelocity(5.0);	&lt;br /&gt;
;Notes&lt;br /&gt;
*Velocity parameter must be in metres per second and may be negative.&lt;br /&gt;
*Use the [[#Measurement Conversion Multipliers|Measurement Conversion Multipliers]] to convert from other units.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===ClearTrainTimetable===&lt;br /&gt;
{{MethodHeader|public void ClearTrainTimetable(ScenarioBehavior rule)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;rule&#039;&#039;&#039; = rule that called [[#SetTrainTimetable|SetTrainTimetable()]] on this train.		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None	&lt;br /&gt;
;Syntax&lt;br /&gt;
 train.ClearTimeTable(timetableRule);	&lt;br /&gt;
;Notes&lt;br /&gt;
*Clears the train timetable of this train. 	&lt;br /&gt;
*Having cleared the TrainTimetable, it is now safe again to set another TrainTimetable for this train through [[#SetTrainTimetable|SetTrainTimetable()]].&lt;br /&gt;
*This method must only be called by the rule which called SetTrainTimetable() in the first place. &lt;br /&gt;
*It is the responsibility of the caller to post a (TrainTimetable, Touch) message after calling this function.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===DecTrainBusy===&lt;br /&gt;
{{MethodHeader|public void DecTrainBusy(void)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*None		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None	&lt;br /&gt;
;Syntax&lt;br /&gt;
 train.DecTrainBusy();	&lt;br /&gt;
;Notes&lt;br /&gt;
*Decrements this train&#039;s busy count.&lt;br /&gt;
*See [[#IsTrainBusy|IsTrainBusy()]] for further details.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Derail===&lt;br /&gt;
{{MethodHeader|public native void Derail(void)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*None		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None	&lt;br /&gt;
;Syntax&lt;br /&gt;
 train.Derail();	&lt;br /&gt;
;Notes&lt;br /&gt;
*Deliberately derails the train.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===EnablePhysics===&lt;br /&gt;
{{MethodHeader|public native void EnablePhysics(bool enable)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;enable&#039;&#039;&#039; = True to enable physics calculations for this train, false to disable		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None	&lt;br /&gt;
;Syntax&lt;br /&gt;
 train.EnablePhysics(false);		&lt;br /&gt;
;Notes&lt;br /&gt;
*Turning physics off for scenic rolling stock that the player cannot interact with can boost performance.&lt;br /&gt;
*There is no point in doing physic calculations for idle rollingstock.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetActiveDriver===&lt;br /&gt;
{{MethodHeader|public native DriverCharacter GetActiveDriver(void)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*None		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*The active driver of this train, null if there is no driver assigned.&lt;br /&gt;
;Syntax&lt;br /&gt;
 DriverCharacter driver = train.GetActiveDriver();		&lt;br /&gt;
;Notes&lt;br /&gt;
*There may be more than one driver on a train but there is only one active driver and an individual Locomotive may only have one driver assigned.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetAdvisoryLimit===&lt;br /&gt;
{{MethodHeader|public native float GetAdvisoryLimit(void)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*None		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*The current advisory speed limit set by script.		&lt;br /&gt;
;Syntax&lt;br /&gt;
 float speed = train.GetAdvisoryLimit();		&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetAllowsUserContol===&lt;br /&gt;
{{MethodHeader|public native bool GetAllowsUserControl(void)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*None		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*True if this train allows the user to control it directly through DCC or Cabin interfaces, false otherwise.&lt;br /&gt;
;Syntax&lt;br /&gt;
 bool canDrive =train.getAllowsUserControl();		&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetAutopilotMode===&lt;br /&gt;
{{MethodHeader|public native int GetAutopilot Mode(void)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*None		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*One of the [[#Train Control Modes|Train Control Mode]] constants defining the method by which the train is currently controlled.&lt;br /&gt;
;Syntax&lt;br /&gt;
 int controlMode = train.GetAutopilotMode();		&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetAutopilotStopJunctionBase===&lt;br /&gt;
{{MethodHeader|public native JunctionBase GetAutopilotStopJunctionBase(void)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*None		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*The junction object that is preventing the autopilot from taking this train any further, null if the train is not stopped by a junction.		&lt;br /&gt;
;Syntax&lt;br /&gt;
 JunctionBase junction = train GetAutopilotStopJunctionBase();		&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetAutopilotStopTrain===&lt;br /&gt;
{{MethodHeader|public native Train GetAutopilotStopTrain(void)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*None		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*The train that is preventing the autopilot from taking this train any further, null if the train is not being held up by another train.		&lt;br /&gt;
;Syntax&lt;br /&gt;
 Train otherTrain = train.GetAutopilotStopTrain();		&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetAutopilotTargetSlowing===&lt;br /&gt;
{{MethodHeader|public native bool GetAutopilotTargetSlowing(void)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*None		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*True if the autopilot is slowing down for its target destination, false otherwise.		&lt;br /&gt;
;Syntax&lt;br /&gt;
 bool isSlowing = train.GetAutopilotTargetSlowing();		&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetDCCThrottle===&lt;br /&gt;
{{MethodHeader|public native float GetDCCThrottle(void)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*None		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*The DCC throttle setting for this train when using DCC physics.		&lt;br /&gt;
;Syntax&lt;br /&gt;
 float throttle = GetDCCThrottle();		&lt;br /&gt;
;Notes&lt;br /&gt;
*The returned value will be in the range [-1.0 .. 1.0] where -1.0 is full throttle in reverse, 0.0 is stationary and 1.0 is full throttle forward.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetFrontmostLocomotive===&lt;br /&gt;
{{MethodHeader|public native Locomotive GetFrontmostLocomotive(void)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*None		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*Returns a reference to the frontmost locomotive in the train.	&lt;br /&gt;
;Syntax&lt;br /&gt;
 Loco = Train.GetFrontmostLocomotive();	&lt;br /&gt;
;Notes&lt;br /&gt;
*&amp;lt;font color=red&amp;gt;The &#039;&#039;front&#039;&#039; of the train is defined relative to the train&#039;s current heading.??&amp;lt;/font&amp;gt;	&lt;br /&gt;
*The train&#039;s heading may not correspond to its physical appearance and can change during game play.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetHeadlightState===&lt;br /&gt;
{{MethodHeader|public native bool GetHeadlightState(void)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*None		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*True if headlights are turned on, false otherwise.		&lt;br /&gt;
;Syntax&lt;br /&gt;
 bool lights = train.GetHeadlightState();		&lt;br /&gt;
;Notes&lt;br /&gt;
*Only the frontmost locomotive will display headlighs.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetLastVisitedBuildable===&lt;br /&gt;
{{MethodHeader|public Buildable GetLastVisitedBuildable(void)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*None		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*The last [[Class Buildable|Buildable]] object visited by this train, null if there have been no such visits.&lt;br /&gt;
;Syntax&lt;br /&gt;
 Buildable buildable = train.GetLastVisitedBuildable();		&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetLastVisitedIndustry===&lt;br /&gt;
{{MethodHeader|public Industry GetLastVisitedIndustry(void)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*None		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*The last Industry object visited by this train, null if there have been no such visits.		&lt;br /&gt;
;Syntax&lt;br /&gt;
 Industry industry = train.GetLastVisitedIndustry();		&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetLastVisitedTrack===&lt;br /&gt;
{{MethodHeader|public Track GetLastVisitedTrack(void)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*None		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*The last track segment visited by this train.		&lt;br /&gt;
;Syntax&lt;br /&gt;
 Track track = train.GetLastVisitedTrack();		&lt;br /&gt;
;Notes&lt;br /&gt;
*Note that the returned value may be null. &amp;lt;font color=red&amp;gt;How is that possible?&amp;lt;/font&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetHighBeams===&lt;br /&gt;
{{MethodHeader|public bool GetHighBeams(void)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*None		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*True if the frontmost locomotive&#039;s high beams are on, false otherwise.		&lt;br /&gt;
;Syntax&lt;br /&gt;
 bool High_Lights = train.GetHighBeams();		&lt;br /&gt;
;Notes&lt;br /&gt;
*See also [[Class Vehicle#GetHighBeams|Vehicle.GetHighBeams()]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetMaximumCouplingStressVehicle===&lt;br /&gt;
{{MethodHeader|public native Vehicle GetMaximumCouplingStressVehicle(void)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*None		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*The Vehicle in this consist that is experiencing the greatest level of coupling stress.		&lt;br /&gt;
;Syntax&lt;br /&gt;
 Vehicle vehicle = GetMaximumCouplingStressVehicle();		&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetPantographState===&lt;br /&gt;
{{MethodHeader|public native int GetPantographState(void)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*None		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*The state of the pantographs of the electric locomotives in this train.		&lt;br /&gt;
;Syntax&lt;br /&gt;
 int pantoState = train.GetPantographState();		&lt;br /&gt;
;Notes&lt;br /&gt;
*The returned value will be in the range [0..3] where:&lt;br /&gt;
**0 = Both pantographs down.&lt;br /&gt;
**1 = Front pantograph up.&lt;br /&gt;
**2 = Rear pantograph up.&lt;br /&gt;
**3 = Both pantographs up.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetPhysicsModel===&lt;br /&gt;
{{MethodHeader|public native int GetPhysicsModel(void)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*None		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*The mode of control chosen by the player to drive the locomotive		&lt;br /&gt;
;Syntax&lt;br /&gt;
 int Mode = train.GetPhysicsModel();		&lt;br /&gt;
;Notes&lt;br /&gt;
*The returned value will be :&lt;br /&gt;
**2 = CabinControl&lt;br /&gt;
**1 = DCCMode&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===GetSmoothedVelocity===&lt;br /&gt;
{{MethodHeader|public native float GetSmoothedVelocity(void)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*None		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*Returns a smoothed velocity, intended for human consumption.		&lt;br /&gt;
;Syntax&lt;br /&gt;
 float speed = train.GetSmoothedVelocity();		&lt;br /&gt;
;Notes&lt;br /&gt;
*If you require an accurate velocity readout for physics operations, use [[#GetVelocity|GetVelocity()]]. &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetSpeedLimit===&lt;br /&gt;
{{MethodHeader|public native float GetSpeedLimit(void)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*None		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*The current sign posted speed limit. 		&lt;br /&gt;
;Syntax&lt;br /&gt;
 float permittedSpeed = train.GetSpeedLimit();		&lt;br /&gt;
;Notes&lt;br /&gt;
*The speed limit is dependent on trackside signs placed in Surveyor as well as the direction of the train.&lt;br /&gt;
*A default value applies to track that isn&#039;t sign posted.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetTrackmarkDirection===&lt;br /&gt;
{{MethodHeader|public native int GetTrackmarkDirection(TrackMark mark)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;mark&#039;&#039;&#039; = A reference to the Trackmark to search for.&lt;br /&gt;
;Returned Value&lt;br /&gt;
* One of the [[#Found Results|Found Result]] values representing the location of the given track mark relative to this train.			&lt;br /&gt;
;Syntax&lt;br /&gt;
 int location = train.GetTrackmarkDirection(trackmark);		&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetTrainBrakes===&lt;br /&gt;
{{MethodHeader|public native float GetTrainBrakes(void)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*None		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*One of the [[#Train Brake Modes|Train Brake mode]] constants indicating the current state of this train&#039;s brakes.		&lt;br /&gt;
;Syntax&lt;br /&gt;
 float brakeState = train.GetTrainBrakes();		&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetTrainDisplayName===&lt;br /&gt;
{{MethodHeader|public native string GetTrainDisplayName(void)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*None		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*A localised display name for this train. 		&lt;br /&gt;
;Syntax&lt;br /&gt;
 string trainName = train.GetTrainDisplayName();		&lt;br /&gt;
;Notes&lt;br /&gt;
*This will be a name Trainz has created for the consist such as &amp;quot;Consist 0&amp;quot; and will match the description shown in the Minimap view. &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetTrainPriorityNumber===&lt;br /&gt;
{{MethodHeader|public native int GetTrainPriorityNumber(void)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*None		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*Train priority value in the range [1 .. 3]		&lt;br /&gt;
;Syntax&lt;br /&gt;
 int priority = train.GetTrainPriorityNumber();&lt;br /&gt;
;Notes&lt;br /&gt;
*See [[#SetTrainPriority|SetTrainPriority()]] for further details.		&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetTrainTimetable===&lt;br /&gt;
{{MethodHeader|public TrainTimetable GetTrainTimetable(void)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*None		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*The TrainTimetable that the train is currently using, null if there is none.&lt;br /&gt;
;Syntax&lt;br /&gt;
  TrainTimetable timetable = train.GetTrainTimetable();		&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetTrainVelocity===&lt;br /&gt;
{{MethodHeader|public native float GetTrainVelocity(void)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*None		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*The train&#039;s current velocity in metres per second.&lt;br /&gt;
;Syntax&lt;br /&gt;
  float speed = train.GetTrainVelocity();		&lt;br /&gt;
;Notes&lt;br /&gt;
* This function provides the instantaneous velocity for vehicles in this train, which is good for physics calculations but not good for human-readable display.  If you want human-readable display, use [[#GetSmoothedVelocity|GetSmoothedVelocity()]] instead.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===GetVehicles===&lt;br /&gt;
{{MethodHeader|public native Vehicle[ ] GetVehicles(void)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*None		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*Returns an array consisting of all the vehicles making up this train.	&lt;br /&gt;
;Syntax&lt;br /&gt;
 Vehicle[] vehicles = train.GetVehicles();	&lt;br /&gt;
;Notes&lt;br /&gt;
 *GetVehicles[0] is always the front vehicle of the train relative to the train&#039;s current heading.	&lt;br /&gt;
*The train&#039;s heading may not correspond to its physical appearance and can change during game play.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetVelocity===&lt;br /&gt;
{{MethodHeader|public native float GetVelocity(void)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*None		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*The train&#039;s current velocity.		&lt;br /&gt;
;Syntax&lt;br /&gt;
 float speed = train.GetVelocity();		&lt;br /&gt;
;Notes&lt;br /&gt;
*Warning!  The TS10 and TS12 Train.gs scripts advise this method is buggy and to use [[#GetSmoothedVelocity|GetSmoothedVelocity()]] or [[#GetTrainVelocity|GetTrainVelocity()]] instead.&lt;br /&gt;
*This function provides the instantaneous velocity for vehicles in this train, which is good for physics calculations but not good for human-readable display.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===HasReachedInnerJunctionRadius===&lt;br /&gt;
{{MethodHeader|public bool HasReachedJunctionInnerJunctionRadius(JunctionBase junction)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;junction&#039;&#039;&#039; = JunctionBase object to query.			&lt;br /&gt;
;Returned Value&lt;br /&gt;
*True if this train is within the inner radius of the given junction, false otherwise.		&lt;br /&gt;
;Syntax&lt;br /&gt;
 bool arrived = train.HasReachedInnerJunctionRadius(junction10);		&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===HasTrainTimetable===&lt;br /&gt;
{{MethodHeader|public bool HasTrainTimetable(void)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*None		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*True if this train has an attached TrainTimetable, false otherwise.		&lt;br /&gt;
;Syntax&lt;br /&gt;
 bool timed = train.HasTrainTimetable();		&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===IsScheduleRunning===&lt;br /&gt;
{{MethodHeader|public bool IsScheduleRunning(void)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*None		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*True if this train is currently running to a Schedule, false otherwise.		&lt;br /&gt;
;Syntax&lt;br /&gt;
 bool scheduled = train.IsScheduleRunning();		&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===IsScheduleWindowVisible===&lt;br /&gt;
{{MethodHeader|public bool IsScheduleWindowVisible(void)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*None		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*True if the schedule window for this train is currently open, false otherwise.		&lt;br /&gt;
;Syntax&lt;br /&gt;
 bool windowOpen = IsScheduleWindowVisible();		&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===IsStillInJunction===&lt;br /&gt;
{{MethodHeader|public bool IsStillInJunction(JunctionBase junction)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;junction&#039;&#039;&#039; = JunctionBase object to query.			&lt;br /&gt;
;Returned Value&lt;br /&gt;
*True if the train holds a Permit for the given junction, flse otherwise.		&lt;br /&gt;
;Syntax&lt;br /&gt;
 bool inJunction = train.IsStillInJunction(junction10);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===IsStopped===&lt;br /&gt;
{{MethodHeader|public native bool IsStopped(void)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*None		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*True if the train is currently stationary, false if it is in motion.		&lt;br /&gt;
;Syntax&lt;br /&gt;
 bool moving=train.IsStopped();		&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===IsTrainBusy===&lt;br /&gt;
{{MethodHeader|public bool IsTrainBusy(void)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*None		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*True if the train&#039;s &#039;busy&#039; count is greater than zero, false otherwise.		&lt;br /&gt;
;Syntax&lt;br /&gt;
 bool busy = train.IsTrainBusy();		&lt;br /&gt;
;Notes&lt;br /&gt;
*Using the [[#IncTrainBusy|IncTrainBusy()]] method, any piece of script code can tag a train being busy. &lt;br /&gt;
*The train can be untagged later by calling DecTrainBusy(). &lt;br /&gt;
*This mechanism is mainly used by industries that are doing something with the train. &lt;br /&gt;
*A train can be tagged as being busy more than once by calling IncTrainBusy() multiple times so different industries can tag the train. &lt;br /&gt;
*Each time IncTrainBusy() is called, an internal busy count is incremented and if that busy count is greater than zero, the train is considered busy.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===IsViewDetailsVisible===&lt;br /&gt;
{{MethodHeader|public bool IsViewDetailsVisible(void)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*None		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*true if the ViewDetails window for this train is visible, false otherwise.		&lt;br /&gt;
;Syntax&lt;br /&gt;
 bool visible = train.IsViewDetailsVisible();		&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===MapObjectIsInFront===&lt;br /&gt;
{{MethodHeader|public bool MapObjectIsInFront(MapObject obj, float range)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;obj&#039;&#039;&#039; = MapObject to search for.&lt;br /&gt;
*&#039;&#039;&#039;range&#039;&#039;&#039; = Maximum search distance.			&lt;br /&gt;
;Returned Value&lt;br /&gt;
*True if the object is found within the specified distance and in front of the train, false otherwise.		&lt;br /&gt;
;Syntax&lt;br /&gt;
 bool isClose = train.MapObjectIsInFront(terminus,100.0);		&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===ReleaseTrackPermits===&lt;br /&gt;
{{MethodHeader|public void ReleaseTrackPermits(Permit[ ] permitList)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;permitList&#039;&#039;&#039; = Permit array containing a list of permits to release.		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None	&lt;br /&gt;
;Syntax&lt;br /&gt;
 train.ReleaseTrackPermits(permitList);		&lt;br /&gt;
;Notes&lt;br /&gt;
*This method will release any permits from the &#039;&#039;permitList&#039;&#039; array that are currently held by this train.&lt;br /&gt;
*Any other permits in the array that are not held by this train will be ignored.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===RunSchedule===&lt;br /&gt;
{{MethodHeader|public thread void RunSchedule(Schedule schedule, bool loop, float delay)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;schedule&#039;&#039;&#039; = The Schedule that the train is to follow.&lt;br /&gt;
*&#039;&#039;&#039;loop&#039;&#039;&#039; = False to run the schedule once, True to repeat it continuously.&lt;br /&gt;
*&#039;&#039;&#039;delay&#039;&#039;&#039; = Time in seconds to wait before starting the schedule.			&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None	&lt;br /&gt;
;Syntax&lt;br /&gt;
 train.RunSchedule(schedule,false,10.0);		&lt;br /&gt;
;Notes&lt;br /&gt;
*See [[Class Schedule|Schedule]] for information on how to build a schedule.&lt;br /&gt;
*Only one schedule may run on a train at a time and the user cannot control the train when it is running a schedule.&lt;br /&gt;
*This method is a thread, so the calling code does not need to wait for it to finish and return before executing other code.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetAdvisoryLimit===&lt;br /&gt;
{{MethodHeader|public native void SetAdvisoryLimit(float speed)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;speed&#039;&#039;&#039; = Speed limit to set in &amp;lt;del&amp;gt;KPH&amp;lt;/del&amp;gt; metres/second.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None	&lt;br /&gt;
;Syntax&lt;br /&gt;
 train.SetAdvisoryLimit(60.0);&lt;br /&gt;
;Notes&lt;br /&gt;
*Sets an advisory speed limit for a script controlled train.&lt;br /&gt;
*Use zero in the speed parameter to clear any previously imposed limit.&lt;br /&gt;
*&amp;lt;font color=red&amp;gt;Does this really use KPH, most similar methods use MPS&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=red&amp;gt;Experimental evidence confirms that it&#039;s in m/s not kph or mph&amp;lt;/font&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetAutopilotMode===&lt;br /&gt;
{{MethodHeader|public native void SetAutopilotMode(int mode)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;mode&#039;&#039;&#039; = One of the [[#Train Control Modes|Train Control Mode]] constants specifying the method by which this train is controlled.		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None	&lt;br /&gt;
;Syntax&lt;br /&gt;
 train.SetAutopilotMode(Train.CONTROL_AUTOMANUAL);		&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetAutopilotTarget===&lt;br /&gt;
{{MethodHeader|public native void SetAutopilotTarget(Buildable buildable, string trigger)&amp;lt;br&amp;gt;public native void SetAutopilotTarget(Trackside trackside)&amp;lt;br&amp;gt;public native void SetAutopilotTarget(Track track)&amp;lt;br&amp;gt;public native void SetAutopilotTarget(JunctionBase junction)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;buildable&#039;&#039;&#039; = Buildable object to use as a destination.&lt;br /&gt;
*&#039;&#039;&#039;trigger&#039;&#039;&#039; = Attached trigger within the buildable, specified by name.&lt;br /&gt;
*&#039;&#039;&#039;trackside&#039;&#039;&#039; =  Trackside object to use as a destination.&lt;br /&gt;
*&#039;&#039;&#039;track&#039;&#039;&#039; = Track segment to use as a destination.&lt;br /&gt;
*&#039;&#039;&#039;junction&#039;&#039;&#039; = JunctionBase object to use as a destination.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None	&lt;br /&gt;
;Syntax&lt;br /&gt;
 train.SetAutopilotTarget(&amp;quot;Kings Cross Station&amp;quot;,&amp;quot;trigger1&amp;quot;);		&lt;br /&gt;
;Notes&lt;br /&gt;
*This method sets a destination for the autopilot to take this train to.&lt;br /&gt;
*Objects from respective child classes such as industries, signals and trackmarks may be specified.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetAutopilotTargetMinimumDistance===&lt;br /&gt;
{{MethodHeader|public native void SetAutopilotTargetMinimumDistance(float distance)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;distance&#039;&#039;&#039; = The minimum distance in metres, between the train and the autopilot target, to be reached before the train will start to slow down.			&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None	&lt;br /&gt;
;Syntax&lt;br /&gt;
 train SetAutopilotTargetMinimumDistance(100.0);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetAutoPilotTargetMinimumSpeed===&lt;br /&gt;
{{MethodHeader|public native void SetAutopilotTargetMinimumSpeed(float speed)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;speed&#039;&#039;&#039; = Minimum speed, in metres per second, that the train should be travelling at when it reaches the Autopilot target.			&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None	&lt;br /&gt;
;Syntax&lt;br /&gt;
 train.SetAutoPilotTargetMinimumSpeed(20.0);		&lt;br /&gt;
;Notes&lt;br /&gt;
*&amp;lt;font color=red&amp;gt;The documentation seems to mean that the train should be going at 20.0 OR MORE.  Shouldn&#039;t it be MaximumSpeed???&amp;lt;/font&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetBail===&lt;br /&gt;
{{MethodHeader|public native void SetBail(void)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*None		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None	&lt;br /&gt;
;Syntax&lt;br /&gt;
 train.SetBail();		&lt;br /&gt;
;Notes&lt;br /&gt;
*Depresses the bail control for a short period.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetCouplingMask===&lt;br /&gt;
{{MethodHeader|public void SetCouplingMask(int mask)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;mask&#039;&#039;&#039; = A mask specifying which of the trains exposed couplers are allowed to couple.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None	&lt;br /&gt;
;Syntax&lt;br /&gt;
 train.SetCouplingMask(Vehicle.COUPLE_NONE); // prevents this train from coupling to another in Driver mode.&lt;br /&gt;
;Notes&lt;br /&gt;
*The mask can be built using the [[Class Vehicle#Coupler Flags|Coupler Flag]] constants defined in [[Class Vehicle]].&lt;br /&gt;
*This method will not prevent vehicles or trains from coupling in Surveyor, but takes effect in Driver mode.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetDCCThrottle===&lt;br /&gt;
{{MethodHeader|public native void SetDCCThrottle(float throttle)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;throttle&#039;&#039;&#039; = Float value in the range -1.0 .. 1.0 defining the throttle setting for the train when using DCC physics.			&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None	&lt;br /&gt;
;Syntax&lt;br /&gt;
 train.SetDCCThrottle(0.0); //sets the throttle to neutral.		&lt;br /&gt;
;Notes&lt;br /&gt;
*Full speed ahead is 1.0&lt;br /&gt;
*Maximum in reverse is -1.0&lt;br /&gt;
*Neutral is 0.0&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetDecouplingMask===&lt;br /&gt;
{{MethodHeader|public void SetDecouplingMask(int mask)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;mask&#039;&#039;&#039; = A mask specifying which of the couplers are allowed to couple, applies to all of the vehicles in the train.			&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None	&lt;br /&gt;
;Syntax&lt;br /&gt;
 train.SetDecouplingMask(Vehicle.COUPLE_FRONT|Vehicle.COUPLE_BACK); // prevents vehicles being uncoupled from the train in Driver mode.&lt;br /&gt;
;Notes&lt;br /&gt;
*The mask can be built using the [[Class Vehicle#Coupler Flags|Coupler Flag]] constants defined in [[Class Vehicle]].&lt;br /&gt;
*This method will not prevent vehicles or trains from being uncoupled in Surveyor, but takes effect in Driver mode.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetDynamicBrakeMode===&lt;br /&gt;
{{MethodHeader|public native void SetDynamicBrakeMode(int mode)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*One of the [[#Dynamic Brake States|Dynamic Brake State]] constants indicating the current state of this train&#039;s brakes.			&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None	&lt;br /&gt;
;Syntax&lt;br /&gt;
 train.SetDynamicBrakeMode(Train.DYNAMIC_BRAKE_TRACTION);		&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetFloatingLimit===&lt;br /&gt;
{{MethodHeader|public native void SetFloatingLimit(float delta, bool enable)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;delta&#039;&#039;&#039; = Tolerance allowed from the posted limit in metres per second.&lt;br /&gt;
*&#039;&#039;&#039;enable&#039;&#039;&#039; = Use true to enable messages related to floating limits, false to disable.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None	&lt;br /&gt;
;Syntax&lt;br /&gt;
 train.SetFloatingLimit(5.0,true);		&lt;br /&gt;
;Notes&lt;br /&gt;
*Sets the floating speed limit level above the sign posted limit.&lt;br /&gt;
*The floating limit is an amount of tolerance above the current speed limit. &lt;br /&gt;
*Messages for floating speed violations are not to be confused with regular speed limit messages.&lt;br /&gt;
*The floating limit is monitored by the Scenario.Monitor() thread, and may be used for point deduction when speeding. It should therefore be reserved for player trains.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetHandBrake===&lt;br /&gt;
{{MethodHeader|public void SetHandBrake(bool state)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;state&#039;&#039;&#039; = Use true to apply the handbrake to all vehicles in this train which are not Locomotives, false to release the handbrake.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None	&lt;br /&gt;
;Syntax&lt;br /&gt;
 train.SetHandBrake(true);		&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetHeadlightState===&lt;br /&gt;
{{MethodHeader|public native void SetHeadlightState(bool lightsOn)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;lightsOn&#039;&#039;&#039; = True to turn the headlights on, false to turn them off.			&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None	&lt;br /&gt;
;Syntax&lt;br /&gt;
 train.SetHeadlightState(true);		&lt;br /&gt;
;Notes&lt;br /&gt;
*This method affects only the headlights on the frontmost locomotive.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetHighBeams===&lt;br /&gt;
{{MethodHeader|public void SetHighBeams(bool value)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;value&#039;&#039;&#039; = True to turn on high beams, false to turn them off.		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 train.SetHighBeams(true);		&lt;br /&gt;
;Notes&lt;br /&gt;
*See also [[Class Vehicle#SetHighBeams|Vehicle.SetHighColor()]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetLastVisitedBuildable===&lt;br /&gt;
{{MethodHeader|public void SetLastVisitedBuildable(Buildable buildable)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;buildable&#039;&#039;&#039; = Sets the last visited buildable to the given object.			&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None	&lt;br /&gt;
;Syntax&lt;br /&gt;
 train.SetLastVisitedBuildable(KingsCrossStation);		&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetManualThrottle===&lt;br /&gt;
{{MethodHeader|public native void SetManualThrottle(int notch)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;notch&#039;&#039;&#039; = Value in the range 0 .. 8 to set the throttle.			&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None	&lt;br /&gt;
;Syntax&lt;br /&gt;
 train.SetManualThrottle(5);		&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetPantogaphState===&lt;br /&gt;
{{MethodHeader|public native void SetPantographState(int state)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;state&#039;&#039;&#039; = Value in the range 0 .. 3 to set the pantographs if this train has them.			&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None	&lt;br /&gt;
;Syntax&lt;br /&gt;
 train.SetPantographState(3);		&lt;br /&gt;
;Notes&lt;br /&gt;
*Use one of these values for &#039;&#039;state&#039;&#039;:&lt;br /&gt;
**0 = Both pantographs down.&lt;br /&gt;
**1 = Front pantograph up.&lt;br /&gt;
**2 = Rear pantograph up.&lt;br /&gt;
**3 = Both pantographs up.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetReverser===&lt;br /&gt;
{{MethodHeader|public native void SetReverser(int mode)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;mode&#039;&#039;&#039; = One of the [[#Reverser Traction Modes|Reverser Traction Mode]] constants defining the required state of the train&#039;s reverser lever.			&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None	&lt;br /&gt;
;Syntax&lt;br /&gt;
 train.SetReverser(Train.TRACTION_REVERSE);		&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetTrainBrakes===&lt;br /&gt;
{{MethodHeader|public native void SetTrainBrakes(float mode)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;mode&#039;&#039;&#039; = One of the [[#Train Brake States|Train Brake State]] constants defining the required state of the train&#039;s brakes.			&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None	&lt;br /&gt;
;Syntax&lt;br /&gt;
 train.SetTrainBrakes(Train.TRAIN_BRAKE_EMERGENCY);		&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetTrainPriorityNumber===&lt;br /&gt;
{{MethodHeader|public native void SetTrainPriority Number(int priority)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;priority&#039;&#039;&#039; = Priority value in the range 1 .. 3.			&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None	&lt;br /&gt;
;Syntax&lt;br /&gt;
 train.SetTrainPriorityNumber(2);		&lt;br /&gt;
;Notes&lt;br /&gt;
*All trains and track sections can be assigned a priority value in the range of [1 - 3] with the default value being 2.&lt;br /&gt;
*The priority value is not a numerical scale of precedence, but a value for the AI driver to attempt to match.&lt;br /&gt;
*This means the driver will &#039;&#039;prefer&#039;&#039; track sections that have a priority equal to that of the train.&lt;br /&gt;
*Changing the priority of the train only takes affect when the driver restarts a new schedule.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetTrainTimetable===&lt;br /&gt;
{{MethodHeader|public void SetTrainTimetable(TrainTimetable timetable)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;timetable&#039;&#039;&#039; = Assigns the specified timetable to this train.			&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None	&lt;br /&gt;
;Syntax&lt;br /&gt;
 train.SetTrainTimetable(timetable);&lt;br /&gt;
;Notes&lt;br /&gt;
*This train must not already have a TrainTimetable assigned.&lt;br /&gt;
*To ensure that this proviso is met, use [[#ClearTrainTimetabel|ClearTrainTimetable()]] prior to calling this method.&lt;br /&gt;
*It is the responsibility of the caller to post a &amp;quot;TrainTimetable&amp;quot;,&amp;quot;Touch&amp;quot; message after calling this function.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetVelocity===&lt;br /&gt;
{{MethodHeader|public native void SetVelocity(float velocity)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;velocity&#039;&#039;&#039; = Velocity to apply to the train, in metres per second.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None	&lt;br /&gt;
;Syntax&lt;br /&gt;
 train.SetVelocity(0.0); // stops the train, subject to braking performance.		&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===ShowInConsistMenu===&lt;br /&gt;
{{MethodHeader|public native void ShowInConsistMenu(bool show)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;show&#039;&#039;&#039; = True to make this train visible to the in-game consist menu, false to hide it.			&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None	&lt;br /&gt;
;Syntax&lt;br /&gt;
 train.ShowInConsistMenu(false);		&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SoundHorn===&lt;br /&gt;
{{MethodHeader|public native void SoundHorn(void)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*None		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None	&lt;br /&gt;
;Syntax&lt;br /&gt;
 train.SoundHorn();		&lt;br /&gt;
;Notes&lt;br /&gt;
*Sounds the horn or whictle for all locomotives in this train.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===StopSchedule===&lt;br /&gt;
{{MethodHeader|public void StopSchedule(void)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*None		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None	&lt;br /&gt;
;Syntax&lt;br /&gt;
 train.StopSchedule();		&lt;br /&gt;
;Notes&lt;br /&gt;
*This method stops the Schedule this train is currently running (if any).&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===StopScheduleAndWait===&lt;br /&gt;
{{MethodHeader|public void StopSchedule(void)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*None		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None	&lt;br /&gt;
;Syntax&lt;br /&gt;
 train.StopSchedule();		&lt;br /&gt;
;Notes&lt;br /&gt;
*This method stops the Schedule this train is currently running (if any) and waits until the train&#039;s schedule actually stops before returning. &lt;br /&gt;
*If the train is not running a schedule, the method returns after broadcasting a &amp;quot;Schedule&amp;quot;,&amp;quot;Touch&amp;quot; message, in case someone is listening for schedule messages.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===StopTrainGently===&lt;br /&gt;
{{MethodHeader|public native void StopTrainGently(void)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*None		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None	&lt;br /&gt;
;Syntax&lt;br /&gt;
 train.StopTrainGently();		&lt;br /&gt;
;Notes&lt;br /&gt;
*Brings the train to a halt over a short time period.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===TakePermitOnTrack===&lt;br /&gt;
{{MethodHeader|public Permit[ ] TakePermitOnTrack(bool direction)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;direction&#039;&#039;&#039; = Direction relative to the train in which to take out permits.			&lt;br /&gt;
;Returned Value&lt;br /&gt;
*An array including any permits taken which have not yet been granted to this train. Some of these permits may not yet have been granted. 		&lt;br /&gt;
;Syntax&lt;br /&gt;
 Permit[] permits = train.TakePermitOnTrack(true);		&lt;br /&gt;
;Notes&lt;br /&gt;
*Gets permits on the current track in the given direction.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===TestTrackPermit===&lt;br /&gt;
{{MethodHeader|public native bool TestTrackPermit(Permit permit, bool innerOnly)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;permit&#039;&#039;&#039; = An existing Permit object.&lt;br /&gt;
*&#039;&#039;&#039;innerOnly&#039;&#039;&#039; = If true the method will test only the inner radius, if false the default radius of 150 metres will be used.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*True if this train is within the track controlled by &#039;&#039;permit&#039;&#039;, false otherwise. 		&lt;br /&gt;
;Syntax&lt;br /&gt;
 bool ownPermit = train.TestTrackPermit(permit1,false);		&lt;br /&gt;
;Notes&lt;br /&gt;
*The method generates an exception if the &#039;&#039;permit&#039;&#039; parameter does not refer to a track.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===ToggleScheduleWindow===&lt;br /&gt;
{{MethodHeader|public void ToggleScheduleWindow(void)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*None		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None	&lt;br /&gt;
;Syntax&lt;br /&gt;
 train.ToggleScheduleWindow();		&lt;br /&gt;
;Notes&lt;br /&gt;
*If the schedule window is already open/visible, this method will destroy it.&lt;br /&gt;
*Otherwise if the view details window is not visible, UpdateScheduleWindow() is called to create it for display.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===ToggleViewDetailsWindow===&lt;br /&gt;
{{MethodHeader|public void ToggleViewDetailsWindow(void)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*None		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None	&lt;br /&gt;
;Syntax&lt;br /&gt;
 train.ToggleViewDetailsWindow();		&lt;br /&gt;
;Notes&lt;br /&gt;
*If the ViewDetails window is already open/visible, this method will destroy it.&lt;br /&gt;
*Otherwise if the view details window is not visible, ViewDetails() is called to create it for display.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===TrackSearch===&lt;br /&gt;
{{MethodHeader|public native MapObject[ ] TrackSearch(bool direction, float distance)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;direction&#039;&#039;&#039; = Direction to search relative to the train&#039;s heading, true for forwards, false for backwards.&lt;br /&gt;
*&#039;&#039;&#039;distance&#039;&#039;&#039; = Maximum search distance in metres.			&lt;br /&gt;
;Returned Value&lt;br /&gt;
*An array of objects found along the track in the defined search direction, the array might be empty.		&lt;br /&gt;
;Syntax&lt;br /&gt;
 MapObject[] objects = train.TrackSearch(true,5000.0) // searches 5km forwards along the track.		&lt;br /&gt;
;Notes&lt;br /&gt;
*Gets all of the Trackside and SceneryWithTrack objects on a length of track that is either in front of or behind this train. &lt;br /&gt;
*Descendants of these classes are also returned.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===TracksideIsInFront===&lt;br /&gt;
{{MethodHeader|public bool TracksideIsInFront(Trackside obj, float range)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;obj&#039;&#039;&#039; = Trackside object to search for.&lt;br /&gt;
*&#039;&#039;&#039;range&#039;&#039;&#039; = Mximum search distance.			&lt;br /&gt;
;Returned Value&lt;br /&gt;
*True if the object is logically forward of this train, false otherwise.		&lt;br /&gt;
;Syntax&lt;br /&gt;
 bool found = train.TracksideIsInFront(signal1,500.0);		&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Turnaround===&lt;br /&gt;
{{MethodHeader|public native void Turnaround(void)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*None		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None	&lt;br /&gt;
;Syntax&lt;br /&gt;
 train.Turnaround();		&lt;br /&gt;
;Notes&lt;br /&gt;
*Reverses the logical direction of the train, ie changes its heading.&lt;br /&gt;
*The physical direction of the vehicles is not altered but the throttle direction is reversed.&lt;br /&gt;
*If the camera is focused on the train in tracking view when this method is called the camera&#039;s direction of view (relative to the map) will alter through 180 degrees.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===UpdateScheduleWindow===&lt;br /&gt;
{{MethodHeader|public void UpdateScheduleWindow(string vehicleName)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;vehicleName&#039;&#039;&#039; = Name of vehicle within the train.			&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None	&lt;br /&gt;
;Syntax&lt;br /&gt;
 train.UpdateScheduleWindow(&amp;quot;brake2&amp;quot;);		&lt;br /&gt;
;Notes&lt;br /&gt;
*Updates the schedule window from the given vehicle.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===UpdateViewDetails===&lt;br /&gt;
{{MethodHeader|public void UpdateViewDetails(Vehicle vehicle)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;vehicle&#039;&#039;&#039; = Reference to a vehicle within the train.			&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None	&lt;br /&gt;
;Syntax&lt;br /&gt;
 train.UpdateViewDetails(vehicle);&lt;br /&gt;
;Notes&lt;br /&gt;
*Called by Vehicle.UpdateViewDetails() when a vehicle&#039;s load has changed so that the train&#039;s detail window can be amended.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===UpdateViewDetailsLocomotive===&lt;br /&gt;
{{MethodHeader|public void UpdateViewDetailsLocomotive(void)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*None&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None	&lt;br /&gt;
;Syntax&lt;br /&gt;
 train.UpdateViewDetailsLocomotive(vehicle);&lt;br /&gt;
;Notes&lt;br /&gt;
*Called by Locomotive.UpdateViewDetails() when any of the Locomotive&#039;s operating parameters have changed so that the train&#039;s detail window can be amended.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===ViewDetails===&lt;br /&gt;
{{MethodHeader|public void ViewDetails(Vehicle vehicle)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;vehicle&#039;&#039;&#039; = Reference to a vehicle within the train.			&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None	&lt;br /&gt;
;Syntax&lt;br /&gt;
 train.ViewDetails(vehicle);		&lt;br /&gt;
;Notes&lt;br /&gt;
*This method is called by Vehicle.ViewDetails() when the user has requested to view the details of the consist.&lt;br /&gt;
*It will create a Browser window listing information about the train including who the driver character is and the loads of all vehicles.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===WasRunScheduleSuccessful===&lt;br /&gt;
{{MethodHeader|public bool WasRunScheduleSuccessful(void)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*None		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*True if the most recently run schedule was successfully, false otherwise. 		&lt;br /&gt;
;Syntax&lt;br /&gt;
 train.WasRunScheduleSuccessful();		&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Code Examples==&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Related Methods==&lt;br /&gt;
[[Class TrainUtil#AreInTrain|TrainUtil.AreInTrain()]]&amp;lt;br&amp;gt;&lt;br /&gt;
[[Class TrainUtil#CreateTrainFromSoup|TrainUtil.CreateTrainFromSoup()]]&amp;lt;br&amp;gt;&lt;br /&gt;
[[Class TrainUtil#IsInTrain|TrainUtil.IsInTrain()]]&amp;lt;br&amp;gt;&lt;br /&gt;
[[Class World#CreateTrain|World.CreateTrain()]]&amp;lt;br&amp;gt;&lt;br /&gt;
[[Class World#DeleteTrain|World.DeleteTrain()]]&amp;lt;br&amp;gt;&lt;br /&gt;
[[Class World#GetTrainList|World.GetTrainList()]]&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Categories==&lt;br /&gt;
[[Category:Script Class]]&lt;/div&gt;</summary>
		<author><name>Ciceronmt</name></author>
	</entry>
	<entry>
		<id>https://wiki.trainzsimulator.com/index.php?title=Class_Train&amp;diff=20711</id>
		<title>Class Train</title>
		<link rel="alternate" type="text/html" href="https://wiki.trainzsimulator.com/index.php?title=Class_Train&amp;diff=20711"/>
		<updated>2019-08-21T20:12:57Z</updated>

		<summary type="html">&lt;p&gt;Ciceronmt: /* SetHandBrake */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;*[[TrainzScript Language Reference|API Hierarchy]]&lt;br /&gt;
**[[Class GSObject|GSObject]] *&lt;br /&gt;
***[[Class GameObject|GameObject]]&lt;br /&gt;
****Train&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
*A train is a collection of vehicles in TRS.&lt;br /&gt;
*They act as a single entity and may be controlled using this class.&lt;br /&gt;
*A train is placed on a track in script by using [[Class World#CreateTrain|World.CreateTrain()]] or [[Class TrainUtil#CreateTrainFromSoup|TrainUtil.CreateTrainFromSoup()]]. &lt;br /&gt;
*Trainz will automatically create a Train object for each consist that appears in the game.&lt;br /&gt;
*When an existing train is uncoupled and split up into two separate consists a new train object is created.&lt;br /&gt;
*Similarly when two trains couple one of the train objects is destroyed.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Messages==&lt;br /&gt;
*Messages sent to and from Train objects are listed below:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
{{TableHeader|width=50%|margin=15px}}&lt;br /&gt;
|-&lt;br /&gt;
|bgcolor=&amp;quot;#EEEEEE&amp;quot;|&#039;&#039;&#039;Major&#039;&#039;&#039;||bgcolor=&amp;quot;#EEEEEE&amp;quot;|&#039;&#039;&#039;Minor&#039;&#039;&#039;||bgcolor=&amp;quot;#EEEEEE&amp;quot;|&#039;&#039;&#039;Source&#039;&#039;&#039;||bgcolor=&amp;quot;#EEEEEE&amp;quot; |&#039;&#039;&#039;Destination&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|Schedule||Abort||Train||Train  &lt;br /&gt;
|-&lt;br /&gt;
|Schedule||Complete||Train||Broadcast  &lt;br /&gt;
|-&lt;br /&gt;
|Schedule||Touch||Train||Train  &lt;br /&gt;
|-&lt;br /&gt;
|[[Train Messages|Train]]||Deleted||Train||&lt;br /&gt;
|-&lt;br /&gt;
|[[Signal Messages|Train]]||Entered red signal notify||Train||Broadcast  &lt;br /&gt;
|-&lt;br /&gt;
|[[Signal Messages|Train]]||Entered red signal||Signal||Train  &lt;br /&gt;
|-&lt;br /&gt;
|[[Object Messages|Train]]||EnterTrack||Track||Train  &lt;br /&gt;
|-&lt;br /&gt;
|[[Object Messages|Train]]||InnerEnterTrack||Track||Train  &lt;br /&gt;
|-&lt;br /&gt;
|[[Object Messages|Train]]||InnerLeaveTrack||Track||Train  &lt;br /&gt;
|-&lt;br /&gt;
|[[Object Messages|Train]]||LeaveTrack||Track||Train  &lt;br /&gt;
|-&lt;br /&gt;
|[[Train Messages|Train]]||Over advisory speed limit||Train||Broadcast  &lt;br /&gt;
|-&lt;br /&gt;
|[[Train Messages|Train]]||Over floating speed limit||Train||Broadcast  &lt;br /&gt;
|-&lt;br /&gt;
|[[Train Messages|Train]]||Over speed limit||Train||Broadcast  &lt;br /&gt;
|-&lt;br /&gt;
|[[Train Messages|Train]]||ReachedTarget||Train||Train&lt;br /&gt;
|-&lt;br /&gt;
|[[Train Messages|Train]]||SlowingForTarget||Train||Train  &lt;br /&gt;
|-&lt;br /&gt;
|[[Train Messages|Train]]||StartedMoving||Train||Train  &lt;br /&gt;
|-&lt;br /&gt;
|[[Train Messages|Train]]||StoppedMoving||Train||Train  &lt;br /&gt;
|-&lt;br /&gt;
|[[Train Messages|Train]]||Under advisory speed limit||Train||Broadcast  &lt;br /&gt;
|-&lt;br /&gt;
|[[Train Messages|Train]]||Under floating speed limit||Train||Broadcast  &lt;br /&gt;
|-&lt;br /&gt;
|[[Train Messages|Train]]||Under speed limit||Train||Broadcast  &lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Constants==&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
===Train Control Modes===&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
{{TableHeader|width=95%|margin=15px}}&lt;br /&gt;
|width=375|public define int CONTROL_MANUAL = 1||User controls train, script can change settings.&lt;br /&gt;
|-&lt;br /&gt;
|public define int CONTROL_AUTOPILOT = 2||Autopilot controls train.&lt;br /&gt;
|-&lt;br /&gt;
|public define int CONTROL_AUTOMANUAL = 3||User controls train, autopilot takes over when train is not currently &#039;focused&#039;.&lt;br /&gt;
|-&lt;br /&gt;
|public define int CONTROL_SCRIPT = 4||Only the script can control the train.&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
===Reverser Traction Modes===&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
{{TableHeader|width=95%|margin=15px}}&lt;br /&gt;
|width=375|public define int TRACTION_FORWARD = 2||Reverse is in forward setting.&lt;br /&gt;
|-&lt;br /&gt;
|public define int TRACTION_NEUTRAL = 1||Reverser is in neutral.&lt;br /&gt;
|-&lt;br /&gt;
|public define int TRACTION_REVERSE = 0||Reverser is in reverse.&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
===Train Brake Modes===&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
{{TableHeader|width=95%|margin=15px}}&lt;br /&gt;
|width=375|public define float  TRAIN_BRAKE_RELEASE = 0.0||Train brakes are released.&lt;br /&gt;
|-&lt;br /&gt;
|public define float  TRAIN_BRAKE_INITIAL = 1.0||Train brakes are in initial mode.&lt;br /&gt;
|-&lt;br /&gt;
|public define float  TRAIN_BRAKE_APPLICATION = 2.0||Train brakes are applied.&lt;br /&gt;
|-&lt;br /&gt;
|public define float  TRAIN_BRAKE_HANDLE_OFF = 3.0||Train brake handle is off.&lt;br /&gt;
|-&lt;br /&gt;
|public define float  TRAIN_BRAKE_EMERGENCY = 4.0||Train brakes are in emergency stop position.&lt;br /&gt;
|-&lt;br /&gt;
|public define float  TRAIN_BRAKE_LAP = 5.0||Train brakes are in the lap position, not available for all trains.&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
===Dynamic Brake States===&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
{{TableHeader|width=95%|margin=15px}}&lt;br /&gt;
|width=375|public define int  DYNAMIC_BRAKE_TRACTION = 0||Dynamic brakes in traction mode.&lt;br /&gt;
|-&lt;br /&gt;
|public define int  DYNAMIC_BRAKE_NEUTRAL = 1 ||Dynamic brakes in neutral.&lt;br /&gt;
|-&lt;br /&gt;
|public define int  DYNAMIC_BRAKE_BRAKE = 2 ||Dynamic brakes are on.&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Found Results===&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
{{TableHeader|width=95%|margin=15px}}&lt;br /&gt;
|width=375|public define int  RESULT_NONE = 0||Item not found.&lt;br /&gt;
|-&lt;br /&gt;
|public define int  RESULT_FORWARD = 1||Item is in front of train.&lt;br /&gt;
|-&lt;br /&gt;
|public define int  RESULT_INSIDE = 2||Item is within the train, ie between the front and the rear limits.&lt;br /&gt;
|-&lt;br /&gt;
|public define int  RESULT_BACKWARD = 3||Item is behind the train.&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
===Measurement Conversion Multipliers===&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
{{TableHeader|width=95%|margin=15px}}&lt;br /&gt;
|width=375|public define float  KPH_TO_MPS = 0.278||Kilometres per hour -&amp;gt; Metres per second.&lt;br /&gt;
|-&lt;br /&gt;
|public define float  MPH_TO_MPS = 0.447||Miles per hour -&amp;gt; Metres per second.&lt;br /&gt;
|-&lt;br /&gt;
|public define float  MPH_TO_KPH = 1.609||Miles per hour -&amp;gt; Kilometres per hour.&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
==Members==&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
{{TableHeader|width=95%|margin=15px}}&lt;br /&gt;
|width=375|&amp;lt;b&amp;gt;public Browser timeTableInfo&amp;lt;/b&amp;gt;||A publicly accessible Browser object for timetable information.&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
==Methods==&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===AddVelocity===&lt;br /&gt;
{{MethodHeader|public native void AddVelocity(float velocity)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;velocity&#039;&#039;&#039; = Velocity to add to the current speed of the train.		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None	&lt;br /&gt;
;Syntax&lt;br /&gt;
 train.AddVelocity(5.0);	&lt;br /&gt;
;Notes&lt;br /&gt;
*Velocity parameter must be in metres per second and may be negative.&lt;br /&gt;
*Use the [[#Measurement Conversion Multipliers|Measurement Conversion Multipliers]] to convert from other units.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===ClearTrainTimetable===&lt;br /&gt;
{{MethodHeader|public void ClearTrainTimetable(ScenarioBehavior rule)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;rule&#039;&#039;&#039; = rule that called [[#SetTrainTimetable|SetTrainTimetable()]] on this train.		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None	&lt;br /&gt;
;Syntax&lt;br /&gt;
 train.ClearTimeTable(timetableRule);	&lt;br /&gt;
;Notes&lt;br /&gt;
*Clears the train timetable of this train. 	&lt;br /&gt;
*Having cleared the TrainTimetable, it is now safe again to set another TrainTimetable for this train through [[#SetTrainTimetable|SetTrainTimetable()]].&lt;br /&gt;
*This method must only be called by the rule which called SetTrainTimetable() in the first place. &lt;br /&gt;
*It is the responsibility of the caller to post a (TrainTimetable, Touch) message after calling this function.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===DecTrainBusy===&lt;br /&gt;
{{MethodHeader|public void DecTrainBusy(void)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*None		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None	&lt;br /&gt;
;Syntax&lt;br /&gt;
 train.DecTrainBusy();	&lt;br /&gt;
;Notes&lt;br /&gt;
*Decrements this train&#039;s busy count.&lt;br /&gt;
*See [[#IsTrainBusy|IsTrainBusy()]] for further details.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Derail===&lt;br /&gt;
{{MethodHeader|public native void Derail(void)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*None		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None	&lt;br /&gt;
;Syntax&lt;br /&gt;
 train.Derail();	&lt;br /&gt;
;Notes&lt;br /&gt;
*Deliberately derails the train.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===EnablePhysics===&lt;br /&gt;
{{MethodHeader|public native void EnablePhysics(bool enable)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;enable&#039;&#039;&#039; = True to enable physics calculations for this train, false to disable		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None	&lt;br /&gt;
;Syntax&lt;br /&gt;
 train.EnablePhysics(false);		&lt;br /&gt;
;Notes&lt;br /&gt;
*Turning physics off for scenic rolling stock that the player cannot interact with can boost performance.&lt;br /&gt;
*There is no point in doing physic calculations for idle rollingstock.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetActiveDriver===&lt;br /&gt;
{{MethodHeader|public native DriverCharacter GetActiveDriver(void)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*None		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*The active driver of this train, null if there is no driver assigned.&lt;br /&gt;
;Syntax&lt;br /&gt;
 DriverCharacter driver = train.GetActiveDriver();		&lt;br /&gt;
;Notes&lt;br /&gt;
*There may be more than one driver on a train but there is only one active driver and an individual Locomotive may only have one driver assigned.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetAdvisoryLimit===&lt;br /&gt;
{{MethodHeader|public native float GetAdvisoryLimit(void)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*None		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*The current advisory speed limit set by script.		&lt;br /&gt;
;Syntax&lt;br /&gt;
 float speed = train.GetAdvisoryLimit();		&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetAllowsUserContol===&lt;br /&gt;
{{MethodHeader|public native bool GetAllowsUserControl(void)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*None		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*True if this train allows the user to control it directly through DCC or Cabin interfaces, false otherwise.&lt;br /&gt;
;Syntax&lt;br /&gt;
 bool canDrive =train.getAllowsUserControl();		&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetAutopilotMode===&lt;br /&gt;
{{MethodHeader|public native int GetAutopilot Mode(void)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*None		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*One of the [[#Train Control Modes|Train Control Mode]] constants defining the method by which the train is currently controlled.&lt;br /&gt;
;Syntax&lt;br /&gt;
 int controlMode = train.GetAutopilotMode();		&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetAutopilotStopJunctionBase===&lt;br /&gt;
{{MethodHeader|public native JunctionBase GetAutopilotStopJunctionBase(void)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*None		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*The junction object that is preventing the autopilot from taking this train any further, null if the train is not stopped by a junction.		&lt;br /&gt;
;Syntax&lt;br /&gt;
 JunctionBase junction = train GetAutopilotStopJunctionBase();		&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetAutopilotStopTrain===&lt;br /&gt;
{{MethodHeader|public native Train GetAutopilotStopTrain(void)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*None		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*The train that is preventing the autopilot from taking this train any further, null if the train is not being held up by another train.		&lt;br /&gt;
;Syntax&lt;br /&gt;
 Train otherTrain = train.GetAutopilotStopTrain();		&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetAutopilotTargetSlowing===&lt;br /&gt;
{{MethodHeader|public native bool GetAutopilotTargetSlowing(void)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*None		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*True if the autopilot is slowing down for its target destination, false otherwise.		&lt;br /&gt;
;Syntax&lt;br /&gt;
 bool isSlowing = train.GetAutopilotTargetSlowing();		&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetDCCThrottle===&lt;br /&gt;
{{MethodHeader|public native float GetDCCThrottle(void)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*None		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*The DCC throttle setting for this train when using DCC physics.		&lt;br /&gt;
;Syntax&lt;br /&gt;
 float throttle = GetDCCThrottle();		&lt;br /&gt;
;Notes&lt;br /&gt;
*The returned value will be in the range [-1.0 .. 1.0] where -1.0 is full throttle in reverse, 0.0 is stationary and 1.0 is full throttle forward.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetFrontmostLocomotive===&lt;br /&gt;
{{MethodHeader|public native Locomotive GetFrontmostLocomotive(void)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*None		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*Returns a reference to the frontmost locomotive in the train.	&lt;br /&gt;
;Syntax&lt;br /&gt;
 Loco = Train.GetFrontmostLocomotive();	&lt;br /&gt;
;Notes&lt;br /&gt;
*&amp;lt;font color=red&amp;gt;The &#039;&#039;front&#039;&#039; of the train is defined relative to the train&#039;s current heading.??&amp;lt;/font&amp;gt;	&lt;br /&gt;
*The train&#039;s heading may not correspond to its physical appearance and can change during game play.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetHeadlightState===&lt;br /&gt;
{{MethodHeader|public native bool GetHeadlightState(void)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*None		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*True if headlights are turned on, false otherwise.		&lt;br /&gt;
;Syntax&lt;br /&gt;
 bool lights = train.GetHeadlightState();		&lt;br /&gt;
;Notes&lt;br /&gt;
*Only the frontmost locomotive will display headlighs.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetLastVisitedBuildable===&lt;br /&gt;
{{MethodHeader|public Buildable GetLastVisitedBuildable(void)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*None		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*The last [[Class Buildable|Buildable]] object visited by this train, null if there have been no such visits.&lt;br /&gt;
;Syntax&lt;br /&gt;
 Buildable buildable = train.GetLastVisitedBuildable();		&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetLastVisitedIndustry===&lt;br /&gt;
{{MethodHeader|public Industry GetLastVisitedIndustry(void)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*None		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*The last Industry object visited by this train, null if there have been no such visits.		&lt;br /&gt;
;Syntax&lt;br /&gt;
 Industry industry = train.GetLastVisitedIndustry();		&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetLastVisitedTrack===&lt;br /&gt;
{{MethodHeader|public Track GetLastVisitedTrack(void)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*None		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*The last track segment visited by this train.		&lt;br /&gt;
;Syntax&lt;br /&gt;
 Track track = train.GetLastVisitedTrack();		&lt;br /&gt;
;Notes&lt;br /&gt;
*Note that the returned value may be null. &amp;lt;font color=red&amp;gt;How is that possible?&amp;lt;/font&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetHighBeams===&lt;br /&gt;
{{MethodHeader|public bool GetHighBeams(void)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*None		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*True if the frontmost locomotive&#039;s high beams are on, false otherwise.		&lt;br /&gt;
;Syntax&lt;br /&gt;
 bool High_Lights = train.GetHighBeams();		&lt;br /&gt;
;Notes&lt;br /&gt;
*See also [[Class Vehicle#GetHighBeams|Vehicle.GetHighBeams()]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetMaximumCouplingStressVehicle===&lt;br /&gt;
{{MethodHeader|public native Vehicle GetMaximumCouplingStressVehicle(void)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*None		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*The Vehicle in this consist that is experiencing the greatest level of coupling stress.		&lt;br /&gt;
;Syntax&lt;br /&gt;
 Vehicle vehicle = GetMaximumCouplingStressVehicle();		&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetPantographState===&lt;br /&gt;
{{MethodHeader|public native int GetPantographState(void)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*None		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*The state of the pantographs of the electric locomotives in this train.		&lt;br /&gt;
;Syntax&lt;br /&gt;
 int pantoState = train.GetPantographState();		&lt;br /&gt;
;Notes&lt;br /&gt;
*The returned value will be in the range [0..3] where:&lt;br /&gt;
**0 = Both pantographs down.&lt;br /&gt;
**1 = Front pantograph up.&lt;br /&gt;
**2 = Rear pantograph up.&lt;br /&gt;
**3 = Both pantographs up.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetPhysicsModel===&lt;br /&gt;
{{MethodHeader|public native int GetPhysicsModel(void)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*None		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*The mode of control chosen by the player to drive the locomotive		&lt;br /&gt;
;Syntax&lt;br /&gt;
 int Mode = train.GetPhysicsModel();		&lt;br /&gt;
;Notes&lt;br /&gt;
*The returned value will be :&lt;br /&gt;
**2 = CabinControl&lt;br /&gt;
**1 = DCCMode&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===GetSmoothedVelocity===&lt;br /&gt;
{{MethodHeader|public native float GetSmoothedVelocity(void)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*None		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*Returns a smoothed velocity, intended for human consumption.		&lt;br /&gt;
;Syntax&lt;br /&gt;
 float speed = train.GetSmoothedVelocity();		&lt;br /&gt;
;Notes&lt;br /&gt;
*If you require an accurate velocity readout for physics operations, use [[#GetVelocity|GetVelocity()]]. &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetSpeedLimit===&lt;br /&gt;
{{MethodHeader|public native float GetSpeedLimit(void)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*None		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*The current sign posted speed limit. 		&lt;br /&gt;
;Syntax&lt;br /&gt;
 float permittedSpeed = train.GetSpeedLimit();		&lt;br /&gt;
;Notes&lt;br /&gt;
*The speed limit is dependent on trackside signs placed in Surveyor as well as the direction of the train.&lt;br /&gt;
*A default value applies to track that isn&#039;t sign posted.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetTrackmarkDirection===&lt;br /&gt;
{{MethodHeader|public native int GetTrackmarkDirection(TrackMark mark)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;mark&#039;&#039;&#039; = A reference to the Trackmark to search for.&lt;br /&gt;
;Returned Value&lt;br /&gt;
* One of the [[#Found Results|Found Result]] values representing the location of the given track mark relative to this train.			&lt;br /&gt;
;Syntax&lt;br /&gt;
 int location = train.GetTrackmarkDirection(trackmark);		&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetTrainBrakes===&lt;br /&gt;
{{MethodHeader|public native float GetTrainBrakes(void)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*None		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*One of the [[#Train Brake Modes|Train Brake mode]] constants indicating the current state of this train&#039;s brakes.		&lt;br /&gt;
;Syntax&lt;br /&gt;
 float brakeState = train.GetTrainBrakes();		&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetTrainDisplayName===&lt;br /&gt;
{{MethodHeader|public native string GetTrainDisplayName(void)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*None		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*A localised display name for this train. 		&lt;br /&gt;
;Syntax&lt;br /&gt;
 string trainName = train.GetTrainDisplayName();		&lt;br /&gt;
;Notes&lt;br /&gt;
*This will be a name Trainz has created for the consist such as &amp;quot;Consist 0&amp;quot; and will match the description shown in the Minimap view. &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetTrainPriorityNumber===&lt;br /&gt;
{{MethodHeader|public native int GetTrainPriorityNumber(void)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*None		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*Train priority value in the range [1 .. 3]		&lt;br /&gt;
;Syntax&lt;br /&gt;
 int priority = train.GetTrainPriorityNumber();&lt;br /&gt;
;Notes&lt;br /&gt;
*See [[#SetTrainPriority|SetTrainPriority()]] for further details.		&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetTrainTimetable===&lt;br /&gt;
{{MethodHeader|public TrainTimetable GetTrainTimetable(void)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*None		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*The TrainTimetable that the train is currently using, null if there is none.&lt;br /&gt;
;Syntax&lt;br /&gt;
  TrainTimetable timetable = train.GetTrainTimetable();		&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetTrainVelocity===&lt;br /&gt;
{{MethodHeader|public native float GetTrainVelocity(void)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*None		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*The train&#039;s current velocity in metres per second.&lt;br /&gt;
;Syntax&lt;br /&gt;
  float speed = train.GetTrainVelocity();		&lt;br /&gt;
;Notes&lt;br /&gt;
* This function provides the instantaneous velocity for vehicles in this train, which is good for physics calculations but not good for human-readable display.  If you want human-readable display, use [[#GetSmoothedVelocity|GetSmoothedVelocity()]] instead.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===GetVehicles===&lt;br /&gt;
{{MethodHeader|public native Vehicle[ ] GetVehicles(void)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*None		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*Returns an array consisting of all the vehicles making up this train.	&lt;br /&gt;
;Syntax&lt;br /&gt;
 Vehicle[] vehicles = train.GetVehicles();	&lt;br /&gt;
;Notes&lt;br /&gt;
 *GetVehicles[0] is always the front vehicle of the train relative to the train&#039;s current heading.	&lt;br /&gt;
*The train&#039;s heading may not correspond to its physical appearance and can change during game play.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetVelocity===&lt;br /&gt;
{{MethodHeader|public native float GetVelocity(void)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*None		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*The train&#039;s current velocity.		&lt;br /&gt;
;Syntax&lt;br /&gt;
 float speed = train.GetVelocity();		&lt;br /&gt;
;Notes&lt;br /&gt;
*Warning!  The TS10 and TS12 Train.gs scripts advise this method is buggy and to use [[#GetSmoothedVelocity|GetSmoothedVelocity()]] or [[#GetTrainVelocity|GetTrainVelocity()]] instead.&lt;br /&gt;
*This function provides the instantaneous velocity for vehicles in this train, which is good for physics calculations but not good for human-readable display.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===HasReachedInnerJunctionRadius===&lt;br /&gt;
{{MethodHeader|public bool HasReachedJunctionInnerJunctionRadius(JunctionBase junction)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;junction&#039;&#039;&#039; = JunctionBase object to query.			&lt;br /&gt;
;Returned Value&lt;br /&gt;
*True if this train is within the inner radius of the given junction, false otherwise.		&lt;br /&gt;
;Syntax&lt;br /&gt;
 bool arrived = train.HasReachedInnerJunctionRadius(junction10);		&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===HasTrainTimetable===&lt;br /&gt;
{{MethodHeader|public bool HasTrainTimetable(void)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*None		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*True if this train has an attached TrainTimetable, false otherwise.		&lt;br /&gt;
;Syntax&lt;br /&gt;
 bool timed = train.HasTrainTimetable();		&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===IsScheduleRunning===&lt;br /&gt;
{{MethodHeader|public bool IsScheduleRunning(void)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*None		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*True if this train is currently running to a Schedule, false otherwise.		&lt;br /&gt;
;Syntax&lt;br /&gt;
 bool scheduled = train.IsScheduleRunning();		&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===IsScheduleWindowVisible===&lt;br /&gt;
{{MethodHeader|public bool IsScheduleWindowVisible(void)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*None		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*True if the schedule window for this train is currently open, false otherwise.		&lt;br /&gt;
;Syntax&lt;br /&gt;
 bool windowOpen = IsScheduleWindowVisible();		&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===IsStillInJunction===&lt;br /&gt;
{{MethodHeader|public bool IsStillInJunction(JunctionBase junction)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;junction&#039;&#039;&#039; = JunctionBase object to query.			&lt;br /&gt;
;Returned Value&lt;br /&gt;
*True if the train holds a Permit for the given junction, flse otherwise.		&lt;br /&gt;
;Syntax&lt;br /&gt;
 bool inJunction = train.IsStillInJunction(junction10);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===IsStopped===&lt;br /&gt;
{{MethodHeader|public native bool IsStopped(void)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*None		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*True if the train is currently stationary, false if it is in motion.		&lt;br /&gt;
;Syntax&lt;br /&gt;
 bool moving=train.IsMoving();		&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===IsTrainBusy===&lt;br /&gt;
{{MethodHeader|public bool IsTrainBusy(void)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*None		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*True if the train&#039;s &#039;busy&#039; count is greater than zero, false otherwise.		&lt;br /&gt;
;Syntax&lt;br /&gt;
 bool busy = train.IsTrainBusy();		&lt;br /&gt;
;Notes&lt;br /&gt;
*Using the [[#IncTrainBusy|IncTrainBusy()]] method, any piece of script code can tag a train being busy. &lt;br /&gt;
*The train can be untagged later by calling DecTrainBusy(). &lt;br /&gt;
*This mechanism is mainly used by industries that are doing something with the train. &lt;br /&gt;
*A train can be tagged as being busy more than once by calling IncTrainBusy() multiple times so different industries can tag the train. &lt;br /&gt;
*Each time IncTrainBusy() is called, an internal busy count is incremented and if that busy count is greater than zero, the train is considered busy.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===IsViewDetailsVisible===&lt;br /&gt;
{{MethodHeader|public bool IsViewDetailsVisible(void)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*None		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*true if the ViewDetails window for this train is visible, false otherwise.		&lt;br /&gt;
;Syntax&lt;br /&gt;
 bool visible = train.IsViewDetailsVisible();		&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===MapObjectIsInFront===&lt;br /&gt;
{{MethodHeader|public bool MapObjectIsInFront(MapObject obj, float range)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;obj&#039;&#039;&#039; = MapObject to search for.&lt;br /&gt;
*&#039;&#039;&#039;range&#039;&#039;&#039; = Maximum search distance.			&lt;br /&gt;
;Returned Value&lt;br /&gt;
*True if the object is found within the specified distance and in front of the train, false otherwise.		&lt;br /&gt;
;Syntax&lt;br /&gt;
 bool isClose = train.MapObjectIsInFront(terminus,100.0);		&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===ReleaseTrackPermits===&lt;br /&gt;
{{MethodHeader|public void ReleaseTrackPermits(Permit[ ] permitList)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;permitList&#039;&#039;&#039; = Permit array containing a list of permits to release.		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None	&lt;br /&gt;
;Syntax&lt;br /&gt;
 train.ReleaseTrackPermits(permitList);		&lt;br /&gt;
;Notes&lt;br /&gt;
*This method will release any permits from the &#039;&#039;permitList&#039;&#039; array that are currently held by this train.&lt;br /&gt;
*Any other permits in the array that are not held by this train will be ignored.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===RunSchedule===&lt;br /&gt;
{{MethodHeader|public thread void RunSchedule(Schedule schedule, bool loop, float delay)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;schedule&#039;&#039;&#039; = The Schedule that the train is to follow.&lt;br /&gt;
*&#039;&#039;&#039;loop&#039;&#039;&#039; = False to run the schedule once, True to repeat it continuously.&lt;br /&gt;
*&#039;&#039;&#039;delay&#039;&#039;&#039; = Time in seconds to wait before starting the schedule.			&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None	&lt;br /&gt;
;Syntax&lt;br /&gt;
 train.RunSchedule(schedule,false,10.0);		&lt;br /&gt;
;Notes&lt;br /&gt;
*See [[Class Schedule|Schedule]] for information on how to build a schedule.&lt;br /&gt;
*Only one schedule may run on a train at a time and the user cannot control the train when it is running a schedule.&lt;br /&gt;
*This method is a thread, so the calling code does not need to wait for it to finish and return before executing other code.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetAdvisoryLimit===&lt;br /&gt;
{{MethodHeader|public native void SetAdvisoryLimit(float speed)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;speed&#039;&#039;&#039; = Speed limit to set in &amp;lt;del&amp;gt;KPH&amp;lt;/del&amp;gt; metres/second.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None	&lt;br /&gt;
;Syntax&lt;br /&gt;
 train.SetAdvisoryLimit(60.0);&lt;br /&gt;
;Notes&lt;br /&gt;
*Sets an advisory speed limit for a script controlled train.&lt;br /&gt;
*Use zero in the speed parameter to clear any previously imposed limit.&lt;br /&gt;
*&amp;lt;font color=red&amp;gt;Does this really use KPH, most similar methods use MPS&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=red&amp;gt;Experimental evidence confirms that it&#039;s in m/s not kph or mph&amp;lt;/font&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetAutopilotMode===&lt;br /&gt;
{{MethodHeader|public native void SetAutopilotMode(int mode)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;mode&#039;&#039;&#039; = One of the [[#Train Control Modes|Train Control Mode]] constants specifying the method by which this train is controlled.		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None	&lt;br /&gt;
;Syntax&lt;br /&gt;
 train.SetAutopilotMode(Train.CONTROL_AUTOMANUAL);		&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetAutopilotTarget===&lt;br /&gt;
{{MethodHeader|public native void SetAutopilotTarget(Buildable buildable, string trigger)&amp;lt;br&amp;gt;public native void SetAutopilotTarget(Trackside trackside)&amp;lt;br&amp;gt;public native void SetAutopilotTarget(Track track)&amp;lt;br&amp;gt;public native void SetAutopilotTarget(JunctionBase junction)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;buildable&#039;&#039;&#039; = Buildable object to use as a destination.&lt;br /&gt;
*&#039;&#039;&#039;trigger&#039;&#039;&#039; = Attached trigger within the buildable, specified by name.&lt;br /&gt;
*&#039;&#039;&#039;trackside&#039;&#039;&#039; =  Trackside object to use as a destination.&lt;br /&gt;
*&#039;&#039;&#039;track&#039;&#039;&#039; = Track segment to use as a destination.&lt;br /&gt;
*&#039;&#039;&#039;junction&#039;&#039;&#039; = JunctionBase object to use as a destination.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None	&lt;br /&gt;
;Syntax&lt;br /&gt;
 train.SetAutopilotTarget(&amp;quot;Kings Cross Station&amp;quot;,&amp;quot;trigger1&amp;quot;);		&lt;br /&gt;
;Notes&lt;br /&gt;
*This method sets a destination for the autopilot to take this train to.&lt;br /&gt;
*Objects from respective child classes such as industries, signals and trackmarks may be specified.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetAutopilotTargetMinimumDistance===&lt;br /&gt;
{{MethodHeader|public native void SetAutopilotTargetMinimumDistance(float distance)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;distance&#039;&#039;&#039; = The minimum distance in metres, between the train and the autopilot target, to be reached before the train will start to slow down.			&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None	&lt;br /&gt;
;Syntax&lt;br /&gt;
 train SetAutopilotTargetMinimumDistance(100.0);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetAutoPilotTargetMinimumSpeed===&lt;br /&gt;
{{MethodHeader|public native void SetAutopilotTargetMinimumSpeed(float speed)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;speed&#039;&#039;&#039; = Minimum speed, in metres per second, that the train should be travelling at when it reaches the Autopilot target.			&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None	&lt;br /&gt;
;Syntax&lt;br /&gt;
 train.SetAutoPilotTargetMinimumSpeed(20.0);		&lt;br /&gt;
;Notes&lt;br /&gt;
*&amp;lt;font color=red&amp;gt;The documentation seems to mean that the train should be going at 20.0 OR MORE.  Shouldn&#039;t it be MaximumSpeed???&amp;lt;/font&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetBail===&lt;br /&gt;
{{MethodHeader|public native void SetBail(void)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*None		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None	&lt;br /&gt;
;Syntax&lt;br /&gt;
 train.SetBail();		&lt;br /&gt;
;Notes&lt;br /&gt;
*Depresses the bail control for a short period.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetCouplingMask===&lt;br /&gt;
{{MethodHeader|public void SetCouplingMask(int mask)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;mask&#039;&#039;&#039; = A mask specifying which of the trains exposed couplers are allowed to couple.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None	&lt;br /&gt;
;Syntax&lt;br /&gt;
 train.SetCouplingMask(Vehicle.COUPLE_NONE); // prevents this train from coupling to another in Driver mode.&lt;br /&gt;
;Notes&lt;br /&gt;
*The mask can be built using the [[Class Vehicle#Coupler Flags|Coupler Flag]] constants defined in [[Class Vehicle]].&lt;br /&gt;
*This method will not prevent vehicles or trains from coupling in Surveyor, but takes effect in Driver mode.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetDCCThrottle===&lt;br /&gt;
{{MethodHeader|public native void SetDCCThrottle(float throttle)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;throttle&#039;&#039;&#039; = Float value in the range -1.0 .. 1.0 defining the throttle setting for the train when using DCC physics.			&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None	&lt;br /&gt;
;Syntax&lt;br /&gt;
 train.SetDCCThrottle(0.0); //sets the throttle to neutral.		&lt;br /&gt;
;Notes&lt;br /&gt;
*Full speed ahead is 1.0&lt;br /&gt;
*Maximum in reverse is -1.0&lt;br /&gt;
*Neutral is 0.0&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetDecouplingMask===&lt;br /&gt;
{{MethodHeader|public void SetDecouplingMask(int mask)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;mask&#039;&#039;&#039; = A mask specifying which of the couplers are allowed to couple, applies to all of the vehicles in the train.			&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None	&lt;br /&gt;
;Syntax&lt;br /&gt;
 train.SetDecouplingMask(Vehicle.COUPLE_FRONT|Vehicle.COUPLE_BACK); // prevents vehicles being uncoupled from the train in Driver mode.&lt;br /&gt;
;Notes&lt;br /&gt;
*The mask can be built using the [[Class Vehicle#Coupler Flags|Coupler Flag]] constants defined in [[Class Vehicle]].&lt;br /&gt;
*This method will not prevent vehicles or trains from being uncoupled in Surveyor, but takes effect in Driver mode.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetDynamicBrakeMode===&lt;br /&gt;
{{MethodHeader|public native void SetDynamicBrakeMode(int mode)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*One of the [[#Dynamic Brake States|Dynamic Brake State]] constants indicating the current state of this train&#039;s brakes.			&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None	&lt;br /&gt;
;Syntax&lt;br /&gt;
 train.SetDynamicBrakeMode(Train.DYNAMIC_BRAKE_TRACTION);		&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetFloatingLimit===&lt;br /&gt;
{{MethodHeader|public native void SetFloatingLimit(float delta, bool enable)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;delta&#039;&#039;&#039; = Tolerance allowed from the posted limit in metres per second.&lt;br /&gt;
*&#039;&#039;&#039;enable&#039;&#039;&#039; = Use true to enable messages related to floating limits, false to disable.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None	&lt;br /&gt;
;Syntax&lt;br /&gt;
 train.SetFloatingLimit(5.0,true);		&lt;br /&gt;
;Notes&lt;br /&gt;
*Sets the floating speed limit level above the sign posted limit.&lt;br /&gt;
*The floating limit is an amount of tolerance above the current speed limit. &lt;br /&gt;
*Messages for floating speed violations are not to be confused with regular speed limit messages.&lt;br /&gt;
*The floating limit is monitored by the Scenario.Monitor() thread, and may be used for point deduction when speeding. It should therefore be reserved for player trains.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetHandBrake===&lt;br /&gt;
{{MethodHeader|public void SetHandBrake(bool state)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;state&#039;&#039;&#039; = Use true to apply the handbrake to all vehicles in this train which are not Locomotives, false to release the handbrake.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None	&lt;br /&gt;
;Syntax&lt;br /&gt;
 train.SetHandBrake(true);		&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetHeadlightState===&lt;br /&gt;
{{MethodHeader|public native void SetHeadlightState(bool lightsOn)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;lightsOn&#039;&#039;&#039; = True to turn the headlights on, false to turn them off.			&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None	&lt;br /&gt;
;Syntax&lt;br /&gt;
 train.SetHeadlightState(true);		&lt;br /&gt;
;Notes&lt;br /&gt;
*This method affects only the headlights on the frontmost locomotive.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetHighBeams===&lt;br /&gt;
{{MethodHeader|public void SetHighBeams(bool value)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;value&#039;&#039;&#039; = True to turn on high beams, false to turn them off.		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 train.SetHighBeams(true);		&lt;br /&gt;
;Notes&lt;br /&gt;
*See also [[Class Vehicle#SetHighBeams|Vehicle.SetHighColor()]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetLastVisitedBuildable===&lt;br /&gt;
{{MethodHeader|public void SetLastVisitedBuildable(Buildable buildable)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;buildable&#039;&#039;&#039; = Sets the last visited buildable to the given object.			&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None	&lt;br /&gt;
;Syntax&lt;br /&gt;
 train.SetLastVisitedBuildable(KingsCrossStation);		&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetManualThrottle===&lt;br /&gt;
{{MethodHeader|public native void SetManualThrottle(int notch)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;notch&#039;&#039;&#039; = Value in the range 0 .. 8 to set the throttle.			&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None	&lt;br /&gt;
;Syntax&lt;br /&gt;
 train.SetManualThrottle(5);		&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetPantogaphState===&lt;br /&gt;
{{MethodHeader|public native void SetPantographState(int state)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;state&#039;&#039;&#039; = Value in the range 0 .. 3 to set the pantographs if this train has them.			&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None	&lt;br /&gt;
;Syntax&lt;br /&gt;
 train.SetPantographState(3);		&lt;br /&gt;
;Notes&lt;br /&gt;
*Use one of these values for &#039;&#039;state&#039;&#039;:&lt;br /&gt;
**0 = Both pantographs down.&lt;br /&gt;
**1 = Front pantograph up.&lt;br /&gt;
**2 = Rear pantograph up.&lt;br /&gt;
**3 = Both pantographs up.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetReverser===&lt;br /&gt;
{{MethodHeader|public native void SetReverser(int mode)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;mode&#039;&#039;&#039; = One of the [[#Reverser Traction Modes|Reverser Traction Mode]] constants defining the required state of the train&#039;s reverser lever.			&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None	&lt;br /&gt;
;Syntax&lt;br /&gt;
 train.SetReverser(Train.TRACTION_REVERSE);		&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetTrainBrakes===&lt;br /&gt;
{{MethodHeader|public native void SetTrainBrakes(float mode)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;mode&#039;&#039;&#039; = One of the [[#Train Brake States|Train Brake State]] constants defining the required state of the train&#039;s brakes.			&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None	&lt;br /&gt;
;Syntax&lt;br /&gt;
 train.SetTrainBrakes(Train.TRAIN_BRAKE_EMERGENCY);		&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetTrainPriorityNumber===&lt;br /&gt;
{{MethodHeader|public native void SetTrainPriority Number(int priority)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;priority&#039;&#039;&#039; = Priority value in the range 1 .. 3.			&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None	&lt;br /&gt;
;Syntax&lt;br /&gt;
 train.SetTrainPriorityNumber(2);		&lt;br /&gt;
;Notes&lt;br /&gt;
*All trains and track sections can be assigned a priority value in the range of [1 - 3] with the default value being 2.&lt;br /&gt;
*The priority value is not a numerical scale of precedence, but a value for the AI driver to attempt to match.&lt;br /&gt;
*This means the driver will &#039;&#039;prefer&#039;&#039; track sections that have a priority equal to that of the train.&lt;br /&gt;
*Changing the priority of the train only takes affect when the driver restarts a new schedule.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetTrainTimetable===&lt;br /&gt;
{{MethodHeader|public void SetTrainTimetable(TrainTimetable timetable)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;timetable&#039;&#039;&#039; = Assigns the specified timetable to this train.			&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None	&lt;br /&gt;
;Syntax&lt;br /&gt;
 train.SetTrainTimetable(timetable);&lt;br /&gt;
;Notes&lt;br /&gt;
*This train must not already have a TrainTimetable assigned.&lt;br /&gt;
*To ensure that this proviso is met, use [[#ClearTrainTimetabel|ClearTrainTimetable()]] prior to calling this method.&lt;br /&gt;
*It is the responsibility of the caller to post a &amp;quot;TrainTimetable&amp;quot;,&amp;quot;Touch&amp;quot; message after calling this function.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetVelocity===&lt;br /&gt;
{{MethodHeader|public native void SetVelocity(float velocity)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;velocity&#039;&#039;&#039; = Velocity to apply to the train, in metres per second.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None	&lt;br /&gt;
;Syntax&lt;br /&gt;
 train.SetVelocity(0.0); // stops the train, subject to braking performance.		&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===ShowInConsistMenu===&lt;br /&gt;
{{MethodHeader|public native void ShowInConsistMenu(bool show)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;show&#039;&#039;&#039; = True to make this train visible to the in-game consist menu, false to hide it.			&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None	&lt;br /&gt;
;Syntax&lt;br /&gt;
 train.ShowInConsistMenu(false);		&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SoundHorn===&lt;br /&gt;
{{MethodHeader|public native void SoundHorn(void)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*None		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None	&lt;br /&gt;
;Syntax&lt;br /&gt;
 train.SoundHorn();		&lt;br /&gt;
;Notes&lt;br /&gt;
*Sounds the horn or whictle for all locomotives in this train.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===StopSchedule===&lt;br /&gt;
{{MethodHeader|public void StopSchedule(void)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*None		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None	&lt;br /&gt;
;Syntax&lt;br /&gt;
 train.StopSchedule();		&lt;br /&gt;
;Notes&lt;br /&gt;
*This method stops the Schedule this train is currently running (if any).&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===StopScheduleAndWait===&lt;br /&gt;
{{MethodHeader|public void StopSchedule(void)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*None		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None	&lt;br /&gt;
;Syntax&lt;br /&gt;
 train.StopSchedule();		&lt;br /&gt;
;Notes&lt;br /&gt;
*This method stops the Schedule this train is currently running (if any) and waits until the train&#039;s schedule actually stops before returning. &lt;br /&gt;
*If the train is not running a schedule, the method returns after broadcasting a &amp;quot;Schedule&amp;quot;,&amp;quot;Touch&amp;quot; message, in case someone is listening for schedule messages.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===StopTrainGently===&lt;br /&gt;
{{MethodHeader|public native void StopTrainGently(void)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*None		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None	&lt;br /&gt;
;Syntax&lt;br /&gt;
 train.StopTrainGently();		&lt;br /&gt;
;Notes&lt;br /&gt;
*Brings the train to a halt over a short time period.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===TakePermitOnTrack===&lt;br /&gt;
{{MethodHeader|public Permit[ ] TakePermitOnTrack(bool direction)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;direction&#039;&#039;&#039; = Direction relative to the train in which to take out permits.			&lt;br /&gt;
;Returned Value&lt;br /&gt;
*An array including any permits taken which have not yet been granted to this train. Some of these permits may not yet have been granted. 		&lt;br /&gt;
;Syntax&lt;br /&gt;
 Permit[] permits = train.TakePermitOnTrack(true);		&lt;br /&gt;
;Notes&lt;br /&gt;
*Gets permits on the current track in the given direction.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===TestTrackPermit===&lt;br /&gt;
{{MethodHeader|public native bool TestTrackPermit(Permit permit, bool innerOnly)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;permit&#039;&#039;&#039; = An existing Permit object.&lt;br /&gt;
*&#039;&#039;&#039;innerOnly&#039;&#039;&#039; = If true the method will test only the inner radius, if false the default radius of 150 metres will be used.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*True if this train is within the track controlled by &#039;&#039;permit&#039;&#039;, false otherwise. 		&lt;br /&gt;
;Syntax&lt;br /&gt;
 bool ownPermit = train.TestTrackPermit(permit1,false);		&lt;br /&gt;
;Notes&lt;br /&gt;
*The method generates an exception if the &#039;&#039;permit&#039;&#039; parameter does not refer to a track.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===ToggleScheduleWindow===&lt;br /&gt;
{{MethodHeader|public void ToggleScheduleWindow(void)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*None		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None	&lt;br /&gt;
;Syntax&lt;br /&gt;
 train.ToggleScheduleWindow();		&lt;br /&gt;
;Notes&lt;br /&gt;
*If the schedule window is already open/visible, this method will destroy it.&lt;br /&gt;
*Otherwise if the view details window is not visible, UpdateScheduleWindow() is called to create it for display.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===ToggleViewDetailsWindow===&lt;br /&gt;
{{MethodHeader|public void ToggleViewDetailsWindow(void)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*None		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None	&lt;br /&gt;
;Syntax&lt;br /&gt;
 train.ToggleViewDetailsWindow();		&lt;br /&gt;
;Notes&lt;br /&gt;
*If the ViewDetails window is already open/visible, this method will destroy it.&lt;br /&gt;
*Otherwise if the view details window is not visible, ViewDetails() is called to create it for display.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===TrackSearch===&lt;br /&gt;
{{MethodHeader|public native MapObject[ ] TrackSearch(bool direction, float distance)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;direction&#039;&#039;&#039; = Direction to search relative to the train&#039;s heading, true for forwards, false for backwards.&lt;br /&gt;
*&#039;&#039;&#039;distance&#039;&#039;&#039; = Maximum search distance in metres.			&lt;br /&gt;
;Returned Value&lt;br /&gt;
*An array of objects found along the track in the defined search direction, the array might be empty.		&lt;br /&gt;
;Syntax&lt;br /&gt;
 MapObject[] objects = train.TrackSearch(true,5000.0) // searches 5km forwards along the track.		&lt;br /&gt;
;Notes&lt;br /&gt;
*Gets all of the Trackside and SceneryWithTrack objects on a length of track that is either in front of or behind this train. &lt;br /&gt;
*Descendants of these classes are also returned.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===TracksideIsInFront===&lt;br /&gt;
{{MethodHeader|public bool TracksideIsInFront(Trackside obj, float range)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;obj&#039;&#039;&#039; = Trackside object to search for.&lt;br /&gt;
*&#039;&#039;&#039;range&#039;&#039;&#039; = Mximum search distance.			&lt;br /&gt;
;Returned Value&lt;br /&gt;
*True if the object is logically forward of this train, false otherwise.		&lt;br /&gt;
;Syntax&lt;br /&gt;
 bool found = train.TracksideIsInFront(signal1,500.0);		&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Turnaround===&lt;br /&gt;
{{MethodHeader|public native void Turnaround(void)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*None		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None	&lt;br /&gt;
;Syntax&lt;br /&gt;
 train.Turnaround();		&lt;br /&gt;
;Notes&lt;br /&gt;
*Reverses the logical direction of the train, ie changes its heading.&lt;br /&gt;
*The physical direction of the vehicles is not altered but the throttle direction is reversed.&lt;br /&gt;
*If the camera is focused on the train in tracking view when this method is called the camera&#039;s direction of view (relative to the map) will alter through 180 degrees.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===UpdateScheduleWindow===&lt;br /&gt;
{{MethodHeader|public void UpdateScheduleWindow(string vehicleName)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;vehicleName&#039;&#039;&#039; = Name of vehicle within the train.			&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None	&lt;br /&gt;
;Syntax&lt;br /&gt;
 train.UpdateScheduleWindow(&amp;quot;brake2&amp;quot;);		&lt;br /&gt;
;Notes&lt;br /&gt;
*Updates the schedule window from the given vehicle.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===UpdateViewDetails===&lt;br /&gt;
{{MethodHeader|public void UpdateViewDetails(Vehicle vehicle)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;vehicle&#039;&#039;&#039; = Reference to a vehicle within the train.			&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None	&lt;br /&gt;
;Syntax&lt;br /&gt;
 train.UpdateViewDetails(vehicle);&lt;br /&gt;
;Notes&lt;br /&gt;
*Called by Vehicle.UpdateViewDetails() when a vehicle&#039;s load has changed so that the train&#039;s detail window can be amended.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===UpdateViewDetailsLocomotive===&lt;br /&gt;
{{MethodHeader|public void UpdateViewDetailsLocomotive(void)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*None&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None	&lt;br /&gt;
;Syntax&lt;br /&gt;
 train.UpdateViewDetailsLocomotive(vehicle);&lt;br /&gt;
;Notes&lt;br /&gt;
*Called by Locomotive.UpdateViewDetails() when any of the Locomotive&#039;s operating parameters have changed so that the train&#039;s detail window can be amended.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===ViewDetails===&lt;br /&gt;
{{MethodHeader|public void ViewDetails(Vehicle vehicle)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;vehicle&#039;&#039;&#039; = Reference to a vehicle within the train.			&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None	&lt;br /&gt;
;Syntax&lt;br /&gt;
 train.ViewDetails(vehicle);		&lt;br /&gt;
;Notes&lt;br /&gt;
*This method is called by Vehicle.ViewDetails() when the user has requested to view the details of the consist.&lt;br /&gt;
*It will create a Browser window listing information about the train including who the driver character is and the loads of all vehicles.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===WasRunScheduleSuccessful===&lt;br /&gt;
{{MethodHeader|public bool WasRunScheduleSuccessful(void)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*None		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*True if the most recently run schedule was successfully, false otherwise. 		&lt;br /&gt;
;Syntax&lt;br /&gt;
 train.WasRunScheduleSuccessful();		&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Code Examples==&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Related Methods==&lt;br /&gt;
[[Class TrainUtil#AreInTrain|TrainUtil.AreInTrain()]]&amp;lt;br&amp;gt;&lt;br /&gt;
[[Class TrainUtil#CreateTrainFromSoup|TrainUtil.CreateTrainFromSoup()]]&amp;lt;br&amp;gt;&lt;br /&gt;
[[Class TrainUtil#IsInTrain|TrainUtil.IsInTrain()]]&amp;lt;br&amp;gt;&lt;br /&gt;
[[Class World#CreateTrain|World.CreateTrain()]]&amp;lt;br&amp;gt;&lt;br /&gt;
[[Class World#DeleteTrain|World.DeleteTrain()]]&amp;lt;br&amp;gt;&lt;br /&gt;
[[Class World#GetTrainList|World.GetTrainList()]]&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Categories==&lt;br /&gt;
[[Category:Script Class]]&lt;/div&gt;</summary>
		<author><name>Ciceronmt</name></author>
	</entry>
	<entry>
		<id>https://wiki.trainzsimulator.com/index.php?title=Class_Train&amp;diff=20710</id>
		<title>Class Train</title>
		<link rel="alternate" type="text/html" href="https://wiki.trainzsimulator.com/index.php?title=Class_Train&amp;diff=20710"/>
		<updated>2019-08-21T20:07:38Z</updated>

		<summary type="html">&lt;p&gt;Ciceronmt: /* SetHighBeams */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;*[[TrainzScript Language Reference|API Hierarchy]]&lt;br /&gt;
**[[Class GSObject|GSObject]] *&lt;br /&gt;
***[[Class GameObject|GameObject]]&lt;br /&gt;
****Train&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
*A train is a collection of vehicles in TRS.&lt;br /&gt;
*They act as a single entity and may be controlled using this class.&lt;br /&gt;
*A train is placed on a track in script by using [[Class World#CreateTrain|World.CreateTrain()]] or [[Class TrainUtil#CreateTrainFromSoup|TrainUtil.CreateTrainFromSoup()]]. &lt;br /&gt;
*Trainz will automatically create a Train object for each consist that appears in the game.&lt;br /&gt;
*When an existing train is uncoupled and split up into two separate consists a new train object is created.&lt;br /&gt;
*Similarly when two trains couple one of the train objects is destroyed.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Messages==&lt;br /&gt;
*Messages sent to and from Train objects are listed below:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
{{TableHeader|width=50%|margin=15px}}&lt;br /&gt;
|-&lt;br /&gt;
|bgcolor=&amp;quot;#EEEEEE&amp;quot;|&#039;&#039;&#039;Major&#039;&#039;&#039;||bgcolor=&amp;quot;#EEEEEE&amp;quot;|&#039;&#039;&#039;Minor&#039;&#039;&#039;||bgcolor=&amp;quot;#EEEEEE&amp;quot;|&#039;&#039;&#039;Source&#039;&#039;&#039;||bgcolor=&amp;quot;#EEEEEE&amp;quot; |&#039;&#039;&#039;Destination&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|Schedule||Abort||Train||Train  &lt;br /&gt;
|-&lt;br /&gt;
|Schedule||Complete||Train||Broadcast  &lt;br /&gt;
|-&lt;br /&gt;
|Schedule||Touch||Train||Train  &lt;br /&gt;
|-&lt;br /&gt;
|[[Train Messages|Train]]||Deleted||Train||&lt;br /&gt;
|-&lt;br /&gt;
|[[Signal Messages|Train]]||Entered red signal notify||Train||Broadcast  &lt;br /&gt;
|-&lt;br /&gt;
|[[Signal Messages|Train]]||Entered red signal||Signal||Train  &lt;br /&gt;
|-&lt;br /&gt;
|[[Object Messages|Train]]||EnterTrack||Track||Train  &lt;br /&gt;
|-&lt;br /&gt;
|[[Object Messages|Train]]||InnerEnterTrack||Track||Train  &lt;br /&gt;
|-&lt;br /&gt;
|[[Object Messages|Train]]||InnerLeaveTrack||Track||Train  &lt;br /&gt;
|-&lt;br /&gt;
|[[Object Messages|Train]]||LeaveTrack||Track||Train  &lt;br /&gt;
|-&lt;br /&gt;
|[[Train Messages|Train]]||Over advisory speed limit||Train||Broadcast  &lt;br /&gt;
|-&lt;br /&gt;
|[[Train Messages|Train]]||Over floating speed limit||Train||Broadcast  &lt;br /&gt;
|-&lt;br /&gt;
|[[Train Messages|Train]]||Over speed limit||Train||Broadcast  &lt;br /&gt;
|-&lt;br /&gt;
|[[Train Messages|Train]]||ReachedTarget||Train||Train&lt;br /&gt;
|-&lt;br /&gt;
|[[Train Messages|Train]]||SlowingForTarget||Train||Train  &lt;br /&gt;
|-&lt;br /&gt;
|[[Train Messages|Train]]||StartedMoving||Train||Train  &lt;br /&gt;
|-&lt;br /&gt;
|[[Train Messages|Train]]||StoppedMoving||Train||Train  &lt;br /&gt;
|-&lt;br /&gt;
|[[Train Messages|Train]]||Under advisory speed limit||Train||Broadcast  &lt;br /&gt;
|-&lt;br /&gt;
|[[Train Messages|Train]]||Under floating speed limit||Train||Broadcast  &lt;br /&gt;
|-&lt;br /&gt;
|[[Train Messages|Train]]||Under speed limit||Train||Broadcast  &lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Constants==&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
===Train Control Modes===&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
{{TableHeader|width=95%|margin=15px}}&lt;br /&gt;
|width=375|public define int CONTROL_MANUAL = 1||User controls train, script can change settings.&lt;br /&gt;
|-&lt;br /&gt;
|public define int CONTROL_AUTOPILOT = 2||Autopilot controls train.&lt;br /&gt;
|-&lt;br /&gt;
|public define int CONTROL_AUTOMANUAL = 3||User controls train, autopilot takes over when train is not currently &#039;focused&#039;.&lt;br /&gt;
|-&lt;br /&gt;
|public define int CONTROL_SCRIPT = 4||Only the script can control the train.&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
===Reverser Traction Modes===&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
{{TableHeader|width=95%|margin=15px}}&lt;br /&gt;
|width=375|public define int TRACTION_FORWARD = 2||Reverse is in forward setting.&lt;br /&gt;
|-&lt;br /&gt;
|public define int TRACTION_NEUTRAL = 1||Reverser is in neutral.&lt;br /&gt;
|-&lt;br /&gt;
|public define int TRACTION_REVERSE = 0||Reverser is in reverse.&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
===Train Brake Modes===&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
{{TableHeader|width=95%|margin=15px}}&lt;br /&gt;
|width=375|public define float  TRAIN_BRAKE_RELEASE = 0.0||Train brakes are released.&lt;br /&gt;
|-&lt;br /&gt;
|public define float  TRAIN_BRAKE_INITIAL = 1.0||Train brakes are in initial mode.&lt;br /&gt;
|-&lt;br /&gt;
|public define float  TRAIN_BRAKE_APPLICATION = 2.0||Train brakes are applied.&lt;br /&gt;
|-&lt;br /&gt;
|public define float  TRAIN_BRAKE_HANDLE_OFF = 3.0||Train brake handle is off.&lt;br /&gt;
|-&lt;br /&gt;
|public define float  TRAIN_BRAKE_EMERGENCY = 4.0||Train brakes are in emergency stop position.&lt;br /&gt;
|-&lt;br /&gt;
|public define float  TRAIN_BRAKE_LAP = 5.0||Train brakes are in the lap position, not available for all trains.&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
===Dynamic Brake States===&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
{{TableHeader|width=95%|margin=15px}}&lt;br /&gt;
|width=375|public define int  DYNAMIC_BRAKE_TRACTION = 0||Dynamic brakes in traction mode.&lt;br /&gt;
|-&lt;br /&gt;
|public define int  DYNAMIC_BRAKE_NEUTRAL = 1 ||Dynamic brakes in neutral.&lt;br /&gt;
|-&lt;br /&gt;
|public define int  DYNAMIC_BRAKE_BRAKE = 2 ||Dynamic brakes are on.&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Found Results===&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
{{TableHeader|width=95%|margin=15px}}&lt;br /&gt;
|width=375|public define int  RESULT_NONE = 0||Item not found.&lt;br /&gt;
|-&lt;br /&gt;
|public define int  RESULT_FORWARD = 1||Item is in front of train.&lt;br /&gt;
|-&lt;br /&gt;
|public define int  RESULT_INSIDE = 2||Item is within the train, ie between the front and the rear limits.&lt;br /&gt;
|-&lt;br /&gt;
|public define int  RESULT_BACKWARD = 3||Item is behind the train.&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
===Measurement Conversion Multipliers===&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
{{TableHeader|width=95%|margin=15px}}&lt;br /&gt;
|width=375|public define float  KPH_TO_MPS = 0.278||Kilometres per hour -&amp;gt; Metres per second.&lt;br /&gt;
|-&lt;br /&gt;
|public define float  MPH_TO_MPS = 0.447||Miles per hour -&amp;gt; Metres per second.&lt;br /&gt;
|-&lt;br /&gt;
|public define float  MPH_TO_KPH = 1.609||Miles per hour -&amp;gt; Kilometres per hour.&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
==Members==&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
{{TableHeader|width=95%|margin=15px}}&lt;br /&gt;
|width=375|&amp;lt;b&amp;gt;public Browser timeTableInfo&amp;lt;/b&amp;gt;||A publicly accessible Browser object for timetable information.&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
==Methods==&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===AddVelocity===&lt;br /&gt;
{{MethodHeader|public native void AddVelocity(float velocity)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;velocity&#039;&#039;&#039; = Velocity to add to the current speed of the train.		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None	&lt;br /&gt;
;Syntax&lt;br /&gt;
 train.AddVelocity(5.0);	&lt;br /&gt;
;Notes&lt;br /&gt;
*Velocity parameter must be in metres per second and may be negative.&lt;br /&gt;
*Use the [[#Measurement Conversion Multipliers|Measurement Conversion Multipliers]] to convert from other units.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===ClearTrainTimetable===&lt;br /&gt;
{{MethodHeader|public void ClearTrainTimetable(ScenarioBehavior rule)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;rule&#039;&#039;&#039; = rule that called [[#SetTrainTimetable|SetTrainTimetable()]] on this train.		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None	&lt;br /&gt;
;Syntax&lt;br /&gt;
 train.ClearTimeTable(timetableRule);	&lt;br /&gt;
;Notes&lt;br /&gt;
*Clears the train timetable of this train. 	&lt;br /&gt;
*Having cleared the TrainTimetable, it is now safe again to set another TrainTimetable for this train through [[#SetTrainTimetable|SetTrainTimetable()]].&lt;br /&gt;
*This method must only be called by the rule which called SetTrainTimetable() in the first place. &lt;br /&gt;
*It is the responsibility of the caller to post a (TrainTimetable, Touch) message after calling this function.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===DecTrainBusy===&lt;br /&gt;
{{MethodHeader|public void DecTrainBusy(void)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*None		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None	&lt;br /&gt;
;Syntax&lt;br /&gt;
 train.DecTrainBusy();	&lt;br /&gt;
;Notes&lt;br /&gt;
*Decrements this train&#039;s busy count.&lt;br /&gt;
*See [[#IsTrainBusy|IsTrainBusy()]] for further details.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Derail===&lt;br /&gt;
{{MethodHeader|public native void Derail(void)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*None		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None	&lt;br /&gt;
;Syntax&lt;br /&gt;
 train.Derail();	&lt;br /&gt;
;Notes&lt;br /&gt;
*Deliberately derails the train.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===EnablePhysics===&lt;br /&gt;
{{MethodHeader|public native void EnablePhysics(bool enable)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;enable&#039;&#039;&#039; = True to enable physics calculations for this train, false to disable		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None	&lt;br /&gt;
;Syntax&lt;br /&gt;
 train.EnablePhysics(false);		&lt;br /&gt;
;Notes&lt;br /&gt;
*Turning physics off for scenic rolling stock that the player cannot interact with can boost performance.&lt;br /&gt;
*There is no point in doing physic calculations for idle rollingstock.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetActiveDriver===&lt;br /&gt;
{{MethodHeader|public native DriverCharacter GetActiveDriver(void)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*None		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*The active driver of this train, null if there is no driver assigned.&lt;br /&gt;
;Syntax&lt;br /&gt;
 DriverCharacter driver = train.GetActiveDriver();		&lt;br /&gt;
;Notes&lt;br /&gt;
*There may be more than one driver on a train but there is only one active driver and an individual Locomotive may only have one driver assigned.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetAdvisoryLimit===&lt;br /&gt;
{{MethodHeader|public native float GetAdvisoryLimit(void)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*None		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*The current advisory speed limit set by script.		&lt;br /&gt;
;Syntax&lt;br /&gt;
 float speed = train.GetAdvisoryLimit();		&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetAllowsUserContol===&lt;br /&gt;
{{MethodHeader|public native bool GetAllowsUserControl(void)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*None		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*True if this train allows the user to control it directly through DCC or Cabin interfaces, false otherwise.&lt;br /&gt;
;Syntax&lt;br /&gt;
 bool canDrive =train.getAllowsUserControl();		&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetAutopilotMode===&lt;br /&gt;
{{MethodHeader|public native int GetAutopilot Mode(void)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*None		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*One of the [[#Train Control Modes|Train Control Mode]] constants defining the method by which the train is currently controlled.&lt;br /&gt;
;Syntax&lt;br /&gt;
 int controlMode = train.GetAutopilotMode();		&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetAutopilotStopJunctionBase===&lt;br /&gt;
{{MethodHeader|public native JunctionBase GetAutopilotStopJunctionBase(void)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*None		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*The junction object that is preventing the autopilot from taking this train any further, null if the train is not stopped by a junction.		&lt;br /&gt;
;Syntax&lt;br /&gt;
 JunctionBase junction = train GetAutopilotStopJunctionBase();		&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetAutopilotStopTrain===&lt;br /&gt;
{{MethodHeader|public native Train GetAutopilotStopTrain(void)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*None		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*The train that is preventing the autopilot from taking this train any further, null if the train is not being held up by another train.		&lt;br /&gt;
;Syntax&lt;br /&gt;
 Train otherTrain = train.GetAutopilotStopTrain();		&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetAutopilotTargetSlowing===&lt;br /&gt;
{{MethodHeader|public native bool GetAutopilotTargetSlowing(void)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*None		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*True if the autopilot is slowing down for its target destination, false otherwise.		&lt;br /&gt;
;Syntax&lt;br /&gt;
 bool isSlowing = train.GetAutopilotTargetSlowing();		&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetDCCThrottle===&lt;br /&gt;
{{MethodHeader|public native float GetDCCThrottle(void)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*None		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*The DCC throttle setting for this train when using DCC physics.		&lt;br /&gt;
;Syntax&lt;br /&gt;
 float throttle = GetDCCThrottle();		&lt;br /&gt;
;Notes&lt;br /&gt;
*The returned value will be in the range [-1.0 .. 1.0] where -1.0 is full throttle in reverse, 0.0 is stationary and 1.0 is full throttle forward.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetFrontmostLocomotive===&lt;br /&gt;
{{MethodHeader|public native Locomotive GetFrontmostLocomotive(void)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*None		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*Returns a reference to the frontmost locomotive in the train.	&lt;br /&gt;
;Syntax&lt;br /&gt;
 Loco = Train.GetFrontmostLocomotive();	&lt;br /&gt;
;Notes&lt;br /&gt;
*&amp;lt;font color=red&amp;gt;The &#039;&#039;front&#039;&#039; of the train is defined relative to the train&#039;s current heading.??&amp;lt;/font&amp;gt;	&lt;br /&gt;
*The train&#039;s heading may not correspond to its physical appearance and can change during game play.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetHeadlightState===&lt;br /&gt;
{{MethodHeader|public native bool GetHeadlightState(void)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*None		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*True if headlights are turned on, false otherwise.		&lt;br /&gt;
;Syntax&lt;br /&gt;
 bool lights = train.GetHeadlightState();		&lt;br /&gt;
;Notes&lt;br /&gt;
*Only the frontmost locomotive will display headlighs.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetLastVisitedBuildable===&lt;br /&gt;
{{MethodHeader|public Buildable GetLastVisitedBuildable(void)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*None		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*The last [[Class Buildable|Buildable]] object visited by this train, null if there have been no such visits.&lt;br /&gt;
;Syntax&lt;br /&gt;
 Buildable buildable = train.GetLastVisitedBuildable();		&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetLastVisitedIndustry===&lt;br /&gt;
{{MethodHeader|public Industry GetLastVisitedIndustry(void)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*None		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*The last Industry object visited by this train, null if there have been no such visits.		&lt;br /&gt;
;Syntax&lt;br /&gt;
 Industry industry = train.GetLastVisitedIndustry();		&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetLastVisitedTrack===&lt;br /&gt;
{{MethodHeader|public Track GetLastVisitedTrack(void)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*None		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*The last track segment visited by this train.		&lt;br /&gt;
;Syntax&lt;br /&gt;
 Track track = train.GetLastVisitedTrack();		&lt;br /&gt;
;Notes&lt;br /&gt;
*Note that the returned value may be null. &amp;lt;font color=red&amp;gt;How is that possible?&amp;lt;/font&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetHighBeams===&lt;br /&gt;
{{MethodHeader|public bool GetHighBeams(void)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*None		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*True if the frontmost locomotive&#039;s high beams are on, false otherwise.		&lt;br /&gt;
;Syntax&lt;br /&gt;
 bool High_Lights = train.GetHighBeams();		&lt;br /&gt;
;Notes&lt;br /&gt;
*See also [[Class Vehicle#GetHighBeams|Vehicle.GetHighBeams()]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetMaximumCouplingStressVehicle===&lt;br /&gt;
{{MethodHeader|public native Vehicle GetMaximumCouplingStressVehicle(void)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*None		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*The Vehicle in this consist that is experiencing the greatest level of coupling stress.		&lt;br /&gt;
;Syntax&lt;br /&gt;
 Vehicle vehicle = GetMaximumCouplingStressVehicle();		&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetPantographState===&lt;br /&gt;
{{MethodHeader|public native int GetPantographState(void)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*None		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*The state of the pantographs of the electric locomotives in this train.		&lt;br /&gt;
;Syntax&lt;br /&gt;
 int pantoState = train.GetPantographState();		&lt;br /&gt;
;Notes&lt;br /&gt;
*The returned value will be in the range [0..3] where:&lt;br /&gt;
**0 = Both pantographs down.&lt;br /&gt;
**1 = Front pantograph up.&lt;br /&gt;
**2 = Rear pantograph up.&lt;br /&gt;
**3 = Both pantographs up.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetPhysicsModel===&lt;br /&gt;
{{MethodHeader|public native int GetPhysicsModel(void)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*None		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*The mode of control chosen by the player to drive the locomotive		&lt;br /&gt;
;Syntax&lt;br /&gt;
 int Mode = train.GetPhysicsModel();		&lt;br /&gt;
;Notes&lt;br /&gt;
*The returned value will be :&lt;br /&gt;
**2 = CabinControl&lt;br /&gt;
**1 = DCCMode&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===GetSmoothedVelocity===&lt;br /&gt;
{{MethodHeader|public native float GetSmoothedVelocity(void)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*None		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*Returns a smoothed velocity, intended for human consumption.		&lt;br /&gt;
;Syntax&lt;br /&gt;
 float speed = train.GetSmoothedVelocity();		&lt;br /&gt;
;Notes&lt;br /&gt;
*If you require an accurate velocity readout for physics operations, use [[#GetVelocity|GetVelocity()]]. &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetSpeedLimit===&lt;br /&gt;
{{MethodHeader|public native float GetSpeedLimit(void)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*None		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*The current sign posted speed limit. 		&lt;br /&gt;
;Syntax&lt;br /&gt;
 float permittedSpeed = train.GetSpeedLimit();		&lt;br /&gt;
;Notes&lt;br /&gt;
*The speed limit is dependent on trackside signs placed in Surveyor as well as the direction of the train.&lt;br /&gt;
*A default value applies to track that isn&#039;t sign posted.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetTrackmarkDirection===&lt;br /&gt;
{{MethodHeader|public native int GetTrackmarkDirection(TrackMark mark)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;mark&#039;&#039;&#039; = A reference to the Trackmark to search for.&lt;br /&gt;
;Returned Value&lt;br /&gt;
* One of the [[#Found Results|Found Result]] values representing the location of the given track mark relative to this train.			&lt;br /&gt;
;Syntax&lt;br /&gt;
 int location = train.GetTrackmarkDirection(trackmark);		&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetTrainBrakes===&lt;br /&gt;
{{MethodHeader|public native float GetTrainBrakes(void)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*None		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*One of the [[#Train Brake Modes|Train Brake mode]] constants indicating the current state of this train&#039;s brakes.		&lt;br /&gt;
;Syntax&lt;br /&gt;
 float brakeState = train.GetTrainBrakes();		&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetTrainDisplayName===&lt;br /&gt;
{{MethodHeader|public native string GetTrainDisplayName(void)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*None		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*A localised display name for this train. 		&lt;br /&gt;
;Syntax&lt;br /&gt;
 string trainName = train.GetTrainDisplayName();		&lt;br /&gt;
;Notes&lt;br /&gt;
*This will be a name Trainz has created for the consist such as &amp;quot;Consist 0&amp;quot; and will match the description shown in the Minimap view. &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetTrainPriorityNumber===&lt;br /&gt;
{{MethodHeader|public native int GetTrainPriorityNumber(void)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*None		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*Train priority value in the range [1 .. 3]		&lt;br /&gt;
;Syntax&lt;br /&gt;
 int priority = train.GetTrainPriorityNumber();&lt;br /&gt;
;Notes&lt;br /&gt;
*See [[#SetTrainPriority|SetTrainPriority()]] for further details.		&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetTrainTimetable===&lt;br /&gt;
{{MethodHeader|public TrainTimetable GetTrainTimetable(void)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*None		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*The TrainTimetable that the train is currently using, null if there is none.&lt;br /&gt;
;Syntax&lt;br /&gt;
  TrainTimetable timetable = train.GetTrainTimetable();		&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetTrainVelocity===&lt;br /&gt;
{{MethodHeader|public native float GetTrainVelocity(void)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*None		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*The train&#039;s current velocity in metres per second.&lt;br /&gt;
;Syntax&lt;br /&gt;
  float speed = train.GetTrainVelocity();		&lt;br /&gt;
;Notes&lt;br /&gt;
* This function provides the instantaneous velocity for vehicles in this train, which is good for physics calculations but not good for human-readable display.  If you want human-readable display, use [[#GetSmoothedVelocity|GetSmoothedVelocity()]] instead.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===GetVehicles===&lt;br /&gt;
{{MethodHeader|public native Vehicle[ ] GetVehicles(void)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*None		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*Returns an array consisting of all the vehicles making up this train.	&lt;br /&gt;
;Syntax&lt;br /&gt;
 Vehicle[] vehicles = train.GetVehicles();	&lt;br /&gt;
;Notes&lt;br /&gt;
 *GetVehicles[0] is always the front vehicle of the train relative to the train&#039;s current heading.	&lt;br /&gt;
*The train&#039;s heading may not correspond to its physical appearance and can change during game play.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GetVelocity===&lt;br /&gt;
{{MethodHeader|public native float GetVelocity(void)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*None		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*The train&#039;s current velocity.		&lt;br /&gt;
;Syntax&lt;br /&gt;
 float speed = train.GetVelocity();		&lt;br /&gt;
;Notes&lt;br /&gt;
*Warning!  The TS10 and TS12 Train.gs scripts advise this method is buggy and to use [[#GetSmoothedVelocity|GetSmoothedVelocity()]] or [[#GetTrainVelocity|GetTrainVelocity()]] instead.&lt;br /&gt;
*This function provides the instantaneous velocity for vehicles in this train, which is good for physics calculations but not good for human-readable display.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===HasReachedInnerJunctionRadius===&lt;br /&gt;
{{MethodHeader|public bool HasReachedJunctionInnerJunctionRadius(JunctionBase junction)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;junction&#039;&#039;&#039; = JunctionBase object to query.			&lt;br /&gt;
;Returned Value&lt;br /&gt;
*True if this train is within the inner radius of the given junction, false otherwise.		&lt;br /&gt;
;Syntax&lt;br /&gt;
 bool arrived = train.HasReachedInnerJunctionRadius(junction10);		&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===HasTrainTimetable===&lt;br /&gt;
{{MethodHeader|public bool HasTrainTimetable(void)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*None		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*True if this train has an attached TrainTimetable, false otherwise.		&lt;br /&gt;
;Syntax&lt;br /&gt;
 bool timed = train.HasTrainTimetable();		&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===IsScheduleRunning===&lt;br /&gt;
{{MethodHeader|public bool IsScheduleRunning(void)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*None		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*True if this train is currently running to a Schedule, false otherwise.		&lt;br /&gt;
;Syntax&lt;br /&gt;
 bool scheduled = train.IsScheduleRunning();		&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===IsScheduleWindowVisible===&lt;br /&gt;
{{MethodHeader|public bool IsScheduleWindowVisible(void)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*None		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*True if the schedule window for this train is currently open, false otherwise.		&lt;br /&gt;
;Syntax&lt;br /&gt;
 bool windowOpen = IsScheduleWindowVisible();		&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===IsStillInJunction===&lt;br /&gt;
{{MethodHeader|public bool IsStillInJunction(JunctionBase junction)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;junction&#039;&#039;&#039; = JunctionBase object to query.			&lt;br /&gt;
;Returned Value&lt;br /&gt;
*True if the train holds a Permit for the given junction, flse otherwise.		&lt;br /&gt;
;Syntax&lt;br /&gt;
 bool inJunction = train.IsStillInJunction(junction10);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===IsStopped===&lt;br /&gt;
{{MethodHeader|public native bool IsStopped(void)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*None		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*True if the train is currently stationary, false if it is in motion.		&lt;br /&gt;
;Syntax&lt;br /&gt;
 bool moving=train.IsMoving();		&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===IsTrainBusy===&lt;br /&gt;
{{MethodHeader|public bool IsTrainBusy(void)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*None		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*True if the train&#039;s &#039;busy&#039; count is greater than zero, false otherwise.		&lt;br /&gt;
;Syntax&lt;br /&gt;
 bool busy = train.IsTrainBusy();		&lt;br /&gt;
;Notes&lt;br /&gt;
*Using the [[#IncTrainBusy|IncTrainBusy()]] method, any piece of script code can tag a train being busy. &lt;br /&gt;
*The train can be untagged later by calling DecTrainBusy(). &lt;br /&gt;
*This mechanism is mainly used by industries that are doing something with the train. &lt;br /&gt;
*A train can be tagged as being busy more than once by calling IncTrainBusy() multiple times so different industries can tag the train. &lt;br /&gt;
*Each time IncTrainBusy() is called, an internal busy count is incremented and if that busy count is greater than zero, the train is considered busy.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===IsViewDetailsVisible===&lt;br /&gt;
{{MethodHeader|public bool IsViewDetailsVisible(void)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*None		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*true if the ViewDetails window for this train is visible, false otherwise.		&lt;br /&gt;
;Syntax&lt;br /&gt;
 bool visible = train.IsViewDetailsVisible();		&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===MapObjectIsInFront===&lt;br /&gt;
{{MethodHeader|public bool MapObjectIsInFront(MapObject obj, float range)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;obj&#039;&#039;&#039; = MapObject to search for.&lt;br /&gt;
*&#039;&#039;&#039;range&#039;&#039;&#039; = Maximum search distance.			&lt;br /&gt;
;Returned Value&lt;br /&gt;
*True if the object is found within the specified distance and in front of the train, false otherwise.		&lt;br /&gt;
;Syntax&lt;br /&gt;
 bool isClose = train.MapObjectIsInFront(terminus,100.0);		&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===ReleaseTrackPermits===&lt;br /&gt;
{{MethodHeader|public void ReleaseTrackPermits(Permit[ ] permitList)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;permitList&#039;&#039;&#039; = Permit array containing a list of permits to release.		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None	&lt;br /&gt;
;Syntax&lt;br /&gt;
 train.ReleaseTrackPermits(permitList);		&lt;br /&gt;
;Notes&lt;br /&gt;
*This method will release any permits from the &#039;&#039;permitList&#039;&#039; array that are currently held by this train.&lt;br /&gt;
*Any other permits in the array that are not held by this train will be ignored.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===RunSchedule===&lt;br /&gt;
{{MethodHeader|public thread void RunSchedule(Schedule schedule, bool loop, float delay)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;schedule&#039;&#039;&#039; = The Schedule that the train is to follow.&lt;br /&gt;
*&#039;&#039;&#039;loop&#039;&#039;&#039; = False to run the schedule once, True to repeat it continuously.&lt;br /&gt;
*&#039;&#039;&#039;delay&#039;&#039;&#039; = Time in seconds to wait before starting the schedule.			&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None	&lt;br /&gt;
;Syntax&lt;br /&gt;
 train.RunSchedule(schedule,false,10.0);		&lt;br /&gt;
;Notes&lt;br /&gt;
*See [[Class Schedule|Schedule]] for information on how to build a schedule.&lt;br /&gt;
*Only one schedule may run on a train at a time and the user cannot control the train when it is running a schedule.&lt;br /&gt;
*This method is a thread, so the calling code does not need to wait for it to finish and return before executing other code.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetAdvisoryLimit===&lt;br /&gt;
{{MethodHeader|public native void SetAdvisoryLimit(float speed)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;speed&#039;&#039;&#039; = Speed limit to set in &amp;lt;del&amp;gt;KPH&amp;lt;/del&amp;gt; metres/second.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None	&lt;br /&gt;
;Syntax&lt;br /&gt;
 train.SetAdvisoryLimit(60.0);&lt;br /&gt;
;Notes&lt;br /&gt;
*Sets an advisory speed limit for a script controlled train.&lt;br /&gt;
*Use zero in the speed parameter to clear any previously imposed limit.&lt;br /&gt;
*&amp;lt;font color=red&amp;gt;Does this really use KPH, most similar methods use MPS&amp;lt;/font&amp;gt;&lt;br /&gt;
*&amp;lt;font color=red&amp;gt;Experimental evidence confirms that it&#039;s in m/s not kph or mph&amp;lt;/font&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetAutopilotMode===&lt;br /&gt;
{{MethodHeader|public native void SetAutopilotMode(int mode)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;mode&#039;&#039;&#039; = One of the [[#Train Control Modes|Train Control Mode]] constants specifying the method by which this train is controlled.		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None	&lt;br /&gt;
;Syntax&lt;br /&gt;
 train.SetAutopilotMode(Train.CONTROL_AUTOMANUAL);		&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetAutopilotTarget===&lt;br /&gt;
{{MethodHeader|public native void SetAutopilotTarget(Buildable buildable, string trigger)&amp;lt;br&amp;gt;public native void SetAutopilotTarget(Trackside trackside)&amp;lt;br&amp;gt;public native void SetAutopilotTarget(Track track)&amp;lt;br&amp;gt;public native void SetAutopilotTarget(JunctionBase junction)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;buildable&#039;&#039;&#039; = Buildable object to use as a destination.&lt;br /&gt;
*&#039;&#039;&#039;trigger&#039;&#039;&#039; = Attached trigger within the buildable, specified by name.&lt;br /&gt;
*&#039;&#039;&#039;trackside&#039;&#039;&#039; =  Trackside object to use as a destination.&lt;br /&gt;
*&#039;&#039;&#039;track&#039;&#039;&#039; = Track segment to use as a destination.&lt;br /&gt;
*&#039;&#039;&#039;junction&#039;&#039;&#039; = JunctionBase object to use as a destination.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None	&lt;br /&gt;
;Syntax&lt;br /&gt;
 train.SetAutopilotTarget(&amp;quot;Kings Cross Station&amp;quot;,&amp;quot;trigger1&amp;quot;);		&lt;br /&gt;
;Notes&lt;br /&gt;
*This method sets a destination for the autopilot to take this train to.&lt;br /&gt;
*Objects from respective child classes such as industries, signals and trackmarks may be specified.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetAutopilotTargetMinimumDistance===&lt;br /&gt;
{{MethodHeader|public native void SetAutopilotTargetMinimumDistance(float distance)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;distance&#039;&#039;&#039; = The minimum distance in metres, between the train and the autopilot target, to be reached before the train will start to slow down.			&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None	&lt;br /&gt;
;Syntax&lt;br /&gt;
 train SetAutopilotTargetMinimumDistance(100.0);&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetAutoPilotTargetMinimumSpeed===&lt;br /&gt;
{{MethodHeader|public native void SetAutopilotTargetMinimumSpeed(float speed)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;speed&#039;&#039;&#039; = Minimum speed, in metres per second, that the train should be travelling at when it reaches the Autopilot target.			&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None	&lt;br /&gt;
;Syntax&lt;br /&gt;
 train.SetAutoPilotTargetMinimumSpeed(20.0);		&lt;br /&gt;
;Notes&lt;br /&gt;
*&amp;lt;font color=red&amp;gt;The documentation seems to mean that the train should be going at 20.0 OR MORE.  Shouldn&#039;t it be MaximumSpeed???&amp;lt;/font&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetBail===&lt;br /&gt;
{{MethodHeader|public native void SetBail(void)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*None		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None	&lt;br /&gt;
;Syntax&lt;br /&gt;
 train.SetBail();		&lt;br /&gt;
;Notes&lt;br /&gt;
*Depresses the bail control for a short period.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetCouplingMask===&lt;br /&gt;
{{MethodHeader|public void SetCouplingMask(int mask)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;mask&#039;&#039;&#039; = A mask specifying which of the trains exposed couplers are allowed to couple.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None	&lt;br /&gt;
;Syntax&lt;br /&gt;
 train.SetCouplingMask(Vehicle.COUPLE_NONE); // prevents this train from coupling to another in Driver mode.&lt;br /&gt;
;Notes&lt;br /&gt;
*The mask can be built using the [[Class Vehicle#Coupler Flags|Coupler Flag]] constants defined in [[Class Vehicle]].&lt;br /&gt;
*This method will not prevent vehicles or trains from coupling in Surveyor, but takes effect in Driver mode.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetDCCThrottle===&lt;br /&gt;
{{MethodHeader|public native void SetDCCThrottle(float throttle)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;throttle&#039;&#039;&#039; = Float value in the range -1.0 .. 1.0 defining the throttle setting for the train when using DCC physics.			&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None	&lt;br /&gt;
;Syntax&lt;br /&gt;
 train.SetDCCThrottle(0.0); //sets the throttle to neutral.		&lt;br /&gt;
;Notes&lt;br /&gt;
*Full speed ahead is 1.0&lt;br /&gt;
*Maximum in reverse is -1.0&lt;br /&gt;
*Neutral is 0.0&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetDecouplingMask===&lt;br /&gt;
{{MethodHeader|public void SetDecouplingMask(int mask)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;mask&#039;&#039;&#039; = A mask specifying which of the couplers are allowed to couple, applies to all of the vehicles in the train.			&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None	&lt;br /&gt;
;Syntax&lt;br /&gt;
 train.SetDecouplingMask(Vehicle.COUPLE_FRONT|Vehicle.COUPLE_BACK); // prevents vehicles being uncoupled from the train in Driver mode.&lt;br /&gt;
;Notes&lt;br /&gt;
*The mask can be built using the [[Class Vehicle#Coupler Flags|Coupler Flag]] constants defined in [[Class Vehicle]].&lt;br /&gt;
*This method will not prevent vehicles or trains from being uncoupled in Surveyor, but takes effect in Driver mode.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetDynamicBrakeMode===&lt;br /&gt;
{{MethodHeader|public native void SetDynamicBrakeMode(int mode)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*One of the [[#Dynamic Brake States|Dynamic Brake State]] constants indicating the current state of this train&#039;s brakes.			&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None	&lt;br /&gt;
;Syntax&lt;br /&gt;
 train.SetDynamicBrakeMode(Train.DYNAMIC_BRAKE_TRACTION);		&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetFloatingLimit===&lt;br /&gt;
{{MethodHeader|public native void SetFloatingLimit(float delta, bool enable)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;delta&#039;&#039;&#039; = Tolerance allowed from the posted limit in metres per second.&lt;br /&gt;
*&#039;&#039;&#039;enable&#039;&#039;&#039; = Use true to enable messages related to floating limits, false to disable.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None	&lt;br /&gt;
;Syntax&lt;br /&gt;
 train.SetFloatingLimit(5.0,true);		&lt;br /&gt;
;Notes&lt;br /&gt;
*Sets the floating speed limit level above the sign posted limit.&lt;br /&gt;
*The floating limit is an amount of tolerance above the current speed limit. &lt;br /&gt;
*Messages for floating speed violations are not to be confused with regular speed limit messages.&lt;br /&gt;
*The floating limit is monitored by the Scenario.Monitor() thread, and may be used for point deduction when speeding. It should therefore be reserved for player trains.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetHandBrake===&lt;br /&gt;
{{MethodHeader|public void SetHandBrake(bool state)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;state&#039;&#039;&#039; = Use true to apply the handbrake to all vehicles in this train which are not Locomotives, false to release the handbrake.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None	&lt;br /&gt;
;Syntax&lt;br /&gt;
 train.SetHandBrake(true)&#039;		&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetHeadlightState===&lt;br /&gt;
{{MethodHeader|public native void SetHeadlightState(bool lightsOn)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;lightsOn&#039;&#039;&#039; = True to turn the headlights on, false to turn them off.			&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None	&lt;br /&gt;
;Syntax&lt;br /&gt;
 train.SetHeadlightState(true);		&lt;br /&gt;
;Notes&lt;br /&gt;
*This method affects only the headlights on the frontmost locomotive.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetHighBeams===&lt;br /&gt;
{{MethodHeader|public void SetHighBeams(bool value)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;value&#039;&#039;&#039; = True to turn on high beams, false to turn them off.		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 train.SetHighBeams(true);		&lt;br /&gt;
;Notes&lt;br /&gt;
*See also [[Class Vehicle#SetHighBeams|Vehicle.SetHighColor()]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetLastVisitedBuildable===&lt;br /&gt;
{{MethodHeader|public void SetLastVisitedBuildable(Buildable buildable)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;buildable&#039;&#039;&#039; = Sets the last visited buildable to the given object.			&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None	&lt;br /&gt;
;Syntax&lt;br /&gt;
 train.SetLastVisitedBuildable(KingsCrossStation);		&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetManualThrottle===&lt;br /&gt;
{{MethodHeader|public native void SetManualThrottle(int notch)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;notch&#039;&#039;&#039; = Value in the range 0 .. 8 to set the throttle.			&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None	&lt;br /&gt;
;Syntax&lt;br /&gt;
 train.SetManualThrottle(5);		&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetPantogaphState===&lt;br /&gt;
{{MethodHeader|public native void SetPantographState(int state)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;state&#039;&#039;&#039; = Value in the range 0 .. 3 to set the pantographs if this train has them.			&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None	&lt;br /&gt;
;Syntax&lt;br /&gt;
 train.SetPantographState(3);		&lt;br /&gt;
;Notes&lt;br /&gt;
*Use one of these values for &#039;&#039;state&#039;&#039;:&lt;br /&gt;
**0 = Both pantographs down.&lt;br /&gt;
**1 = Front pantograph up.&lt;br /&gt;
**2 = Rear pantograph up.&lt;br /&gt;
**3 = Both pantographs up.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetReverser===&lt;br /&gt;
{{MethodHeader|public native void SetReverser(int mode)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;mode&#039;&#039;&#039; = One of the [[#Reverser Traction Modes|Reverser Traction Mode]] constants defining the required state of the train&#039;s reverser lever.			&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None	&lt;br /&gt;
;Syntax&lt;br /&gt;
 train.SetReverser(Train.TRACTION_REVERSE);		&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetTrainBrakes===&lt;br /&gt;
{{MethodHeader|public native void SetTrainBrakes(float mode)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;mode&#039;&#039;&#039; = One of the [[#Train Brake States|Train Brake State]] constants defining the required state of the train&#039;s brakes.			&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None	&lt;br /&gt;
;Syntax&lt;br /&gt;
 train.SetTrainBrakes(Train.TRAIN_BRAKE_EMERGENCY);		&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetTrainPriorityNumber===&lt;br /&gt;
{{MethodHeader|public native void SetTrainPriority Number(int priority)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;priority&#039;&#039;&#039; = Priority value in the range 1 .. 3.			&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None	&lt;br /&gt;
;Syntax&lt;br /&gt;
 train.SetTrainPriorityNumber(2);		&lt;br /&gt;
;Notes&lt;br /&gt;
*All trains and track sections can be assigned a priority value in the range of [1 - 3] with the default value being 2.&lt;br /&gt;
*The priority value is not a numerical scale of precedence, but a value for the AI driver to attempt to match.&lt;br /&gt;
*This means the driver will &#039;&#039;prefer&#039;&#039; track sections that have a priority equal to that of the train.&lt;br /&gt;
*Changing the priority of the train only takes affect when the driver restarts a new schedule.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetTrainTimetable===&lt;br /&gt;
{{MethodHeader|public void SetTrainTimetable(TrainTimetable timetable)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;timetable&#039;&#039;&#039; = Assigns the specified timetable to this train.			&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None	&lt;br /&gt;
;Syntax&lt;br /&gt;
 train.SetTrainTimetable(timetable);&lt;br /&gt;
;Notes&lt;br /&gt;
*This train must not already have a TrainTimetable assigned.&lt;br /&gt;
*To ensure that this proviso is met, use [[#ClearTrainTimetabel|ClearTrainTimetable()]] prior to calling this method.&lt;br /&gt;
*It is the responsibility of the caller to post a &amp;quot;TrainTimetable&amp;quot;,&amp;quot;Touch&amp;quot; message after calling this function.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SetVelocity===&lt;br /&gt;
{{MethodHeader|public native void SetVelocity(float velocity)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;velocity&#039;&#039;&#039; = Velocity to apply to the train, in metres per second.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None	&lt;br /&gt;
;Syntax&lt;br /&gt;
 train.SetVelocity(0.0); // stops the train, subject to braking performance.		&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===ShowInConsistMenu===&lt;br /&gt;
{{MethodHeader|public native void ShowInConsistMenu(bool show)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;show&#039;&#039;&#039; = True to make this train visible to the in-game consist menu, false to hide it.			&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None	&lt;br /&gt;
;Syntax&lt;br /&gt;
 train.ShowInConsistMenu(false);		&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SoundHorn===&lt;br /&gt;
{{MethodHeader|public native void SoundHorn(void)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*None		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None	&lt;br /&gt;
;Syntax&lt;br /&gt;
 train.SoundHorn();		&lt;br /&gt;
;Notes&lt;br /&gt;
*Sounds the horn or whictle for all locomotives in this train.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===StopSchedule===&lt;br /&gt;
{{MethodHeader|public void StopSchedule(void)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*None		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None	&lt;br /&gt;
;Syntax&lt;br /&gt;
 train.StopSchedule();		&lt;br /&gt;
;Notes&lt;br /&gt;
*This method stops the Schedule this train is currently running (if any).&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===StopScheduleAndWait===&lt;br /&gt;
{{MethodHeader|public void StopSchedule(void)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*None		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None	&lt;br /&gt;
;Syntax&lt;br /&gt;
 train.StopSchedule();		&lt;br /&gt;
;Notes&lt;br /&gt;
*This method stops the Schedule this train is currently running (if any) and waits until the train&#039;s schedule actually stops before returning. &lt;br /&gt;
*If the train is not running a schedule, the method returns after broadcasting a &amp;quot;Schedule&amp;quot;,&amp;quot;Touch&amp;quot; message, in case someone is listening for schedule messages.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===StopTrainGently===&lt;br /&gt;
{{MethodHeader|public native void StopTrainGently(void)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*None		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None	&lt;br /&gt;
;Syntax&lt;br /&gt;
 train.StopTrainGently();		&lt;br /&gt;
;Notes&lt;br /&gt;
*Brings the train to a halt over a short time period.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===TakePermitOnTrack===&lt;br /&gt;
{{MethodHeader|public Permit[ ] TakePermitOnTrack(bool direction)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;direction&#039;&#039;&#039; = Direction relative to the train in which to take out permits.			&lt;br /&gt;
;Returned Value&lt;br /&gt;
*An array including any permits taken which have not yet been granted to this train. Some of these permits may not yet have been granted. 		&lt;br /&gt;
;Syntax&lt;br /&gt;
 Permit[] permits = train.TakePermitOnTrack(true);		&lt;br /&gt;
;Notes&lt;br /&gt;
*Gets permits on the current track in the given direction.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===TestTrackPermit===&lt;br /&gt;
{{MethodHeader|public native bool TestTrackPermit(Permit permit, bool innerOnly)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;permit&#039;&#039;&#039; = An existing Permit object.&lt;br /&gt;
*&#039;&#039;&#039;innerOnly&#039;&#039;&#039; = If true the method will test only the inner radius, if false the default radius of 150 metres will be used.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*True if this train is within the track controlled by &#039;&#039;permit&#039;&#039;, false otherwise. 		&lt;br /&gt;
;Syntax&lt;br /&gt;
 bool ownPermit = train.TestTrackPermit(permit1,false);		&lt;br /&gt;
;Notes&lt;br /&gt;
*The method generates an exception if the &#039;&#039;permit&#039;&#039; parameter does not refer to a track.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===ToggleScheduleWindow===&lt;br /&gt;
{{MethodHeader|public void ToggleScheduleWindow(void)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*None		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None	&lt;br /&gt;
;Syntax&lt;br /&gt;
 train.ToggleScheduleWindow();		&lt;br /&gt;
;Notes&lt;br /&gt;
*If the schedule window is already open/visible, this method will destroy it.&lt;br /&gt;
*Otherwise if the view details window is not visible, UpdateScheduleWindow() is called to create it for display.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===ToggleViewDetailsWindow===&lt;br /&gt;
{{MethodHeader|public void ToggleViewDetailsWindow(void)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*None		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None	&lt;br /&gt;
;Syntax&lt;br /&gt;
 train.ToggleViewDetailsWindow();		&lt;br /&gt;
;Notes&lt;br /&gt;
*If the ViewDetails window is already open/visible, this method will destroy it.&lt;br /&gt;
*Otherwise if the view details window is not visible, ViewDetails() is called to create it for display.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===TrackSearch===&lt;br /&gt;
{{MethodHeader|public native MapObject[ ] TrackSearch(bool direction, float distance)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;direction&#039;&#039;&#039; = Direction to search relative to the train&#039;s heading, true for forwards, false for backwards.&lt;br /&gt;
*&#039;&#039;&#039;distance&#039;&#039;&#039; = Maximum search distance in metres.			&lt;br /&gt;
;Returned Value&lt;br /&gt;
*An array of objects found along the track in the defined search direction, the array might be empty.		&lt;br /&gt;
;Syntax&lt;br /&gt;
 MapObject[] objects = train.TrackSearch(true,5000.0) // searches 5km forwards along the track.		&lt;br /&gt;
;Notes&lt;br /&gt;
*Gets all of the Trackside and SceneryWithTrack objects on a length of track that is either in front of or behind this train. &lt;br /&gt;
*Descendants of these classes are also returned.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===TracksideIsInFront===&lt;br /&gt;
{{MethodHeader|public bool TracksideIsInFront(Trackside obj, float range)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;obj&#039;&#039;&#039; = Trackside object to search for.&lt;br /&gt;
*&#039;&#039;&#039;range&#039;&#039;&#039; = Mximum search distance.			&lt;br /&gt;
;Returned Value&lt;br /&gt;
*True if the object is logically forward of this train, false otherwise.		&lt;br /&gt;
;Syntax&lt;br /&gt;
 bool found = train.TracksideIsInFront(signal1,500.0);		&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Turnaround===&lt;br /&gt;
{{MethodHeader|public native void Turnaround(void)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*None		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None	&lt;br /&gt;
;Syntax&lt;br /&gt;
 train.Turnaround();		&lt;br /&gt;
;Notes&lt;br /&gt;
*Reverses the logical direction of the train, ie changes its heading.&lt;br /&gt;
*The physical direction of the vehicles is not altered but the throttle direction is reversed.&lt;br /&gt;
*If the camera is focused on the train in tracking view when this method is called the camera&#039;s direction of view (relative to the map) will alter through 180 degrees.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===UpdateScheduleWindow===&lt;br /&gt;
{{MethodHeader|public void UpdateScheduleWindow(string vehicleName)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;vehicleName&#039;&#039;&#039; = Name of vehicle within the train.			&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None	&lt;br /&gt;
;Syntax&lt;br /&gt;
 train.UpdateScheduleWindow(&amp;quot;brake2&amp;quot;);		&lt;br /&gt;
;Notes&lt;br /&gt;
*Updates the schedule window from the given vehicle.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===UpdateViewDetails===&lt;br /&gt;
{{MethodHeader|public void UpdateViewDetails(Vehicle vehicle)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;vehicle&#039;&#039;&#039; = Reference to a vehicle within the train.			&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None	&lt;br /&gt;
;Syntax&lt;br /&gt;
 train.UpdateViewDetails(vehicle);&lt;br /&gt;
;Notes&lt;br /&gt;
*Called by Vehicle.UpdateViewDetails() when a vehicle&#039;s load has changed so that the train&#039;s detail window can be amended.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===UpdateViewDetailsLocomotive===&lt;br /&gt;
{{MethodHeader|public void UpdateViewDetailsLocomotive(void)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*None&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None	&lt;br /&gt;
;Syntax&lt;br /&gt;
 train.UpdateViewDetailsLocomotive(vehicle);&lt;br /&gt;
;Notes&lt;br /&gt;
*Called by Locomotive.UpdateViewDetails() when any of the Locomotive&#039;s operating parameters have changed so that the train&#039;s detail window can be amended.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===ViewDetails===&lt;br /&gt;
{{MethodHeader|public void ViewDetails(Vehicle vehicle)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;vehicle&#039;&#039;&#039; = Reference to a vehicle within the train.			&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None	&lt;br /&gt;
;Syntax&lt;br /&gt;
 train.ViewDetails(vehicle);		&lt;br /&gt;
;Notes&lt;br /&gt;
*This method is called by Vehicle.ViewDetails() when the user has requested to view the details of the consist.&lt;br /&gt;
*It will create a Browser window listing information about the train including who the driver character is and the loads of all vehicles.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===WasRunScheduleSuccessful===&lt;br /&gt;
{{MethodHeader|public bool WasRunScheduleSuccessful(void)}}	&lt;br /&gt;
;Parameters&lt;br /&gt;
*None		&lt;br /&gt;
;Returned Value&lt;br /&gt;
*True if the most recently run schedule was successfully, false otherwise. 		&lt;br /&gt;
;Syntax&lt;br /&gt;
 train.WasRunScheduleSuccessful();		&lt;br /&gt;
;Notes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Code Examples==&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Related Methods==&lt;br /&gt;
[[Class TrainUtil#AreInTrain|TrainUtil.AreInTrain()]]&amp;lt;br&amp;gt;&lt;br /&gt;
[[Class TrainUtil#CreateTrainFromSoup|TrainUtil.CreateTrainFromSoup()]]&amp;lt;br&amp;gt;&lt;br /&gt;
[[Class TrainUtil#IsInTrain|TrainUtil.IsInTrain()]]&amp;lt;br&amp;gt;&lt;br /&gt;
[[Class World#CreateTrain|World.CreateTrain()]]&amp;lt;br&amp;gt;&lt;br /&gt;
[[Class World#DeleteTrain|World.DeleteTrain()]]&amp;lt;br&amp;gt;&lt;br /&gt;
[[Class World#GetTrainList|World.GetTrainList()]]&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Categories==&lt;br /&gt;
[[Category:Script Class]]&lt;/div&gt;</summary>
		<author><name>Ciceronmt</name></author>
	</entry>
	<entry>
		<id>https://wiki.trainzsimulator.com/index.php?title=List_of_Standard_Messages&amp;diff=20683</id>
		<title>List of Standard Messages</title>
		<link rel="alternate" type="text/html" href="https://wiki.trainzsimulator.com/index.php?title=List_of_Standard_Messages&amp;diff=20683"/>
		<updated>2019-08-20T13:53:06Z</updated>

		<summary type="html">&lt;p&gt;Ciceronmt: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;*[[TrainzScript Language Reference|API Hierarchy]]&lt;br /&gt;
&lt;br /&gt;
*This list is a first step towards documenting Trainz use of messages. It has been generated by scanning one or two copies of jetlog.txt from TC, together with the TC scripts folder and the TRS2006 copy of index.chm. There are probably many standard messages missing and there are some obscure ones listed. Please add anything that is missing. I will progressively link and document the list. &lt;br /&gt;
__NOTOC__ __NOEDITSECTION__&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{|rules=&amp;quot;rows&amp;quot; cellpadding=&amp;quot;2&amp;quot; cellspacing=&amp;quot;2&amp;quot; width=&amp;quot;95%&amp;quot; style=&amp;quot;border-collapse:collapse;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|width=&amp;quot;15&amp;quot;|&lt;br /&gt;
|width=&amp;quot;250&amp;quot;|Message&lt;br /&gt;
|width=&amp;quot;165&amp;quot;|Source &amp;amp; Destination&lt;br /&gt;
|Purpose&lt;br /&gt;
|&lt;br /&gt;
{{IndexSplit|A}}&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Animation-Event Message|Animation-Event,&#039;&#039;eventname&#039;&#039;]]&lt;br /&gt;
|meshobject &amp;gt; meshobject&lt;br /&gt;
|Sent when an animation triggers an event. These events are included in *.kin files generated by Max when the &#039;Query for Event&#039; box is checked during animation export.  They are used to enable code to be executed in sync with animations.&lt;br /&gt;
{{IndexSplit|B}}&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|BaseIndustry,LoadComplete&lt;br /&gt;
|industry &amp;gt; industry&lt;br /&gt;
|Sent when an industry loading operation has completed&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Browser Messages|Browser-Closed,&#039;&#039;null&#039;&#039;]]&lt;br /&gt;
|browser &amp;gt; broadcast&lt;br /&gt;
|Sent when any in game browser is closed.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|Browser-Key,ScriptObjectives&lt;br /&gt;
|? &amp;gt; ?&lt;br /&gt;
|Sent by Trainz in response to a ScriptObjectives hotkey press. Obsolete?&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Browser Messages|Browser-URL,&#039;&#039;live://linkname&#039;&#039;]]&lt;br /&gt;
|browser &amp;gt; broadcast&lt;br /&gt;
|Sent when the user clicks in a link in a custom browser&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|Build,Cancelled&lt;br /&gt;
|? &amp;gt; buildable&lt;br /&gt;
|Not generally used. Intended for RTS-style gameplay where individual industries (etc) start in an unbuilt state and can be built at some resource cost during gameplay.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|Build,Completed&lt;br /&gt;
|? &amp;gt; buildable&lt;br /&gt;
|Not generally used. Intended for RTS-style gameplay where individual industries (etc) start in an unbuilt state and can be built at some resource cost during gameplay.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|Build,Started&lt;br /&gt;
|? &amp;gt; buildable&lt;br /&gt;
|Not generally used. Intended for RTS-style gameplay where individual industries (etc) start in an unbuilt state and can be built at some resource cost during gameplay.&lt;br /&gt;
{{IndexSplit|C}}&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Camera Messages|Camera,Interior-Changed]]&lt;br /&gt;
|new train? &amp;gt; broadcast&lt;br /&gt;
|Sent when a different train is selected.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Camera Messages|Camera,Target-Changed]]&lt;br /&gt;
|new target? &amp;gt; broadcast&lt;br /&gt;
|Sent when the camera selects a different target, may not be a train.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Camera Messages|Camera,External-View]]&lt;br /&gt;
|? &amp;gt; broadcast&lt;br /&gt;
|Sent when the camera mode is changed.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Camera Messages|Camera,Internal-View]]&lt;br /&gt;
|? &amp;gt; Broadcast&lt;br /&gt;
|Sent when the camera mode is changed.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Camera Messages|Camera,Roaming-View]]&lt;br /&gt;
|? &amp;gt; broadcast&lt;br /&gt;
|Sent when the camera mode is changed.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Camera Messages|Camera,Tracking-View]]&lt;br /&gt;
|? &amp;gt; broadcast&lt;br /&gt;
|Sent when the camera mode is changed.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|Check,Speed&lt;br /&gt;
|vehicle &amp;gt; vehicle&lt;br /&gt;
|Sent continuously to ensure that jetlog isn&#039;t allowed to remain legible :-)&lt;br /&gt;
{{IndexSplit|D}}&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|DriverCharacter,BoardedTrain&lt;br /&gt;
|driver &amp;gt; broadcast&lt;br /&gt;
|Sent when a driver boards a train&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|DriverCharacter,Created&lt;br /&gt;
|driver &amp;gt; broadcast&lt;br /&gt;
|Sent when a driver character is initialised&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|DriverCharacter,LeftTrain&lt;br /&gt;
|driver &amp;gt; broadcast&lt;br /&gt;
|Sent when a driver leaves a train&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|DriverDisplay,ResetTripMeter&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Interface Messages|DriverModule,DCC-Panel-Created]]&lt;br /&gt;
|? &amp;gt; broadcast&lt;br /&gt;
|Sent when driver selection widget has been created&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|DriverSetup,CharactersDone&lt;br /&gt;
|? &amp;gt; broadcast&lt;br /&gt;
|Sent when driver characters have been initialised&lt;br /&gt;
{{IndexSplit|G}}&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|GenericIndustry,LoadComplete&lt;br /&gt;
|industry &amp;gt; industry&lt;br /&gt;
|Sent when an industry loading operation has completed&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|GenericIndustry,ProcessComplete&lt;br /&gt;
|industry &amp;gt; industry&lt;br /&gt;
|Sent when an industry process has completed&lt;br /&gt;
{{IndexSplit|H}}&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|HandleTrain,Release&lt;br /&gt;
|industry &amp;gt; train&lt;br /&gt;
|Sent when an industry loading operation has completed&lt;br /&gt;
{{IndexSplit|I}}&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Interface Messages|Interface,ClickSystemButton]]&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Interface Messages|Interface-Event,MapViewOff]]&lt;br /&gt;
|? &amp;gt; broadcast&lt;br /&gt;
|Sent when the minimap is opened&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Interface Messages|Interface-Event,MapViewOn]]&lt;br /&gt;
|? &amp;gt; broadcast&lt;br /&gt;
|Sent when the minimap is closed&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Interface Messages|Interface-Event,Minimap-Mouse-Enter]]&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Interface Messages|Interface-Event,Minimap-Mouse-Leave]]&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Interface Messages|Interface-Event,New-Driver-Message]]&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Interface Messages|Interface-Event,Mouse-Enter]]&lt;br /&gt;
|object &amp;gt; broadcast&lt;br /&gt;
|Sent on mouseover an object&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Interface Messages|Interface-Event,Mouse-Leave]]&lt;br /&gt;
|? &amp;gt; broadcast&lt;br /&gt;
|Sent on mouseout of an object&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Interface Messages|Interface-Event,Set-Metric-Mode]]&lt;br /&gt;
|? &amp;gt; broadcast&lt;br /&gt;
|Sent when the interface units are changed&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Interface Messages|Interface-Event,Toggle-Interface]]&lt;br /&gt;
|? &amp;gt; broadcast&lt;br /&gt;
|Sent when the main HUD is turned on or off&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Interface Messages|Interface-Event,Toggle-ButtonBar]]&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Interface Messages|Interface-Event,Toggle-CustomHUD]]&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Interface Messages|Interface-Event,Toggle-VehicleControls]]&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Interface Messages|Interface-Event,Left-Click]]&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Interface Messages|Interface-Event,Surveyor-Left-Click]]&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
{{IndexSplit|J}}&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Object Messages|Junction,Enter]]&lt;br /&gt;
|junction &amp;gt; train&lt;br /&gt;
|Sent when a train enters a junction&#039;s outer area&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Object Messages|Junction,InnerEnter]]&lt;br /&gt;
|junction &amp;gt; train&lt;br /&gt;
|Sent when a train enters a junction&#039;s inner area&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Object Messages|Junction,InnerLeave]]&lt;br /&gt;
|junction &amp;gt; train&lt;br /&gt;
|Sent when a train leaves a junction&#039;s inner area&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Object Messages|Junction,Leave]]&lt;br /&gt;
|junction &amp;gt; train&lt;br /&gt;
|Sent when a train leaves a junction&#039;s outer area&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Object Messages|Junction,Stopped]]&lt;br /&gt;
|junction &amp;gt; train&lt;br /&gt;
|Sent when a train stops in a junction trigger area&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|Junction,Toggled&lt;br /&gt;
|junction &amp;gt; broadcast&lt;br /&gt;
|Sent when a junctionbase object is toggled&lt;br /&gt;
{{IndexSplit|M}}&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[MapObject Messages|MapObject,View-Details]]&lt;br /&gt;
|? &amp;gt; object&lt;br /&gt;
|Sent when the user right-clicks an object and selects &#039;View Details&#039; from the resulting menu, some assets provide a built-in browser in response to this message.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[MapObject Messages|MapObject,View-Schedule]]&lt;br /&gt;
|? &amp;gt; ?&lt;br /&gt;
|Sent when the user right-clicks an object and selects &#039;View Schedule&#039; from the resulting menu. The vehicle must have a timetable for this menu item to be displayed.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|MeshObject-Click,*&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
{{IndexSplit|O}}&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Object Messages|Object,Enter]]&lt;br /&gt;
|crossing &amp;gt; crossing&lt;br /&gt;
|Train has entered crossing trigger area&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Object Messages|Object,Leave]]&lt;br /&gt;
|crossing &amp;gt; crossing&lt;br /&gt;
|Train has left crossing trigger area&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Object Messages|Object,Enter]]&lt;br /&gt;
|train &amp;gt; junction&lt;br /&gt;
|Sent when a train enters a junction&#039;s outer area&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Object Messages|Object,InnerEnter]]&lt;br /&gt;
|train &amp;gt; junction&lt;br /&gt;
|Sent when a train enters a junction&#039;s inner area&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Object Messages|Object,InnerLeave]]&lt;br /&gt;
|train &amp;gt; junction&lt;br /&gt;
|Sent when a train leaves a junction&#039;s inner area&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Object Messages|Object,Leave]]&lt;br /&gt;
|train &amp;gt; junction&lt;br /&gt;
|Sent when a train leaves a junction&#039;s outer area&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Object Messages|Object,Stopped]]&lt;br /&gt;
|train &amp;gt; junction&lt;br /&gt;
|Sent when a train stops in a junction trigger area&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Object Messages|Object,Enter]]&lt;br /&gt;
|train &amp;gt; trackmark&lt;br /&gt;
|Sent when a train enters a trackmark&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Object Messages|Object,Leave]]&lt;br /&gt;
|train &amp;gt; trackmark&lt;br /&gt;
|Sent when a train leaves a trackmark&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Object Messages|Object,Stopped]]&lt;br /&gt;
|train &amp;gt; trackmark&lt;br /&gt;
|Sent when a train stops at a trackmark&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Object Messages|Object,Enter]]&lt;br /&gt;
|train &amp;gt; trigger&lt;br /&gt;
|Sent when a train enters a trigger&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Object Messages|Object,Leave]]&lt;br /&gt;
|train &amp;gt; trigger&lt;br /&gt;
|Sent when a train leaves a trigger&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Object Messages|Object,Stopped]]&lt;br /&gt;
|train &amp;gt; trigger&lt;br /&gt;
|Sent when a train stops at a trigger&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Object Messages|Object,Enter]]&lt;br /&gt;
|vehicle &amp;gt; scenerywithtrack&lt;br /&gt;
|Sent when a vehicle enters a scenery trigger&#039;s outer area&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Object Messages|Object,InnerEnter]]&lt;br /&gt;
|vehicle &amp;gt; scenerywithtrack&lt;br /&gt;
|Sent when a vehicle enters a scenery trigger&#039;s inner area&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Object Messages|Object,InnerLeave]]&lt;br /&gt;
|vehicle &amp;gt; scenerywithtrack&lt;br /&gt;
|Sent when a vehicle leaves a scenery trigger&#039;s inner area&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Object Messages|Object,Leave]]&lt;br /&gt;
|vehicle &amp;gt; scenerywithtrack&lt;br /&gt;
|Sent when a vehicle leaves a scenery trigger&#039;s outer area&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Object Messages|Object,Stopped]]&lt;br /&gt;
|vehicle &amp;gt; scenerywithtrack&lt;br /&gt;
|Sent when a train stops in a scenery trigger&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|OnlineAccess,ReceiveMessage&lt;br /&gt;
|? &amp;gt; onlineaccess&lt;br /&gt;
|Message awaiting collection&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|OnlineAccess,StatusChange&lt;br /&gt;
|? &amp;gt; onlineaccess&lt;br /&gt;
|Network status change&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|OnlineGroup,StatusChange&lt;br /&gt;
|? &amp;gt; onlinegroup&lt;br /&gt;
|Network status change&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|OnlineGroup,UsersChange&lt;br /&gt;
|? &amp;gt; onlinegroup&lt;br /&gt;
|Network users change&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|OnlineGroup.UserRemoved,*&lt;br /&gt;
|? &amp;gt; onlinegroup&lt;br /&gt;
|Network users change&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|OnlineGroup.UserAdded,*&lt;br /&gt;
|? &amp;gt; onlinegroup&lt;br /&gt;
|Network users change&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|OnlineGroup.UserStatus,*&lt;br /&gt;
|? &amp;gt; onlinegroup&lt;br /&gt;
|Network users change&lt;br /&gt;
{{IndexSplit|P}}&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|Permit,Granted&lt;br /&gt;
|? &amp;gt; objectrequesting&lt;br /&gt;
|Sent when a track or junction permit is granted&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|PortalTunnel,EmitTrain&lt;br /&gt;
|portal &amp;gt; portal&lt;br /&gt;
|Sent when a portal produces a train&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[pfx Message|pfx,&#039;&#039;particledata&#039;&#039;]]&lt;br /&gt;
|script &amp;gt; object&lt;br /&gt;
|Sent by script to control particle effects&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|Process-Start,&#039;&#039;processname&#039;&#039;&lt;br /&gt;
|industry &amp;gt; industry&lt;br /&gt;
|Sent when an industry process has started&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|Process-Stop,&#039;&#039;processname&#039;&#039;&lt;br /&gt;
|industry &amp;gt; industry&lt;br /&gt;
|Sent when an industry process has completed&lt;br /&gt;
{{IndexSplit|S}}&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|Scenario,KillMonitor&lt;br /&gt;
|? &amp;gt; ?&lt;br /&gt;
|Sent to terminate a scenario thread&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|Scenario,Quit&lt;br /&gt;
|? &amp;gt; ?&lt;br /&gt;
|Sent to terminate a scenario&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|ScenarioBehaviour,Touch&lt;br /&gt;
|? &amp;gt; ?&lt;br /&gt;
|Called on a parent rule when the child rule completes. May also indicate other state changes.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Object Messages|SceneryTrigger,Enter]]&lt;br /&gt;
|scenerywithtrack &amp;gt; vehicle&lt;br /&gt;
|Sent when a vehicle enters a scenery trigger&#039;s outer area&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Object Messages|SceneryTrigger,InnerEnter]]&lt;br /&gt;
|scenerywithtrack &amp;gt; vehicle&lt;br /&gt;
|Sent when a vehicle enters a scenery trigger&#039;s inner area&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Object Messages|SceneryTrigger,InnerLeave]]&lt;br /&gt;
|scenerywithtrack &amp;gt; vehicle&lt;br /&gt;
|Sent when a vehicle leaves a scenery trigger&#039;s inner area&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Object Messages|SceneryTrigger,Leave]]&lt;br /&gt;
|scenerywithtrack &amp;gt; vehicle&lt;br /&gt;
|Sent when a vehicle leaves a scenery trigger&#039;s outer area&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Object Messages|SceneryTrigger,Stopped]]&lt;br /&gt;
|scenerywithtrack &amp;gt; vehicle&lt;br /&gt;
|Sent when a train stops in a scenery trigger&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|Schedule,Abort&lt;br /&gt;
|train &amp;gt; train&lt;br /&gt;
|Sent when a command schedule is abandoned&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|Schedule,Complete&lt;br /&gt;
|train &amp;gt; broadcast&lt;br /&gt;
|Sent when a command schedule is completed&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|Schedule,Touch&lt;br /&gt;
|train &amp;gt; train&lt;br /&gt;
|Sent when a Train&#039;s AI schedule state is modified (see Train.StopSchedule()) and sniffed by DriverCharacter to implement DriverCommand support.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Signal Messages|Signal,StateChanged]]&lt;br /&gt;
|signal &amp;gt; broadcast&lt;br /&gt;
|Signal aspect has changed&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|StationMain.Timer,Tick&lt;br /&gt;
|station &amp;gt; station&lt;br /&gt;
|Sent by stations to initiate a periodic update&lt;br /&gt;
{{IndexSplit|T}}&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|Timer,Tick&lt;br /&gt;
|? &amp;gt; ?&lt;br /&gt;
|A common custom message used by various scripts to implement timed polling.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|Timetable,&lt;br /&gt;
|? &amp;gt; ?&lt;br /&gt;
|?&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Object Messages|Trackmark,Enter]]&lt;br /&gt;
|trackmark &amp;gt; train&lt;br /&gt;
|Sent when a train enters a trackmark&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Object Messages|Trackmark,Leave]]&lt;br /&gt;
|trackmark &amp;gt; train&lt;br /&gt;
|Sent when a train leaves a trackmark&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Object Messages|Trackmark,Stopped]]&lt;br /&gt;
|trackmark &amp;gt; train&lt;br /&gt;
|Sent when a train stops at a trackmark&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Signal Messages|Train,Entered red signal]]&lt;br /&gt;
|signal &amp;gt; train&lt;br /&gt;
|Train has entered signal&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Signal Messages|Train,Entered red signal notify]]&lt;br /&gt;
|train &amp;gt; broadcast&lt;br /&gt;
|Train has entered signal&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Signal Messages|Train,Passed Signal]]&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Train Messages|Train,Over speed limit]]&lt;br /&gt;
|train &amp;gt; broadcast&lt;br /&gt;
|Sent when a train exceeds the current speed limit.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Train Messages|Train,Under speed limit]]&lt;br /&gt;
|train &amp;gt; broadcast&lt;br /&gt;
|Sent when a train slows below the current speed limit.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Train Messages|Train,Over advisory speed limit]]&lt;br /&gt;
|train &amp;gt; broadcast&lt;br /&gt;
|Sent when a train exceeds the current advisory speed limit.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Train Messages|Train,Under advisory speed limit]]&lt;br /&gt;
|train &amp;gt; broadcast&lt;br /&gt;
|Sent when a train slows below the current advisory speed limit.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Train Messages|Train,Over floating speed limit]]&lt;br /&gt;
|train &amp;gt; broadcast&lt;br /&gt;
|Sent when a train exceeds the floating speed limit.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Train Messages|Train,Under floating speed limit]]&lt;br /&gt;
|train &amp;gt; broadcast&lt;br /&gt;
|Sent when a train slows below the floating speed limit.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Train Messages|Train,Cleanup]]&lt;br /&gt;
|? &amp;gt; ?&lt;br /&gt;
|Sent immediately prior to the destruction of a Train object, to allow certain scripts to clean up their state.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Train Messages|Train,Deleted]]&lt;br /&gt;
|train &amp;gt; ?&lt;br /&gt;
|Sent when a train is deleted from the train list. This will also occur when two trains couple to form a new train.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|Train,ThreadAITrainStoppedMovingFailed&lt;br /&gt;
|train &amp;gt; train&lt;br /&gt;
|Internal Train.gs implementation- sent when the AI fails to enter the expected junction.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|Train,CommandCoupleVehicleTimer&lt;br /&gt;
|train &amp;gt; train&lt;br /&gt;
|Internal Train.gs implementation- sent when the AI fails to couple in a two-second window.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|Train,CommandReverseTrain.Pulse&lt;br /&gt;
|train &amp;gt; train&lt;br /&gt;
|Internal Train.gs implementation- sent when the AI fails to take permits to reverse a train within a 20-second window.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Train Messages|Train,DriverBoarded]]&lt;br /&gt;
|train &amp;gt; driver&lt;br /&gt;
|Sent when a driver boards a train&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|Train,NotifyBell&lt;br /&gt;
|train &amp;gt; train&lt;br /&gt;
|Sent when the interface bell button is clicked. Does not work since build 4.3&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|Train,NotifyHeadlights&lt;br /&gt;
|train &amp;gt; train&lt;br /&gt;
|Sent when the interface headlight button is clicked. Does not work since build 4.3&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|Train,NotifyHorn&lt;br /&gt;
|train &amp;gt; train&lt;br /&gt;
|Sent when the interface horn button is clicked&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|Train,NotifyPantographs&lt;br /&gt;
|train &amp;gt; train&lt;br /&gt;
|Sent when the interface pantograph button is clicked. Does not work since build 4.3&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|Train,NotifySanding&lt;br /&gt;
|&lt;br /&gt;
|Does not work since build 4.3&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|Train,TurnAround&lt;br /&gt;
|&lt;br /&gt;
|Does not work since build 4.3&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Train Messages|Train,ReachedTarget]]&lt;br /&gt;
|? &amp;gt; ?&lt;br /&gt;
|Sent by Trainz when a train reaches the specified Autopilot Target Position.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Train Messages|Train,SlowingForTarget]]&lt;br /&gt;
|train &amp;gt; train&lt;br /&gt;
|Sent by Trainz when the train begins to slow on approach to a specified Autopilot Target Position.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Train Messages|Train,Handbrake-Apply]]&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Train Messages|Train,Handbrake-Release]]&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Train Messages|Train,StartedMoving]]&lt;br /&gt;
|train &amp;gt; train&lt;br /&gt;
|Sent when a train starts to move&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Train Messages|Train,StoppedMoving]]&lt;br /&gt;
|train &amp;gt; train&lt;br /&gt;
|Sent when a train stops&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Train Messages|Train,ThrottleChanged]]&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|Train,Tick&lt;br /&gt;
|train &amp;gt; train&lt;br /&gt;
|?&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Object Messages|Train,EnterTrack]]&lt;br /&gt;
|track &amp;gt; train&lt;br /&gt;
|Sent when a train enters a track section&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Object Messages|Train,InnerEnterTrack]]&lt;br /&gt;
|track &amp;gt; train&lt;br /&gt;
|?&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Object Messages|Train,InnerLeaveTrack]]&lt;br /&gt;
|track &amp;gt; train&lt;br /&gt;
|?&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Object Messages|Train,LeaveTrack]]&lt;br /&gt;
|track &amp;gt; train&lt;br /&gt;
|Sent when a train leaves a track section&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|Train.ThreadAITrainStuck,Touch&lt;br /&gt;
|train &amp;gt; train&lt;br /&gt;
|?&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|TrainTimetable,Touch&lt;br /&gt;
|? &amp;gt; ?&lt;br /&gt;
|?&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Object Messages|Trigger,Enter]]&lt;br /&gt;
|trigger &amp;gt; train&lt;br /&gt;
|Sent when a train enters a trigger&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Object Messages|Trigger,Leave]]&lt;br /&gt;
|trigger &amp;gt; train&lt;br /&gt;
|Sent when a train leaves a trigger&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Object Messages|Trigger,Stopped]]&lt;br /&gt;
|trigger &amp;gt; train&lt;br /&gt;
|Sent when a train stops at a trigger&lt;br /&gt;
{{IndexSplit|V}}&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Vehicle Messages|Vehicle,BadCouple]]&lt;br /&gt;
|vehicle &amp;gt; broadcast&lt;br /&gt;
|Sent when a vehicle couples at excessive speed&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Vehicle Messages|Vehicle,Collided]]&lt;br /&gt;
|vehicle &amp;gt; broadcast&lt;br /&gt;
|Sent on a collision between vehicles&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Vehicle Messages|Vehicle,Coupled]]&lt;br /&gt;
|vehicle &amp;gt; broadcast&lt;br /&gt;
|Sent when a vehicle couples to another&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Vehicle Messages|Vehicle,Decoupled]]&lt;br /&gt;
|vehicle &amp;gt; broadcast&lt;br /&gt;
|Sent when a vehicle uncouples from another&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Vehicle Messages|Vehicle,Derailed]]&lt;br /&gt;
|vehicle &amp;gt; broadcast&lt;br /&gt;
|Sent when a vehicle is derailed&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|Vehicle,LoadComplete&lt;br /&gt;
|industry &amp;gt; vehicle&lt;br /&gt;
|Sent when loading of a vehicle from an industry is complete&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|Vehicle,Coupler breakage&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|Vehicle,Coupler breakage notify&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|Vehicle,Coupler Repaired&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
{{IndexSplit|W}}&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Interface Messages|WaybillManager,WaybillsWindowShown]]&lt;br /&gt;
|waybillmanager &amp;gt; broadcast&lt;br /&gt;
|?&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Interface Messages|WaybillManager,WaybillsWindowHidden]]&lt;br /&gt;
|waybillmanager &amp;gt; broadcast&lt;br /&gt;
|?&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[ModuleInit Message|World,ModuleInit]]&lt;br /&gt;
|? &amp;gt; broadcast&lt;br /&gt;
|Sent whenever TRS switches to Driver, Surveyor or Railyard modes&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|World,Paused&lt;br /&gt;
|? &amp;gt; broadcast&lt;br /&gt;
|?&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|World,Unpaused&lt;br /&gt;
|? &amp;gt; broadcast&lt;br /&gt;
|?&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|World,Day&lt;br /&gt;
|? &amp;gt; broadcast&lt;br /&gt;
|Sent 1.) at ca. 05:45 ~ 0.739409 Gametime 2.) sometimes when TS starts Driver&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|World,Night&lt;br /&gt;
|? &amp;gt; broadcast&lt;br /&gt;
|Sent 1.) at ca. 18:15 ~ 0.260611 GameTime 2.) whenever TS starts Driver or Surveyor and Playtime is beween 18:15 and 05:45 3.) sometimes when TS switched to Driver or Surveyor&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Ciceronmt</name></author>
	</entry>
</feed>