https://online.ts2009.com/mediaWiki/api.php?action=feedcontributions&user=Vvmm&feedformat=atomTrainzOnline - User contributions [en]2024-03-28T20:33:05ZUser contributionsMediaWiki 1.19.1https://online.ts2009.com/mediaWiki/index.php/Vvmm%27s_Trainz_ToolsVvmm's Trainz Tools2024-02-06T08:31:02Z<p>Vvmm: Updated link</p>
<hr />
<div>==TZarchiver==<br />
<br />
This application can be used to open or create TZarc files that are present in Trainz A New Era.<br />
<br />
Now you can open and restore backups created by the game (from the backups folder), edit content directly from the local folder or transfer the content from local to TS12/2010/2009. The app allows batch operation with a single click.<br />
<br />
It supports file association with TZarc files and adding them to the list by double-clicking. (Use the Open With... dialog to create association)<br />
<br />
==CDP Explorer==<br />
<br />
With CDP Explorer you can display the contents of CDP files before installing them and you can search if a CDP contains a certain asset (kuid).<br />
You can use drag&drop or 'open with' to open a CDP.<br />
<br />
Features:<br />
* '''Extract assets from CDP as separate files.'''<br />
* List assets contained in CDP: kuid, username, build, class, region, era.<br />
* Copy kuid list.<br />
* Copy kuid+name list.<br />
* Search for known info in CDP: kuid, username.<br />
* Count total number of objects.<br />
<br />
==Chump expander==<br />
<br />
This application unpacks chump files (i.e.: config.chump or cdp) to txt format.<br />
<br />
Now you can edit content directly from the local folder or transfer the content between any Trainz versions. The app allows batch operation with a single click.<br />
<br />
Supports file association with chump files and adding them to the list by double-clicking. (Use the Open With... dialog to create association)<br />
<br />
==Kuid Lister==<br />
<br />
With this application you can create organized lists of asset KUIDs, in order to post them in the missing KUIDs forum section.<br />
<br />
It can also create multiple asset versions for the listed KUIDs, which is useful to find any available version of the asset.<br />
<br />
==Kuid2Hash==<br />
<br />
Application for converting a numeric kuid value to hexadecimal and calculating the hash value. It can also calculate the reverse conversion, from hexadecimal to numeric value.<br />
<br />
The app is useful for finding a kuid in the local content hash folders.<br />
<br />
==Trainz Settings Viewer==<br />
<br />
With this application you can explore all the saved settings of the game from the assets.tdx file.<br />
<br />
For example you can see your username, password and the cd-key used. Or you can take advantage of the Surveyor picklist and view the lists directly. The "Jump to" options takes you to the most usual information.<br />
<br />
Supports file association with tdx files. (Use the Open With... dialog to create association)<br />
<br />
==Download and getting help==<br />
<br />
You can use my forum in order to ask any question you like or receive support using my software: https://www.tapatalk.com/groups/vvmm/software-f56/<br />
<br />
In each topic you will find a download link to the software which will only run on Windows 7/8/8.1/10.<br />
<br />
For getting help you should post only in English or Romanian.<br />
<br />
==Disclaimer==<br />
<br />
I am not responsible for any damage caused from the use or misuse of the above software.<br />
<br />
The programs are provided free of charge to help other Trainz content creators and users.<br />
<br />
==About vvmm==<br />
<br />
I am an Embedded Software Engineer, currently working in Bucharest, Romania. My biggest passion are trains, especially the Trainz Railroad Simulator. I also like electronics, music and networking and in my free time I like to create custom quality Trainz content and software to make Trainz assets management easier for other people. <br />
<br />
==Exit==<br />
<br />
[[Tools|Return to Tools]]</div>Vvmmhttps://online.ts2009.com/mediaWiki/index.php/CCG/Modelling:_Chunky_Mesh_TrackCCG/Modelling: Chunky Mesh Track2019-02-18T08:46:14Z<p>Vvmm: Why "should be removed"? We definitely don't want to remove reference documentation even if it's obsolete. This will help creators update their content. Should not be used is better.</p>
<hr />
<div><font color=red>'''Note: This page describes obsolete asset formats (trainz-build prior to 2.9) and should not be used for any new asset. The current equivalent of this format is [[KIND Track]].'''</font><br />
<br />
<br />
==Chunky Mesh Track==<br />
Chunky mesh track is an asset that uses a default inbuilt mesh. The creator does not have to construct a mesh in 3dsmax or gmax.<br />
<br />
The cross sectional track and ballast shape of the mesh is pre-defined by the diagram below.<br />
<br />
A 128 by 128 pixel tga file is used for the texture. This generally includes the ballast, ties and a larger rail section texture on the right of the graphic. Because the shape is defined by geometric proportions, the approximate equivalent dimensions measured in pixels is shown in the chunky_info texture file data shown below. This is approximate due to rounding of values to whole pixels. For additional information on using the Kind, <font color="red">refer to XXXXX.</font><br />
<br />
====chunky_info====<br />
These values (in metres) define the shape of the mesh created for the track. See drawing below:<br />
<br />
[[Image:CCG_chunky_track_section.jpg]]<br />
<br />
<br />
====chunky_info texture file====<br />
The texture file with the track texture on the left and a rail texture on the right is 128 x 128 uncompressed tga, and may have an alpha layer. The texture is mapped to the mesh shape above using the values in the drawing below, as fractions of the 128 pixel width.<br />
<br />
[[Image:CCG_chunky_track_texture.jpg]]<br />
<table cellpadding="5"><tr><td>Fraction</td><td>0.01</td><td>0.225</td><td>0.525</td><td>0.74</td><br />
<td>0.75</td><td>0.83</td><td>0.91</td><td>0.99</td></tr><br />
<tr><td>Pixels</td><td>1</td><td>29</td><td>67</td><td>95</td><td>96</td><td>106</td><td>117</td><td>127</td></tr></table><br />
<br />
<br />
===SPLINES===<br />
Splines have a number of tags that have special effects in Trainz, and also need to be constructed in a certain way in 3DSMax (or GMax.)<br />
<br />
For example, the effect of the following tags are explained in the diagrams:<br />
<br />
====upright====<br />
<table cellpadding="10"><tr><td valign="top"><br />
[[Image:CCG_upright.jpg]]<br />
<table><tr><td width="50"></td><td width="160">upright 1</td><td>upright 0</td></tr></table><br />
</td><td valign="top"><br />
upright 0<br />
This effects how vertical the objects in the spline, for example a row of poles:<br />
:0 = the poles will be placed at right angles to the slope of the ground.<br />
:1 = the poles will be truly vertical regardless of the ground slope.<br />
</td></tr></table><br />
<br />
<br />
====bendy====<br />
<table cellpadding="10"><tr><td width="340" valign="top" align="center"><br />
[[Image:CCG_bendy.jpg]]<br />
<table><td width="100" align="left">bendy 1</td><td>bendy 0</td></table><br />
</td><td valign="top"><br />
bendy 1<br />
Switches how track is bent on corners, set as 1 allows the mesh to be deformed as the spline is bent around corners.<br />
</td></tr></table><br />
<br />
<br />
'''Notes:''' bendy and upright have a visible effect for Kind Track splines, as above. For Kind Bridge or Tunnel, the splines show as in bendy 1, bendy 0 has no visual effect. However, bendy 1 should always be entered in the config.txt file for bridge and tunnel as the tag improves handling of the spline and Trainz performance.<br />
<br />
<br />
====length and endlength====<br />
A spline may be made by specifying a length value in the config.txt file. To add a different model at the start or end of the spline, Initiators and Terminators are used.<br />
<br />
<br />
====initiator====<br />
Name of model to use at the end of the bridge, placed in a sub folder with same name.<br />
<br />
<br />
<br />
====terminator====<br />
Name of model to use at the end of the bridge, placed in a sub folder with same name.<br />
<br />
<br />
====length====<br />
Length of the main spline track segment in metres.<br />
<br />
<br />
====endlength====<br />
Length in metres of the initiator and terminator models.<br />
<br />
<br />
<br />
[[Image:CCG_bridge_single.jpg]]<br />
<br />
The initiator or terminator is a fixed length and the main spline model repeats as in the diagram above.<br />
<br />
<br />
In 3dsmax/gmax, the initiator, terminator and spline models must be constructed starting on the origin and extending in the negative Y axis direction. The top view in the diagram shows the correct placement and dimensions L1 or L.<br />
<br />
<br />
<table><td width="40"></td><td>'''3DSMax Top View'''</td></table><br />
<br />
[[Image:CCG_3dmax_top_view.jpg]]<br />
<br />
<br />
<br />
The initiator may be rotated 180 degrees to create a terminator model, if required.<br />
<br />
Attachment points will be automatically generated in Trainz at ground level. The model heights need to be adjusted in 3dsmax/gmax so a road or track will connect at the correct levels.<br />
<br />
<br />
<table><td width="40"></td><td>'''3DSMax Front View'''</td></table><br />
<br />
[[Image:CCG_3dmax_front_view.jpg]]<br />
<br />
<br />
<br />
[[CCG/Modelling: FixedTrack|Previous Page]] . . . . [[CCG/Modelling: TrainzOptions File|Next Page]]<br />
<br />
==Return to CCG Index==<br />
[[Content Creator's Guide]]</div>Vvmmhttps://online.ts2009.com/mediaWiki/index.php/Class_WorldClass World2017-10-30T20:37:29Z<p>Vvmm: /* PlaySound */</p>
<hr />
<div>*[[TrainzScript Language Reference|API Hierarchy]]<br />
**World<br />
<br><br />
*World is a static class used to access various aspects of the Trainz environment.<br />
<br><br />
<br />
==Constants==<br />
*These constants are used to define various values and can be used as mnenomics.<br />
*If accessed from scripts the values must be prefixed ''World.'', for example:<br />
World.SetWeather(World.WEATHER_TYPE_LIGHT_SNOW,World.WEATHER_CHANGEABILITY_PERIODIC);<br />
<br><br />
<br />
===Camera View Modes===<br />
----<br />
*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().<br />
<br />
{{TableHeader|width=95%|margin=15px}}<br />
|width=375|public define int CAMERA_INTERNAL = 1||Internal cabin camera view.<br />
|-<br />
|public define int CAMERA_EXTERNAL = 2||External train camera view<br />
|-<br />
|public define int CAMERA_TRACKING = 4||External tracking camera view.<br />
|-<br />
|public define int CAMERA_ROAMING = 128||Roaming camera view.<br />
|}<br />
<br><br />
<br />
===Camera Flags===<br />
----<br />
*These flags are used in addition to the Camera Mode Flags to allow or disallow specific camera actions. <br />
{{TableHeader|width=95%|margin=15px}}<br />
|width=375|public define int CAMERA_SWITCH_VIEWS = 8||User permitted to swap between the camera views.<br />
|-<br />
|public define int CAMERA_SWITCH_VEHICLES = 16||User permitted to swap vehicles within the current train.<br />
|-<br />
|public define int CAMERA_SWITCH_TRAINS = 32||User permitted to swap to other trains which are in the consist menu.<br />
|-<br />
|public define int CAMERA_LOCKED = 64||User is NOT permitted to adjust camera (i.e. zoom, pan etc.).<br />
|-<br />
|public define int CAMERA_NORMAL = * ||Normal camera mode where everything is permitted.<br />
|-<br />
|colspan=2|<sup>* NOTE: CAMERA_NORMAL = CAMERA_INTERNAL | CAMERA_EXTERNAL | CAMERA_TRACKING | CAMERA_SWITCH_VIEWS | CAMERA_SWITCH_VEHICLES | CAMERA_SWITCH_TRAINS</sup><br />
|}<br />
<br><br />
<br />
===Weather Type Constants===<br />
----<br />
*Define the current state of the weather in Trainz. <br />
*A variety of weather conditions are supported and can be changed by using one of these values with the World.SetWeather() method. <br />
{{TableHeader|width=95%|margin=15px}}<br />
|width=375|public define int WEATHER_TYPE_CLEAR = 0||Clear weather, no clouds, rain or snow.<br />
|-<br />
|public define int WEATHER_TYPE_CLOUDY = 1||Cloudy weather, no rain.<br />
|-<br />
|public define int WEATHER_TYPE_DRIZZLE = 2||Drizzle, light rain.<br />
|-<br />
|public define int WEATHER_TYPE_RAIN = 3||Rainy weather.<br />
|-<br />
|public define int WEATHER_TYPE_STORMY = 4||Stormy weather that includes lightning and thunder.<br />
|-<br />
|public define int WEATHER_TYPE_LIGHT_SNOW = 5||Snowing lightly.<br />
|-<br />
|public define int WEATHER_TYPE_MEDIUM_SNOW = 6||Medium level snow fall.<br />
|-<br />
|public define int WEATHER_TYPE_HEAVY_SNOW = 7||Heavy snow fall.<br />
|}<br />
<br><br />
<br />
===Weather Changeability Constants===<br />
----<br />
*Define the changeability settings for the weather. <br />
*Weather changeability refers to variability of weather conditions rather than to a specific weather type.<br />
{{TableHeader|width=95%|margin=15px}}<br />
|width=375|public define int WEATHER_CHANGEABILITY_NONE = 0||Weather remains static.<br />
|-<br />
|public define int WEATHER_CHANGEABILITY_PERIODIC = 1||Periodic changes in weather.<br />
|-<br />
|public define int WEATHER_CHANGEABILITY_EXTREME = 2||Extreme and frequent changes in weather. <br />
|}<br />
<br><br />
<br />
===Time Values===<br />
----<br />
*Time constants defined in seconds.<br />
{{TableHeader|width=95%|margin=15px}}<br />
|width=375|public define float TIME_SECOND = 1.0f||One second.<br />
|-<br />
|public define float TIME_MINUTE = TIME_SECOND * 60.0f||One minute, 60.0 seconds.<br />
|-<br />
|public define float TIME_HOUR = TIME_MINUTE * 60.0f||One hour, 60.0 minutes, 3600.0 seconds.<br />
|-<br />
|public define float TIME_DAY = TIME_HOUR * 24.0f||One day, 24 hours, 1440.0 minutes, 86400.0 seconds.<br />
|}<br />
<br><br />
<br />
===Time Rate Constants===<br />
----<br />
*Values that define the time rates relative to normal time. <br />
*These constants can be used to set the time rate that Trainz runs out through the World.SetGameTimeRate() method. <br />
{{TableHeader|width=95%|margin=15px}}<br />
|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)<br />
|-<br />
|public define int TIME_RATE_2X = 1||Time passes at twice normal speed.<br />
|-<br />
|public define int TIME_RATE_4X = 2||<br />
|-<br />
|public define int TIME_RATE_8X = 3||<br />
|-<br />
|public define int TIME_RATE_16X = 4||<br />
|-<br />
|public define int TIME_RATE_32X = 5||<br />
|-<br />
|public define int TIME_RATE_60X = 6||<br />
|-<br />
| public define int TIME_RATE_120X = 7||<br />
|-<br />
| public define int TIME_RATE_240X = 8||<br />
|-<br />
|public define int TIME_RATE_360X = 9||<br />
|-<br />
|public define int TIME_RATE_480X = 10||<br />
|-<br />
|public define int TIME_RATE_720X = 11||<br />
|-<br />
|public define int TIME_RATE_960X = 12||<br />
|-<br />
|public define int TIME_RATE_1200X = 13||<br />
|-<br />
|public define int TIME_RATE_1440X = 14||<br />
|}<br />
<br><br />
<br />
===Trainz Modules===<br />
----<br />
*Trainz module mode constants. <br />
*These values define the various module environments that Trainz can be in. <br />
{{TableHeader|width=95%|margin=15px}}<br />
|width=375|public define int NO_MODULE = 0||Trainz not running in a module.<br />
|-<br />
|public define int SURVEYOR_MODULE = 1||Trainz is currently running in Surveyor.<br />
|-<br />
|public define int DRIVER_MODULE = 2||Trainz is currently running in Driver.<br />
|}<br />
<br> <br />
<br />
==Related Messages==<br />
* [[TrainzScript Message Reference]]<br><br />
* [[Camera Messages]]<br><br />
* [[Interface Messages]]<br><br />
* [[ModuleInit Message]]<br><br />
<br><br />
<br />
==AddDriverCharacter==<br />
{{MethodHeader|public native DriverCharacter AddDriverCharacter(Asset driverCharacterAsset)}}<br />
;Parameters<br />
*'''driverCharacterAsset''' = Asset containing character to be added.<br />
;Returned Value<br />
*Reference to the DriverCharacter if successful, null otherwise.<br />
;Syntax<br />
DriverCharacter Casey = World.AddDriverCharacter(CaseyJones);<br />
;Notes<br />
<br><br />
<br />
==AddDriverCommand==<br />
{{MethodHeader|public native DriverCommand AddDriverCommand(Asset driverCommandAsset)}}<br />
;Parameters<br />
*'''driverCommandAsset''' = Asset containing command to be added.<br />
;Returned Value<br />
*Reference to the DriverCommand if successful, null otherwise.<br />
;Syntax<br />
DriverCommand GoFaster = World.AddDriverCommand(accelerate);<br />
;Notes<br />
<br><br />
<br />
==CreateBehavior==<br />
{{MethodHeader|public native ScenarioBehavior CreateBehavior(KUID kuid, Soup initialProperties)}}<br />
;Parameters<br />
*'''kuid''' = KUID of scenario.<br />
'''initialProperties''' = Soup object containing initial properties for scenario.<br />
;Returned Value<br />
*Reference to the ScenarioBehavior created if successful, null otherwise.<br />
;Syntax<br />
ScenarioBehavior scenario = World.CreateBehavior(scenarioAsset, scenarioSoup);<br />
;Notes<br />
*The returned ScenarioBehavior object may be ended by releasing all references to it (resetting all references to null).<br />
<br><br />
<br />
==CreateTrain==<br />
{{MethodHeader|public native Train CreateTrain(KUID[ ] consist, string trackmarkName, bool direction)<br>public native Train CreateTrain(KUID[ ] consist, TrackMark trackmark, bool direction)<br>public native Train CreateTrain(KUID[ ] consist, Buildable buildable, string trackName, float position, bool direction)}}<br />
;Parameters<br />
*'''consist''' = An array of vehicle KUIDs used to describe the required Train object.<br />
*'''trackmarkName''' = Name of Trackmark at which the consist is to be formed.<br />
*'''buildable''' = Buildable on which the consist is to be formed.<br />
*'''trackName''' = Name of track within Buildable object.<br />
*'''position''' = Distance at which the Train is to be placed relative to the start of the track.<br />
*'''trackmark''' = Reference to Trackmark at which the consist is to be formed.<br />
*'''direction''' = Orientation of Train relative to direction of track or trackmark.<br />
;Returned Value<br />
*Reference to the Train created if successful, null otherwise.<br />
;Syntax<br />
Train train = World.CreateTrain(consist, buildable, "Track 1", 10.0, true);<br />
;Notes<br />
*These methods create a train from a list of vehicles in a consist array.<br />
*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.<br />
*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.<br />
<br><br />
<br />
==DeleteTrain==<br />
{{MethodHeader|public native void DeleteTrain(Train train)}}<br />
;Parameters<br />
*'''train''' = train to be deleted from map.<br />
;Returned Value<br />
*None<br />
;Syntax<br />
World.DeleteTrain(flyingScotsman);<br />
;Notes<br />
*Once a train has been deleted, care should be taken to avoid using its reference.<br />
<br><br />
<br />
==DeleteVehicle==<br />
{{MethodHeader|public native void DeleteVehicle(Vehicle vehicle)}}<br />
;Parameters<br />
*'''vehicle''' = vehicle to be deleted from its train.<br />
;Returned Value<br />
*None<br />
;Syntax<br />
World.DeleteVehicle(vehicles[vehicles.size()-1]);<br />
;Notes<br />
*Use Train.GetVehicles() to obtain an array of vehicles for a given train.<br />
*Use Vehicle.GetMyTrain() to obtain a train reference for a given vehicle.<br />
<br><br />
<br />
==FindAsset==<br />
{{MethodHeader|public native Asset FindAsset(KUID kuid)}}<br />
;Parameters<br />
*'''kuid''' = KUID of Asset to return.<br />
;Returned Value<br />
*Given a valid KUID parameter, this method return an Asset reference if successful, null otherwise.<br />
;Syntax<br />
Asset asset = World.FindAsset(kuid);<br />
;Notes<br />
*See also Asset.FindAsset()<br />
<br><br />
<br />
==FindDriverCommand==<br />
{{MethodHeader|public native DriverCommand FindDriverCommand(Asset driverCommandAsset)}}<br />
;Parameters<br />
*'''driverCommandAsset''' = Asset containing command to be added.<br />
;Returned Value<br />
*Reference to the DriverCommand if successful, null otherwise.<br />
;Syntax<br />
DriverCommand GoFaster = World.FindDriverCommand(accelerate);<br />
;Notes<br />
<br><br />
<br />
==GetAssetList==<br />
{{MethodHeader|public native Asset[ ] GetAssetList(string kind)}}<br />
;Parameters<br />
*'''kind''' = String representing the Kind of asset to return.<br />
;Returned Value<br />
*A list of all assets of the given ''kind''<br />
;Syntax<br />
Asset[] Libraries = World.GetAssetList("Library");<br />
;Notes<br />
*All installed assets of the given ''kind'' are returned, irrespective of whether or not they are in use on the current map.<br />
<br><br />
<br />
==GetBadWeatherFog==<br />
{{MethodHeader|public native float GetBadWeatherFog(void)}}<br />
;Parameters<br />
*None<br />
;Returned Value<br />
*Bad weather fog distance as a float in the range 0.0..1.0.<br />
;Syntax<br />
float dist = World.GetBadWeatherFog();<br />
;Notes<br />
<br><br />
<br />
==GetBehaviors==<br />
{{MethodHeader|public native ScenarioBehavior[ ] GetBehaviors(void)}}<br />
;Parameters<br />
*None<br />
;Returned Value<br />
*A list of top-level behaviors or rules on the currently loaded route.<br />
;Syntax<br />
ScenarioBehavior[] rules = World.GetBehaviors();<br />
;Notes<br />
<br><br />
<br />
==GetCameraPositionX==<br />
{{MethodHeader|public native float GetCameraPositionX(void)}}<br />
;Parameters<br />
*None<br />
;Returned Value<br />
*X Coordinate of the current camera position.<br />
;Syntax<br />
float X = World.GetCameraPositionX();<br />
*Notes<br />
<br><br />
<br />
==GetCameraPositionY==<br />
{{MethodHeader|public native float GetCameraPositionY(void)}}<br />
;Parameters<br />
*None<br />
;Returned Value<br />
*Y Coordinate of the current camera position.<br />
;Syntax<br />
float Y = World.GetCameraPositionY();<br />
*Notes<br />
<br><br />
<br />
==GetCameraPositionZ==<br />
{{MethodHeader|public native float GetCameraPositionZ(void)}}<br />
;Parameters<br />
*None<br />
;Returned Value<br />
*Z Coordinate of the current camera position.<br />
;Syntax<br />
float Z = World.GetCameraPositionZ();<br />
*Notes<br />
<br><br />
<br />
==GetCurrentModule==<br />
{{MethodHeader|public native int GetCurrentModule(void)}}<br />
;Parameters<br />
*None<br />
;Returned Value<br />
*An integer representing the current Trainz module.<br />
;Syntax<br />
int module = World,GetCurrentModule();<br />
;Notes<br />
* See [[#Trainz Modules|Trainz Modules]] for details of the constants associated with this method. <br />
* See [[ModuleInit Message]] for further details.<br />
<br><br />
<br />
==GetDriverCharacterList==<br />
{{MethodHeader|public native DriverCharacter[ ] GetDriverCharacterList(void)}}<br />
;Parameters<br />
*None<br />
;Returned Value<br />
*An array of DriverCharacter objects installed in the current world.<br />
;Syntax<br />
DriverCharacter[] drivers = World.GetDriverCharacterList();<br />
;Notes<br />
<br><br />
<br />
==GetDriverCommandList==<br />
{{MethodHeader|public native DriverCommand[ ] GetDriverCommandList(void)}}<br />
;Parameters<br />
*None<br />
;Returned Value<br />
*An array of DriverCommand objects installed in the current world.<br />
;Syntax<br />
DriverCommand[] commands = World.GetDriverCommandList();<br />
;Notes<br />
<br><br />
<br />
==GetGameTime==<br />
{{MethodHeader|public native float GetGameTime(void)}}<br />
;Parameters<br />
*None<br />
;Returned value<br />
*Current game time.<br />
;Syntax<br />
float Now = World.GetGameTime();<br />
;Notes<br />
*The returned time is normalised to a value between 0.0 and 1.0<br />
*0.0 = midday.<br />
*0.5 = midnight<br />
*Use the [[#Time_Values|Time Value]] constants to convert the normalised values to human readable times.<br />
<br><br />
<br />
==GetGoodWeatherFog==<br />
{{MethodHeader|public native float GetGoodWeatherFog(void)}}<br />
;Parameters<br />
*None<br />
;Returned Value<br />
*Good weather fog distance as a float in the range 0.0..1.0.<br />
;Syntax<br />
float dist = World.GetGoodWeatherFog();<br />
;Notes<br />
<br><br />
<br />
==GetGroundDrawDistance==<br />
{{MethodHeader|public native float GetGroundDrawDistance(void)}}<br />
;Parameters<br />
*None<br />
;Returned Value<br />
*Ground draw distance in metres.<br />
;Syntax<br />
float dist = World.GetGroundDrawDistance();<br />
;Notes<br />
<br><br />
<br />
==GetIndustryList==<br />
{{MethodHeader|public native GameObject[ ] GetIndustryList(void)}}<br />
;Parameters <br />
*None<br />
;Returned Value<br />
*An array of references to all of the Industry objects for the current route.<br />
;Syntax<br />
GameObject[] Industries = World.GetIndustryList();<br />
;Notes<br />
<br><br />
<br />
==GetJunctionList==<br />
{{MethodHeader|public native Junction[ ] GetJunctionList(void)}}<br />
;Parameters <br />
*None<br />
;Returned Value<br />
*An array of references to all of the trackside junction objects for the current route.<br />
;Syntax<br />
Junction[] junctions = World.GetJunctionList();<br />
;Notes<br />
*Junction objects attached to fixed track junctions are not currently returned by this method.<br />
<br><br />
<br />
==GetLibrary==<br />
{{MethodHeader|public native Library GetLibrary(KUID kuid)}}<br />
;Parameters<br />
*'''kuid''' = KUID of script library asset to load.<br />
;Returned Value<br />
*A reference to the script library asset if successful, null otherwise.<br />
;Syntax<br />
Library codelib = World.GetLibrary(LibraryKUID);<br />
;Notes<br />
*The [[Class Library|Library]] asset is initialised when this method is first called in a session.<br />
*Since only one instance can exist, subsequent calls return a reference to the existing Library object.<br />
*See [[Class Library|Library]] for notes on how to use this method.<br />
<br><br />
<br />
==GetSceneryDrawDistance==<br />
{{MethodHeader|public native float GetSceneryDrawDistance(void)}}<br />
;Parameters<br />
*None<br />
;Returned Value<br />
*Undefined.<br />
;Notes<br />
*Included for legacy script compatibility only. Has no effect.<br />
<br><br />
<br />
==GetSeconds==<br />
{{MethodHeader|public native float GetSeconds(void)}}<br />
;Parameters<br />
*None<br />
;Returned Value<br />
*The current value of a floating point number incrementing once per second in real time.<br />
;Syntax<br />
float start = World.GetSeconds();<br />
// do stuff<br />
float finish = World.GetSeconds();<br />
float period = finish - start;<br />
;Notes<br />
*Each call will return a float value containing the current value of an internal counter.<br />
*Subtracting a later value from a value saved at an earlier call will enable the delay between the two calls to be established.<br />
<br><br />
<br />
==GetSignalList==<br />
{{MethodHeader|public native Signal[ ] GetSignalList(void)}}<br />
;Parameters <br />
*None<br />
;Returned Value<br />
*An array of references to all of the signal objects for the current route.<br />
;Syntax<br />
Signal[] signals = World.GetSignalList();<br />
;Notes<br />
<br><br />
<br />
==GetStringTable==<br />
{{MethodHeader|public native StringTable GetStringTable(void)}}<br />
;Parameters <br />
*None<br />
;Returned Value<br />
*The StringTable for the current session.<br />
;Syntax<br />
StringTable data = World.GetStringTable();<br />
;Notes<br />
<br><br />
<br />
==GetSurveyorSavedConsist==<br />
{{MethodHeader|public native Soup GetSurveyorSavedConsistList(string name)}}<br />
;Parameters <br />
*'''name''' = Name of the consist to retireiev.<br />
;Returned Value<br />
*Returns a Soup definition of the named consist if it exists, null otherwise.<br />
;Syntax<br />
Soup consist = World.GetSurveyorSavedConsist("Brighton Belle");<br />
;Notes<br />
*Remember that the returned data is in a Soup format, which is not the same thing as a Train. <br />
*TrainUtil.CreateTrainFormSoup() can be used to create a train from the returned Soup.<br />
*This method only works in Surveyor.<br />
<br><br />
<br />
==GetSurveyorSavedConsistList==<br />
{{MethodHeader|public native string[ ] GetSurveyorSavedConsistList()}}<br />
;Parameters <br />
*None<br />
;Returned Value<br />
*An array of names of all the saved consist objects in Surveyor.<br />
;Syntax<br />
string[] consists = World.GetSurveyorSavedConsistList();<br />
;Notes<br />
*This method only works in Surveyor.<br />
<br><br />
<br />
==GetTrackmarkList==<br />
{{MethodHeader|public native TrackMark[ ] GetTrackmarkList(void)}}<br />
;Parameters <br />
*None<br />
;Returned Value<br />
*An array of references to all of the trackmark objects for the current route.<br />
;Syntax<br />
Trackmark[] trackmarks = World.GetTrackmarkList();<br />
;Notes<br />
<br><br />
<br />
==GetTrainList==<br />
{{MethodHeader|public native Train[ ] GetTrainList(void)}}<br />
;Parameters <br />
*None<br />
;Returned Value<br />
*An array of references to all of the trains for the current route.<br />
;Syntax<br />
Train[] trains = World.GetTrainList();<br />
;Notes<br />
<br><br />
<br />
==GetTrainzBuild==<br />
{{MethodHeader|public native int GetTrainzBuild(void)}}<br />
;Parameters;<br />
*None<br />
;Returned Value<br />
*Gets the current build number of Trainz. <br />
;Syntax<br />
int build = World.GetTrainzBuild();<br />
;Notes<br />
*The value returned corresponds to the build number you can see in the bottom-right side of the main Trainz menu screen.<br />
<br><br />
<br />
==GetTrainzVersion==<br />
{{MethodHeader|public native float GetTrainzVersion(void)}}<br />
;Parameters<br />
*None<br />
;Returned Value<br />
*The TRS version number.<br />
;Syntax<br />
float version = World.GetTrainzVersion();<br />
;Notes<br />
*The value returned corresponds to the version number you can see in the bottom-right side of the main Trainz menu screen. <br />
<br><br />
<br />
==GetTriggerList==<br />
{{MethodHeader|public native Trigger[ ] GetTriggerList(void)}}<br />
;Parameters <br />
*None<br />
;Returned Value<br />
*An array of references to all of the trigger objects for the current route.<br />
;Syntax<br />
Trigger[] triggers = World.GetTriggerList();<br />
;Notes<br />
*This method does not return scenery triggers, ie those attached to SceneryWithTrack objects and their descendants.<br />
<br><br />
<br />
==GetVehicleList==<br />
{{MethodHeader|public native Vehicle[ ] GetVehicleList(void)}}<br />
;Parameters <br />
*None<br />
;Returned Value<br />
*An array of references to all of the vehicles in the current route.<br />
;Syntax<br />
Vehicle[] vehicles = World.GetVehicleList();<br />
;Notes<br />
<br><br />
<br />
==GetWeatherChangeability==<br />
{{MethodHeader|public native int GetWeatherChangeability(void)}}<br />
;Parameter<br />
*None<br />
;Returned Value<br />
*One of the [[#Weather_Changeability_Constants|Weather Changeability Constants]] denoting the variability of weather conditions.<br />
;Syntax<br />
int variability = World.GetWeatherChangeability();<br />
;Notes<br />
<br><br />
<br />
==GetWeatherType==<br />
{{MethodHeader|public native int GetWeatherType(void)}}<br />
;Parameter<br />
*None<br />
;Returned Value<br />
*One of the [[#Weather_Type_Constants|Weather Type Constants]] denoting the current weather conditions.<br />
;Syntax<br />
int weather = World.GetWeatherType();<br />
;Notes<br />
<br><br />
<br />
==LoadMap==<br />
{{MethodHeader|public native bool LoadMap(KUID kuid)}}<br />
;Parameters<br />
*'''kuid''' = KUID of map to load.<br />
;Returned Value<br />
*True if successful, false otherwise.<br />
;Syntax<br />
if (World.LoadMap(mapKUID) Interface.Print("Map loaded OK");<br />
else Interface.Print("Map load failed");<br />
;Notes<br />
<br><br />
<br />
==Play2DSound==<br />
{{MethodHeader|public float Play2DSound(Asset asset, string wave)}}<br />
;Parameters<br />
*'''asset''' = Asset where the sound file is located.<br />
*'''wave''' = Name of the ''*.wav'' file to be played, a relative path can be included.<br />
;Returned Value<br />
* Undefined.<br />
;Syntax<br />
// Play the sound and continues script execution.<br />
World.Play2DSound(soundAsset,"sounds/allaboard.wav"); <br />
// Wait until sound has completed before continuing (pre-TS12 only!)<br />
Sleep(World.Play2DSound(soundAsset,"sounds/allaboard.wav")); <br />
;Notes<br />
*Plays a ''.wav" sound file from the given asset's folder.<br />
*The sound is non directional and can be mono or stereo. <br />
*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. <br />
*This means your code will keep on executing while Trainz is playing the sound.<br />
<br><br />
<br />
==PlaySound==<br />
{{MethodHeader|public native float PlaySound<br>&nbsp;&nbsp;&nbsp;&nbsp;(Asset asset, string wave, float vol, float near, float far, GameObject target, string pt)<br>&nbsp;&nbsp;&nbsp;&nbsp;(Asset asset, string wave, float vol, float near, float far, GameObject target, string pt, bool loop)}}<br />
;Parameters<br />
*'''asset''' = Asset where the sound file is located.<br />
*'''wave''' = Name of the ''*.wav'' file to be played, a relative path can be included.<br />
*'''vol''' = Volume level to play the sound at<br />
*'''near''' = Distance from the target asset at which the sound will be played at maximum volume.<br />
*'''far''' = Distance from the target asset at which the sound will become inaudible.<br />
*'''target''' = GameObject to which the sound will be attached if a 3d sound is required, null for 2D.<br />
*'''pt''' = Name of attachment point in the target object if a 3d sound is required, null for 2D.<br />
*'''loop''' = (Optional) If true the sound will loop continuously.<br />
;Returned Value<br />
* Sound length in seconds for Trainz before TS12<br />
* Undefined for TS12 and TANE<br />
;Syntax<br />
// Play the sound and continues script execution.<br />
World.PlaySound(soundAsset,"sounds/allaboard.wav",1000.0,10.0,100.0,Station,"a.loudspeaker"); <br />
// Wait until sound has completed before continuing (pre-TS12 only!)<br />
Sleep(World.PlaySound(soundAsset,"sounds/allaboard.wav",1000.0,10.0,100.0,Station,"a.loudspeaker"); <br />
;Notes<br />
*Plays a ''.wav'' sound file from the given asset's folder.<br />
*If the sound is to be directional a mono sound file is required. <br />
*This method does not return after the sound has finished playing: it returns as soon as it is called. <br />
*This means your code will keep on executing while Trainz is playing the sound.<br />
*If you want to wait for the sound to complete playing before moving on, wrap the PlaySound() call up in a Sleep() call. '''Note!''' 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.<br />
*The sound volume will be at a maximum for a camera position at or less than the value of the ''near'' parameter and will reduce with distance until the hearing position reaches ''far'', when the sound will be inaudible.<br />
<br><br />
<br />
==RemoveDriverCharacter==<br />
{{MethodHeader|public native void RemoveDriverCharacter(DriverCharacter driver)}}<br />
;Parameters<br />
*'''driver''' = DriverCharacter to remove.<br />
;Returned Value<br />
*None<br />
;Syntax<br />
World.RemoveDriverCharacter(dave);<br />
;Notes<br />
<br><br />
<br />
==RemoveDriverCommand==<br />
{{MethodHeader|public native void RemoveDriverCommand(DriverCommand command)}}<br />
;Parameters<br />
*'''command''' = DriverCommand to remove.<br />
;Returned Value<br />
*None<br />
;Syntax<br />
World.RemoveDriverCommand(driverCommand);<br />
;Notes<br />
<br><br />
<br />
==SetBadWeatherFog==<br />
{{MethodHeader|public native void SetBadWeatherFog(float distance)}}<br />
;Parameters<br />
*'''distance''' = Bad weather fog distance to set.<br />
;Returned Value<br />
*None<br />
;Syntax<br />
World.SetBadWeatherFog(0.5);<br />
;Notes<br />
<br><br />
<br />
==SetCamera==<br />
{{MethodHeader|public native bool SetCamera(MapObject focus)<br>public native void SetCamera(Junction focus)<br>public native void SetCamera(Vehicle focus, int cameraMode)<br>public native void SetCamera(Train focus, int cameraMode)}}<br />
;Parameters<br />
*'''focus''' = Object on which the camera is to be focused.<br />
*''cameraMode''' = One of the [[#Camera_View_Modes|Camera View Mode]] constants defining the view which should be assigned to the camera.<br />
;Returned Value<br />
*The first variant returns a boolean to indicate success or failure.<br />
*Remaining variants do not return a value<br />
'Syntax<br />
World.SetCamera(train.GetVehicles[0],World.CAMERA_TRACKING); // sets the camera to track the first vehicle in the train.<br />
<br><br />
<br />
==SetCameraAngle==<br />
{{MethodHeader|public void SetCameraAngle(int yaw, int pitch, float radius)}}<br />
;Parameters<br />
*'''yaw''' = Camera rotation in degrees, 90 is a direct front view.<br />
*'''pitch''' = Camera angle relative to the horizon, 0 is horizontal, 90 points vertically upwards.<br />
*'''radius''' = Distance in metres to the object in focus.<br />
;Returned Value<br />
*None<br />
;Syntax<br />
World.SetCameraAngle(90,0,25); // Sets the camera to a direct frontal view at 25 metres from the currently focused object.<br />
;Notes<br />
*''Radius'' is measured from the object origin point (0,0,0).<br />
<br><br />
<br />
==SetCameraFlags==<br />
{{MethodHeader|public native void SetCameraFlags(int flags)}}<br />
;Parameter<br />
*'''flags''' integer value defining what the user is permitted to do with the game camera.<br />
;Returned Value<br />
*None<br />
;Syntax<br />
// User is permitted to select External or Tracking views only.<br />
World.SetCameraFlags(World.CAMERA_EXTERNAL | World.CAMERA_TRACKING);<br />
;Notes<br />
*Use any combination of [[#Camera_Flags|Camera Flags]] and [[#Camera_View_Modes|Camera View Modes]] to set the parameter.<br />
<br><br />
<br />
==SetCameraMode==<br />
{{MethodHeader|public void SetCameraMode(int mode)}}<br />
;Parameter<br />
*'''mode''' = Camera mode to select.<br />
;Returned Value<br />
*None<br />
;Syntax<br />
World.SetCameraMode(World.CAMERA_TRACKING);<br />
;Notes<br />
*Use one of the [[#Camera_View_Modes|Camera View Modes]] to set the parameter.<br />
<br><br />
<br />
==SetGameTime==<br />
{{MethodHeader|public void SetGameTime(float time)}}<br />
;Parameters<br />
*'''time''' = new gane time to set.<br />
;Returned Value<br />
*None<br />
;Syntax<br />
World.SetGameTime(0.5); // sets time to midnight<br />
;Notes<br />
*Game time is normalised to a value between 0.0 and 1.0<br />
*0.0 = midday.<br />
*0.5 = midnight<br />
*Use the [[#Time_Values|Time Value]] constants to convert human readable times to normalised values. <br />
<br><br />
<br />
==SetGameTimeRate==<br />
{{MethodHeader|public native void SetGameTimeRate(float rate)}}<br />
;Parameters<br />
*'''rate''' = New time rate to set.<br />
;Returned Value<br />
*None<br />
;Syntax<br />
World.SetGameTimeRate(World.TIME_RATE_8X); // sets game time to advance by 8 minutes per minute of real world time.<br />
;Notes<br />
*Use one of the [[#Time_Rate_Constants|Time Rate Constants]] to define the parameter.<br />
<br><br />
<br />
==SetGoodWeatherFog==<br />
{{MethodHeader|public native void SetGoodWeatherFog(float distance)}}<br />
;Parameters<br />
*'''distance''' = Good weather fog distance to set.<br />
;Returned Value<br />
*None<br />
;Syntax<br />
World.SetGoodWeatherFog(0.5);<br />
;Notes<br />
<br><br />
<br />
==SetGroundDrawDistance==<br />
{{MethodHeader|public native void SetGroundDrawDistance(float distance)}}<br />
;Parameters<br />
*'''distance''' = Ground draw distance in metres.<br />
;Returned Value<br />
*None<br />
;Syntax<br />
World.SetGroundDrawDistance(1000.0);<br />
;Notes<br />
*Compatibility warning: Use of this function is not recommended, it may become non-functional in future Trainz versions.<br />
<br><br />
<br />
==SetSceneryDrawDistance==<br />
{{MethodHeader|public native void SetSceneryDrawDistance(float distance)}}<br />
;Parameters<br />
*'''distance''' = unused.<br />
;Returned Value<br />
*None<br />
;Notes<br />
* Does nothing. Included for script compatibility only.<br />
<br><br />
<br />
==SetTargetObserver==<br />
{{MethodHeader|public void SetTargetObserver(GameObject observer)}}<br />
;Parameters<br />
*'''observer''' = The game object to receive targeting messages.<br />
;Returned Value<br />
*None<br />
;Syntax<br />
SetTargetObserver(self);<br />
;Notes<br />
* Causes the specified object to receive "Track", "LeftClick" messages when a track is clicked. Causes the specified object to receive "Interface-Event", "Left-Click" 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's request.<br />
<br><br />
<br />
==SetWeather==<br />
{{MethodHeader|public native void SetWeather(int type, int changeability)}}<br />
;Parameters<br />
*'''type''' = Weather conditions as defined by one of the [[#Weather_Type_Constants|Weather Type Constants]].<br />
*'''change''' = Weather variation as defined by one of the [[#Weather_Changeability_Constants|Weather Changeability Constants]].<br />
;Returned Value<br />
*None<br />
;Syntax<br />
World.SetWeather(World.WEATHER_TYPE_HEAVY_SNOW,World.WEATHER_CHANGEABILITY_EXTREME); // April in Paris.<br />
;Notes<br />
<br><br />
<br />
==UserSetCamera==<br />
{{MethodHeader|public native bool UserSetCamera(GameObject target)}}<br />
;Parameters<br />
*'''target''' = GameObject to set focus to.<br />
;Returned Value<br />
*True if successful, false otherwise.<br />
;Syntax<br />
World.UserSetCamera(Router,GetGameObject("Junction 5"));<br />
;Notes<br />
<br><br />
<br />
==UserSetCameraMode==<br />
{{MethodHeader|public native void UserSetCameraMode(int mode)}}<br />
;Parameters<br />
*'''mode''' = One of the [[#Camera_View_Modes|Camera View Modes]]<br />
;Returned Value<br />
*None<br />
;Syntax<br />
World.UserSetCameraMode(World.CAMERA_ROAMING); // switches to roaming view if permitted.<br />
;Notes<br />
*This method respects the current [[#Camera_Flags|Camera Flag]] settings, disallowing any change which the flags do not permit.<br />
<br><br />
<br />
<br />
==Categories==<br />
[[Category:Script Class]]</div>Vvmmhttps://online.ts2009.com/mediaWiki/index.php/Class_WorldClass World2017-10-30T20:36:35Z<p>Vvmm: /* Play2DSound */</p>
<hr />
<div>*[[TrainzScript Language Reference|API Hierarchy]]<br />
**World<br />
<br><br />
*World is a static class used to access various aspects of the Trainz environment.<br />
<br><br />
<br />
==Constants==<br />
*These constants are used to define various values and can be used as mnenomics.<br />
*If accessed from scripts the values must be prefixed ''World.'', for example:<br />
World.SetWeather(World.WEATHER_TYPE_LIGHT_SNOW,World.WEATHER_CHANGEABILITY_PERIODIC);<br />
<br><br />
<br />
===Camera View Modes===<br />
----<br />
*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().<br />
<br />
{{TableHeader|width=95%|margin=15px}}<br />
|width=375|public define int CAMERA_INTERNAL = 1||Internal cabin camera view.<br />
|-<br />
|public define int CAMERA_EXTERNAL = 2||External train camera view<br />
|-<br />
|public define int CAMERA_TRACKING = 4||External tracking camera view.<br />
|-<br />
|public define int CAMERA_ROAMING = 128||Roaming camera view.<br />
|}<br />
<br><br />
<br />
===Camera Flags===<br />
----<br />
*These flags are used in addition to the Camera Mode Flags to allow or disallow specific camera actions. <br />
{{TableHeader|width=95%|margin=15px}}<br />
|width=375|public define int CAMERA_SWITCH_VIEWS = 8||User permitted to swap between the camera views.<br />
|-<br />
|public define int CAMERA_SWITCH_VEHICLES = 16||User permitted to swap vehicles within the current train.<br />
|-<br />
|public define int CAMERA_SWITCH_TRAINS = 32||User permitted to swap to other trains which are in the consist menu.<br />
|-<br />
|public define int CAMERA_LOCKED = 64||User is NOT permitted to adjust camera (i.e. zoom, pan etc.).<br />
|-<br />
|public define int CAMERA_NORMAL = * ||Normal camera mode where everything is permitted.<br />
|-<br />
|colspan=2|<sup>* NOTE: CAMERA_NORMAL = CAMERA_INTERNAL | CAMERA_EXTERNAL | CAMERA_TRACKING | CAMERA_SWITCH_VIEWS | CAMERA_SWITCH_VEHICLES | CAMERA_SWITCH_TRAINS</sup><br />
|}<br />
<br><br />
<br />
===Weather Type Constants===<br />
----<br />
*Define the current state of the weather in Trainz. <br />
*A variety of weather conditions are supported and can be changed by using one of these values with the World.SetWeather() method. <br />
{{TableHeader|width=95%|margin=15px}}<br />
|width=375|public define int WEATHER_TYPE_CLEAR = 0||Clear weather, no clouds, rain or snow.<br />
|-<br />
|public define int WEATHER_TYPE_CLOUDY = 1||Cloudy weather, no rain.<br />
|-<br />
|public define int WEATHER_TYPE_DRIZZLE = 2||Drizzle, light rain.<br />
|-<br />
|public define int WEATHER_TYPE_RAIN = 3||Rainy weather.<br />
|-<br />
|public define int WEATHER_TYPE_STORMY = 4||Stormy weather that includes lightning and thunder.<br />
|-<br />
|public define int WEATHER_TYPE_LIGHT_SNOW = 5||Snowing lightly.<br />
|-<br />
|public define int WEATHER_TYPE_MEDIUM_SNOW = 6||Medium level snow fall.<br />
|-<br />
|public define int WEATHER_TYPE_HEAVY_SNOW = 7||Heavy snow fall.<br />
|}<br />
<br><br />
<br />
===Weather Changeability Constants===<br />
----<br />
*Define the changeability settings for the weather. <br />
*Weather changeability refers to variability of weather conditions rather than to a specific weather type.<br />
{{TableHeader|width=95%|margin=15px}}<br />
|width=375|public define int WEATHER_CHANGEABILITY_NONE = 0||Weather remains static.<br />
|-<br />
|public define int WEATHER_CHANGEABILITY_PERIODIC = 1||Periodic changes in weather.<br />
|-<br />
|public define int WEATHER_CHANGEABILITY_EXTREME = 2||Extreme and frequent changes in weather. <br />
|}<br />
<br><br />
<br />
===Time Values===<br />
----<br />
*Time constants defined in seconds.<br />
{{TableHeader|width=95%|margin=15px}}<br />
|width=375|public define float TIME_SECOND = 1.0f||One second.<br />
|-<br />
|public define float TIME_MINUTE = TIME_SECOND * 60.0f||One minute, 60.0 seconds.<br />
|-<br />
|public define float TIME_HOUR = TIME_MINUTE * 60.0f||One hour, 60.0 minutes, 3600.0 seconds.<br />
|-<br />
|public define float TIME_DAY = TIME_HOUR * 24.0f||One day, 24 hours, 1440.0 minutes, 86400.0 seconds.<br />
|}<br />
<br><br />
<br />
===Time Rate Constants===<br />
----<br />
*Values that define the time rates relative to normal time. <br />
*These constants can be used to set the time rate that Trainz runs out through the World.SetGameTimeRate() method. <br />
{{TableHeader|width=95%|margin=15px}}<br />
|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)<br />
|-<br />
|public define int TIME_RATE_2X = 1||Time passes at twice normal speed.<br />
|-<br />
|public define int TIME_RATE_4X = 2||<br />
|-<br />
|public define int TIME_RATE_8X = 3||<br />
|-<br />
|public define int TIME_RATE_16X = 4||<br />
|-<br />
|public define int TIME_RATE_32X = 5||<br />
|-<br />
|public define int TIME_RATE_60X = 6||<br />
|-<br />
| public define int TIME_RATE_120X = 7||<br />
|-<br />
| public define int TIME_RATE_240X = 8||<br />
|-<br />
|public define int TIME_RATE_360X = 9||<br />
|-<br />
|public define int TIME_RATE_480X = 10||<br />
|-<br />
|public define int TIME_RATE_720X = 11||<br />
|-<br />
|public define int TIME_RATE_960X = 12||<br />
|-<br />
|public define int TIME_RATE_1200X = 13||<br />
|-<br />
|public define int TIME_RATE_1440X = 14||<br />
|}<br />
<br><br />
<br />
===Trainz Modules===<br />
----<br />
*Trainz module mode constants. <br />
*These values define the various module environments that Trainz can be in. <br />
{{TableHeader|width=95%|margin=15px}}<br />
|width=375|public define int NO_MODULE = 0||Trainz not running in a module.<br />
|-<br />
|public define int SURVEYOR_MODULE = 1||Trainz is currently running in Surveyor.<br />
|-<br />
|public define int DRIVER_MODULE = 2||Trainz is currently running in Driver.<br />
|}<br />
<br> <br />
<br />
==Related Messages==<br />
* [[TrainzScript Message Reference]]<br><br />
* [[Camera Messages]]<br><br />
* [[Interface Messages]]<br><br />
* [[ModuleInit Message]]<br><br />
<br><br />
<br />
==AddDriverCharacter==<br />
{{MethodHeader|public native DriverCharacter AddDriverCharacter(Asset driverCharacterAsset)}}<br />
;Parameters<br />
*'''driverCharacterAsset''' = Asset containing character to be added.<br />
;Returned Value<br />
*Reference to the DriverCharacter if successful, null otherwise.<br />
;Syntax<br />
DriverCharacter Casey = World.AddDriverCharacter(CaseyJones);<br />
;Notes<br />
<br><br />
<br />
==AddDriverCommand==<br />
{{MethodHeader|public native DriverCommand AddDriverCommand(Asset driverCommandAsset)}}<br />
;Parameters<br />
*'''driverCommandAsset''' = Asset containing command to be added.<br />
;Returned Value<br />
*Reference to the DriverCommand if successful, null otherwise.<br />
;Syntax<br />
DriverCommand GoFaster = World.AddDriverCommand(accelerate);<br />
;Notes<br />
<br><br />
<br />
==CreateBehavior==<br />
{{MethodHeader|public native ScenarioBehavior CreateBehavior(KUID kuid, Soup initialProperties)}}<br />
;Parameters<br />
*'''kuid''' = KUID of scenario.<br />
'''initialProperties''' = Soup object containing initial properties for scenario.<br />
;Returned Value<br />
*Reference to the ScenarioBehavior created if successful, null otherwise.<br />
;Syntax<br />
ScenarioBehavior scenario = World.CreateBehavior(scenarioAsset, scenarioSoup);<br />
;Notes<br />
*The returned ScenarioBehavior object may be ended by releasing all references to it (resetting all references to null).<br />
<br><br />
<br />
==CreateTrain==<br />
{{MethodHeader|public native Train CreateTrain(KUID[ ] consist, string trackmarkName, bool direction)<br>public native Train CreateTrain(KUID[ ] consist, TrackMark trackmark, bool direction)<br>public native Train CreateTrain(KUID[ ] consist, Buildable buildable, string trackName, float position, bool direction)}}<br />
;Parameters<br />
*'''consist''' = An array of vehicle KUIDs used to describe the required Train object.<br />
*'''trackmarkName''' = Name of Trackmark at which the consist is to be formed.<br />
*'''buildable''' = Buildable on which the consist is to be formed.<br />
*'''trackName''' = Name of track within Buildable object.<br />
*'''position''' = Distance at which the Train is to be placed relative to the start of the track.<br />
*'''trackmark''' = Reference to Trackmark at which the consist is to be formed.<br />
*'''direction''' = Orientation of Train relative to direction of track or trackmark.<br />
;Returned Value<br />
*Reference to the Train created if successful, null otherwise.<br />
;Syntax<br />
Train train = World.CreateTrain(consist, buildable, "Track 1", 10.0, true);<br />
;Notes<br />
*These methods create a train from a list of vehicles in a consist array.<br />
*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.<br />
*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.<br />
<br><br />
<br />
==DeleteTrain==<br />
{{MethodHeader|public native void DeleteTrain(Train train)}}<br />
;Parameters<br />
*'''train''' = train to be deleted from map.<br />
;Returned Value<br />
*None<br />
;Syntax<br />
World.DeleteTrain(flyingScotsman);<br />
;Notes<br />
*Once a train has been deleted, care should be taken to avoid using its reference.<br />
<br><br />
<br />
==DeleteVehicle==<br />
{{MethodHeader|public native void DeleteVehicle(Vehicle vehicle)}}<br />
;Parameters<br />
*'''vehicle''' = vehicle to be deleted from its train.<br />
;Returned Value<br />
*None<br />
;Syntax<br />
World.DeleteVehicle(vehicles[vehicles.size()-1]);<br />
;Notes<br />
*Use Train.GetVehicles() to obtain an array of vehicles for a given train.<br />
*Use Vehicle.GetMyTrain() to obtain a train reference for a given vehicle.<br />
<br><br />
<br />
==FindAsset==<br />
{{MethodHeader|public native Asset FindAsset(KUID kuid)}}<br />
;Parameters<br />
*'''kuid''' = KUID of Asset to return.<br />
;Returned Value<br />
*Given a valid KUID parameter, this method return an Asset reference if successful, null otherwise.<br />
;Syntax<br />
Asset asset = World.FindAsset(kuid);<br />
;Notes<br />
*See also Asset.FindAsset()<br />
<br><br />
<br />
==FindDriverCommand==<br />
{{MethodHeader|public native DriverCommand FindDriverCommand(Asset driverCommandAsset)}}<br />
;Parameters<br />
*'''driverCommandAsset''' = Asset containing command to be added.<br />
;Returned Value<br />
*Reference to the DriverCommand if successful, null otherwise.<br />
;Syntax<br />
DriverCommand GoFaster = World.FindDriverCommand(accelerate);<br />
;Notes<br />
<br><br />
<br />
==GetAssetList==<br />
{{MethodHeader|public native Asset[ ] GetAssetList(string kind)}}<br />
;Parameters<br />
*'''kind''' = String representing the Kind of asset to return.<br />
;Returned Value<br />
*A list of all assets of the given ''kind''<br />
;Syntax<br />
Asset[] Libraries = World.GetAssetList("Library");<br />
;Notes<br />
*All installed assets of the given ''kind'' are returned, irrespective of whether or not they are in use on the current map.<br />
<br><br />
<br />
==GetBadWeatherFog==<br />
{{MethodHeader|public native float GetBadWeatherFog(void)}}<br />
;Parameters<br />
*None<br />
;Returned Value<br />
*Bad weather fog distance as a float in the range 0.0..1.0.<br />
;Syntax<br />
float dist = World.GetBadWeatherFog();<br />
;Notes<br />
<br><br />
<br />
==GetBehaviors==<br />
{{MethodHeader|public native ScenarioBehavior[ ] GetBehaviors(void)}}<br />
;Parameters<br />
*None<br />
;Returned Value<br />
*A list of top-level behaviors or rules on the currently loaded route.<br />
;Syntax<br />
ScenarioBehavior[] rules = World.GetBehaviors();<br />
;Notes<br />
<br><br />
<br />
==GetCameraPositionX==<br />
{{MethodHeader|public native float GetCameraPositionX(void)}}<br />
;Parameters<br />
*None<br />
;Returned Value<br />
*X Coordinate of the current camera position.<br />
;Syntax<br />
float X = World.GetCameraPositionX();<br />
*Notes<br />
<br><br />
<br />
==GetCameraPositionY==<br />
{{MethodHeader|public native float GetCameraPositionY(void)}}<br />
;Parameters<br />
*None<br />
;Returned Value<br />
*Y Coordinate of the current camera position.<br />
;Syntax<br />
float Y = World.GetCameraPositionY();<br />
*Notes<br />
<br><br />
<br />
==GetCameraPositionZ==<br />
{{MethodHeader|public native float GetCameraPositionZ(void)}}<br />
;Parameters<br />
*None<br />
;Returned Value<br />
*Z Coordinate of the current camera position.<br />
;Syntax<br />
float Z = World.GetCameraPositionZ();<br />
*Notes<br />
<br><br />
<br />
==GetCurrentModule==<br />
{{MethodHeader|public native int GetCurrentModule(void)}}<br />
;Parameters<br />
*None<br />
;Returned Value<br />
*An integer representing the current Trainz module.<br />
;Syntax<br />
int module = World,GetCurrentModule();<br />
;Notes<br />
* See [[#Trainz Modules|Trainz Modules]] for details of the constants associated with this method. <br />
* See [[ModuleInit Message]] for further details.<br />
<br><br />
<br />
==GetDriverCharacterList==<br />
{{MethodHeader|public native DriverCharacter[ ] GetDriverCharacterList(void)}}<br />
;Parameters<br />
*None<br />
;Returned Value<br />
*An array of DriverCharacter objects installed in the current world.<br />
;Syntax<br />
DriverCharacter[] drivers = World.GetDriverCharacterList();<br />
;Notes<br />
<br><br />
<br />
==GetDriverCommandList==<br />
{{MethodHeader|public native DriverCommand[ ] GetDriverCommandList(void)}}<br />
;Parameters<br />
*None<br />
;Returned Value<br />
*An array of DriverCommand objects installed in the current world.<br />
;Syntax<br />
DriverCommand[] commands = World.GetDriverCommandList();<br />
;Notes<br />
<br><br />
<br />
==GetGameTime==<br />
{{MethodHeader|public native float GetGameTime(void)}}<br />
;Parameters<br />
*None<br />
;Returned value<br />
*Current game time.<br />
;Syntax<br />
float Now = World.GetGameTime();<br />
;Notes<br />
*The returned time is normalised to a value between 0.0 and 1.0<br />
*0.0 = midday.<br />
*0.5 = midnight<br />
*Use the [[#Time_Values|Time Value]] constants to convert the normalised values to human readable times.<br />
<br><br />
<br />
==GetGoodWeatherFog==<br />
{{MethodHeader|public native float GetGoodWeatherFog(void)}}<br />
;Parameters<br />
*None<br />
;Returned Value<br />
*Good weather fog distance as a float in the range 0.0..1.0.<br />
;Syntax<br />
float dist = World.GetGoodWeatherFog();<br />
;Notes<br />
<br><br />
<br />
==GetGroundDrawDistance==<br />
{{MethodHeader|public native float GetGroundDrawDistance(void)}}<br />
;Parameters<br />
*None<br />
;Returned Value<br />
*Ground draw distance in metres.<br />
;Syntax<br />
float dist = World.GetGroundDrawDistance();<br />
;Notes<br />
<br><br />
<br />
==GetIndustryList==<br />
{{MethodHeader|public native GameObject[ ] GetIndustryList(void)}}<br />
;Parameters <br />
*None<br />
;Returned Value<br />
*An array of references to all of the Industry objects for the current route.<br />
;Syntax<br />
GameObject[] Industries = World.GetIndustryList();<br />
;Notes<br />
<br><br />
<br />
==GetJunctionList==<br />
{{MethodHeader|public native Junction[ ] GetJunctionList(void)}}<br />
;Parameters <br />
*None<br />
;Returned Value<br />
*An array of references to all of the trackside junction objects for the current route.<br />
;Syntax<br />
Junction[] junctions = World.GetJunctionList();<br />
;Notes<br />
*Junction objects attached to fixed track junctions are not currently returned by this method.<br />
<br><br />
<br />
==GetLibrary==<br />
{{MethodHeader|public native Library GetLibrary(KUID kuid)}}<br />
;Parameters<br />
*'''kuid''' = KUID of script library asset to load.<br />
;Returned Value<br />
*A reference to the script library asset if successful, null otherwise.<br />
;Syntax<br />
Library codelib = World.GetLibrary(LibraryKUID);<br />
;Notes<br />
*The [[Class Library|Library]] asset is initialised when this method is first called in a session.<br />
*Since only one instance can exist, subsequent calls return a reference to the existing Library object.<br />
*See [[Class Library|Library]] for notes on how to use this method.<br />
<br><br />
<br />
==GetSceneryDrawDistance==<br />
{{MethodHeader|public native float GetSceneryDrawDistance(void)}}<br />
;Parameters<br />
*None<br />
;Returned Value<br />
*Undefined.<br />
;Notes<br />
*Included for legacy script compatibility only. Has no effect.<br />
<br><br />
<br />
==GetSeconds==<br />
{{MethodHeader|public native float GetSeconds(void)}}<br />
;Parameters<br />
*None<br />
;Returned Value<br />
*The current value of a floating point number incrementing once per second in real time.<br />
;Syntax<br />
float start = World.GetSeconds();<br />
// do stuff<br />
float finish = World.GetSeconds();<br />
float period = finish - start;<br />
;Notes<br />
*Each call will return a float value containing the current value of an internal counter.<br />
*Subtracting a later value from a value saved at an earlier call will enable the delay between the two calls to be established.<br />
<br><br />
<br />
==GetSignalList==<br />
{{MethodHeader|public native Signal[ ] GetSignalList(void)}}<br />
;Parameters <br />
*None<br />
;Returned Value<br />
*An array of references to all of the signal objects for the current route.<br />
;Syntax<br />
Signal[] signals = World.GetSignalList();<br />
;Notes<br />
<br><br />
<br />
==GetStringTable==<br />
{{MethodHeader|public native StringTable GetStringTable(void)}}<br />
;Parameters <br />
*None<br />
;Returned Value<br />
*The StringTable for the current session.<br />
;Syntax<br />
StringTable data = World.GetStringTable();<br />
;Notes<br />
<br><br />
<br />
==GetSurveyorSavedConsist==<br />
{{MethodHeader|public native Soup GetSurveyorSavedConsistList(string name)}}<br />
;Parameters <br />
*'''name''' = Name of the consist to retireiev.<br />
;Returned Value<br />
*Returns a Soup definition of the named consist if it exists, null otherwise.<br />
;Syntax<br />
Soup consist = World.GetSurveyorSavedConsist("Brighton Belle");<br />
;Notes<br />
*Remember that the returned data is in a Soup format, which is not the same thing as a Train. <br />
*TrainUtil.CreateTrainFormSoup() can be used to create a train from the returned Soup.<br />
*This method only works in Surveyor.<br />
<br><br />
<br />
==GetSurveyorSavedConsistList==<br />
{{MethodHeader|public native string[ ] GetSurveyorSavedConsistList()}}<br />
;Parameters <br />
*None<br />
;Returned Value<br />
*An array of names of all the saved consist objects in Surveyor.<br />
;Syntax<br />
string[] consists = World.GetSurveyorSavedConsistList();<br />
;Notes<br />
*This method only works in Surveyor.<br />
<br><br />
<br />
==GetTrackmarkList==<br />
{{MethodHeader|public native TrackMark[ ] GetTrackmarkList(void)}}<br />
;Parameters <br />
*None<br />
;Returned Value<br />
*An array of references to all of the trackmark objects for the current route.<br />
;Syntax<br />
Trackmark[] trackmarks = World.GetTrackmarkList();<br />
;Notes<br />
<br><br />
<br />
==GetTrainList==<br />
{{MethodHeader|public native Train[ ] GetTrainList(void)}}<br />
;Parameters <br />
*None<br />
;Returned Value<br />
*An array of references to all of the trains for the current route.<br />
;Syntax<br />
Train[] trains = World.GetTrainList();<br />
;Notes<br />
<br><br />
<br />
==GetTrainzBuild==<br />
{{MethodHeader|public native int GetTrainzBuild(void)}}<br />
;Parameters;<br />
*None<br />
;Returned Value<br />
*Gets the current build number of Trainz. <br />
;Syntax<br />
int build = World.GetTrainzBuild();<br />
;Notes<br />
*The value returned corresponds to the build number you can see in the bottom-right side of the main Trainz menu screen.<br />
<br><br />
<br />
==GetTrainzVersion==<br />
{{MethodHeader|public native float GetTrainzVersion(void)}}<br />
;Parameters<br />
*None<br />
;Returned Value<br />
*The TRS version number.<br />
;Syntax<br />
float version = World.GetTrainzVersion();<br />
;Notes<br />
*The value returned corresponds to the version number you can see in the bottom-right side of the main Trainz menu screen. <br />
<br><br />
<br />
==GetTriggerList==<br />
{{MethodHeader|public native Trigger[ ] GetTriggerList(void)}}<br />
;Parameters <br />
*None<br />
;Returned Value<br />
*An array of references to all of the trigger objects for the current route.<br />
;Syntax<br />
Trigger[] triggers = World.GetTriggerList();<br />
;Notes<br />
*This method does not return scenery triggers, ie those attached to SceneryWithTrack objects and their descendants.<br />
<br><br />
<br />
==GetVehicleList==<br />
{{MethodHeader|public native Vehicle[ ] GetVehicleList(void)}}<br />
;Parameters <br />
*None<br />
;Returned Value<br />
*An array of references to all of the vehicles in the current route.<br />
;Syntax<br />
Vehicle[] vehicles = World.GetVehicleList();<br />
;Notes<br />
<br><br />
<br />
==GetWeatherChangeability==<br />
{{MethodHeader|public native int GetWeatherChangeability(void)}}<br />
;Parameter<br />
*None<br />
;Returned Value<br />
*One of the [[#Weather_Changeability_Constants|Weather Changeability Constants]] denoting the variability of weather conditions.<br />
;Syntax<br />
int variability = World.GetWeatherChangeability();<br />
;Notes<br />
<br><br />
<br />
==GetWeatherType==<br />
{{MethodHeader|public native int GetWeatherType(void)}}<br />
;Parameter<br />
*None<br />
;Returned Value<br />
*One of the [[#Weather_Type_Constants|Weather Type Constants]] denoting the current weather conditions.<br />
;Syntax<br />
int weather = World.GetWeatherType();<br />
;Notes<br />
<br><br />
<br />
==LoadMap==<br />
{{MethodHeader|public native bool LoadMap(KUID kuid)}}<br />
;Parameters<br />
*'''kuid''' = KUID of map to load.<br />
;Returned Value<br />
*True if successful, false otherwise.<br />
;Syntax<br />
if (World.LoadMap(mapKUID) Interface.Print("Map loaded OK");<br />
else Interface.Print("Map load failed");<br />
;Notes<br />
<br><br />
<br />
==Play2DSound==<br />
{{MethodHeader|public float Play2DSound(Asset asset, string wave)}}<br />
;Parameters<br />
*'''asset''' = Asset where the sound file is located.<br />
*'''wave''' = Name of the ''*.wav'' file to be played, a relative path can be included.<br />
;Returned Value<br />
* Undefined.<br />
;Syntax<br />
// Play the sound and continues script execution.<br />
World.Play2DSound(soundAsset,"sounds/allaboard.wav"); <br />
// Wait until sound has completed before continuing (pre-TS12 only!)<br />
Sleep(World.Play2DSound(soundAsset,"sounds/allaboard.wav")); <br />
;Notes<br />
*Plays a ''.wav" sound file from the given asset's folder.<br />
*The sound is non directional and can be mono or stereo. <br />
*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. <br />
*This means your code will keep on executing while Trainz is playing the sound.<br />
<br><br />
<br />
==PlaySound==<br />
{{MethodHeader|public native float PlaySound<br>&nbsp;&nbsp;&nbsp;&nbsp;(Asset asset, string wave, float vol, float near, float far, GameObject target, string pt)<br>&nbsp;&nbsp;&nbsp;&nbsp;(Asset asset, string wave, float vol, float near, float far, GameObject target, string pt, bool loop)}}<br />
;Parameters<br />
*'''asset''' = Asset where the sound file is located.<br />
*'''wave''' = Name of the ''*.wav'' file to be played, a relative path can be included.<br />
*'''vol''' = Volume level to play the sound at<br />
*'''near''' = Distance from the target asset at which the sound will be played at maximum volume.<br />
*'''far''' = Distance from the target asset at which the sound will become inaudible.<br />
*'''target''' = GameObject to which the sound will be attached if a 3d sound is required, null for 2D.<br />
*'''pt''' = Name of attachment point in the target object if a 3d sound is required, null for 2D.<br />
*'''loop''' = (Optional) If true the sound will loop continuously.<br />
;Returned Value<br />
* Sound length in seconds for Trainz before TS12<br />
* Undefined for TS12 and TANE<br />
;Syntax<br />
// Play the sound and continues script execution.<br />
World.PlaySound(soundAsset,"sounds/allaboard.wav",1000.0,10.0,100.0,Station,"a.loudspeaker"); <br />
;Notes<br />
*Plays a ''.wav'' sound file from the given asset's folder.<br />
*If the sound is to be directional a mono sound file is required. <br />
*This method does not return after the sound has finished playing: it returns as soon as it is called. <br />
*This means your code will keep on executing while Trainz is playing the sound.<br />
*If you want to wait for the sound to complete playing before moving on, wrap the PlaySound() call up in a Sleep() call. '''Note!''' 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.<br />
*The sound volume will be at a maximum for a camera position at or less than the value of the ''near'' parameter and will reduce with distance until the hearing position reaches ''far'', when the sound will be inaudible.<br />
<br><br />
<br />
==RemoveDriverCharacter==<br />
{{MethodHeader|public native void RemoveDriverCharacter(DriverCharacter driver)}}<br />
;Parameters<br />
*'''driver''' = DriverCharacter to remove.<br />
;Returned Value<br />
*None<br />
;Syntax<br />
World.RemoveDriverCharacter(dave);<br />
;Notes<br />
<br><br />
<br />
==RemoveDriverCommand==<br />
{{MethodHeader|public native void RemoveDriverCommand(DriverCommand command)}}<br />
;Parameters<br />
*'''command''' = DriverCommand to remove.<br />
;Returned Value<br />
*None<br />
;Syntax<br />
World.RemoveDriverCommand(driverCommand);<br />
;Notes<br />
<br><br />
<br />
==SetBadWeatherFog==<br />
{{MethodHeader|public native void SetBadWeatherFog(float distance)}}<br />
;Parameters<br />
*'''distance''' = Bad weather fog distance to set.<br />
;Returned Value<br />
*None<br />
;Syntax<br />
World.SetBadWeatherFog(0.5);<br />
;Notes<br />
<br><br />
<br />
==SetCamera==<br />
{{MethodHeader|public native bool SetCamera(MapObject focus)<br>public native void SetCamera(Junction focus)<br>public native void SetCamera(Vehicle focus, int cameraMode)<br>public native void SetCamera(Train focus, int cameraMode)}}<br />
;Parameters<br />
*'''focus''' = Object on which the camera is to be focused.<br />
*''cameraMode''' = One of the [[#Camera_View_Modes|Camera View Mode]] constants defining the view which should be assigned to the camera.<br />
;Returned Value<br />
*The first variant returns a boolean to indicate success or failure.<br />
*Remaining variants do not return a value<br />
'Syntax<br />
World.SetCamera(train.GetVehicles[0],World.CAMERA_TRACKING); // sets the camera to track the first vehicle in the train.<br />
<br><br />
<br />
==SetCameraAngle==<br />
{{MethodHeader|public void SetCameraAngle(int yaw, int pitch, float radius)}}<br />
;Parameters<br />
*'''yaw''' = Camera rotation in degrees, 90 is a direct front view.<br />
*'''pitch''' = Camera angle relative to the horizon, 0 is horizontal, 90 points vertically upwards.<br />
*'''radius''' = Distance in metres to the object in focus.<br />
;Returned Value<br />
*None<br />
;Syntax<br />
World.SetCameraAngle(90,0,25); // Sets the camera to a direct frontal view at 25 metres from the currently focused object.<br />
;Notes<br />
*''Radius'' is measured from the object origin point (0,0,0).<br />
<br><br />
<br />
==SetCameraFlags==<br />
{{MethodHeader|public native void SetCameraFlags(int flags)}}<br />
;Parameter<br />
*'''flags''' integer value defining what the user is permitted to do with the game camera.<br />
;Returned Value<br />
*None<br />
;Syntax<br />
// User is permitted to select External or Tracking views only.<br />
World.SetCameraFlags(World.CAMERA_EXTERNAL | World.CAMERA_TRACKING);<br />
;Notes<br />
*Use any combination of [[#Camera_Flags|Camera Flags]] and [[#Camera_View_Modes|Camera View Modes]] to set the parameter.<br />
<br><br />
<br />
==SetCameraMode==<br />
{{MethodHeader|public void SetCameraMode(int mode)}}<br />
;Parameter<br />
*'''mode''' = Camera mode to select.<br />
;Returned Value<br />
*None<br />
;Syntax<br />
World.SetCameraMode(World.CAMERA_TRACKING);<br />
;Notes<br />
*Use one of the [[#Camera_View_Modes|Camera View Modes]] to set the parameter.<br />
<br><br />
<br />
==SetGameTime==<br />
{{MethodHeader|public void SetGameTime(float time)}}<br />
;Parameters<br />
*'''time''' = new gane time to set.<br />
;Returned Value<br />
*None<br />
;Syntax<br />
World.SetGameTime(0.5); // sets time to midnight<br />
;Notes<br />
*Game time is normalised to a value between 0.0 and 1.0<br />
*0.0 = midday.<br />
*0.5 = midnight<br />
*Use the [[#Time_Values|Time Value]] constants to convert human readable times to normalised values. <br />
<br><br />
<br />
==SetGameTimeRate==<br />
{{MethodHeader|public native void SetGameTimeRate(float rate)}}<br />
;Parameters<br />
*'''rate''' = New time rate to set.<br />
;Returned Value<br />
*None<br />
;Syntax<br />
World.SetGameTimeRate(World.TIME_RATE_8X); // sets game time to advance by 8 minutes per minute of real world time.<br />
;Notes<br />
*Use one of the [[#Time_Rate_Constants|Time Rate Constants]] to define the parameter.<br />
<br><br />
<br />
==SetGoodWeatherFog==<br />
{{MethodHeader|public native void SetGoodWeatherFog(float distance)}}<br />
;Parameters<br />
*'''distance''' = Good weather fog distance to set.<br />
;Returned Value<br />
*None<br />
;Syntax<br />
World.SetGoodWeatherFog(0.5);<br />
;Notes<br />
<br><br />
<br />
==SetGroundDrawDistance==<br />
{{MethodHeader|public native void SetGroundDrawDistance(float distance)}}<br />
;Parameters<br />
*'''distance''' = Ground draw distance in metres.<br />
;Returned Value<br />
*None<br />
;Syntax<br />
World.SetGroundDrawDistance(1000.0);<br />
;Notes<br />
*Compatibility warning: Use of this function is not recommended, it may become non-functional in future Trainz versions.<br />
<br><br />
<br />
==SetSceneryDrawDistance==<br />
{{MethodHeader|public native void SetSceneryDrawDistance(float distance)}}<br />
;Parameters<br />
*'''distance''' = unused.<br />
;Returned Value<br />
*None<br />
;Notes<br />
* Does nothing. Included for script compatibility only.<br />
<br><br />
<br />
==SetTargetObserver==<br />
{{MethodHeader|public void SetTargetObserver(GameObject observer)}}<br />
;Parameters<br />
*'''observer''' = The game object to receive targeting messages.<br />
;Returned Value<br />
*None<br />
;Syntax<br />
SetTargetObserver(self);<br />
;Notes<br />
* Causes the specified object to receive "Track", "LeftClick" messages when a track is clicked. Causes the specified object to receive "Interface-Event", "Left-Click" 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's request.<br />
<br><br />
<br />
==SetWeather==<br />
{{MethodHeader|public native void SetWeather(int type, int changeability)}}<br />
;Parameters<br />
*'''type''' = Weather conditions as defined by one of the [[#Weather_Type_Constants|Weather Type Constants]].<br />
*'''change''' = Weather variation as defined by one of the [[#Weather_Changeability_Constants|Weather Changeability Constants]].<br />
;Returned Value<br />
*None<br />
;Syntax<br />
World.SetWeather(World.WEATHER_TYPE_HEAVY_SNOW,World.WEATHER_CHANGEABILITY_EXTREME); // April in Paris.<br />
;Notes<br />
<br><br />
<br />
==UserSetCamera==<br />
{{MethodHeader|public native bool UserSetCamera(GameObject target)}}<br />
;Parameters<br />
*'''target''' = GameObject to set focus to.<br />
;Returned Value<br />
*True if successful, false otherwise.<br />
;Syntax<br />
World.UserSetCamera(Router,GetGameObject("Junction 5"));<br />
;Notes<br />
<br><br />
<br />
==UserSetCameraMode==<br />
{{MethodHeader|public native void UserSetCameraMode(int mode)}}<br />
;Parameters<br />
*'''mode''' = One of the [[#Camera_View_Modes|Camera View Modes]]<br />
;Returned Value<br />
*None<br />
;Syntax<br />
World.UserSetCameraMode(World.CAMERA_ROAMING); // switches to roaming view if permitted.<br />
;Notes<br />
*This method respects the current [[#Camera_Flags|Camera Flag]] settings, disallowing any change which the flags do not permit.<br />
<br><br />
<br />
<br />
==Categories==<br />
[[Category:Script Class]]</div>Vvmmhttps://online.ts2009.com/mediaWiki/index.php/Class_WorldClass World2017-10-30T20:35:30Z<p>Vvmm: </p>
<hr />
<div>*[[TrainzScript Language Reference|API Hierarchy]]<br />
**World<br />
<br><br />
*World is a static class used to access various aspects of the Trainz environment.<br />
<br><br />
<br />
==Constants==<br />
*These constants are used to define various values and can be used as mnenomics.<br />
*If accessed from scripts the values must be prefixed ''World.'', for example:<br />
World.SetWeather(World.WEATHER_TYPE_LIGHT_SNOW,World.WEATHER_CHANGEABILITY_PERIODIC);<br />
<br><br />
<br />
===Camera View Modes===<br />
----<br />
*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().<br />
<br />
{{TableHeader|width=95%|margin=15px}}<br />
|width=375|public define int CAMERA_INTERNAL = 1||Internal cabin camera view.<br />
|-<br />
|public define int CAMERA_EXTERNAL = 2||External train camera view<br />
|-<br />
|public define int CAMERA_TRACKING = 4||External tracking camera view.<br />
|-<br />
|public define int CAMERA_ROAMING = 128||Roaming camera view.<br />
|}<br />
<br><br />
<br />
===Camera Flags===<br />
----<br />
*These flags are used in addition to the Camera Mode Flags to allow or disallow specific camera actions. <br />
{{TableHeader|width=95%|margin=15px}}<br />
|width=375|public define int CAMERA_SWITCH_VIEWS = 8||User permitted to swap between the camera views.<br />
|-<br />
|public define int CAMERA_SWITCH_VEHICLES = 16||User permitted to swap vehicles within the current train.<br />
|-<br />
|public define int CAMERA_SWITCH_TRAINS = 32||User permitted to swap to other trains which are in the consist menu.<br />
|-<br />
|public define int CAMERA_LOCKED = 64||User is NOT permitted to adjust camera (i.e. zoom, pan etc.).<br />
|-<br />
|public define int CAMERA_NORMAL = * ||Normal camera mode where everything is permitted.<br />
|-<br />
|colspan=2|<sup>* NOTE: CAMERA_NORMAL = CAMERA_INTERNAL | CAMERA_EXTERNAL | CAMERA_TRACKING | CAMERA_SWITCH_VIEWS | CAMERA_SWITCH_VEHICLES | CAMERA_SWITCH_TRAINS</sup><br />
|}<br />
<br><br />
<br />
===Weather Type Constants===<br />
----<br />
*Define the current state of the weather in Trainz. <br />
*A variety of weather conditions are supported and can be changed by using one of these values with the World.SetWeather() method. <br />
{{TableHeader|width=95%|margin=15px}}<br />
|width=375|public define int WEATHER_TYPE_CLEAR = 0||Clear weather, no clouds, rain or snow.<br />
|-<br />
|public define int WEATHER_TYPE_CLOUDY = 1||Cloudy weather, no rain.<br />
|-<br />
|public define int WEATHER_TYPE_DRIZZLE = 2||Drizzle, light rain.<br />
|-<br />
|public define int WEATHER_TYPE_RAIN = 3||Rainy weather.<br />
|-<br />
|public define int WEATHER_TYPE_STORMY = 4||Stormy weather that includes lightning and thunder.<br />
|-<br />
|public define int WEATHER_TYPE_LIGHT_SNOW = 5||Snowing lightly.<br />
|-<br />
|public define int WEATHER_TYPE_MEDIUM_SNOW = 6||Medium level snow fall.<br />
|-<br />
|public define int WEATHER_TYPE_HEAVY_SNOW = 7||Heavy snow fall.<br />
|}<br />
<br><br />
<br />
===Weather Changeability Constants===<br />
----<br />
*Define the changeability settings for the weather. <br />
*Weather changeability refers to variability of weather conditions rather than to a specific weather type.<br />
{{TableHeader|width=95%|margin=15px}}<br />
|width=375|public define int WEATHER_CHANGEABILITY_NONE = 0||Weather remains static.<br />
|-<br />
|public define int WEATHER_CHANGEABILITY_PERIODIC = 1||Periodic changes in weather.<br />
|-<br />
|public define int WEATHER_CHANGEABILITY_EXTREME = 2||Extreme and frequent changes in weather. <br />
|}<br />
<br><br />
<br />
===Time Values===<br />
----<br />
*Time constants defined in seconds.<br />
{{TableHeader|width=95%|margin=15px}}<br />
|width=375|public define float TIME_SECOND = 1.0f||One second.<br />
|-<br />
|public define float TIME_MINUTE = TIME_SECOND * 60.0f||One minute, 60.0 seconds.<br />
|-<br />
|public define float TIME_HOUR = TIME_MINUTE * 60.0f||One hour, 60.0 minutes, 3600.0 seconds.<br />
|-<br />
|public define float TIME_DAY = TIME_HOUR * 24.0f||One day, 24 hours, 1440.0 minutes, 86400.0 seconds.<br />
|}<br />
<br><br />
<br />
===Time Rate Constants===<br />
----<br />
*Values that define the time rates relative to normal time. <br />
*These constants can be used to set the time rate that Trainz runs out through the World.SetGameTimeRate() method. <br />
{{TableHeader|width=95%|margin=15px}}<br />
|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)<br />
|-<br />
|public define int TIME_RATE_2X = 1||Time passes at twice normal speed.<br />
|-<br />
|public define int TIME_RATE_4X = 2||<br />
|-<br />
|public define int TIME_RATE_8X = 3||<br />
|-<br />
|public define int TIME_RATE_16X = 4||<br />
|-<br />
|public define int TIME_RATE_32X = 5||<br />
|-<br />
|public define int TIME_RATE_60X = 6||<br />
|-<br />
| public define int TIME_RATE_120X = 7||<br />
|-<br />
| public define int TIME_RATE_240X = 8||<br />
|-<br />
|public define int TIME_RATE_360X = 9||<br />
|-<br />
|public define int TIME_RATE_480X = 10||<br />
|-<br />
|public define int TIME_RATE_720X = 11||<br />
|-<br />
|public define int TIME_RATE_960X = 12||<br />
|-<br />
|public define int TIME_RATE_1200X = 13||<br />
|-<br />
|public define int TIME_RATE_1440X = 14||<br />
|}<br />
<br><br />
<br />
===Trainz Modules===<br />
----<br />
*Trainz module mode constants. <br />
*These values define the various module environments that Trainz can be in. <br />
{{TableHeader|width=95%|margin=15px}}<br />
|width=375|public define int NO_MODULE = 0||Trainz not running in a module.<br />
|-<br />
|public define int SURVEYOR_MODULE = 1||Trainz is currently running in Surveyor.<br />
|-<br />
|public define int DRIVER_MODULE = 2||Trainz is currently running in Driver.<br />
|}<br />
<br> <br />
<br />
==Related Messages==<br />
* [[TrainzScript Message Reference]]<br><br />
* [[Camera Messages]]<br><br />
* [[Interface Messages]]<br><br />
* [[ModuleInit Message]]<br><br />
<br><br />
<br />
==AddDriverCharacter==<br />
{{MethodHeader|public native DriverCharacter AddDriverCharacter(Asset driverCharacterAsset)}}<br />
;Parameters<br />
*'''driverCharacterAsset''' = Asset containing character to be added.<br />
;Returned Value<br />
*Reference to the DriverCharacter if successful, null otherwise.<br />
;Syntax<br />
DriverCharacter Casey = World.AddDriverCharacter(CaseyJones);<br />
;Notes<br />
<br><br />
<br />
==AddDriverCommand==<br />
{{MethodHeader|public native DriverCommand AddDriverCommand(Asset driverCommandAsset)}}<br />
;Parameters<br />
*'''driverCommandAsset''' = Asset containing command to be added.<br />
;Returned Value<br />
*Reference to the DriverCommand if successful, null otherwise.<br />
;Syntax<br />
DriverCommand GoFaster = World.AddDriverCommand(accelerate);<br />
;Notes<br />
<br><br />
<br />
==CreateBehavior==<br />
{{MethodHeader|public native ScenarioBehavior CreateBehavior(KUID kuid, Soup initialProperties)}}<br />
;Parameters<br />
*'''kuid''' = KUID of scenario.<br />
'''initialProperties''' = Soup object containing initial properties for scenario.<br />
;Returned Value<br />
*Reference to the ScenarioBehavior created if successful, null otherwise.<br />
;Syntax<br />
ScenarioBehavior scenario = World.CreateBehavior(scenarioAsset, scenarioSoup);<br />
;Notes<br />
*The returned ScenarioBehavior object may be ended by releasing all references to it (resetting all references to null).<br />
<br><br />
<br />
==CreateTrain==<br />
{{MethodHeader|public native Train CreateTrain(KUID[ ] consist, string trackmarkName, bool direction)<br>public native Train CreateTrain(KUID[ ] consist, TrackMark trackmark, bool direction)<br>public native Train CreateTrain(KUID[ ] consist, Buildable buildable, string trackName, float position, bool direction)}}<br />
;Parameters<br />
*'''consist''' = An array of vehicle KUIDs used to describe the required Train object.<br />
*'''trackmarkName''' = Name of Trackmark at which the consist is to be formed.<br />
*'''buildable''' = Buildable on which the consist is to be formed.<br />
*'''trackName''' = Name of track within Buildable object.<br />
*'''position''' = Distance at which the Train is to be placed relative to the start of the track.<br />
*'''trackmark''' = Reference to Trackmark at which the consist is to be formed.<br />
*'''direction''' = Orientation of Train relative to direction of track or trackmark.<br />
;Returned Value<br />
*Reference to the Train created if successful, null otherwise.<br />
;Syntax<br />
Train train = World.CreateTrain(consist, buildable, "Track 1", 10.0, true);<br />
;Notes<br />
*These methods create a train from a list of vehicles in a consist array.<br />
*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.<br />
*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.<br />
<br><br />
<br />
==DeleteTrain==<br />
{{MethodHeader|public native void DeleteTrain(Train train)}}<br />
;Parameters<br />
*'''train''' = train to be deleted from map.<br />
;Returned Value<br />
*None<br />
;Syntax<br />
World.DeleteTrain(flyingScotsman);<br />
;Notes<br />
*Once a train has been deleted, care should be taken to avoid using its reference.<br />
<br><br />
<br />
==DeleteVehicle==<br />
{{MethodHeader|public native void DeleteVehicle(Vehicle vehicle)}}<br />
;Parameters<br />
*'''vehicle''' = vehicle to be deleted from its train.<br />
;Returned Value<br />
*None<br />
;Syntax<br />
World.DeleteVehicle(vehicles[vehicles.size()-1]);<br />
;Notes<br />
*Use Train.GetVehicles() to obtain an array of vehicles for a given train.<br />
*Use Vehicle.GetMyTrain() to obtain a train reference for a given vehicle.<br />
<br><br />
<br />
==FindAsset==<br />
{{MethodHeader|public native Asset FindAsset(KUID kuid)}}<br />
;Parameters<br />
*'''kuid''' = KUID of Asset to return.<br />
;Returned Value<br />
*Given a valid KUID parameter, this method return an Asset reference if successful, null otherwise.<br />
;Syntax<br />
Asset asset = World.FindAsset(kuid);<br />
;Notes<br />
*See also Asset.FindAsset()<br />
<br><br />
<br />
==FindDriverCommand==<br />
{{MethodHeader|public native DriverCommand FindDriverCommand(Asset driverCommandAsset)}}<br />
;Parameters<br />
*'''driverCommandAsset''' = Asset containing command to be added.<br />
;Returned Value<br />
*Reference to the DriverCommand if successful, null otherwise.<br />
;Syntax<br />
DriverCommand GoFaster = World.FindDriverCommand(accelerate);<br />
;Notes<br />
<br><br />
<br />
==GetAssetList==<br />
{{MethodHeader|public native Asset[ ] GetAssetList(string kind)}}<br />
;Parameters<br />
*'''kind''' = String representing the Kind of asset to return.<br />
;Returned Value<br />
*A list of all assets of the given ''kind''<br />
;Syntax<br />
Asset[] Libraries = World.GetAssetList("Library");<br />
;Notes<br />
*All installed assets of the given ''kind'' are returned, irrespective of whether or not they are in use on the current map.<br />
<br><br />
<br />
==GetBadWeatherFog==<br />
{{MethodHeader|public native float GetBadWeatherFog(void)}}<br />
;Parameters<br />
*None<br />
;Returned Value<br />
*Bad weather fog distance as a float in the range 0.0..1.0.<br />
;Syntax<br />
float dist = World.GetBadWeatherFog();<br />
;Notes<br />
<br><br />
<br />
==GetBehaviors==<br />
{{MethodHeader|public native ScenarioBehavior[ ] GetBehaviors(void)}}<br />
;Parameters<br />
*None<br />
;Returned Value<br />
*A list of top-level behaviors or rules on the currently loaded route.<br />
;Syntax<br />
ScenarioBehavior[] rules = World.GetBehaviors();<br />
;Notes<br />
<br><br />
<br />
==GetCameraPositionX==<br />
{{MethodHeader|public native float GetCameraPositionX(void)}}<br />
;Parameters<br />
*None<br />
;Returned Value<br />
*X Coordinate of the current camera position.<br />
;Syntax<br />
float X = World.GetCameraPositionX();<br />
*Notes<br />
<br><br />
<br />
==GetCameraPositionY==<br />
{{MethodHeader|public native float GetCameraPositionY(void)}}<br />
;Parameters<br />
*None<br />
;Returned Value<br />
*Y Coordinate of the current camera position.<br />
;Syntax<br />
float Y = World.GetCameraPositionY();<br />
*Notes<br />
<br><br />
<br />
==GetCameraPositionZ==<br />
{{MethodHeader|public native float GetCameraPositionZ(void)}}<br />
;Parameters<br />
*None<br />
;Returned Value<br />
*Z Coordinate of the current camera position.<br />
;Syntax<br />
float Z = World.GetCameraPositionZ();<br />
*Notes<br />
<br><br />
<br />
==GetCurrentModule==<br />
{{MethodHeader|public native int GetCurrentModule(void)}}<br />
;Parameters<br />
*None<br />
;Returned Value<br />
*An integer representing the current Trainz module.<br />
;Syntax<br />
int module = World,GetCurrentModule();<br />
;Notes<br />
* See [[#Trainz Modules|Trainz Modules]] for details of the constants associated with this method. <br />
* See [[ModuleInit Message]] for further details.<br />
<br><br />
<br />
==GetDriverCharacterList==<br />
{{MethodHeader|public native DriverCharacter[ ] GetDriverCharacterList(void)}}<br />
;Parameters<br />
*None<br />
;Returned Value<br />
*An array of DriverCharacter objects installed in the current world.<br />
;Syntax<br />
DriverCharacter[] drivers = World.GetDriverCharacterList();<br />
;Notes<br />
<br><br />
<br />
==GetDriverCommandList==<br />
{{MethodHeader|public native DriverCommand[ ] GetDriverCommandList(void)}}<br />
;Parameters<br />
*None<br />
;Returned Value<br />
*An array of DriverCommand objects installed in the current world.<br />
;Syntax<br />
DriverCommand[] commands = World.GetDriverCommandList();<br />
;Notes<br />
<br><br />
<br />
==GetGameTime==<br />
{{MethodHeader|public native float GetGameTime(void)}}<br />
;Parameters<br />
*None<br />
;Returned value<br />
*Current game time.<br />
;Syntax<br />
float Now = World.GetGameTime();<br />
;Notes<br />
*The returned time is normalised to a value between 0.0 and 1.0<br />
*0.0 = midday.<br />
*0.5 = midnight<br />
*Use the [[#Time_Values|Time Value]] constants to convert the normalised values to human readable times.<br />
<br><br />
<br />
==GetGoodWeatherFog==<br />
{{MethodHeader|public native float GetGoodWeatherFog(void)}}<br />
;Parameters<br />
*None<br />
;Returned Value<br />
*Good weather fog distance as a float in the range 0.0..1.0.<br />
;Syntax<br />
float dist = World.GetGoodWeatherFog();<br />
;Notes<br />
<br><br />
<br />
==GetGroundDrawDistance==<br />
{{MethodHeader|public native float GetGroundDrawDistance(void)}}<br />
;Parameters<br />
*None<br />
;Returned Value<br />
*Ground draw distance in metres.<br />
;Syntax<br />
float dist = World.GetGroundDrawDistance();<br />
;Notes<br />
<br><br />
<br />
==GetIndustryList==<br />
{{MethodHeader|public native GameObject[ ] GetIndustryList(void)}}<br />
;Parameters <br />
*None<br />
;Returned Value<br />
*An array of references to all of the Industry objects for the current route.<br />
;Syntax<br />
GameObject[] Industries = World.GetIndustryList();<br />
;Notes<br />
<br><br />
<br />
==GetJunctionList==<br />
{{MethodHeader|public native Junction[ ] GetJunctionList(void)}}<br />
;Parameters <br />
*None<br />
;Returned Value<br />
*An array of references to all of the trackside junction objects for the current route.<br />
;Syntax<br />
Junction[] junctions = World.GetJunctionList();<br />
;Notes<br />
*Junction objects attached to fixed track junctions are not currently returned by this method.<br />
<br><br />
<br />
==GetLibrary==<br />
{{MethodHeader|public native Library GetLibrary(KUID kuid)}}<br />
;Parameters<br />
*'''kuid''' = KUID of script library asset to load.<br />
;Returned Value<br />
*A reference to the script library asset if successful, null otherwise.<br />
;Syntax<br />
Library codelib = World.GetLibrary(LibraryKUID);<br />
;Notes<br />
*The [[Class Library|Library]] asset is initialised when this method is first called in a session.<br />
*Since only one instance can exist, subsequent calls return a reference to the existing Library object.<br />
*See [[Class Library|Library]] for notes on how to use this method.<br />
<br><br />
<br />
==GetSceneryDrawDistance==<br />
{{MethodHeader|public native float GetSceneryDrawDistance(void)}}<br />
;Parameters<br />
*None<br />
;Returned Value<br />
*Undefined.<br />
;Notes<br />
*Included for legacy script compatibility only. Has no effect.<br />
<br><br />
<br />
==GetSeconds==<br />
{{MethodHeader|public native float GetSeconds(void)}}<br />
;Parameters<br />
*None<br />
;Returned Value<br />
*The current value of a floating point number incrementing once per second in real time.<br />
;Syntax<br />
float start = World.GetSeconds();<br />
// do stuff<br />
float finish = World.GetSeconds();<br />
float period = finish - start;<br />
;Notes<br />
*Each call will return a float value containing the current value of an internal counter.<br />
*Subtracting a later value from a value saved at an earlier call will enable the delay between the two calls to be established.<br />
<br><br />
<br />
==GetSignalList==<br />
{{MethodHeader|public native Signal[ ] GetSignalList(void)}}<br />
;Parameters <br />
*None<br />
;Returned Value<br />
*An array of references to all of the signal objects for the current route.<br />
;Syntax<br />
Signal[] signals = World.GetSignalList();<br />
;Notes<br />
<br><br />
<br />
==GetStringTable==<br />
{{MethodHeader|public native StringTable GetStringTable(void)}}<br />
;Parameters <br />
*None<br />
;Returned Value<br />
*The StringTable for the current session.<br />
;Syntax<br />
StringTable data = World.GetStringTable();<br />
;Notes<br />
<br><br />
<br />
==GetSurveyorSavedConsist==<br />
{{MethodHeader|public native Soup GetSurveyorSavedConsistList(string name)}}<br />
;Parameters <br />
*'''name''' = Name of the consist to retireiev.<br />
;Returned Value<br />
*Returns a Soup definition of the named consist if it exists, null otherwise.<br />
;Syntax<br />
Soup consist = World.GetSurveyorSavedConsist("Brighton Belle");<br />
;Notes<br />
*Remember that the returned data is in a Soup format, which is not the same thing as a Train. <br />
*TrainUtil.CreateTrainFormSoup() can be used to create a train from the returned Soup.<br />
*This method only works in Surveyor.<br />
<br><br />
<br />
==GetSurveyorSavedConsistList==<br />
{{MethodHeader|public native string[ ] GetSurveyorSavedConsistList()}}<br />
;Parameters <br />
*None<br />
;Returned Value<br />
*An array of names of all the saved consist objects in Surveyor.<br />
;Syntax<br />
string[] consists = World.GetSurveyorSavedConsistList();<br />
;Notes<br />
*This method only works in Surveyor.<br />
<br><br />
<br />
==GetTrackmarkList==<br />
{{MethodHeader|public native TrackMark[ ] GetTrackmarkList(void)}}<br />
;Parameters <br />
*None<br />
;Returned Value<br />
*An array of references to all of the trackmark objects for the current route.<br />
;Syntax<br />
Trackmark[] trackmarks = World.GetTrackmarkList();<br />
;Notes<br />
<br><br />
<br />
==GetTrainList==<br />
{{MethodHeader|public native Train[ ] GetTrainList(void)}}<br />
;Parameters <br />
*None<br />
;Returned Value<br />
*An array of references to all of the trains for the current route.<br />
;Syntax<br />
Train[] trains = World.GetTrainList();<br />
;Notes<br />
<br><br />
<br />
==GetTrainzBuild==<br />
{{MethodHeader|public native int GetTrainzBuild(void)}}<br />
;Parameters;<br />
*None<br />
;Returned Value<br />
*Gets the current build number of Trainz. <br />
;Syntax<br />
int build = World.GetTrainzBuild();<br />
;Notes<br />
*The value returned corresponds to the build number you can see in the bottom-right side of the main Trainz menu screen.<br />
<br><br />
<br />
==GetTrainzVersion==<br />
{{MethodHeader|public native float GetTrainzVersion(void)}}<br />
;Parameters<br />
*None<br />
;Returned Value<br />
*The TRS version number.<br />
;Syntax<br />
float version = World.GetTrainzVersion();<br />
;Notes<br />
*The value returned corresponds to the version number you can see in the bottom-right side of the main Trainz menu screen. <br />
<br><br />
<br />
==GetTriggerList==<br />
{{MethodHeader|public native Trigger[ ] GetTriggerList(void)}}<br />
;Parameters <br />
*None<br />
;Returned Value<br />
*An array of references to all of the trigger objects for the current route.<br />
;Syntax<br />
Trigger[] triggers = World.GetTriggerList();<br />
;Notes<br />
*This method does not return scenery triggers, ie those attached to SceneryWithTrack objects and their descendants.<br />
<br><br />
<br />
==GetVehicleList==<br />
{{MethodHeader|public native Vehicle[ ] GetVehicleList(void)}}<br />
;Parameters <br />
*None<br />
;Returned Value<br />
*An array of references to all of the vehicles in the current route.<br />
;Syntax<br />
Vehicle[] vehicles = World.GetVehicleList();<br />
;Notes<br />
<br><br />
<br />
==GetWeatherChangeability==<br />
{{MethodHeader|public native int GetWeatherChangeability(void)}}<br />
;Parameter<br />
*None<br />
;Returned Value<br />
*One of the [[#Weather_Changeability_Constants|Weather Changeability Constants]] denoting the variability of weather conditions.<br />
;Syntax<br />
int variability = World.GetWeatherChangeability();<br />
;Notes<br />
<br><br />
<br />
==GetWeatherType==<br />
{{MethodHeader|public native int GetWeatherType(void)}}<br />
;Parameter<br />
*None<br />
;Returned Value<br />
*One of the [[#Weather_Type_Constants|Weather Type Constants]] denoting the current weather conditions.<br />
;Syntax<br />
int weather = World.GetWeatherType();<br />
;Notes<br />
<br><br />
<br />
==LoadMap==<br />
{{MethodHeader|public native bool LoadMap(KUID kuid)}}<br />
;Parameters<br />
*'''kuid''' = KUID of map to load.<br />
;Returned Value<br />
*True if successful, false otherwise.<br />
;Syntax<br />
if (World.LoadMap(mapKUID) Interface.Print("Map loaded OK");<br />
else Interface.Print("Map load failed");<br />
;Notes<br />
<br><br />
<br />
==Play2DSound==<br />
{{MethodHeader|public float Play2DSound(Asset asset, string wave)}}<br />
;Parameters<br />
*'''asset''' = Asset where the sound file is located.<br />
*'''wave''' = Name of the ''*.wav'' file to be played, a relative path can be included.<br />
;Returned Value<br />
* Undefined.<br />
;Syntax<br />
// Play the sound and continues script execution.<br />
World.Play2DSound(soundAsset,"sounds/allaboard.wav"); <br />
// Wait until sound has completed before continuing.<br />
Sleep(World.Play2DSound(soundAsset,"sounds/allaboard.wav")); <br />
;Notes<br />
*Plays a ''.wav" sound file from the given asset's folder.<br />
*The sound is non directional and can be mono or stereo. <br />
*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. <br />
*This means your code will keep on executing while Trainz is playing the sound.<br />
<br><br />
<br />
==PlaySound==<br />
{{MethodHeader|public native float PlaySound<br>&nbsp;&nbsp;&nbsp;&nbsp;(Asset asset, string wave, float vol, float near, float far, GameObject target, string pt)<br>&nbsp;&nbsp;&nbsp;&nbsp;(Asset asset, string wave, float vol, float near, float far, GameObject target, string pt, bool loop)}}<br />
;Parameters<br />
*'''asset''' = Asset where the sound file is located.<br />
*'''wave''' = Name of the ''*.wav'' file to be played, a relative path can be included.<br />
*'''vol''' = Volume level to play the sound at<br />
*'''near''' = Distance from the target asset at which the sound will be played at maximum volume.<br />
*'''far''' = Distance from the target asset at which the sound will become inaudible.<br />
*'''target''' = GameObject to which the sound will be attached if a 3d sound is required, null for 2D.<br />
*'''pt''' = Name of attachment point in the target object if a 3d sound is required, null for 2D.<br />
*'''loop''' = (Optional) If true the sound will loop continuously.<br />
;Returned Value<br />
* Sound length in seconds for Trainz before TS12<br />
* Undefined for TS12 and TANE<br />
;Syntax<br />
// Play the sound and continues script execution.<br />
World.PlaySound(soundAsset,"sounds/allaboard.wav",1000.0,10.0,100.0,Station,"a.loudspeaker"); <br />
;Notes<br />
*Plays a ''.wav'' sound file from the given asset's folder.<br />
*If the sound is to be directional a mono sound file is required. <br />
*This method does not return after the sound has finished playing: it returns as soon as it is called. <br />
*This means your code will keep on executing while Trainz is playing the sound.<br />
*If you want to wait for the sound to complete playing before moving on, wrap the PlaySound() call up in a Sleep() call. '''Note!''' 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.<br />
*The sound volume will be at a maximum for a camera position at or less than the value of the ''near'' parameter and will reduce with distance until the hearing position reaches ''far'', when the sound will be inaudible.<br />
<br><br />
<br />
==RemoveDriverCharacter==<br />
{{MethodHeader|public native void RemoveDriverCharacter(DriverCharacter driver)}}<br />
;Parameters<br />
*'''driver''' = DriverCharacter to remove.<br />
;Returned Value<br />
*None<br />
;Syntax<br />
World.RemoveDriverCharacter(dave);<br />
;Notes<br />
<br><br />
<br />
==RemoveDriverCommand==<br />
{{MethodHeader|public native void RemoveDriverCommand(DriverCommand command)}}<br />
;Parameters<br />
*'''command''' = DriverCommand to remove.<br />
;Returned Value<br />
*None<br />
;Syntax<br />
World.RemoveDriverCommand(driverCommand);<br />
;Notes<br />
<br><br />
<br />
==SetBadWeatherFog==<br />
{{MethodHeader|public native void SetBadWeatherFog(float distance)}}<br />
;Parameters<br />
*'''distance''' = Bad weather fog distance to set.<br />
;Returned Value<br />
*None<br />
;Syntax<br />
World.SetBadWeatherFog(0.5);<br />
;Notes<br />
<br><br />
<br />
==SetCamera==<br />
{{MethodHeader|public native bool SetCamera(MapObject focus)<br>public native void SetCamera(Junction focus)<br>public native void SetCamera(Vehicle focus, int cameraMode)<br>public native void SetCamera(Train focus, int cameraMode)}}<br />
;Parameters<br />
*'''focus''' = Object on which the camera is to be focused.<br />
*''cameraMode''' = One of the [[#Camera_View_Modes|Camera View Mode]] constants defining the view which should be assigned to the camera.<br />
;Returned Value<br />
*The first variant returns a boolean to indicate success or failure.<br />
*Remaining variants do not return a value<br />
'Syntax<br />
World.SetCamera(train.GetVehicles[0],World.CAMERA_TRACKING); // sets the camera to track the first vehicle in the train.<br />
<br><br />
<br />
==SetCameraAngle==<br />
{{MethodHeader|public void SetCameraAngle(int yaw, int pitch, float radius)}}<br />
;Parameters<br />
*'''yaw''' = Camera rotation in degrees, 90 is a direct front view.<br />
*'''pitch''' = Camera angle relative to the horizon, 0 is horizontal, 90 points vertically upwards.<br />
*'''radius''' = Distance in metres to the object in focus.<br />
;Returned Value<br />
*None<br />
;Syntax<br />
World.SetCameraAngle(90,0,25); // Sets the camera to a direct frontal view at 25 metres from the currently focused object.<br />
;Notes<br />
*''Radius'' is measured from the object origin point (0,0,0).<br />
<br><br />
<br />
==SetCameraFlags==<br />
{{MethodHeader|public native void SetCameraFlags(int flags)}}<br />
;Parameter<br />
*'''flags''' integer value defining what the user is permitted to do with the game camera.<br />
;Returned Value<br />
*None<br />
;Syntax<br />
// User is permitted to select External or Tracking views only.<br />
World.SetCameraFlags(World.CAMERA_EXTERNAL | World.CAMERA_TRACKING);<br />
;Notes<br />
*Use any combination of [[#Camera_Flags|Camera Flags]] and [[#Camera_View_Modes|Camera View Modes]] to set the parameter.<br />
<br><br />
<br />
==SetCameraMode==<br />
{{MethodHeader|public void SetCameraMode(int mode)}}<br />
;Parameter<br />
*'''mode''' = Camera mode to select.<br />
;Returned Value<br />
*None<br />
;Syntax<br />
World.SetCameraMode(World.CAMERA_TRACKING);<br />
;Notes<br />
*Use one of the [[#Camera_View_Modes|Camera View Modes]] to set the parameter.<br />
<br><br />
<br />
==SetGameTime==<br />
{{MethodHeader|public void SetGameTime(float time)}}<br />
;Parameters<br />
*'''time''' = new gane time to set.<br />
;Returned Value<br />
*None<br />
;Syntax<br />
World.SetGameTime(0.5); // sets time to midnight<br />
;Notes<br />
*Game time is normalised to a value between 0.0 and 1.0<br />
*0.0 = midday.<br />
*0.5 = midnight<br />
*Use the [[#Time_Values|Time Value]] constants to convert human readable times to normalised values. <br />
<br><br />
<br />
==SetGameTimeRate==<br />
{{MethodHeader|public native void SetGameTimeRate(float rate)}}<br />
;Parameters<br />
*'''rate''' = New time rate to set.<br />
;Returned Value<br />
*None<br />
;Syntax<br />
World.SetGameTimeRate(World.TIME_RATE_8X); // sets game time to advance by 8 minutes per minute of real world time.<br />
;Notes<br />
*Use one of the [[#Time_Rate_Constants|Time Rate Constants]] to define the parameter.<br />
<br><br />
<br />
==SetGoodWeatherFog==<br />
{{MethodHeader|public native void SetGoodWeatherFog(float distance)}}<br />
;Parameters<br />
*'''distance''' = Good weather fog distance to set.<br />
;Returned Value<br />
*None<br />
;Syntax<br />
World.SetGoodWeatherFog(0.5);<br />
;Notes<br />
<br><br />
<br />
==SetGroundDrawDistance==<br />
{{MethodHeader|public native void SetGroundDrawDistance(float distance)}}<br />
;Parameters<br />
*'''distance''' = Ground draw distance in metres.<br />
;Returned Value<br />
*None<br />
;Syntax<br />
World.SetGroundDrawDistance(1000.0);<br />
;Notes<br />
*Compatibility warning: Use of this function is not recommended, it may become non-functional in future Trainz versions.<br />
<br><br />
<br />
==SetSceneryDrawDistance==<br />
{{MethodHeader|public native void SetSceneryDrawDistance(float distance)}}<br />
;Parameters<br />
*'''distance''' = unused.<br />
;Returned Value<br />
*None<br />
;Notes<br />
* Does nothing. Included for script compatibility only.<br />
<br><br />
<br />
==SetTargetObserver==<br />
{{MethodHeader|public void SetTargetObserver(GameObject observer)}}<br />
;Parameters<br />
*'''observer''' = The game object to receive targeting messages.<br />
;Returned Value<br />
*None<br />
;Syntax<br />
SetTargetObserver(self);<br />
;Notes<br />
* Causes the specified object to receive "Track", "LeftClick" messages when a track is clicked. Causes the specified object to receive "Interface-Event", "Left-Click" 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's request.<br />
<br><br />
<br />
==SetWeather==<br />
{{MethodHeader|public native void SetWeather(int type, int changeability)}}<br />
;Parameters<br />
*'''type''' = Weather conditions as defined by one of the [[#Weather_Type_Constants|Weather Type Constants]].<br />
*'''change''' = Weather variation as defined by one of the [[#Weather_Changeability_Constants|Weather Changeability Constants]].<br />
;Returned Value<br />
*None<br />
;Syntax<br />
World.SetWeather(World.WEATHER_TYPE_HEAVY_SNOW,World.WEATHER_CHANGEABILITY_EXTREME); // April in Paris.<br />
;Notes<br />
<br><br />
<br />
==UserSetCamera==<br />
{{MethodHeader|public native bool UserSetCamera(GameObject target)}}<br />
;Parameters<br />
*'''target''' = GameObject to set focus to.<br />
;Returned Value<br />
*True if successful, false otherwise.<br />
;Syntax<br />
World.UserSetCamera(Router,GetGameObject("Junction 5"));<br />
;Notes<br />
<br><br />
<br />
==UserSetCameraMode==<br />
{{MethodHeader|public native void UserSetCameraMode(int mode)}}<br />
;Parameters<br />
*'''mode''' = One of the [[#Camera_View_Modes|Camera View Modes]]<br />
;Returned Value<br />
*None<br />
;Syntax<br />
World.UserSetCameraMode(World.CAMERA_ROAMING); // switches to roaming view if permitted.<br />
;Notes<br />
*This method respects the current [[#Camera_Flags|Camera Flag]] settings, disallowing any change which the flags do not permit.<br />
<br><br />
<br />
<br />
==Categories==<br />
[[Category:Script Class]]</div>Vvmmhttps://online.ts2009.com/mediaWiki/index.php/Vvmm%27s_Trainz_ToolsVvmm's Trainz Tools2017-07-14T07:12:24Z<p>Vvmm: /* CDP Explorer */</p>
<hr />
<div>==TZarchiver==<br />
<br />
This application can be used to open or create TZarc files that are present in Trainz A New Era.<br />
<br />
Now you can open and restore backups created by the game (from the backups folder), edit content directly from the local folder or transfer the content from local to TS12/2010/2009. The app allows batch operation with a single click.<br />
<br />
It supports file association with TZarc files and adding them to the list by double-clicking. (Use the Open With... dialog to create association)<br />
<br />
==CDP Explorer==<br />
<br />
With CDP Explorer you can display the contents of CDP files before installing them and you can search if a CDP contains a certain asset (kuid).<br />
You can use drag&drop or 'open with' to open a CDP.<br />
<br />
Features:<br />
* '''Extract assets from CDP as separate files.'''<br />
* List assets contained in CDP: kuid, username, build, class, region, era.<br />
* Copy kuid list.<br />
* Copy kuid+name list.<br />
* Search for known info in CDP: kuid, username.<br />
* Count total number of objects.<br />
<br />
==Chump expander==<br />
<br />
This application unpacks chump files (i.e.: config.chump or cdp) to txt format.<br />
<br />
Now you can edit content directly from the local folder or transfer the content between any Trainz versions. The app allows batch operation with a single click.<br />
<br />
Supports file association with chump files and adding them to the list by double-clicking. (Use the Open With... dialog to create association)<br />
<br />
==Kuid Lister==<br />
<br />
With this application you can create organized lists of asset KUIDs, in order to post them in the missing KUIDs forum section.<br />
<br />
It can also create multiple asset versions for the listed KUIDs, which is useful to find any available version of the asset.<br />
<br />
==Kuid2Hash==<br />
<br />
Application for converting a numeric kuid value to hexadecimal and calculating the hash value. It can also calculate the reverse conversion, from hexadecimal to numeric value.<br />
<br />
The app is useful for finding a kuid in the local content hash folders.<br />
<br />
==Trainz Settings Viewer==<br />
<br />
With this application you can explore all the saved settings of the game from the assets.tdx file.<br />
<br />
For example you can see your username, password and the cd-key used. Or you can take advantage of the Surveyor picklist and view the lists directly. The "Jump to" options takes you to the most usual information.<br />
<br />
Supports file association with tdx files. (Use the Open With... dialog to create association)<br />
<br />
==Download and getting help==<br />
<br />
You can use my forum in order to ask any question you like or receive support using my software: http://vvmm.freeforums.org/software-f56.html<br />
<br />
In each topic you will find a download link to the software which will only run on Windows 7/8/8.1/10.<br />
<br />
For getting help you should post only in English or Romanian.<br />
<br />
==Disclaimer==<br />
<br />
I am not responsible for any damage caused from the use or misuse of the above software.<br />
<br />
The programs are provided free of charge to help other Trainz content creators and users.<br />
<br />
==About vvmm==<br />
<br />
I am an Embedded Software Engineer, currently working in Bucharest, Romania. My biggest passion are trains, especially the Trainz Railroad Simulator. I also like electronics, music and networking and in my free time I like to create custom quality Trainz content and software to make Trainz assets management easier for other people. <br />
<br />
==Exit==<br />
<br />
[[Tools|Return to Tools]]</div>Vvmmhttps://online.ts2009.com/mediaWiki/index.php/Vvmm%27s_Trainz_ToolsVvmm's Trainz Tools2017-07-14T07:11:58Z<p>Vvmm: /* CDP Explorer */</p>
<hr />
<div>==TZarchiver==<br />
<br />
This application can be used to open or create TZarc files that are present in Trainz A New Era.<br />
<br />
Now you can open and restore backups created by the game (from the backups folder), edit content directly from the local folder or transfer the content from local to TS12/2010/2009. The app allows batch operation with a single click.<br />
<br />
It supports file association with TZarc files and adding them to the list by double-clicking. (Use the Open With... dialog to create association)<br />
<br />
==CDP Explorer==<br />
<br />
With CDP Explorer you can display the contents of CDP files before installing them and you can search if a CDP contains a certain asset (kuid).<br />
You can use drag&drop or 'open with' to open a CDP.<br />
<br />
Features:<br />
* List assets contained in CDP: kuid, username, build, class, region, era.<br />
* Copy kuid list.<br />
* Copy kuid+name list.<br />
* Search for known info in CDP: kuid, username.<br />
* Count total number of objects.<br />
* '''Extract assets from CDP as separate files.'''<br />
<br />
==Chump expander==<br />
<br />
This application unpacks chump files (i.e.: config.chump or cdp) to txt format.<br />
<br />
Now you can edit content directly from the local folder or transfer the content between any Trainz versions. The app allows batch operation with a single click.<br />
<br />
Supports file association with chump files and adding them to the list by double-clicking. (Use the Open With... dialog to create association)<br />
<br />
==Kuid Lister==<br />
<br />
With this application you can create organized lists of asset KUIDs, in order to post them in the missing KUIDs forum section.<br />
<br />
It can also create multiple asset versions for the listed KUIDs, which is useful to find any available version of the asset.<br />
<br />
==Kuid2Hash==<br />
<br />
Application for converting a numeric kuid value to hexadecimal and calculating the hash value. It can also calculate the reverse conversion, from hexadecimal to numeric value.<br />
<br />
The app is useful for finding a kuid in the local content hash folders.<br />
<br />
==Trainz Settings Viewer==<br />
<br />
With this application you can explore all the saved settings of the game from the assets.tdx file.<br />
<br />
For example you can see your username, password and the cd-key used. Or you can take advantage of the Surveyor picklist and view the lists directly. The "Jump to" options takes you to the most usual information.<br />
<br />
Supports file association with tdx files. (Use the Open With... dialog to create association)<br />
<br />
==Download and getting help==<br />
<br />
You can use my forum in order to ask any question you like or receive support using my software: http://vvmm.freeforums.org/software-f56.html<br />
<br />
In each topic you will find a download link to the software which will only run on Windows 7/8/8.1/10.<br />
<br />
For getting help you should post only in English or Romanian.<br />
<br />
==Disclaimer==<br />
<br />
I am not responsible for any damage caused from the use or misuse of the above software.<br />
<br />
The programs are provided free of charge to help other Trainz content creators and users.<br />
<br />
==About vvmm==<br />
<br />
I am an Embedded Software Engineer, currently working in Bucharest, Romania. My biggest passion are trains, especially the Trainz Railroad Simulator. I also like electronics, music and networking and in my free time I like to create custom quality Trainz content and software to make Trainz assets management easier for other people. <br />
<br />
==Exit==<br />
<br />
[[Tools|Return to Tools]]</div>Vvmmhttps://online.ts2009.com/mediaWiki/index.php/Vvmm%27s_Trainz_ToolsVvmm's Trainz Tools2017-06-30T18:51:22Z<p>Vvmm: Created page with "==TZarchiver== This application can be used to open or create TZarc files that are present in Trainz A New Era. Now you can open and restore backups created by the game (fro..."</p>
<hr />
<div>==TZarchiver==<br />
<br />
This application can be used to open or create TZarc files that are present in Trainz A New Era.<br />
<br />
Now you can open and restore backups created by the game (from the backups folder), edit content directly from the local folder or transfer the content from local to TS12/2010/2009. The app allows batch operation with a single click.<br />
<br />
It supports file association with TZarc files and adding them to the list by double-clicking. (Use the Open With... dialog to create association)<br />
<br />
==CDP Explorer==<br />
<br />
With CDP Explorer you can display the contents of CDP files before installing them and you can search if a CDP contains a certain asset (kuid).<br />
You can use drag&drop or 'open with' to open a CDP.<br />
<br />
Features:<br />
* List assets contained in CDP: kuid, username, build, class, region, era.<br />
* Copy kuid list.<br />
* Copy kuid+name list.<br />
* Search for known info in CDP: kuid, username.<br />
* Count total number of objects.<br />
<br />
==Chump expander==<br />
<br />
This application unpacks chump files (i.e.: config.chump or cdp) to txt format.<br />
<br />
Now you can edit content directly from the local folder or transfer the content between any Trainz versions. The app allows batch operation with a single click.<br />
<br />
Supports file association with chump files and adding them to the list by double-clicking. (Use the Open With... dialog to create association)<br />
<br />
==Kuid Lister==<br />
<br />
With this application you can create organized lists of asset KUIDs, in order to post them in the missing KUIDs forum section.<br />
<br />
It can also create multiple asset versions for the listed KUIDs, which is useful to find any available version of the asset.<br />
<br />
==Kuid2Hash==<br />
<br />
Application for converting a numeric kuid value to hexadecimal and calculating the hash value. It can also calculate the reverse conversion, from hexadecimal to numeric value.<br />
<br />
The app is useful for finding a kuid in the local content hash folders.<br />
<br />
==Trainz Settings Viewer==<br />
<br />
With this application you can explore all the saved settings of the game from the assets.tdx file.<br />
<br />
For example you can see your username, password and the cd-key used. Or you can take advantage of the Surveyor picklist and view the lists directly. The "Jump to" options takes you to the most usual information.<br />
<br />
Supports file association with tdx files. (Use the Open With... dialog to create association)<br />
<br />
==Download and getting help==<br />
<br />
You can use my forum in order to ask any question you like or receive support using my software: http://vvmm.freeforums.org/software-f56.html<br />
<br />
In each topic you will find a download link to the software which will only run on Windows 7/8/8.1/10.<br />
<br />
For getting help you should post only in English or Romanian.<br />
<br />
==Disclaimer==<br />
<br />
I am not responsible for any damage caused from the use or misuse of the above software.<br />
<br />
The programs are provided free of charge to help other Trainz content creators and users.<br />
<br />
==About vvmm==<br />
<br />
I am an Embedded Software Engineer, currently working in Bucharest, Romania. My biggest passion are trains, especially the Trainz Railroad Simulator. I also like electronics, music and networking and in my free time I like to create custom quality Trainz content and software to make Trainz assets management easier for other people. <br />
<br />
==Exit==<br />
<br />
[[Tools|Return to Tools]]</div>Vvmmhttps://online.ts2009.com/mediaWiki/index.php/ToolsTools2017-06-30T18:32:09Z<p>Vvmm: Added vvmm</p>
<hr />
<div>==Auran-provided Tools==<br />
<br />
The following executable tools are made available to Trainz users.<br />
<br />
[[Content Manager]] - ''Auran's included content management GUI, which provides functionality for downloading, installing, managing and building custom content.''<br />
<br />
[[Content Creator Plus]] - ''Auran's included content creation GUI, which provides functionality for creating, editing, viewing and validating asset configurations.''<br />
<br />
[[Trainz Mesh Importer]] - ''An xml-to-im converter that can be used to simplify conversion of models from various formats into Trainz .im format.''<br />
<br />
[[TrainzUtil]] - ''A command line content management tool.''<br />
<br />
==Third-party Tools==<br />
<br />
The following Trainz-related tools are maintained by Trainz 3rd-party developers.<br />
<br />
[[AssetX Wiki|AssetX]] - ''A multi purpose toolbox by Andi06 and PEV designed to view, edit and repair the majority of files used in all versions of TRS from TRS2004 onwards.''<br />
<br />
[[Trainz Tools by PEV]] - ''Editing and repair tools for most Trainz Content files. Shane Turner now hosts these.''<br />
<br />
[[Shane Turner's Trainz Tools]] - ''Tools to enhance and help resolve some Trainz technical problems. Hosted on the same site as the PEV Trainz Tools''<br />
<br />
[[vvmm's Trainz Tools]] - Tools for opening TZarc files, explore CDP files contents, list kuids etc.<br />
<br />
[[Basemapz]] - ''A tool to assist in creating Model Trainz baseboards from scale plans by ModelerMJ.''<br />
<br />
More ''TBD''<br />
<br />
==Native APIs==<br />
<br />
Auran provides some native (C++) libraries which allow Trainz 3rd-party developers to access specific Trainz internal files and functionality which are otherwise opaque. These are provided in DLL form within the Trainz installation, and should not be redistributed as their implementation is specific to each Trainz install version.<br />
<br />
[[TrainzNativeInterface]] - A helper DLL which provides the basic functionality for communication between Trainz executables and third-party DLLs.<br />
<br />
<br />
==Documentation==<br />
<br />
[[Command Line Guidelines]] - ''Details guidelines for developing Trainz-related command-line utilities with the intention of creating a standardised, easy-to-use interface.''<br />
<br />
''TBD''<br />
<br />
[[Category:TBD]]<br />
[[Category:Trainz Wiki]]</div>Vvmmhttps://online.ts2009.com/mediaWiki/index.php/KIND_PantographKIND Pantograph2016-05-13T12:31:06Z<p>Vvmm: /* Example Config.txt */</p>
<hr />
<div>[[KIND Pantograph]] objects are used to represent current collecting apparatus on electric locomotives. They are animated, and can be raised and lowered within Trainz.<br />
<br />
==KIND Hierarchy==<br />
===Parent Classes===<br />
* [[KIND Mesh]]<br />
===Child Classes===<br />
* ''none.''<br />
<br />
==Supported Tags==<br />
Kind Pantograph does not introduce new tags. A [["mesh-table" container]] is used to define the mesh and animation for a pantograph.<br />
<br />
<br />
==Example Config.txt==<br />
Sample [[config.txt file]] for a Pantograph asset, with the Standard Tags excluded for brevity:<br />
<br />
<br />
username "Pantograph"<br />
kuid <kuid2:1234:1234:1><br />
trainz-build 2.9<br />
category-class "ZP"<br />
category-region "00"<br />
category-era "1900s"<br />
kind "pantograph"<br />
mesh-table<br />
{<br />
default<br />
{<br />
mesh "panto.im"<br />
anim "anim.kin"<br />
auto-create 1<br />
}<br />
}<br />
thumbnails<br />
{<br />
}<br />
<br />
==Downloads==<br />
''Attach sample files here?''<br />
<br />
<br />
==Categories==<br />
[[Category:Asset KIND|P]]<br />
[[Category:TBD]]</div>Vvmmhttps://online.ts2009.com/mediaWiki/index.php/HowTo/Export_from_Blender_using_FBXHowTo/Export from Blender using FBX2016-04-19T07:55:46Z<p>Vvmm: /* Config.txt */</p>
<hr />
<div>(Work in progress)<br />
<br />
This page provides advice on exporting from Blender to the FBX format. It may contain sections that may be better placed on other pages, such as material definition pages, but will be hosted here for now.<br />
<br />
Note that FBX export/import is currently only available to TrainzDev members using dev build 81786 or higher. (as at 14 Apr 2016)<br />
<br />
==Introduction==<br />
<br />
This guide provides information for the export of FilmBoX (FBX) files from Blender. The FBX format is currently only available for TrainzDev members using TANE test builds. The guide will be updated as lessons are learned and features added to the export process.<br />
<br />
The FBX format is intended as a replacement for existing indexed mesh (IM) and perhaps animation (KIN) files. It is not known if existing IM and KIN will continue to be supported by N3V.<br />
{{TOC}}<br />
<br />
===Development of this guide===<br />
<br />
The FBX importer is incomplete as is this guide. The guide will be updated as testing discovers new information. Currently (18 Apr 2016), only mesh objects can be imported. There is no support as yet for attachments or animation.<br />
<br />
===Versions===<br />
<br />
{| class="wikitable"<br />
<br />
|-<br />
|style="width:100px;"|TANE:||style="width:200px;"|4.4 or later.<br />
|-<br />
|Blender:|| Not sure about this but it does work for Blender 2.77. The FBX exporter is a standard addon for Blender.<br />
|-<br />
|FBX format:|| Binary format only (see discussion below). FBX 2011, FBX2012, FBX2013.<br />
|-<br />
|Special requirements:|| None. Creators will need their preferred image editors and text editors but there are no special requirements for FBX.<br />
|-<br />
|Other software:|| There are free FBX viewers available on the web including the {{plain link|http://www.autodesk.com/products/fbx/fbx-review FBX Review}} program by Autodesk.<br />
|}<br />
<br />
<br />
===The FBX format===<br />
<br />
A brief discussion on the FBX format history can be found {{plain link|https://en.wikipedia.org/wiki/FBX here}}. FBX can be exported either as an ASCII (i.e. human readable) file or in binary format. TANE will only recognise the binary format.<br />
<br />
<br />
==Blender and FBX==<br />
<br />
Blender is capable of both importing and exporting FBX. The Blender exporter does not export all possible object attributes and it is likely that TANE will not recognise all those attributes that are exported.<br />
The Blender documention contains a {{plain link|https://wiki.blender.org/index.php/Extensions:2.6/Py/Scripts/Import-Export/Autodesk_FBX list of attributes}} that are exported. <br />
<br />
Included in this guide is a list of attributes that have been observed as exported and treatment/acceptance by TANE. The list is incomplete and so is a work in progress.<br />
<br />
<br />
==Skills Required==<br />
For this version of the guide, it is assumed the user has some knowledge of the use of Blender and an understanding of the Trainz asset creation process. <br />
<br />
<br />
==Exporting a mesh object from Blender in FBX format==<br />
<br />
The FBX exporter addon must be enabled in User Preferences.<br />
<br />
Select File->Export->Export FBX and the FBX export panel will show in the bottom left hand corner and should look like the following picture. The panel contents<br />
vary significantly between the Binary export version and the ASCII export version so make sure you have Binary selected.<br />
<br />
===The Main Menu===<br />
[[File:FBX_Main_Menu.jpg|380px|left|thumb|frameless|Caption FBX Main Menu]] <br />
* Ignore the Operator Presets for now.<br />
* Ensure FBX 7.4 binary version is selected.<br />
* The Main/Geometry/Armatures/Animation buttons provide menu options for the item selected. Select the Main option.<br />
* Selected Objects. This option needs careful consideration. Unlike the Blender XML exporter, the FBX exporter will export all objects in all layers<br />
which is probably undesirable in many cases and particularly if you have different LOD models in different layers. So, first select those objects within Blender<br />
that you want to export and then select Selected Objects in this panel. (note that hiding objects may be a useful option but that hasn't been tested)<br />
* Scale. Leave the Scale value as 1.00 and deselect the small icon to the right of the Scale value. The default value for this icon is selected and<br />
will cause your object to be 100 times its specified size in Blender. This issue is still being investigated.<br />
* Forward and Up. Leave these in the default values of "-Z Forward" and "Y Up".<br />
* The next six options of Empty, Camera, Lamp, Armature, Mesh and Other are mult select. i.e. zero or more can be selected. Select Mesh only at this point.<br />
* Leave the Experimental and Custom Properties as deselected. These have not been tested.<br />
* Leave Path Mode as Auto and Batch Mode as Off. These will be investigated later.<br />
* Choose the FBX filename and export using the Export FBX in the top right hand corner. There is no exporter log.<br />
{{clear}}<br />
<br />
===The Geometry Menu===<br />
<br />
[[File:FBX Geometry Menu.jpg|380px|left|thumb|Caption FBX Geometry Menu]] <br />
* Leave these values as shown. We need more information on this.<br />
{{clear}}<br />
<br />
===The Armatures Menu===<br />
<br />
[[File:FBX Armatures Menu.jpg|380px|left|thumb|Caption FBX Armatures Menu]] <br />
* Leave these values as shown. We need more information on this.<br />
{{clear}}<br />
<br />
===The Animation Menu===<br />
<br />
[[File:FBX Animation Menu.jpg|380px|left|thumb|Caption FBX Animation Menu]] <br />
* Leave these values as shown. We need more information on this.<br />
{{clear}}<br />
<br />
<br />
==Config.txt==<br />
<br />
Setting up the CONFIG.TXT<br />
(The config.txt WiKi page will probably be updated in the future to reflect changes required for FBX)<br />
<br />
The only changes to the config.txt are in the mesh table. The mesh entries for FBX files now have a "trainzmesh" extention as per the following example:<br />
<br />
mesh-table {<br />
default {<br />
auto-create 1<br />
mesh "my-mesh.trainzmesh"<br />
}<br />
}<br />
<br />
==Files Created==<br />
<br />
===Mesh Files===<br />
<br />
The file my-mesh.trainzmesh is created during the asset commit. Currently the FBX file is not deleted but bundled into the asset and made available if opened for edit. This may change.<br />
<br />
===Texture.txt Files===<br />
<br />
You can provide your own texture.txt files or let the commit process create them for you. The commit process will create suitable files, such as those required for normal maps, but you can provide your own if you have special requirements.<br />
<br />
<br />
==Materials==<br />
<br />
(This section may be moved to the Materials WiKi pages when the FBX importer is mature)<br />
<br />
Treatment of materials is unchanged and no changes to existing textures are required.<br />
<br />
===m.notex===<br />
<br />
Currently there may be a problem with mixing NOTEX materials and other materials in the same export. This is being investigated.<br />
<br />
===m.onetex===<br />
<br />
There are no special Blender settings for ONETEX materials. A sample ONETEX material and texture setting is shown below.<br />
<br />
(insert pics for onetex)<br />
<br />
===m.reflect===<br />
<br />
(TBD)<br />
<br />
===m.gloss===<br />
<br />
(TBD)<br />
<br />
===m.tbumptex===<br />
<br />
(TBD)<br />
<br />
===m.tbumpenv===<br />
<br />
(TBD)<br />
<br />
===m.tbumpgloss===<br />
<br />
(TBD)<br />
<br />
==Exportable Attributes and TANE==<br />
<br />
(table here)<br />
<br />
<br />
<br />
(to be continued)</div>Vvmmhttps://online.ts2009.com/mediaWiki/index.php/Class_CabinClass Cabin2016-02-14T19:30:53Z<p>Vvmm: /* UserKeyPress */</p>
<hr />
<div>*[[TrainzScript Language Reference|API Hierarchy]]<br />
**[[Class GSObject|GSObject]] *<br />
***[[Class GameObject|GameObject]]<br />
****[[Class TrainzGameObject|TrainzGameObject]]<br />
****[[Class PropertyObject|PropertyObject]] *<br />
*****[[Class MeshObject|MeshObject]]<br />
******Bogey<br />
<br />
<br><br />
*This class is the interface class used for cabins and interior assets in Trainz.<br />
*From the scripting perspective, a Cabin is mainly a collection of controls. <br />
*What controls the cabin has depends on the configuration of the asset. <br />
*If a cabin asset is to have custom scripted features, it's script class will need to be derived from this one. <br />
*The types of controls a cabin has is locomotive specific hence this class is the interface and not a cabin implementation.<br />
*The DefaultLocomotiveCabin and DefaultSteamCabin classes provide basic default Cabin implementations.<br />
<br><br />
<br />
===Attach===<br />
{{MethodHeader|public void Attach(GameObject owner)}}<br />
;Parameters<br />
*'''owner''' = GameObjet to which the cabin will be attached, normally a Locomotive.<br />
;Returned Value<br />
*None<br />
;Notes<br />
*A callback method used by the game engine when it is about to attach this cabin to an object.<br />
*A cabin is destroyed when it is no longer needed and re-created by Trainz later on if needed again.<br />
*This method is where you should restore any saved cabin control settings.<br />
*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()]])<br />
*The programmer will need to update and make use of cabin settings in their implementation of this method.<br />
<br><br />
<br />
===FireAddCoal===<br />
{{MethodHeader|public native bool FireAddCoal(void)}}<br />
;Parameters<br />
*None<br />
;Returned Value<br />
*True if coal is added successfully, false otherwise.<br />
;Syntax<br />
FireAddCoal();<br />
;Notes<br />
<br><br />
<br />
===GetControls===<br />
{{MethodHeader|public native CabinControl[ ] GetControls(void)}}<br />
;Parameters<br />
*None<br />
;Returned Value<br />
*An array of the CabinControl objects applicable to the cabin.<br />
;Syntax<br />
CabinControl[] controls = GetControls();<br />
;Notes<br />
<br><br />
<br />
===GetNamedControl===<br />
{{MethodHeader|public native CabinControl GetNamedControl(string name)}}<br />
;Parameters<br />
*'''name''' = Name of control to return.<br />
;Returned Value<br />
*A reference to the named control if it exists, null otherwise.<br />
;Syntax<br />
CabinControl control = GetNamedControl("brake");<br />
;Notes<br />
<br><br />
<br />
===GetParentObject===<br />
{{MethodHeader|public native GameObject GetParentObject(void)}}<br />
;Parameters<br />
*None<br />
;Returned Value<br />
*A reference to the parent GameObject to which the cabin is attached, usually a Locomotive.<br />
;Syntax<br />
Locomotive loco = cast<Locomotive>cabin.GetParentObject();<br />
;Notes<br />
<br><br />
<br />
===IsActive===<br />
{{MethodHeader|public native bool IsActive(void)}}<br />
;Parameters<br />
*None<br />
;Returned Value<br />
*True if the cabin is currently active, false otherwise.<br />
;Syntax<br />
bool cabinExists = cabin.IsActive();<br />
;Notes<br />
<br><br />
<br />
===SetCabLightIntensity===<br />
{{MethodHeader|public native void SetCabLightIntensity(float intensity)}}<br />
;Parameters<br />
*''intensity''' = A normalised lighting level in the range 0.0..1.0<br />
;Returned Value<br />
*None<br />
;Syntax<br />
SetCabLightIntensity(0.5);<br />
;Notes<br />
<br><br />
<br />
===Update===<br />
{{MethodHeader|public void Update(void)}}<br />
;Parameters<br />
*None<br />
;Returned Value<br />
*None<br />
;Notes<br />
*This is a callback method used by Trainz to update the cabin object.<br />
*This implementation is empty so the script programmer must implement it if they want their cabin's controls to be updated.<br />
*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.<br />
*This is mostly a case of querying the current status of the host locomotive and applying it to the matching control.<br />
*The speedometer in the cab for instance should be updated based on the loco's current velocity.<br />
<br><br />
<br />
===UserPressKey===<br />
{{MethodHeader|public void UserPressKey(string keyName)}}<br />
;Parameters<br />
*'''keyName''' = The name of the key pressed.<br />
;Returned Value<br />
*None<br />
;Notes<br />
*This is a callback method used by Trainz when the user presses a key.<br />
*The default Cabin implementation does not handle any keystrokes. You must do so in your own overridden implementation.<br />
<br><br />
<br />
===UserSetControl===<br />
{{MethodHeader|public void UserSetControl(CabinControl control, float value)}}<br />
;Parameters<br />
*'''control''' = The control that the user has operated.<br />
*'''value''' = The value to assign as a result of the user's action.<br />
;Returned Value<br />
*None<br />
;Notes<br />
*This is a callback method used by Trainz when the user presses a key.<br />
*You should override this method to apply the settings selected by the user.<br />
<br><br />
<br />
==Related Methods==<br />
<br><br />
<br />
==Categories==<br />
[[Category:Script Class]]</div>Vvmmhttps://online.ts2009.com/mediaWiki/index.php/Class_GameObjectClass GameObject2016-02-11T16:37:49Z<p>Vvmm: Updated PlaySound example.</p>
<hr />
<div>*[[TrainzScript Language Reference|API Hierarchy]]<br />
**[[Class GSObject|GSObject]]<br />
***GameObject<br />
<br><br />
<br />
*GameObject is the base class for any object that requires messaging and threading support. <br />
*GameObjects are placed in the game's object table, known as the Router. <br />
*You cannot create a GameObject using ''new()'' from a script, all game objects are created by the game. <br />
*Each game object has a unique ID (see [[#GetId|GetId()]]) and many also have a name. <br />
*GameObject instances are often referred to as a ''node'' because they represent a message node in the Router. <br />
<br />
<br />
==AddHandler==<br />
{{MethodHeader|public native void AddHandler(GameObject target, string major, string minor, string Handler)}}<br />
;Parameters<br />
*'''target''' = Object to add the message handler to. This is usually ''me'' but can be any ''GameObject''.<br />
*'''major''' = Message ''major'' to listen for.<br />
*'''minor''' = Message ''minor'' to listen for. If this paremeter is null or an empty string then all messages that match the ''major'' parameter will be sent to the handler.<br />
*'''Handler''' Name of the message handler method to call. This must have a prototype in of the form ''void MessageHandler(Message msg)''<br />
;Returned Value<br />
*None<br />
;Syntax<br />
AddHandler(me,"Object","Enter","ObjectHandler");<br />
AddHandler(me,"Object","","ObjectHandler");<br />
;Notes<br />
*Adds a message handler to the current class such that it will be called whenever the target GameObject receives a matching message.<br />
*Message handlers called by this means are not threaded and will be executed immediately.<br />
<br><br />
<br />
==ClearMessages==<br />
{{MethodHeader|public native void ClearMessages(string major, string minor)}}<br />
;Parameters<br />
*'''major''' = Message ''major'' to listen for.<br />
*'''minor''' = Message ''minor'' to listen for.<br />
;Returned Value<br />
*None<br />
;Syntax<br />
ClearMessages("Object","Enter");<br />
;Notes<br />
*Clears any outstanding messages of the specified major and minor types that have been sent via calls to [[#PostMessage|PostMessage()]] and have not yet been processed.<br />
<br><br />
<br />
==Exception==<br />
{{MethodHeader|public native void Exception(string reason)}}<br />
;Parameters<br />
*'''reason''' = Explanatory text to add to the message box.<br />
;Returned Value<br />
*None<br />
;Syntax<br />
Exception("Fatal Error");<br />
;Notes<br />
*Raises an Exception on the current thread and prints out the contents of the ''reason'' parameter followed by a stack dump.<br />
<br><br />
<br />
==GetId==<br />
{{MethodHeader|public native int GetId(void)}}<br />
;Parameters<br />
*None<br />
;Returned Value<br />
*The GameObject ID, an integer value which the Router uses to identify the current object.<br />
;Syntax<br />
int ID = GetId();<br />
;Notes<br />
*The ID is unique to the current session.<br />
<br><br />
<br />
==GetName==<br />
{{MethodHeader|public native string GetName(void)'''}}<br />
;Parameters<br />
*None<br />
;Returned Value<br />
*The name of the current object if it has one, an empty string otherwise.<br />
;Syntax<br />
string MyName = GetName();<br />
;Notes<br />
*The name returned is the text string that is shown at the top of the property object browser for the object concerned.<br />
*If the name has been assigned by the game this will be the asset's username followed by a serial number.<br />
*The string returned by this method is not guaranteed to be unique although TRS will issue prompts requesting confirmation in situations where duplication of names is about to occur.<br />
*The name persists from session to session.<br />
<br><br />
<br />
==PostMessage==<br />
{{MethodHeader|public native void PostMessage(GameObject dest, string major, string minor, float seconds)}}<br />
;Parameters<br />
*'''dest''' = Destination object for the message. If this is null the message will be broadcast.<br />
*'''major''' = Message ''major'' to be sent. <br />
*'''minor''' = Message ''minor'' to be sent.<br />
*'''seconds''' = Delay in seconds before the message is posted. If this is zero the message will be posted immediately.<br />
;Returned Value<br />
*None<br />
;Syntax<br />
PostMessage(me,"Timer","Tick",10.0); <br />
PostMessage(null,"Browser-URL","live://next",0.0);<br />
;Notes<br />
*Messages sent via this method are processed by the Router in the next game update after they become due.<br />
<br><br />
<br />
==SendMessage==<br />
{{MethodHeader|public native void SendMessage(GameObject dest, string major, string minor)}}<br />
;Parameters<br />
*'''dest''' = Destination object for the message. If this is null the message will be broadcast.<br />
*'''major''' = Message ''major'' to be sent. <br />
*'''minor''' = Message ''minor'' to be sent.<br />
;Returned Value<br />
*None<br />
;Syntax<br />
SendMessage(train,"Object","Enter");<br />
;Notes<br />
*Sends a message to the destination object for immediate processing.<br />
<br><br />
<br />
==Sleep==<br />
{{MethodHeader|public native void Sleep(float seconds)}}<br />
;Parameters<br />
*'''seconds''' = Time to wait in seconds.<br />
;Returned Value<br />
*None<br />
;Syntax<br />
Sleep(10.0);<br />
;Notes<br />
*Causes the current thread to pause for the specified period of time.<br />
*Warning! Cannot be used anymore as Sleep(World.PlaySound(...)) as PlaySound does not return the file duration anymore!<br />
<br><br />
<br />
==Sniff==<br />
{{MethodHeader|public native void Sniff(GameObject target, string major, string minor, bool state)}}<br />
;Parameters<br />
*'''target''' = Game Object to which the handler will be attached.<br />
*'''major''' = Message ''major'' to listen for.<br />
*'''minor''' = Message ''minor'' to listen for. If this parameter is null or an empty string then all messages matching the ''major'' parameter will be processed.<br />
*'''state''' = Boolean flag to set whether or not the handler is currently active.<br />
;Returned Value<br />
*None<br />
;Syntax<br />
Sniff(train,"Object","Enter",true);<br />
;Notes<br />
*Attaches a message handler to another object allowing the current script to listen in on the specified messages.<br />
*Messages of the specified type received by the target object will be copied to the current script.<br />
*The current script will usually need a separate handler to process these messages and will normally need to check the identity of the message source.<br />
<br><br />
<br />
==Code Examples==<br />
Script calls made during the Init() method of an object can never be certain that other objects within the map have already been initialised. In cases where initialisation depends on the existence of other objects [[#PostMessage|PostMessage()]] can be used to delay part or all of the startup. Messages sent in this way are never processed until the next game update and this does not occur until all objects have been initialised.<br />
public void Init(void)<br />
{<br />
inherited();<br />
SetupTasks();<br />
AddHandler(me,"Setup","","SetupHandler");<br />
PostMessage(me,"Setup","",0.0);<br />
}<br />
<br />
void SetupHandler(Message msg)<br />
{<br />
if (msg.src == me)<br />
{<br />
MoreSetupTasks();<br />
}<br />
}<br />
<br><br />
<br />
==Related Methods==<br />
[[Class Router#GetGameObject|Router.GetGameObject()]]<br><br />
[[Class Router#PostMessage|Router.PostMessage()]]<br><br />
[[TrainzScript Message Reference]]<br><br />
<br />
==Categories==<br />
[[Category:Script Class]]</div>Vvmmhttps://online.ts2009.com/mediaWiki/index.php/%22Extensions%22_container"Extensions" container2016-01-31T18:09:13Z<p>Vvmm: /* "Extensions" container Example */</p>
<hr />
<div>The [["Extensions" container]] is a top-level [[config.txt file]] entry available to any Asset which derives from [[KIND TrainzBaseSpec]] (in short, all Assets.) This container is intended to allow third-party developers to introduce custom Asset-keyed data which may be processed by custom scripts.<br />
<br />
The extensions container is a list of custom tags or subcontainers with a specific naming convention.<br />
<br />
==Supported Tags==<br />
<br />
The naming of top-level tags within the [["Extensions" container]] is important. Tag names should be meaningful and must end with a hyphen followed by the [[KUID#User_ID_Number|User ID]] of the content creator who is introducing the extension. This content creator is solely responsible for determining any rules and restrictions which apply to the tag or subcontainer, and should ideally make an effort to provide this information to other creators via this wiki. While content creators are permitted to make use of each other's extension formats, it is not permissible for a creator to introduce a new extension (or change the meaning of an extension) which exists in a namespace belonging to another content creator.<br />
<br />
Each tag in the extensions container may be either a single value, or a subcontainer. If a subcontainer is used, the contents of the subcontainer should be specified in the extension documentation. No restrictions are placed by N3V on the values within a specific extension.<br />
<br />
==Validation==<br />
<br />
At the current time, the contents of the [["Extensions" container]] is not validated. It is expected that future versions of Trainz and the [[Download Station]] will perform validation of the extensions container according to the rules described on this page. Furthermore, it is feasible that N3V will formally adopt specific extensions which have entered common use. In this scenario, N3V may choose to introduce asset validation to the extension creator's formal specification or, where such specification is not available, to a formal specification written by N3V derived from the common usage.<br />
<br />
==Extension Documentation==<br />
<br />
If you are a third-party content creator who has created a custom extensions according to these specifications, please document your extension on this wiki and link to your extension page here:<br />
<br />
* Add your entry here.<br />
<br />
=="Extensions" container Example==<br />
<br />
extensions<br />
{<br />
delayinterval-474195 0.1<br />
signaltype-474195 "DTV"<br />
}<br />
<br />
[[Category:Config Container|E]]</div>Vvmmhttps://online.ts2009.com/mediaWiki/index.php/%22season-selector%22_container"season-selector" container2016-01-31T17:14:14Z<p>Vvmm: /* "Season-selector" Example */</p>
<hr />
<div>The [["Season-selector" container]] is a top-level container is some assets' [[config.txt file]] which allows the simulator to display an appropriate visual for each asset instance based on certain environmental parameters. The container does not specify anything about the visuals directly, but rather provides logic which maps the varied environmental parameters down to a single "season index" which is then used in other parts of the asset's [[config.txt file]].<br />
<br />
The [["Season-selector" container]] is a recursive structure- meaning that the container may contain one or more of itself as sub-containers.<br />
<br />
==Supported Tags==<br />
The [["Season-selector" container]] supports the following tags. Each tag is show here with its default value.<br />
<br />
output-season<br />
season-range 0.0, 1.0<br />
above-snow-line 0<br />
branch-true<br />
branch-false<br />
<br />
====output-season====<br />
:Type: Integer<br />
:Desc: The season index used for this asset if the decision logic reaches this [sub-]container. If specified, this should be the only tag in this "Season-selector" [sub-]container.<br />
<br />
====season-range====<br />
:Type: vector2<br />
:Desc: A conditional tag which tests whether the global time-of-year value falls within the specified range. If the first number is less than the second, the condition is evaluated by (first-value <= time-of-year <= second-value.) If the second number is less than the first, the condition is evaluated by (time-of-year <= second-value || time-of-year >= first-value.) The global time-of-year value varies from 0.0 to 1.0 throughout the year, where 0 is start of summer and 0.5 is start of winter.<br />
<br />
====above-snow-line====<br />
:Type: boolean<br />
:Desc: A conditional tag which tests whether the asset instance is above the snow-line. If set to a true value (eg. 1) then asset instances will evaluate this condition as (asset-height >= snow-line-height.) If set to a false value (eg. 0) then no test is performed.<br />
<br />
====branch-true====<br />
:Type: [["Season-selector" container]]<br />
:Desc: If all of the conditional tags in this [sub-]container evaluate to true, this child branch is evaluated to determine the output-season for a specified asset instance.<br />
<br />
====branch-false====<br />
:Type: [["Season-selector" container]]<br />
:Desc: If one or more of the conditional tags in this [sub-]container evaluate to false, this child branch is evaluated to determine the output-season for a specified asset instance.<br />
<br />
<br />
=="Season-selector" Example==<br />
<br />
The season-selector for selecting winter would look like this in the top-level of your config file (1 means winter, 0 the other three):<br />
<br />
season-selector<br />
{<br />
season-range 0.503,0.741<br />
<br />
branch-true<br />
{<br />
output-season 1<br />
}<br />
<br />
branch-false<br />
{<br />
output-season 0<br />
}<br />
}<br />
<br />
If you apply it to a mesh (scenery), the mesh table would be:<br />
<br />
mesh-table<br />
{<br />
default<br />
{<br />
mesh "default/mesh.im"<br />
auto-create 1<br />
mesh-season 0<br />
}<br />
<br />
winter<br />
{<br />
mesh "winter/mesh.im"<br />
auto-create 1<br />
mesh-season 1<br />
}<br />
}<br />
<br />
If you apply it to a groundtexture, add a texture-variants container:<br />
<br />
texture-variants<br />
{<br />
0<br />
{<br />
diffuse-texture "default.texture"<br />
}<br />
<br />
1<br />
{<br />
diffuse-texture "winter.texture"<br />
}<br />
}<br />
<br />
==See Also==<br />
* [["Texture-variants" container]]<br />
* [["mesh-table" container#mesh-season|'mesh-season' tag in the "mesh-table" container]]<br />
* [["track-lod-tree" container|'lod-season-index' tag in the "track-lod-tree" container]]<br />
<br />
<br />
[[Category:Config Container|S]]</div>Vvmmhttps://online.ts2009.com/mediaWiki/index.php/%22season-selector%22_container"season-selector" container2016-01-31T17:13:33Z<p>Vvmm: Simplified season-selector</p>
<hr />
<div>The [["Season-selector" container]] is a top-level container is some assets' [[config.txt file]] which allows the simulator to display an appropriate visual for each asset instance based on certain environmental parameters. The container does not specify anything about the visuals directly, but rather provides logic which maps the varied environmental parameters down to a single "season index" which is then used in other parts of the asset's [[config.txt file]].<br />
<br />
The [["Season-selector" container]] is a recursive structure- meaning that the container may contain one or more of itself as sub-containers.<br />
<br />
==Supported Tags==<br />
The [["Season-selector" container]] supports the following tags. Each tag is show here with its default value.<br />
<br />
output-season<br />
season-range 0.0, 1.0<br />
above-snow-line 0<br />
branch-true<br />
branch-false<br />
<br />
====output-season====<br />
:Type: Integer<br />
:Desc: The season index used for this asset if the decision logic reaches this [sub-]container. If specified, this should be the only tag in this "Season-selector" [sub-]container.<br />
<br />
====season-range====<br />
:Type: vector2<br />
:Desc: A conditional tag which tests whether the global time-of-year value falls within the specified range. If the first number is less than the second, the condition is evaluated by (first-value <= time-of-year <= second-value.) If the second number is less than the first, the condition is evaluated by (time-of-year <= second-value || time-of-year >= first-value.) The global time-of-year value varies from 0.0 to 1.0 throughout the year, where 0 is start of summer and 0.5 is start of winter.<br />
<br />
====above-snow-line====<br />
:Type: boolean<br />
:Desc: A conditional tag which tests whether the asset instance is above the snow-line. If set to a true value (eg. 1) then asset instances will evaluate this condition as (asset-height >= snow-line-height.) If set to a false value (eg. 0) then no test is performed.<br />
<br />
====branch-true====<br />
:Type: [["Season-selector" container]]<br />
:Desc: If all of the conditional tags in this [sub-]container evaluate to true, this child branch is evaluated to determine the output-season for a specified asset instance.<br />
<br />
====branch-false====<br />
:Type: [["Season-selector" container]]<br />
:Desc: If one or more of the conditional tags in this [sub-]container evaluate to false, this child branch is evaluated to determine the output-season for a specified asset instance.<br />
<br />
<br />
=="Season-selector" Example==<br />
<br />
The season-selector for selecting winter would look like this in the top-level of your config file (1 means winter, 0 the other three):<br />
<br />
season-selector<br />
{<br />
season-range 0.586,0.741<br />
<br />
branch-true<br />
{<br />
output-season 1<br />
}<br />
<br />
branch-false<br />
{<br />
output-season 0<br />
}<br />
}<br />
<br />
If you apply it to a mesh (scenery), the mesh table would be:<br />
<br />
mesh-table<br />
{<br />
default<br />
{<br />
mesh "default/mesh.im"<br />
auto-create 1<br />
mesh-season 0<br />
}<br />
<br />
winter<br />
{<br />
mesh "winter/mesh.im"<br />
auto-create 1<br />
mesh-season 1<br />
}<br />
}<br />
<br />
If you apply it to a groundtexture, add a texture-variants container:<br />
<br />
texture-variants<br />
{<br />
0<br />
{<br />
diffuse-texture "default.texture"<br />
}<br />
<br />
1<br />
{<br />
diffuse-texture "winter.texture"<br />
}<br />
}<br />
<br />
==See Also==<br />
* [["Texture-variants" container]]<br />
* [["mesh-table" container#mesh-season|'mesh-season' tag in the "mesh-table" container]]<br />
* [["track-lod-tree" container|'lod-season-index' tag in the "track-lod-tree" container]]<br />
<br />
<br />
[[Category:Config Container|S]]</div>Vvmmhttps://online.ts2009.com/mediaWiki/index.php/%22season-selector%22_container"season-selector" container2016-01-31T16:45:29Z<p>Vvmm: Corrected 0-1 sumer-winter period</p>
<hr />
<div>The [["Season-selector" container]] is a top-level container is some assets' [[config.txt file]] which allows the simulator to display an appropriate visual for each asset instance based on certain environmental parameters. The container does not specify anything about the visuals directly, but rather provides logic which maps the varied environmental parameters down to a single "season index" which is then used in other parts of the asset's [[config.txt file]].<br />
<br />
The [["Season-selector" container]] is a recursive structure- meaning that the container may contain one or more of itself as sub-containers.<br />
<br />
==Supported Tags==<br />
The [["Season-selector" container]] supports the following tags. Each tag is show here with its default value.<br />
<br />
output-season<br />
season-range 0.0, 1.0<br />
above-snow-line 0<br />
branch-true<br />
branch-false<br />
<br />
====output-season====<br />
:Type: Integer<br />
:Desc: The season index used for this asset if the decision logic reaches this [sub-]container. If specified, this should be the only tag in this "Season-selector" [sub-]container.<br />
<br />
====season-range====<br />
:Type: vector2<br />
:Desc: A conditional tag which tests whether the global time-of-year value falls within the specified range. If the first number is less than the second, the condition is evaluated by (first-value <= time-of-year <= second-value.) If the second number is less than the first, the condition is evaluated by (time-of-year <= second-value || time-of-year >= first-value.) The global time-of-year value varies from 0.0 to 1.0 throughout the year, where 0 = mid-summer, 0.5 = mid-winter.<br />
<br />
====above-snow-line====<br />
:Type: boolean<br />
:Desc: A conditional tag which tests whether the asset instance is above the snow-line. If set to a true value (eg. 1) then asset instances will evaluate this condition as (asset-height >= snow-line-height.) If set to a false value (eg. 0) then no test is performed.<br />
<br />
====branch-true====<br />
:Type: [["Season-selector" container]]<br />
:Desc: If all of the conditional tags in this [sub-]container evaluate to true, this child branch is evaluated to determine the output-season for a specified asset instance.<br />
<br />
====branch-false====<br />
:Type: [["Season-selector" container]]<br />
:Desc: If one or more of the conditional tags in this [sub-]container evaluate to false, this child branch is evaluated to determine the output-season for a specified asset instance.<br />
<br />
<br />
=="Season-selector" Example==<br />
<br />
The season-selector for selecting winter would look like this in the top-level of your config file (1 means winter, 0 the other three):<br />
<br />
season-selector<br />
{<br />
season-range 0.25,0.75<br />
<br />
branch-true<br />
{<br />
season-range 0.25,0.5<br />
<br />
branch-true<br />
{<br />
output-season 0<br />
}<br />
<br />
branch-false<br />
{<br />
output-season 1<br />
}<br />
}<br />
<br />
branch-false<br />
{<br />
output-season 0<br />
}<br />
}<br />
<br />
If you apply it to a mesh (scenery), the mesh table would be:<br />
<br />
mesh-table<br />
{<br />
default<br />
{<br />
mesh "default/mesh.im"<br />
auto-create 1<br />
mesh-season 0<br />
}<br />
<br />
winter<br />
{<br />
mesh "winter/mesh.im"<br />
auto-create 1<br />
mesh-season 1<br />
}<br />
}<br />
<br />
If you apply it to a groundtexture, add a texture-variants container:<br />
<br />
texture-variants<br />
{<br />
0<br />
{<br />
diffuse-texture "default.texture"<br />
}<br />
<br />
1<br />
{<br />
diffuse-texture "winter.texture"<br />
}<br />
}<br />
<br />
==See Also==<br />
* [["Texture-variants" container]]<br />
* [["mesh-table" container#mesh-season|'mesh-season' tag in the "mesh-table" container]]<br />
* [["track-lod-tree" container|'lod-season-index' tag in the "track-lod-tree" container]]<br />
<br />
<br />
[[Category:Config Container|S]]</div>Vvmmhttps://online.ts2009.com/mediaWiki/index.php/%22trainz-build%22_number"trainz-build" number2016-01-21T12:17:18Z<p>Vvmm: Added TANE SP1</p>
<hr />
<div>New releases of Trainz bring new features and improved content validation techniques. This will happen for major product editions (eg. [[TS2010]], [[TS12]] and [[TANE]]) but may also occur during the larger service packs which are released for each product. The [["Trainz-build" number]] is used to differentiate these compatibility versions, and the corresponding [["Trainz-build" tag]] is used in each asset's [[Config.txt file]] to specify the minimum Trainz version required in order to use the asset.<br />
<br />
<br />
{| border=2 cellpadding=5 cellspacing=2 <br />
|-<br />
! colspan=2|Trainz-Build version numbers and their mapping to official Trainz release versions are as follows: <br />
|-<br />
!'trainz-build' || Trainz product for which the asset was designed<br />
|-<br />
| {{center|1.3 }} || [[Trainz SP3|Trainz SP3]]<br />
|-<br />
| {{center|1.5 }} || Ultimate Trainz Collection<br />
|-<br />
| {{center|1.6 }} || Ultimate Trainz Collection SP1<br />
|-<br />
| {{center|2.0 }} || [[TRS2004]]<br />
|-<br />
| {{center|2.1 }} || [[TRS2004]] SP1<br />
|-<br />
| {{center|2.2 }} || [[TRS2004]] SP2 - Passenger Pack<br />
|-<br />
| {{center|2.3 }} || [[TRS2004]] SP3<br />
|-<br />
| {{center|2.4 }} || [[TRS2004]] SP4<br />
|-<br />
| {{center|2.5 }} || [[TRS2006]]<br />
|-<br />
| {{center|2.6 }} || [[TRS2006]] SP1<br />
|-<br />
| {{center|2.7 }} || Trainz Classics 1&2<br />
|-<br />
| {{center|2.8 }} || Trainz Classics 3<br />
|-<br />
| {{center|2.9 }} || [[TS2009]]<br />
|-<br />
| {{center|3.0 }} || [[TS2009 SP1]]<br />
|-<br />
| {{center|3.1 }} || [[TS2009 SP2]] / [[TS2009 SP3]]<br />
|-<br />
| {{center|3.2 }} || [[TS2010]] / [[TS2010 SP1]]<br />
|-<br />
| {{center|3.3 }} || [[TS2010 SP2]] / [[TS2010 SP3]] / [[TS2009 SP4]]<br />
|-<br />
| {{center|3.4 }} || [[TS2010 SP4]]<br />
|-<br />
| {{center|3.5 }} || [[TS12]]<br />
|-<br />
| {{center|3.6 }} || [[TS12]] and [[Trainz Simulator Mac]]<br />
|-<br />
| {{center|3.7 }} || [[TS12 SP1]]<br />
|-<br />
| {{center|3.8 }} || [[Trainz Simulator 2]] (Mac)<br />
|-<br />
| {{center|3.9 }} || [[Trainz A New Era: Community Edition]] 1.0<br />
|-<br />
| {{center|4.0 }} || [[Trainz A New Era: Community Edition]] 1.1<br />
|-<br />
| {{center|4.1 }} || [[Trainz A New Era: Community Edition]] 1.2<br />
|-<br />
| {{center|4.2 }} || [[Trainz A New Era]]<br />
|-<br />
| {{center|4.3 }} || [[Trainz A New Era]] SP1<br />
|}<br />
<br />
<br />
<br />
==Obsolete Versions==<br />
<br />
The [[Trainz Life-Cycle Policy]] defines which product releases have active support from [[N3V Games]]. While users may continue to use older products, including downloading such older content from the [[Download Station]] and even creating new content for these older versions, it is typically not possible to upload content with an unsupported [["Trainz-build" number]] to the [[Download Station]]. This ensures that older content-creation techniques are slowly phased out over time in favour of the more recent improvements.</div>Vvmmhttps://online.ts2009.com/mediaWiki/index.php/%22Trainz-build%22_tag"Trainz-build" tag2015-04-11T08:55:38Z<p>Vvmm: </p>
<hr />
<div>{{ORP-top}}<br />
==Trainz-build tag number==<br />
The '''Trainz-build tag''' number indicates the minimum '''[[Trainz build versions|Trainz Code Version]]''' required to use the asset. Trainz will not attempt to load an asset which has a trainz-build tag that is newer than it's own version number, but unfortunately ContentManager will continue to report there are updates, even when they are entirely inappropriate. <br />
<br />
This tag is also an indication of the age of the asset, and the general technical configuration and standards to which it is built. The values will range up from the oldest [[Trainz 1.0]] release (2001) with three {{wp|service pack|Service Packs}} making the version commonly referred to as Trainz V-1.3, or Trainz 1.3. Assets with old Trainz-build numbers are not built to take advantage of new Trainz features that did not exist in the version of Trainz that the asset was built for, and the oldest used approaches which have been entirely abandoned. Newer Trainz releases do their best to translate these older technologies into the newer releases standards (data organization and graphical tech) but some small percentage of assets cannot be converted. <br />
&nbsp;<br />
{{UserTip|The word ''version'' is used in Trainz to refer to three different concepts. There is the '''Trainz Retail Version''', the '''Trainz Version''' and the '''Trainz Build Number'''.<br />
The '''Trainz Retail Version''' is a text string for a product release, such as ''Trainz Simulator 2009''.<br />
The '''Trainz version''' is a numeric code (e.g ''2.4'' or ''3.6'') which is incremented for each major release. This code is updated whenever a significant change to Trainz is made. Most service packs (which introduce significant functionality changes) will have a new ''Trainz Version'', but hotfixes (which do not introduce significant functionality changes) do not see a ''Trainz version'' number change. Different language versions of the same product will also generally share the same ''Trainz Version''.<br />
The '''Trainz Build Number''' is a unique number (e.g. ''44653'' or ''58414'') that identifies an individual Trainz release. All releases (including minor changes and language translations) have a different ''Trainz Build Number''.<br />
The '''Trainz-build''' tag uses the ''Trainz Version'' numeric code.<br />
}} <br />
&nbsp; <br />
[[file:CM will input Versions too advanced-TS10-SP2 shown.JPG|thumb|400px|'''TS10 SP2's Content Manager (V-3.2)''' happily imported TS12 version (V-3.4) texture cdp's for TransDEM.exe in November 2013. Other legacy versions of Trainz will also import 'Version unidentified' trainz content.<br> <br />
<br />
* '''For the new Trainz users:'''' the moral of this story is to examine trainz-build tags (versions) ASAP after importing new content into CM and provide human intelligence as to whether to delete, keep the asset, or set it aside; seek advice before trying to use, or risk breaking Trainz for while.<br> <br />
* Some content can be retrograded to work in earlier Trainz releases. More recently published Routes and Sessions cannot. ]]<br />
<br />
{| border=2 cellpadding=5 cellspacing=2 <br />
|-<br />
! colspan=2|Trainz-Build version numbers and their mapping to official Trainz release versions are as follows: <br />
|-<br />
!'trainz-build' || Trainz product for which the asset was designed<br />
|-<br />
| {{center|1.3 }} || [[Trainz SP3|Trainz SP3]]<br />
|-<br />
| {{center|1.5 }} || Ultimate Trainz Collection<br />
|-<br />
| {{center|1.6 }} || Ultimate Trainz Collection SP1<br />
|-<br />
| {{center|2.0 }} || [[TRS2004]]<br />
|-<br />
| {{center|2.1 }} || [[TRS2004]] SP1<br />
|-<br />
| {{center|2.2 }} || [[TRS2004]] SP2 - Passenger Pack<br />
|-<br />
| {{center|2.3 }} || [[TRS2004]] SP3<br />
|-<br />
| {{center|2.4 }} || [[TRS2004]] SP4<br />
|-<br />
| {{center|2.5 }} || [[TRS2006]]<br />
|-<br />
| {{center|2.6 }} || [[TRS2006]] SP1<br />
|-<br />
| {{center|2.7 }} || Trainz Classics 1&2<br />
|-<br />
| {{center|2.8 }} || Trainz Classics 3<br />
|-<br />
| {{center|2.9 }} || [[TS2009]]<br />
|-<br />
| {{center|3.0 }} || [[TS2009 SP1]]<br />
|-<br />
| {{center|3.1 }} || [[TS2009 SP2]] / [[TS2009 SP3]]<br />
|-<br />
| {{center|3.2 }} || [[TS2010]] / [[TS2010 SP1]]<br />
|-<br />
| {{center|3.3 }} || [[TS2010 SP2]] / [[TS2010 SP3]] / [[TS2009 SP4]]<br />
|-<br />
| {{center|3.4 }} || [[TS2010 SP4]]<br />
|-<br />
| {{center|3.5 }} || [[TS12]]<br />
|-<br />
| {{center|3.6 }} || [[TS12]] and [[Trainz Simulator Mac]]<br />
|-<br />
| {{center|3.7 }} || [[TS12 SP1]]<br />
|-<br />
| {{center|3.8 }} || [[Trainz Simulator 2]] (Mac)<br />
|-<br />
| {{center|3.9 }} || [[Trainz A New Era: Community Edition]] 1.0<br />
|-<br />
| {{center|4.0 }} || [[Trainz A New Era: Community Edition]] 1.1<br />
|-<br />
| {{center|4.1 }} || [[Trainz A New Era]]<br />
|}<br />
<br />
==Asset compatibility==<br />
It is important for an asset to list the correct Trainz-build in the [[config.txt file]]. It specifies the version of Trainz the asset was intended to be used with. An earlier version of Trainz will refuse to load the asset. A later version of Trainz will enable appropriate backwards compatibility workarounds (e.g. using different validation requirements) as required.<br />
&nbsp;<br />
<br />
A correctly-constructed asset built for an older version will usually function in a newer version of Trainz. However, Trainz content validation is improved over time, and newer versions of Trainz detect errors that older versions did not pick up on. Some content may be detected as 'faulty' in a current Trainz version that was missed in the version it was originally created for.<br />
&nbsp;<br />
<br />
It should be noted that content that is uploaded to the [[Download Station]] is validated by the most recent version of Trainz, using the validation compatibility for the trainz-build specified by the asset.<br />
&nbsp;<br />
<br />
If [[Content Creator Plus]] is used to modify an asset, it will automatically update the trainz-build version in the config.txt file to the current Trainz version. If this version has changed significantly, other changes to the config.txt file will probably be required.<br />
Assets which are manually edited will need the appropriate version entered. If the line is omitted entirely, the lowest possible version is assumed. This is currently ''Trainz-build 1.3''.<br />
&nbsp;<br />
<br />
==Obsolete Versions==<br />
<br />
Trainz build numbers up to and including 3.4 are considered obsolete as of September 2014 and can no longer be uploaded to the [[Download Station]]. See the [[Trainz Life-Cycle Policy]] for additional details.<br />
<br />
{{TBKR|trainz-build tag}}<br />
[[Category:Config Tag|trainz-build tag]]<br />
[[Category:Trainz fundamentals pages|trainz-build tag]]<br />
{{ORP-bot|trainz-build tag}}</div>Vvmmhttps://online.ts2009.com/mediaWiki/index.php/User:VvmmUser:Vvmm2015-02-03T14:47:37Z<p>Vvmm: /* Downloads */</p>
<hr />
<div>==About me==<br />
Hi!<br />
<br />
I'm from [http://en.wikipedia.org/wiki/Romania România].<br />
<br />
I'm interested in trains, Trainz, programming, computers, networks, electronics and music.<br />
<br />
I'm part of the DLS cleanup team to prepare for Tranz: A New Era.<br />
<br />
I'm trying to create new content, tutorials, contribute to the Trainz Wiki and also organize the Romanian Trainz Community.<br />
<br />
<br />
==Downloads==<br />
<br />
My Website: [http://vvmm.freeforums.org/ http://vvmm.freeforums.org/] (in română, use [http://translate.google.ro/translate?sl=ro&tl=en&prev=_t&hl=en&ie=UTF-8&eotf=1&u=vvmm.freeforums.org Google Translate for English])</div>Vvmmhttps://online.ts2009.com/mediaWiki/index.php/User:VvmmUser:Vvmm2015-02-03T14:47:19Z<p>Vvmm: /* Downloads */</p>
<hr />
<div>==About me==<br />
Hi!<br />
<br />
I'm from [http://en.wikipedia.org/wiki/Romania România].<br />
<br />
I'm interested in trains, Trainz, programming, computers, networks, electronics and music.<br />
<br />
I'm part of the DLS cleanup team to prepare for Tranz: A New Era.<br />
<br />
I'm trying to create new content, tutorials, contribute to the Trainz Wiki and also organize the Romanian Trainz Community.<br />
<br />
<br />
==Downloads==<br />
<br />
My Website: [http://vvmm.freeforums.org/ http://vvmm.freeforums.org/] (in română, use [http://translate.google.ro/translate?sl=ro&tl=en&prev=_t&hl=en&ie=UTF-8&eotf=1&u=vvmm.zapto.org Google Translate for English])</div>Vvmmhttps://online.ts2009.com/mediaWiki/index.php/Trainz_A_New_Era:_Community_EditionTrainz A New Era: Community Edition2015-01-27T08:42:43Z<p>Vvmm: Redirect to TANE CE</p>
<hr />
<div>#REDIRECT [[TANE CE]]</div>Vvmmhttps://online.ts2009.com/mediaWiki/index.php/%22Trainz-build%22_tag"Trainz-build" tag2015-01-27T08:42:04Z<p>Vvmm: /* Trainz-build tag number */</p>
<hr />
<div>{{ORP-top}}<br />
==Trainz-build tag number==<br />
The '''Trainz-build tag''' number indicates the minimum '''[[Trainz build versions|Trainz Code Version]]''' required to use the asset. Trainz will not attempt to load an asset which has a trainz-build tag that is newer than it's own version number, but unfortunately ContentManager will continue to report there are updates, even when they are entirely inappropriate. <br />
<br />
This tag is also an indication of the age of the asset, and the general technical configuration and standards to which it is built. The values will range up from the oldest [[Trainz 1.0]] release (2001) with three {{wp|service pack|Service Packs}} making the version commonly referred to as Trainz V-1.3, or Trainz 1.3. Assets with old Trainz-build numbers are not built to take advantage of new Trainz features that did not exist in the version of Trainz that the asset was built for, and the oldest used approaches which have been entirely abandoned. Newer Trainz releases do their best to translate these older technologies into the newer releases standards (data organization and graphical tech) but some small percentage of assets cannot be converted. <br />
&nbsp;<br />
{{UserTip|The word ''version'' is used in Trainz to refer to three different concepts. There is the '''Trainz Retail Version''', the '''Trainz Version''' and the '''Trainz Build Number'''.<br />
The '''Trainz Retail Version''' is a text string for a product release, such as ''Trainz Simulator 2009''.<br />
The '''Trainz version''' is a numeric code (e.g ''2.4'' or ''3.6'') which is incremented for each major release. This code is updated whenever a significant change to Trainz is made. Most service packs (which introduce significant functionality changes) will have a new ''Trainz Version'', but hotfixes (which do not introduce significant functionality changes) do not see a ''Trainz version'' number change. Different language versions of the same product will also generally share the same ''Trainz Version''.<br />
The '''Trainz Build Number''' is a unique number (e.g. ''44653'' or ''58414'') that identifies an individual Trainz release. All releases (including minor changes and language translations) have a different ''Trainz Build Number''.<br />
The '''Trainz-build''' tag uses the ''Trainz Version'' numeric code.<br />
}} <br />
&nbsp; <br />
[[file:CM will input Versions too advanced-TS10-SP2 shown.JPG|thumb|400px|'''TS10 SP2's Content Manager (V-3.2)''' happily imported TS12 version (V-3.4) texture cdp's for TransDEM.exe in November 2013. Other legacy versions of Trainz will also import 'Version unidentified' trainz content.<br> <br />
<br />
* '''For the new Trainz users:'''' the moral of this story is to examine trainz-build tags (versions) ASAP after importing new content into CM and provide human intelligence as to whether to delete, keep the asset, or set it aside; seek advice before trying to use, or risk breaking Trainz for while.<br> <br />
* Some content can be retrograded to work in earlier Trainz releases. More recently published Routes and Sessions cannot. ]]<br />
<br />
{| border=2 cellpadding=5 cellspacing=2 <br />
|-<br />
! colspan=2|Trainz-Build version numbers and their mapping to official Trainz release versions are as follows: <br />
|-<br />
!'trainz-build' || Trainz product for which the asset was designed<br />
|-<br />
| {{center|1.3 }} || [[Trainz SP3|Trainz SP3]]<br />
|-<br />
| {{center|1.5 }} || Ultimate Trainz Collection<br />
|-<br />
| {{center|1.6 }} || Ultimate Trainz Collection SP1<br />
|-<br />
| {{center|2.0 }} || [[TRS2004]]<br />
|-<br />
| {{center|2.1 }} || [[TRS2004]] SP1<br />
|-<br />
| {{center|2.2 }} || [[TRS2004]] SP2 - Passenger Pack<br />
|-<br />
| {{center|2.3 }} || [[TRS2004]] SP3<br />
|-<br />
| {{center|2.4 }} || [[TRS2004]] SP4<br />
|-<br />
| {{center|2.5 }} || [[TRS2006]]<br />
|-<br />
| {{center|2.6 }} || [[TRS2006]] SP1<br />
|-<br />
| {{center|2.7 }} || Trainz Classics 1&2<br />
|-<br />
| {{center|2.8 }} || Trainz Classics 3<br />
|-<br />
| {{center|2.9 }} || [[TS2009]]<br />
|-<br />
| {{center|3.0 }} || [[TS2009 SP1]]<br />
|-<br />
| {{center|3.1 }} || [[TS2009 SP2]] / [[TS2009 SP3]]<br />
|-<br />
| {{center|3.2 }} || [[TS2010]] / [[TS2010 SP1]]<br />
|-<br />
| {{center|3.3 }} || [[TS2010 SP2]] / [[TS2010 SP3]] / [[TS2009 SP4]]<br />
|-<br />
| {{center|3.4 }} || [[TS2010 SP4]]<br />
|-<br />
| {{center|3.5 }} || [[TS12]]<br />
|-<br />
| {{center|3.6 }} || [[TS12]] and [[Trainz Simulator Mac]]<br />
|-<br />
| {{center|3.7 }} || [[TS12 SP1]]<br />
|-<br />
| {{center|3.8 }} || [[Trainz Simulator 2]] (Mac)<br />
|-<br />
| {{center|3.9 }} || [[Trainz A New Era: Community Edition]]<br />
|-<br />
| {{center|4.0 }} || [[Trainz A New Era]] (''TBA'')<br />
|}<br />
<br />
==Asset compatibility==<br />
It is important for an asset to list the correct Trainz-build in the [[config.txt file]]. It specifies the version of Trainz the asset was intended to be used with. An earlier version of Trainz will refuse to load the asset. A later version of Trainz will enable appropriate backwards compatibility workarounds (e.g. using different validation requirements) as required.<br />
&nbsp;<br />
<br />
A correctly-constructed asset built for an older version will usually function in a newer version of Trainz. However, Trainz content validation is improved over time, and newer versions of Trainz detect errors that older versions did not pick up on. Some content may be detected as 'faulty' in a current Trainz version that was missed in the version it was originally created for.<br />
&nbsp;<br />
<br />
It should be noted that content that is uploaded to the [[Download Station]] is validated by the most recent version of Trainz, using the validation compatibility for the trainz-build specified by the asset.<br />
&nbsp;<br />
<br />
If [[Content Creator Plus]] is used to modify an asset, it will automatically update the trainz-build version in the config.txt file to the current Trainz version. If this version has changed significantly, other changes to the config.txt file will probably be required.<br />
Assets which are manually edited will need the appropriate version entered. If the line is omitted entirely, the lowest possible version is assumed. This is currently ''Trainz-build 1.3''.<br />
&nbsp;<br />
<br />
==Obsolete Versions==<br />
<br />
Trainz build numbers up to and including 3.4 are considered obsolete as of September 2014 and can no longer be uploaded to the [[Download Station]]. See the [[Trainz Life-Cycle Policy]] for additional details.<br />
<br />
{{TBKR|trainz-build tag}}<br />
[[Category:Config Tag|trainz-build tag]]<br />
[[Category:Trainz fundamentals pages|trainz-build tag]]<br />
{{ORP-bot|trainz-build tag}}</div>Vvmmhttps://online.ts2009.com/mediaWiki/index.php/%22Trainz-build%22_tag"Trainz-build" tag2015-01-27T08:40:51Z<p>Vvmm: TANE 4.0</p>
<hr />
<div>{{ORP-top}}<br />
==Trainz-build tag number==<br />
The '''Trainz-build tag''' number indicates the minimum '''[[Trainz build versions|Trainz Code Version]]''' required to use the asset. Trainz will not attempt to load an asset which has a trainz-build tag that is newer than it's own version number, but unfortunately ContentManager will continue to report there are updates, even when they are entirely inappropriate. <br />
<br />
This tag is also an indication of the age of the asset, and the general technical configuration and standards to which it is built. The values will range up from the oldest [[Trainz 1.0]] release (2001) with three {{wp|service pack|Service Packs}} making the version commonly referred to as Trainz V-1.3, or Trainz 1.3. Assets with old Trainz-build numbers are not built to take advantage of new Trainz features that did not exist in the version of Trainz that the asset was built for, and the oldest used approaches which have been entirely abandoned. Newer Trainz releases do their best to translate these older technologies into the newer releases standards (data organization and graphical tech) but some small percentage of assets cannot be converted. <br />
&nbsp;<br />
{{UserTip|The word ''version'' is used in Trainz to refer to three different concepts. There is the '''Trainz Retail Version''', the '''Trainz Version''' and the '''Trainz Build Number'''.<br />
The '''Trainz Retail Version''' is a text string for a product release, such as ''Trainz Simulator 2009''.<br />
The '''Trainz version''' is a numeric code (e.g ''2.4'' or ''3.6'') which is incremented for each major release. This code is updated whenever a significant change to Trainz is made. Most service packs (which introduce significant functionality changes) will have a new ''Trainz Version'', but hotfixes (which do not introduce significant functionality changes) do not see a ''Trainz version'' number change. Different language versions of the same product will also generally share the same ''Trainz Version''.<br />
The '''Trainz Build Number''' is a unique number (e.g. ''44653'' or ''58414'') that identifies an individual Trainz release. All releases (including minor changes and language translations) have a different ''Trainz Build Number''.<br />
The '''Trainz-build''' tag uses the ''Trainz Version'' numeric code.<br />
}} <br />
&nbsp; <br />
[[file:CM will input Versions too advanced-TS10-SP2 shown.JPG|thumb|400px|'''TS10 SP2's Content Manager (V-3.2)''' happily imported TS12 version (V-3.4) texture cdp's for TransDEM.exe in November 2013. Other legacy versions of Trainz will also import 'Version unidentified' trainz content.<br> <br />
<br />
* '''For the new Trainz users:'''' the moral of this story is to examine trainz-build tags (versions) ASAP after importing new content into CM and provide human intelligence as to whether to delete, keep the asset, or set it aside; seek advice before trying to use, or risk breaking Trainz for while.<br> <br />
* Some content can be retrograded to work in earlier Trainz releases. More recently published Routes and Sessions cannot. ]]<br />
<br />
{| border=2 cellpadding=5 cellspacing=2 <br />
|-<br />
! colspan=2|Trainz-Build version numbers and their mapping to official Trainz release versions are as follows: <br />
|-<br />
!'trainz-build' || Trainz product for which the asset was designed<br />
|-<br />
| {{center|1.3 }} || [[Trainz SP3|Trainz SP3]]<br />
|-<br />
| {{center|1.5 }} || Ultimate Trainz Collection<br />
|-<br />
| {{center|1.6 }} || Ultimate Trainz Collection SP1<br />
|-<br />
| {{center|2.0 }} || [[TRS2004]]<br />
|-<br />
| {{center|2.1 }} || [[TRS2004]] SP1<br />
|-<br />
| {{center|2.2 }} || [[TRS2004]] SP2 - Passenger Pack<br />
|-<br />
| {{center|2.3 }} || [[TRS2004]] SP3<br />
|-<br />
| {{center|2.4 }} || [[TRS2004]] SP4<br />
|-<br />
| {{center|2.5 }} || [[TRS2006]]<br />
|-<br />
| {{center|2.6 }} || [[TRS2006]] SP1<br />
|-<br />
| {{center|2.7 }} || Trainz Classics 1&2<br />
|-<br />
| {{center|2.8 }} || Trainz Classics 3<br />
|-<br />
| {{center|2.9 }} || [[TS2009]]<br />
|-<br />
| {{center|3.0 }} || [[TS2009 SP1]]<br />
|-<br />
| {{center|3.1 }} || [[TS2009 SP2]] / [[TS2009 SP3]]<br />
|-<br />
| {{center|3.2 }} || [[TS2010]] / [[TS2010 SP1]]<br />
|-<br />
| {{center|3.3 }} || [[TS2010 SP2]] / [[TS2010 SP3]] / [[TS2009 SP4]]<br />
|-<br />
| {{center|3.4 }} || [[TS2010 SP4]]<br />
|-<br />
| {{center|3.5 }} || [[TS12]]<br />
|-<br />
| {{center|3.6 }} || [[TS12]] and [[Trainz Simulator Mac]]<br />
|-<br />
| {{center|3.7 }} || [[TS12 SP1]]<br />
|-<br />
| {{center|3.8 }} || [[Trainz Simulator 2]] (Mac)<br />
|-<br />
| {{center|3.9 }} || [[Trainz A New Era: Comunity Edition]]<br />
|-<br />
| {{center|4.0 }} || [[Trainz A New Era]] (''TBA'')<br />
|}<br />
<br />
==Asset compatibility==<br />
It is important for an asset to list the correct Trainz-build in the [[config.txt file]]. It specifies the version of Trainz the asset was intended to be used with. An earlier version of Trainz will refuse to load the asset. A later version of Trainz will enable appropriate backwards compatibility workarounds (e.g. using different validation requirements) as required.<br />
&nbsp;<br />
<br />
A correctly-constructed asset built for an older version will usually function in a newer version of Trainz. However, Trainz content validation is improved over time, and newer versions of Trainz detect errors that older versions did not pick up on. Some content may be detected as 'faulty' in a current Trainz version that was missed in the version it was originally created for.<br />
&nbsp;<br />
<br />
It should be noted that content that is uploaded to the [[Download Station]] is validated by the most recent version of Trainz, using the validation compatibility for the trainz-build specified by the asset.<br />
&nbsp;<br />
<br />
If [[Content Creator Plus]] is used to modify an asset, it will automatically update the trainz-build version in the config.txt file to the current Trainz version. If this version has changed significantly, other changes to the config.txt file will probably be required.<br />
Assets which are manually edited will need the appropriate version entered. If the line is omitted entirely, the lowest possible version is assumed. This is currently ''Trainz-build 1.3''.<br />
&nbsp;<br />
<br />
==Obsolete Versions==<br />
<br />
Trainz build numbers up to and including 3.4 are considered obsolete as of September 2014 and can no longer be uploaded to the [[Download Station]]. See the [[Trainz Life-Cycle Policy]] for additional details.<br />
<br />
{{TBKR|trainz-build tag}}<br />
[[Category:Config Tag|trainz-build tag]]<br />
[[Category:Trainz fundamentals pages|trainz-build tag]]<br />
{{ORP-bot|trainz-build tag}}</div>Vvmmhttps://online.ts2009.com/mediaWiki/index.php/%22Trainz-build%22_tag"Trainz-build" tag2014-09-05T07:48:06Z<p>Vvmm: /* Trainz-build tag number */</p>
<hr />
<div>{{ORP-top}}<br />
==Trainz-build tag number==<br />
The '''Trainz-build tag''' number indicates the minimum '''[[Trainz build versions|Trainz Code Version]]''' required to use the asset. Trainz will not attempt to load an asset which has a trainz-build tag that is newer than it's own version number, but unfortunately ContentManager will continue to report there are updates, even when they are entirely inappropriate. <br />
<br />
This tag is also an indication of the age of the asset, and the general technical configuration and standards to which it is built. The values will range up from the oldest [[Trainz 1.0]] release (2001) with three {{wp|service pack|Service Packs}} making the version commonly referred to as Trainz V-1.3, or Trainz 1.3. Assets with old Trainz-build numbers are not built to take advantage of new Trainz features that did not exist in the version of Trainz that the asset was built for, and the oldest used approaches which have been entirely abandoned. Newer Trainz releases do their best to translate these older technologies into the newer releases standards (data organization and graphical tech) but some small percentage of assets cannot be converted. <br />
&nbsp;<br />
{{UserTip|The word ''version'' is used in Trainz to refer to three different concepts. There is the '''Trainz Retail Version''', the '''Trainz Version''' and the '''Trainz Build Number'''.<br />
The '''Trainz Retail Version''' is a text string for a product release, such as ''Trainz Simulator 2009''.<br />
The '''Trainz version''' is a numeric code (e.g ''2.4'' or ''3.6'') which is incremented for each major release. This code is updated whenever a significant change to Trainz is made. Most service packs (which introduce significant functionality changes) will have a new ''Trainz Version'', but hotfixes (which do not introduce significant functionality changes) do not see a ''Trainz version'' number change. Different language versions of the same product will also generally share the same ''Trainz Version''.<br />
The '''Trainz Build Number''' is a unique number (e.g. ''44653'' or ''58414'') that identifies an individual Trainz release. All releases (including minor changes and language translations) have a different ''Trainz Build Number''.<br />
The '''Trainz-build''' tag uses the ''Trainz Version'' numeric code.<br />
}} <br />
&nbsp; <br />
[[file:CM will input Versions too advanced-TS10-SP2 shown.JPG|thumb|400px|'''TS10 SP2's Content Manager (V-3.2)''' happily imported TS12 version (V-3.4) texture cdp's for TransDEM.exe in November 2013. Other legacy versions of Trainz will also import 'Version unidentified' trainz content.<br> <br />
<br />
* '''For the new Trainz users:'''' the moral of this story is to examine trainz-build tags (versions) ASAP after importing new content into CM and provide human intelligence as to whether to delete, keep the asset, or set it aside; seek advice before trying to use, or risk breaking Trainz for while.<br> <br />
* Some content can be retrograded to work in earlier Trainz releases. More recently published Routes and Sessions cannot. ]]<br />
<br />
{| border=2 cellpadding=5 cellspacing=2 <br />
|-<br />
! colspan=2|Trainz-Build version numbers and their mapping to official Trainz release versions are as follows: <br />
|-<br />
!'trainz-build' || Trainz product for which the asset was designed<br />
|-<br />
| {{center|1.3 }} || [[Trainz SP3|Trainz SP3]]<br />
|-<br />
| {{center|1.5 }} || Ultimate Trainz Collection<br />
|-<br />
| {{center|1.6 }} || Ultimate Trainz Collection SP1<br />
|-<br />
| {{center|2.0 }} || [[TRS2004]]<br />
|-<br />
| {{center|2.1 }} || [[TRS2004]] SP1<br />
|-<br />
| {{center|2.2 }} || [[TRS2004]] SP2 - Passenger Pack<br />
|-<br />
| {{center|2.3 }} || [[TRS2004]] SP3<br />
|-<br />
| {{center|2.4 }} || [[TRS2004]] SP4<br />
|-<br />
| {{center|2.5 }} || [[TRS2006]]<br />
|-<br />
| {{center|2.6 }} || [[TRS2006]] SP1<br />
|-<br />
| {{center|2.7 }} || Trainz Classics 1&2<br />
|-<br />
| {{center|2.8 }} || Trainz Classics 3<br />
|-<br />
| {{center|2.9 }} || [[TS2009]]<br />
|-<br />
| {{center|3.0 }} || [[TS2009 SP1]]<br />
|-<br />
| {{center|3.1 }} || [[TS2009 SP2]] / [[TS2009 SP3]]<br />
|-<br />
| {{center|3.2 }} || [[TS2010]] / [[TS2010 SP1]]<br />
|-<br />
| {{center|3.3 }} || [[TS2010 SP2]] / [[TS2010 SP3]] / [[TS2009 SP4]]<br />
|-<br />
| {{center|3.4 }} || [[TS2010 SP4]]<br />
|-<br />
| {{center|3.5 }} || [[TS12]]<br />
|-<br />
| {{center|3.6 }} || [[TS12]] and [[Trainz Simulator Mac]]<br />
|-<br />
| {{center|3.7 }} || [[TS12 SP1]]<br />
|-<br />
| {{center|3.8 }} || [[Trainz Simulator 2]] (Mac)<br />
|-<br />
| {{center|3.9 }} || [[Trainz A New Era]] (''TBA'')<br />
|}<br />
<br />
==Asset compatibility==<br />
It is important for an asset to list the correct Trainz-build in the [[config.txt file]]. It specifies the version of Trainz the asset was intended to be used with. An earlier version of Trainz will refuse to load the asset. A later version of Trainz will enable appropriate backwards compatibility workarounds (e.g. using different validation requirements) as required.<br />
&nbsp;<br />
<br />
A correctly-constructed asset built for an older version will usually function in a newer version of Trainz. However, Trainz content validation is improved over time, and newer versions of Trainz detect errors that older versions did not pick up on. Some content may be detected as 'faulty' in a current Trainz version that was missed in the version it was originally created for.<br />
&nbsp;<br />
<br />
It should be noted that content that is uploaded to the [[Download Station]] is validated by the most recent version of Trainz, using the validation compatibility for the trainz-build specified by the asset.<br />
&nbsp;<br />
<br />
If [[Content Creator Plus]] is used to modify an asset, it will automatically update the trainz-build version in the config.txt file to the current Trainz version. If this version has changed significantly, other changes to the config.txt file will probably be required.<br />
Assets which are manually edited will need the appropriate version entered. If the line is omitted entirely, the lowest possible version is assumed. This is currently ''Trainz-build 1.3''.<br />
&nbsp;<br />
<br />
==Obsolete Versions==<br />
<br />
Trainz build numbers up to and including 3.4 are considered obsolete as of September 2014 and can no longer be uploaded to the [[Download Station]]. See the [[Trainz Life-Cycle Policy]] for additional details.<br />
<br />
{{TBKR|trainz-build tag}}<br />
[[Category:Config Tag|trainz-build tag]]<br />
[[Category:Trainz fundamentals pages|trainz-build tag]]<br />
{{ORP-bot|trainz-build tag}}</div>Vvmmhttps://online.ts2009.com/mediaWiki/index.php/%22Trainz-build%22_tag"Trainz-build" tag2014-09-05T07:43:15Z<p>Vvmm: /* Obsolete Versions */</p>
<hr />
<div>{{ORP-top}}<br />
==Trainz-build tag number==<br />
The '''Trainz-build tag''' number indicates the minimum '''[[Trainz build versions|Trainz Code Version]]''' required to use the asset. Trainz will not attempt to load an asset which has a trainz-build tag that is newer than it's own version number, but unfortunately ContentManager will continue to report there are updates, even when they are entirely inappropriate. <br />
<br />
This tag is also an indication of the age of the asset, and the general technical configuration and standards to which it is built. The values will range up from the oldest [[Trainz 1.0]] release (2001) with three {{wp|service pack|Service Packs}} making the version commonly referred to as Trainz V-1.3, or Trainz 1.3. Assets with old Trainz-build numbers are not built to take advantage of new Trainz features that did not exist in the version of Trainz that the asset was built for, and the oldest used approaches which have been entirely abandoned. Newer Trainz releases do their best to translate these older technologies into the newer releases standards (data organization and graphical tech) but some small percentage of assets cannot be converted. <br />
&nbsp;<br />
{{UserTip|The word ''version'' is used in Trainz to refer to three different concepts. There is the '''Trainz Retail Version''', the '''Trainz Version''' and the '''Trainz Build Number'''.<br />
The '''Trainz Retail Version''' is a text string for a product release, such as ''Trainz Simulator 2009''.<br />
The '''Trainz version''' is a numeric code (e.g ''2.4'' or ''3.6'') which is incremented for each major release. This code is updated whenever a significant change to Trainz is made. Most service packs (which introduce significant functionality changes) will have a new ''Trainz Version'', but hotfixes (which do not introduce significant functionality changes) do not see a ''Trainz version'' number change. Different language versions of the same product will also generally share the same ''Trainz Version''.<br />
The '''Trainz Build Number''' is a unique number (e.g. ''44653'' or ''58414'') that identifies an individual Trainz release. All releases (including minor changes and language translations) have a different ''Trainz Build Number''.<br />
The '''Trainz-build''' tag uses the ''Trainz Version'' numeric code.<br />
}} <br />
&nbsp; <br />
[[file:CM will input Versions too advanced-TS10-SP2 shown.JPG|thumb|400px|'''TS10 SP2's Content Manager (V-3.2)''' happily imported TS12 version (V-3.4) texture cdp's for TransDEM.exe in November 2013. Other legacy versions of Trainz will also import 'Version unidentified' trainz content.<br> <br />
<br />
* '''For the new Trainz users:'''' the moral of this story is to examine trainz-build tags (versions) ASAP after importing new content into CM and provide human intelligence as to whether to delete, keep the asset, or set it aside; seek advice before trying to use, or risk breaking Trainz for while.<br> <br />
* Some content can be retrograded to work in earlier Trainz releases. More recently published Routes and Sessions cannot. ]]<br />
<br />
{| border=2 cellpadding=5 cellspacing=2 <br />
|-<br />
! colspan=2|Trainz-Build version numbers and their mapping to official Trainz release versions are as follows: <br />
|-<br />
!'trainz-build' || Trainz product for which the asset was designed<br />
|-<br />
| {{center|1.3 }} || [[Trainz SP3|Trainz SP3]]<br />
|-<br />
| {{center|1.5 }} || Ultimate Trainz Collection<br />
|-<br />
| {{center|1.6 }} || Ultimate Trainz Collection SP1<br />
|-<br />
| {{center|2.0 }} || [[TRS2004]]<br />
|-<br />
| {{center|2.1 }} || [[TRS2004]] SP1<br />
|-<br />
| {{center|2.2 }} || [[TRS2004]] SP2 - Passenger Pack<br />
|-<br />
| {{center|2.3 }} || [[TRS2004]] SP3<br />
|-<br />
| {{center|2.4 }} || [[TRS2004]] SP4<br />
|-<br />
| {{center|2.5 }} || [[TRS2006]]<br />
|-<br />
| {{center|2.6 }} || [[TRS2006]] SP1<br />
|-<br />
| {{center|2.7 }} || Trainz Classics 1&2<br />
|-<br />
| {{center|2.8 }} || Trainz Classics 3<br />
|-<br />
| {{center|2.9 }} || [[TS2009]]<br />
|-<br />
| {{center|3.0 }} || [[TS2009 SP1]]<br />
|-<br />
| {{center|3.1 }} || [[TS2009 SP2]] / [[TS2009 SP3]]<br />
|-<br />
| {{center|3.2 }} || [[TS2010]] / [[TS2010 SP1]]<br />
|-<br />
| {{center|3.3 }} || [[TS2010 SP2]] / [[TS2010 SP3]] / [[TS2009 SP4]]<br />
|-<br />
| {{center|3.4 }} || [[TS2010 SP4]]<br />
|-<br />
| {{center|3.5 }} || [[TS12]]<br />
|-<br />
| {{center|3.6 }} || [[TS12]] and [[Trainz Simulator Mac]]<br />
|-<br />
| {{center|3.7 }} || [[TS12 SP1]]<br />
|}<br />
<br />
==Asset compatibility==<br />
It is important for an asset to list the correct Trainz-build in the [[config.txt file]]. It specifies the version of Trainz the asset was intended to be used with. An earlier version of Trainz will refuse to load the asset. A later version of Trainz will enable appropriate backwards compatibility workarounds (e.g. using different validation requirements) as required.<br />
&nbsp;<br />
<br />
A correctly-constructed asset built for an older version will usually function in a newer version of Trainz. However, Trainz content validation is improved over time, and newer versions of Trainz detect errors that older versions did not pick up on. Some content may be detected as 'faulty' in a current Trainz version that was missed in the version it was originally created for.<br />
&nbsp;<br />
<br />
It should be noted that content that is uploaded to the [[Download Station]] is validated by the most recent version of Trainz, using the validation compatibility for the trainz-build specified by the asset.<br />
&nbsp;<br />
<br />
If [[Content Creator Plus]] is used to modify an asset, it will automatically update the trainz-build version in the config.txt file to the current Trainz version. If this version has changed significantly, other changes to the config.txt file will probably be required.<br />
Assets which are manually edited will need the appropriate version entered. If the line is omitted entirely, the lowest possible version is assumed. This is currently ''Trainz-build 1.3''.<br />
&nbsp;<br />
<br />
==Obsolete Versions==<br />
<br />
Trainz build numbers up to and including 3.4 are considered obsolete as of September 2014 and can no longer be uploaded to the [[Download Station]]. See the [[Trainz Life-Cycle Policy]] for additional details.<br />
<br />
{{TBKR|trainz-build tag}}<br />
[[Category:Config Tag|trainz-build tag]]<br />
[[Category:Trainz fundamentals pages|trainz-build tag]]<br />
{{ORP-bot|trainz-build tag}}</div>Vvmmhttps://online.ts2009.com/mediaWiki/index.php/%22Trainz-build%22_tag"Trainz-build" tag2014-09-02T08:20:57Z<p>Vvmm: /* Obsolete Versions */</p>
<hr />
<div>{{ORP-top}}<br />
==Trainz-build tag number==<br />
The '''Trainz-build tag''' number indicates the minimum '''[[Trainz build versions|Trainz Code Version]]''' required to use the asset. Trainz will not attempt to load an asset which has a trainz-build tag that is newer than it's own version number, but unfortunately ContentManager will continue to report there are updates, even when they are entirely inappropriate. <br />
<br />
This tag is also an indication of the age of the asset, and the general technical configuration and standards to which it is built. The values will range up from the oldest [[Trainz 1.0]] release (2001) with three {{wp|service pack|Service Packs}} making the version commonly referred to as Trainz V-1.3, or Trainz 1.3. Assets with old Trainz-build numbers are not built to take advantage of new Trainz features that did not exist in the version of Trainz that the asset was built for, and the oldest used approaches which have been entirely abandoned. Newer Trainz releases do their best to translate these older technologies into the newer releases standards (data organization and graphical tech) but some small percentage of assets cannot be converted. <br />
&nbsp;<br />
{{UserTip|The word ''version'' is used in Trainz to refer to three different concepts. There is the '''Trainz Retail Version''', the '''Trainz Version''' and the '''Trainz Build Number'''.<br />
The '''Trainz Retail Version''' is a text string for a product release, such as ''Trainz Simulator 2009''.<br />
The '''Trainz version''' is a numeric code (e.g ''2.4'' or ''3.6'') which is incremented for each major release. This code is updated whenever a significant change to Trainz is made. Most service packs (which introduce significant functionality changes) will have a new ''Trainz Version'', but hotfixes (which do not introduce significant functionality changes) do not see a ''Trainz version'' number change. Different language versions of the same product will also generally share the same ''Trainz Version''.<br />
The '''Trainz Build Number''' is a unique number (e.g. ''44653'' or ''58414'') that identifies an individual Trainz release. All releases (including minor changes and language translations) have a different ''Trainz Build Number''.<br />
The '''Trainz-build''' tag uses the ''Trainz Version'' numeric code.<br />
}} <br />
&nbsp; <br />
[[file:CM will input Versions too advanced-TS10-SP2 shown.JPG|thumb|400px|'''TS10 SP2's Content Manager (V-3.2)''' happily imported TS12 version (V-3.4) texture cdp's for TransDEM.exe in November 2013. Other legacy versions of Trainz will also import 'Version unidentified' trainz content.<br> <br />
<br />
* '''For the new Trainz users:'''' the moral of this story is to examine trainz-build tags (versions) ASAP after importing new content into CM and provide human intelligence as to whether to delete, keep the asset, or set it aside; seek advice before trying to use, or risk breaking Trainz for while.<br> <br />
* Some content can be retrograded to work in earlier Trainz releases. More recently published Routes and Sessions cannot. ]]<br />
<br />
{| border=2 cellpadding=5 cellspacing=2 <br />
|-<br />
! colspan=2|Trainz-Build version numbers and their mapping to official Trainz release versions are as follows: <br />
|-<br />
!'trainz-build' || Trainz product for which the asset was designed<br />
|-<br />
| {{center|1.3 }} || [[Trainz SP3|Trainz SP3]]<br />
|-<br />
| {{center|1.5 }} || Ultimate Trainz Collection<br />
|-<br />
| {{center|1.6 }} || Ultimate Trainz Collection SP1<br />
|-<br />
| {{center|2.0 }} || [[TRS2004]]<br />
|-<br />
| {{center|2.1 }} || [[TRS2004]] SP1<br />
|-<br />
| {{center|2.2 }} || [[TRS2004]] SP2 - Passenger Pack<br />
|-<br />
| {{center|2.3 }} || [[TRS2004]] SP3<br />
|-<br />
| {{center|2.4 }} || [[TRS2004]] SP4<br />
|-<br />
| {{center|2.5 }} || [[TRS2006]]<br />
|-<br />
| {{center|2.6 }} || [[TRS2006]] SP1<br />
|-<br />
| {{center|2.7 }} || Trainz Classics 1&2<br />
|-<br />
| {{center|2.8 }} || Trainz Classics 3<br />
|-<br />
| {{center|2.9 }} || [[TS2009]]<br />
|-<br />
| {{center|3.0 }} || [[TS2009 SP1]]<br />
|-<br />
| {{center|3.1 }} || [[TS2009 SP2]] / [[TS2009 SP3]]<br />
|-<br />
| {{center|3.2 }} || [[TS2010]] / [[TS2010 SP1]]<br />
|-<br />
| {{center|3.3 }} || [[TS2010 SP2]] / [[TS2010 SP3]] / [[TS2009 SP4]]<br />
|-<br />
| {{center|3.4 }} || [[TS2010 SP4]]<br />
|-<br />
| {{center|3.5 }} || [[TS12]]<br />
|-<br />
| {{center|3.6 }} || [[TS12]] and [[Trainz Simulator Mac]]<br />
|-<br />
| {{center|3.7 }} || [[TS12 SP1]]<br />
|}<br />
<br />
==Asset compatibility==<br />
It is important for an asset to list the correct Trainz-build in the [[config.txt file]]. It specifies the version of Trainz the asset was intended to be used with. An earlier version of Trainz will refuse to load the asset. A later version of Trainz will enable appropriate backwards compatibility workarounds (e.g. using different validation requirements) as required.<br />
&nbsp;<br />
<br />
A correctly-constructed asset built for an older version will usually function in a newer version of Trainz. However, Trainz content validation is improved over time, and newer versions of Trainz detect errors that older versions did not pick up on. Some content may be detected as 'faulty' in a current Trainz version that was missed in the version it was originally created for.<br />
&nbsp;<br />
<br />
It should be noted that content that is uploaded to the [[Download Station]] is validated by the most recent version of Trainz, using the validation compatibility for the trainz-build specified by the asset.<br />
&nbsp;<br />
<br />
If [[Content Creator Plus]] is used to modify an asset, it will automatically update the trainz-build version in the config.txt file to the current Trainz version. If this version has changed significantly, other changes to the config.txt file will probably be required.<br />
Assets which are manually edited will need the appropriate version entered. If the line is omitted entirely, the lowest possible version is assumed. This is currently ''Trainz-build 1.3''.<br />
&nbsp;<br />
<br />
==Obsolete Versions==<br />
<br />
Trainz build numbers up to and including 3.4 are considered obsolete as of September 2014. See the [[Trainz Life-Cycle Policy]] for additional details.<br />
<br />
Trainz-build numbers up to and including 2.8 are considered obsolete as of September 2012 and can no longer be uploaded to the [[Download Station]].<br />
<br />
{{TBKR|trainz-build tag}}<br />
[[Category:Config Tag|trainz-build tag]]<br />
[[Category:Trainz fundamentals pages|trainz-build tag]]<br />
{{ORP-bot|trainz-build tag}}</div>Vvmmhttps://online.ts2009.com/mediaWiki/index.php/%22Trainz-build%22_tag"Trainz-build" tag2014-06-04T12:19:49Z<p>Vvmm: /* Obsolete Versions */</p>
<hr />
<div>{{ORP-top}}<br />
==Trainz-build tag number==<br />
The '''Trainz-build tag''' number indicates the minimum '''[[Trainz build versions|Trainz Code Version]]''' required to use the asset. Trainz will not attempt to load an asset which has a trainz-build tag that is newer than it's own version number, but unfortunately ContentManager will continue to report there are updates, even when they are entirely inappropriate. <br />
<br />
This tag is also an indication of the age of the asset, and the general technical configuration and standards to which it is built. The values will range up from the oldest [[Trainz 1.0]] release (2001) with three {{wp|service pack|Service Packs}} making the version commonly referred to as Trainz V-1.3, or Trainz 1.3. Assets with old Trainz-build numbers are not built to take advantage of new Trainz features that did not exist in the version of Trainz that the asset was built for, and the oldest used approaches which have been entirely abandoned. Newer Trainz releases do their best to translate these older technologies into the newer releases standards (data organization and graphical tech) but some small percentage of assets cannot be converted. <br />
&nbsp;<br />
{{UserTip|The word ''version'' is used in Trainz to refer to three different concepts. There is the '''Trainz Retail Version''', the '''Trainz Version''' and the '''Trainz Build Number'''.<br />
The '''Trainz Retail Version''' is a text string for a product release, such as ''Trainz Simulator 2009''.<br />
The '''Trainz version''' is a numeric code (e.g ''2.4'' or ''3.6'') which is incremented for each major release. This code is updated whenever a significant change to Trainz is made. Most service packs (which introduce significant functionality changes) will have a new ''Trainz Version'', but hotfixes (which do not introduce significant functionality changes) do not see a ''Trainz version'' number change. Different language versions of the same product will also generally share the same ''Trainz Version''.<br />
The '''Trainz Build Number''' is a unique number (e.g. ''44653'' or ''58414'') that identifies an individual Trainz release. All releases (including minor changes and language translations) have a different ''Trainz Build Number''.<br />
The '''Trainz-build''' tag uses the ''Trainz Version'' numeric code.<br />
}} <br />
&nbsp; <br />
[[file:CM will input Versions too advanced-TS10-SP2 shown.JPG|thumb|400px|'''TS10 SP2's Content Manager (V-3.2)''' happily imported TS12 version (V-3.4) texture cdp's for TransDEM.exe in November 2013. Other legacy versions of Trainz will also import 'Version unidentified' trainz content.<br> <br />
<br />
* '''For the new Trainz users:'''' the moral of this story is to examine trainz-build tags (versions) ASAP after importing new content into CM and provide human intelligence as to whether to delete, keep the asset, or set it aside; seek advice before trying to use, or risk breaking Trainz for while.<br> <br />
* Some content can be retrograded to work in earlier Trainz releases. More recently published Routes and Sessions cannot. ]]<br />
<br />
{| border=2 cellpadding=5 cellspacing=2 <br />
|-<br />
! colspan=2|Trainz-Build version numbers and their mapping to official Trainz release versions are as follows: <br />
|-<br />
!'trainz-build' || Trainz product for which the asset was designed<br />
|-<br />
| {{center|1.3 }} || [[Trainz SP3|Trainz SP3]]<br />
|-<br />
| {{center|1.5 }} || Ultimate Trainz Collection<br />
|-<br />
| {{center|1.6 }} || Ultimate Trainz Collection SP1<br />
|-<br />
| {{center|2.0 }} || [[TRS2004]]<br />
|-<br />
| {{center|2.1 }} || [[TRS2004]] SP1<br />
|-<br />
| {{center|2.2 }} || [[TRS2004]] SP2 - Passenger Pack<br />
|-<br />
| {{center|2.3 }} || [[TRS2004]] SP3<br />
|-<br />
| {{center|2.4 }} || [[TRS2004]] SP4<br />
|-<br />
| {{center|2.5 }} || [[TRS2006]]<br />
|-<br />
| {{center|2.6 }} || [[TRS2006]] SP1<br />
|-<br />
| {{center|2.7 }} || Trainz Classics 1&2<br />
|-<br />
| {{center|2.8 }} || Trainz Classics 3<br />
|-<br />
| {{center|2.9 }} || [[TS2009]]<br />
|-<br />
| {{center|3.0 }} || [[TS2009 SP1]]<br />
|-<br />
| {{center|3.1 }} || [[TS2009 SP2]] / [[TS2009 SP3]]<br />
|-<br />
| {{center|3.2 }} || [[TS2010]] / [[TS2010 SP1]]<br />
|-<br />
| {{center|3.3 }} || [[TS2010 SP2]] / [[TS2010 SP3]] / [[TS2009 SP4]]<br />
|-<br />
| {{center|3.4 }} || [[TS2010 SP4]]<br />
|-<br />
| {{center|3.5 }} || [[TS12]]<br />
|-<br />
| {{center|3.6 }} || [[TS12]] and [[Trainz Simulator Mac]]<br />
|-<br />
| {{center|3.7 }} || [[TS12 SP1]]<br />
|}<br />
<br />
==Asset compatibility==<br />
It is important for an asset to list the correct Trainz-build in the [[config.txt file]]. It specifies the version of Trainz the asset was intended to be used with. An earlier version of Trainz will refuse to load the asset. A later version of Trainz will enable appropriate backwards compatibility workarounds (e.g. using different validation requirements) as required.<br />
&nbsp;<br />
<br />
A correctly-constructed asset built for an older version will usually function in a newer version of Trainz. However, Trainz content validation is improved over time, and newer versions of Trainz detect errors that older versions did not pick up on. Some content may be detected as 'faulty' in a current Trainz version that was missed in the version it was originally created for.<br />
&nbsp;<br />
<br />
It should be noted that content that is uploaded to the [[Download Station]] is validated by the most recent version of Trainz, using the validation compatibility for the trainz-build specified by the asset.<br />
&nbsp;<br />
<br />
If [[Content Creator Plus]] is used to modify an asset, it will automatically update the trainz-build version in the config.txt file to the current Trainz version. If this version has changed significantly, other changes to the config.txt file will probably be required.<br />
Assets which are manually edited will need the appropriate version entered. If the line is omitted entirely, the lowest possible version is assumed. This is currently ''Trainz-build 1.3''.<br />
&nbsp;<br />
<br />
==Obsolete Versions==<br />
Trainz-build numbers up to and including 2.8 are considered obsolete as of September 2012 and can no longer be uploaded to the [[Download Station]]. See the [[Trainz Life-Cycle Policy]] for additional details.<br />
<br />
Trainz build numbers up to and including 3.4 will be considered obsolete starting with September 2014.<br />
<br />
{{TBKR|trainz-build tag}}<br />
[[Category:Config Tag|trainz-build tag]]<br />
[[Category:Trainz fundamentals pages|trainz-build tag]]<br />
{{ORP-bot|trainz-build tag}}</div>Vvmmhttps://online.ts2009.com/mediaWiki/index.php/User:VvmmUser:Vvmm2014-02-11T09:19:04Z<p>Vvmm: </p>
<hr />
<div>==About me==<br />
Hi!<br />
<br />
I'm from [http://en.wikipedia.org/wiki/Romania România].<br />
<br />
I'm interested in trains, Trainz, programming, computers, networks, electronics and music.<br />
<br />
I'm part of the DLS cleanup team to prepare for Tranz: A New Era.<br />
<br />
I'm trying to create new content, tutorials, contribute to the Trainz Wiki and also organize the Romanian Trainz Community.<br />
<br />
<br />
==Downloads==<br />
<br />
My Website: [http://vvmm.zapto.org/ http://vvmm.zapto.org/] (in română, use [http://translate.google.ro/translate?sl=ro&tl=en&prev=_t&hl=en&ie=UTF-8&eotf=1&u=vvmm.zapto.org Google Translate for English])</div>Vvmmhttps://online.ts2009.com/mediaWiki/index.php/JAConverter.exeJAConverter.exe2013-09-05T14:44:28Z<p>Vvmm: Created page with "JAConverter.exe is located in the bin folder. It is used to modify .ja files during patching and not only. == Command-line options == === patchapply === '''Syntax:''' J..."</p>
<hr />
<div>JAConverter.exe is located in the bin folder.<br />
It is used to modify .ja files during patching and not only.<br />
<br />
<br />
== Command-line options ==<br />
<br />
=== patchapply ===<br />
<br />
<br />
'''Syntax:'''<br />
<br />
JAConverter '''patchapply''' ''"file.ja.pbk" "file-diff.ja" "file.ja"''<br />
<br />
This command opens the file.ja from a previously made backup (file.ja.pbk), appedns the content from file-diff.ja and writes the new file, file.ja.<br />
<br />
<br />
'''Example:'''<br />
<br />
JAConverter patchapply "builtin\1.ja.pbk" "builtin\1-diff.ja" "builtin\1.ja"<br />
<br />
This command opens the 1.ja backup (1.ja.pbk), appedns the content from 1-diff.ja and writes the new file, 1.ja.</div>Vvmmhttps://online.ts2009.com/mediaWiki/index.php/Class_CabinClass Cabin2013-08-17T17:04:28Z<p>Vvmm: modified UserPressKey</p>
<hr />
<div>*[[TrainzScript Language Reference|API Hierarchy]]<br />
**[[Class GSObject|GSObject]] *<br />
***[[Class GameObject|GameObject]]<br />
****[[Class TrainzGameObject|TrainzGameObject]]<br />
****[[Class PropertyObject|PropertyObject]] *<br />
*****[[Class MeshObject|MeshObject]]<br />
******Bogey<br />
<br />
<br><br />
*This class is the interface class used for cabins and interior assets in Trainz.<br />
*From the scripting perspective, a Cabin is mainly a collection of controls. <br />
*What controls the cabin has depends on the configuration of the asset. <br />
*If a cabin asset is to have custom scripted features, it's script class will need to be derived from this one. <br />
*The types of controls a cabin has is locomotive specific hence this class is the interface and not a cabin implementation.<br />
*The DefaultLocomotiveCabin and DefaultSteamCabin classes provide basic default Cabin implementations.<br />
<br><br />
<br />
===Attach===<br />
{{MethodHeader|public void Attach(GameObject owner)}}<br />
;Parameters<br />
*'''owner''' = GameObjet to which the cabin will be attached, normally a Locomotive.<br />
;Returned Value<br />
*None<br />
;Notes<br />
*A callback method used by the game engine when it is about to attach this cabin to an object.<br />
*A cabin is destroyed when it is no longer needed and re-created by Trainz later on if needed again.<br />
*This method is where you should restore any saved cabin control settings.<br />
*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()]])<br />
*The programmer will need to update and make use of cabin settings in their implementation of this method.<br />
<br><br />
<br />
===FireAddCoal===<br />
{{MethodHeader|public native bool FireAddCoal(void)}}<br />
;Parameters<br />
*None<br />
;Returned Value<br />
*True if coal is added successfully, false otherwise.<br />
;Syntax<br />
FireAddCoal();<br />
;Notes<br />
<br><br />
<br />
===GetControls===<br />
{{MethodHeader|public native CabinControl[ ] GetControls(void)}}<br />
;Parameters<br />
*None<br />
;Returned Value<br />
*An array of the CabinControl objects applicable to the cabin.<br />
;Syntax<br />
CabinControl[] controls = GetControls();<br />
;Notes<br />
<br><br />
<br />
===GetNamedControl===<br />
{{MethodHeader|public native CabinControl GetNamedControl(string name)}}<br />
;Parameters<br />
*'''name''' = Name of control to return.<br />
;Returned Value<br />
*A reference to the named control if it exists, null otherwise.<br />
;Syntax<br />
CabinControl control = GetNamedControl("brake");<br />
;Notes<br />
<br><br />
<br />
===GetParentObject===<br />
{{MethodHeader|public native GameObject GetParentObject(void)}}<br />
;Parameters<br />
*None<br />
;Returned Value<br />
*A reference to the parent GameObject to which the cabin is attached, usually a Locomotive.<br />
;Syntax<br />
Locomotive loco = cast<Locomotive>cabin.GetParentObject();<br />
;Notes<br />
<br><br />
<br />
===IsActive===<br />
{{MethodHeader|public native bool IsActive(void)}}<br />
;Parameters<br />
*None<br />
;Returned Value<br />
*True if the cabin is currently active, false otherwise.<br />
;Syntax<br />
bool cabinExists = cabin.IsActive();<br />
;Notes<br />
<br><br />
<br />
===SetCabLightIntensity===<br />
{{MethodHeader|public native void SetCabLightIntensity(float intensity)}}<br />
;Parameters<br />
*''intensity''' = A normalised lighting level in the range 0.0..1.0<br />
;Returned Value<br />
*None<br />
;Syntax<br />
SetCabLightIntensity(0.5);<br />
;Notes<br />
<br><br />
<br />
===Update===<br />
{{MethodHeader|public void Update(void)}}<br />
;Parameters<br />
*None<br />
;Returned Value<br />
*None<br />
;Notes<br />
*This is a callback method used by Trainz to update the cabin object.<br />
*This implementation is empty so the script programmer must implement it if they want their cabin's controls to be updated.<br />
*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.<br />
*This is mostly a case of querying the current status of the host locomotive and applying it to the matching control.<br />
*The speedometer in the cab for instance should be updated based on the loco's current velocity.<br />
<br><br />
<br />
===UserPressKey===<br />
{{MethodHeader|public void UserPressKey(string s)}}<br />
;Parameters<br />
*'''s''' = The name of the key pressed, as it is found in [[keyboard.txt]]<br />
;Returned Value<br />
*None<br />
;Notes<br />
*This is a callback method used by Trainz when the user presses a key.<br />
*The default Cabin implementation does not handle any keystrokes. You must do so in your own overridden implementation.<br />
<br><br />
<br />
===UserSetControl===<br />
{{MethodHeader|public void UserSetControl(CabinControl control, float value)}}<br />
;Parameters<br />
*'''control''' = The control that the user has operated.<br />
*'''value''' = The value to assign as a result of the user's action.<br />
;Returned Value<br />
*None<br />
;Notes<br />
*This is a callback method used by Trainz when the user presses a key.<br />
*You should override this method to apply the settings selected by the user.<br />
<br><br />
<br />
==Related Methods==<br />
<br><br />
<br />
==Categories==<br />
[[Category:Script Class]]</div>Vvmmhttps://online.ts2009.com/mediaWiki/index.php/%22mesh-table%22_container"mesh-table" container2013-06-18T02:27:59Z<p>Vvmm: Added mesh-scale, as found in CCP 3.7. Please add details</p>
<hr />
<div>The "mesh-table" container is a top-level [[config.txt file]] entry used by various [[Content_Configuration#Content_Types|Content Types]].<br />
<br />
<br />
The mesh-table is a list of mesh subcontainers with no standalone tags. Each mesh subcontainer uses the following format. Tags are parsed in a standardised format, but not all [[Content_Configuration#Content_Types|Content Types]] support the full range of tags. Each mesh derives its name from the subcontainer's tag name. These names are used to refer to specific meshes from within the mesh-table and also from script.<br />
<br />
=Supported Tags=<br />
Each mesh subcontainer supports the following tags. Each tag is shown here with its default value.<br />
<br />
mesh-asset <NULLKUID><br />
mesh ""<br />
anim ""<br />
lod-level 255<br />
mesh-season 255<br />
att ""<br />
att-parent ""<br />
opacity 1.0<br />
position 0,0,0<br />
orientation 0,0,0<br />
auto-create 0<br />
use-parent-bounds 0<br />
animation-loop-speed 0<br />
light 1<br />
critical-animation 1<br />
effects<br />
{<br />
}<br />
night-mesh-base ""<br />
<br />
====mesh-asset====<br />
Allows assets to be used as 'mesh libraries', the following container specifies that the mesh required (and its optional animation) is located in the root folder of <kuid:1234:5678>. CMP does not check for the existence of these files so you must ensure that they are present before using this tag.<br />
<br />
mesh-table {<br />
submesh {<br />
mesh-asset <kuid:1234:5678><br />
mesh "meshname.im"<br />
anim "meshname.kin"<br />
att "a.point"<br />
att-parent "default"<br />
}<br />
}<br />
<br />
====mesh====<br />
The ‘main’ mesh name. This may include a sub-path; <br />
ie: mesh nightwindows/nightwindows.im, where the file nightwindows.im has been placed in the subdirectory nightwindows.<br />
<br />
Use .im files exported from 3dsmax (as opposed to .pm.) or reference an .lm file if you wish your asset to have ‘Level of Detail’ mesh reduction.<br />
<br />
Level of detail is a process of using different model meshes, depending on how far the viewer is from the model. A finer mesh is used for close up viewing in Trainz.<br />
<br />
====anim====<br />
The animation file (.kin) exported from 3dsmax. This may include a sub-path.<br />
<br />
====lod-level====<br />
The object LOD level at which this mesh is displayed. The default value (255) indicates that this mesh is visible at all detail levels. See also [[KIND Mesh]] for the 'mesh-detail-level' tag.<br />
<br />
====mesh-season====<br />
The season index for which this mesh is displayed. The default value (255) indicates that this mesh is visible in all seasons. See also [["Season-selector" container]].<br />
<br />
====att====<br />
The mesh (and animation if present) is inserted at a mesh attachment point rather than the origin (without this line the mesh is placed relative to the origin of the parent model).<br />
<br />
====att-parent====<br />
The tag tells Trainz in which mesh the attachment point is located. The insertion attachment point is located within the mesh ‘name’ , as listed in the config.txt.<br />
<br />
====opacity====<br />
opacity x (float 0.0 - 1.0 default 1.0)<br />
<br />
Specifies the overall transparency of a mesh. Values other than 0.0 or 1.0 employ alpha blending and a value of 0.0 has the same effect as hiding the mesh.<br />
<br />
Note that this tag is buggy in TS2009 prior to SP4.<br />
<br />
====mesh-scale====<br />
''TBD''<br />
<br />
====position====<br />
position X,Y,Z (in metres, default 0,0,0) <br />
<br />
Specifies the location of a mesh relative to its insertion point.<br />
<br />
====orientation====<br />
orientation X,Y,Z (radians default 0,0,0)<br />
<br />
Allows a submesh to be rotated relative to its insertion point. To reverse a mesh by 180 degrees about the Z axis, add the tag:<br />
<br />
orientation 0,0,3.14159<br />
<br />
A coconut is awarded to the programmer who decided that the parameters to this tag should be in radians.<br />
<br />
====auto-create====<br />
The model is generated automatically when placed, or when you load a map which includes the model. In some instances you don’t want the mesh visible (as this may be controlled through script). If auto-create is 0 the mesh will not be visible when placed.<br />
<br />
====use-parent-bounds====<br />
When enabled, this tag indicates that render culling should occur using the whole object's bounding box rather than this mesh's bounding box. Bounding boxes on individual meshes may not update correctly when animation moves the object's geometry any significant distance from the bind position. This flag can help mitigate such effects, at a tiny performance penalty.<br />
<br />
====animation-loop-speed====<br />
This tag must be here if the asset is to animate when placed. If this tag is not here when placed the animation will not play by default, but may play if controlled by script. A different value (e.g. 0.5, 2.0) may be used in the tag to play the animation at a different speed from that created in 3dsmax.<br />
<br />
====light====<br />
''TBD''<br />
<br />
====critical-animation====<br />
"critical-animation" indicates that this mesh's animation generates events which are critical to the script system's behavior. If your asset is not scripted, does not use scripted animation events, or only uses the events for display purposes and will not break if the occasional event is missed, this tag should be set to ''false''. Leaving this flag set to ''true'' is a '''significant''' performance penalty.<br />
<br />
====night-mesh-base====<br />
This night mesh is linked to the specified mesh and is visible only at night. It is invisible if the specified mesh is invisible, (if the auto-create 0 line were used so the specified mesh can be controlled by script).<br />
<br />
=Effects Container=<br />
The effects container also contains a list of effect subcontainers. The effect subcontainers support the following generic tags.<br />
<br />
kind ""<br />
name ""<br />
<br />
The effect subcontainers support additional tags depending on the effect kind. The following effect kinds are supported:<br />
<br />
* [[Corona Effect]]<br />
* [[Name Effect]]<br />
* [[Attachment Effect]]<br />
* [[Animation Effect]]<br />
* [[Texture-Replacement Effect]]<br />
<br />
<br />
=Mesh-Table Example=<br />
The following is an example of a simple mesh-table which implements two levels of detail.<br />
<br />
mesh-table<br />
{<br />
default-lod0<br />
{<br />
mesh "example-lod0.im"<br />
auto-create 1<br />
lod-level 0<br />
}<br />
default-lod1<br />
{<br />
mesh "example-lod1.im"<br />
auto-create 1<br />
lod-level 1<br />
}<br />
}<br />
<br />
[[Category:Config Container]]</div>Vvmmhttps://online.ts2009.com/mediaWiki/index.php/User:VvmmUser:Vvmm2013-05-12T23:12:55Z<p>Vvmm: /* Downloads */</p>
<hr />
<div>==About me==<br />
Hi!<br />
<br />
I'm from [http://en.wikipedia.org/wiki/Romania România].<br />
<br />
I'm interested in trains, Trainz, programming, computers, networks, electronics and music.<br />
<br />
I'm trying to create new content, tutorials, contribute to the Trainz Wiki and also organize the Romanian Trainz Community.<br />
<br />
<br />
==Downloads==<br />
Check out my thread with Romanian Content and Trainz Utilities on [http://forums.auran.com/trainz/showthread.php?100069-Romanian-Content-%28and-not-only%29-by-vvmm Trainz Forums]<br />
<br />
My Website: [http://vvmm.zapto.org/ http://vvmm.zapto.org/] (in română, use [http://translate.google.ro/translate?sl=ro&tl=en&prev=_t&hl=en&ie=UTF-8&eotf=1&u=vvmm.zapto.org Google Translate for English])</div>Vvmmhttps://online.ts2009.com/mediaWiki/index.php/User:VvmmUser:Vvmm2013-05-10T06:09:10Z<p>Vvmm: </p>
<hr />
<div>==About me==<br />
Hi!<br />
<br />
I'm from [http://en.wikipedia.org/wiki/Romania România].<br />
<br />
I'm interested in trains, Trainz, programming, computers, networks, electronics and music.<br />
<br />
I'm trying to create new content, tutorials, contribute to the Trainz Wiki and also organize the Romanian Trainz Community.<br />
<br />
<br />
==Downloads==<br />
Check out my thread with Romanian Content and Trainz Utilities on [http://forums.auran.com/trainz/showthread.php?100069-Romanian-Content-%28and-not-only%29-by-vvmm Trainz Forums]<br />
<br />
My Website: [http://vvmm.zapto.org/ http://vvmm.zapto.org/]</div>Vvmmhttps://online.ts2009.com/mediaWiki/index.php/User:VvmmUser:Vvmm2013-05-10T06:08:50Z<p>Vvmm: /* Downloads */</p>
<hr />
<div>==About me==<br />
Hi!<br />
<br />
I'm from [http://en.wikipedia.org/wiki/Romania România].<br />
<br />
I'm interested in trains, Trainz, programming, computers, networks, electronics and music.<br />
<br />
I'm trying to create new content, tutorials, contribute to the Trainz Wiki and also organize the Romanian Trainz Community.<br />
<br />
<br />
==Downloads==<br />
Check out my thread with Romanian Content and Trainz Utilities on [http://forums.auran.com/trainz/showthread.php?100069-Romanian-Content-%28and-not-only%29-by-vvmm Trainz Forums]<br />
<br />
My Website: [http://vvmm.zapto.org/]</div>Vvmmhttps://online.ts2009.com/mediaWiki/index.php/User:VvmmUser:Vvmm2013-05-01T03:48:30Z<p>Vvmm: </p>
<hr />
<div>==About me==<br />
Hi!<br />
<br />
I'm from [http://en.wikipedia.org/wiki/Romania România].<br />
<br />
I'm interested in trains, Trainz, programming, computers, networks, electronics and music.<br />
<br />
I'm trying to create new content, tutorials, contribute to the Trainz Wiki and also organize the Romanian Trainz Community.<br />
<br />
<br />
==Downloads==<br />
Check out my thread with Romanian Content and Trainz Utilities on [http://forums.auran.com/trainz/showthread.php?100069-Romanian-Content-%28and-not-only%29-by-vvmm Trainz Forums]<br />
<br />
My Website: ''TBA''</div>Vvmmhttps://online.ts2009.com/mediaWiki/index.php/User:VvmmUser:Vvmm2013-05-01T03:48:20Z<p>Vvmm: /* Downloads */</p>
<hr />
<div>==About me==<br />
Hi!<br />
<br />
I'm from [http://en.wikipedia.org/wiki/Romania România].<br />
<br />
I'm interested in trains, Trainz, programming, computers, networks, electronics and music.<br />
<br />
I'm trying to create new content, tutorials, contribute to the Trainz Wiki and also organize the Romanian Trainz Community.<br />
<br />
<br />
==Downloads==<br />
Check out my thread with Romanian Content and Trainz Utilities on [http://forums.auran.com/trainz/showthread.php?100069-Romanian-Content-%28and-not-only%29-by-vvmm Trainz Forums]<br />
My Website: ''TBA''</div>Vvmmhttps://online.ts2009.com/mediaWiki/index.php/Build_NumbersBuild Numbers2013-04-24T01:30:04Z<p>Vvmm: sp1 hotfix1</p>
<hr />
<div>==TS2009==<br />
<br />
The following builds exist for [[TS2009]]. Where patches are available, these are noted beside the build number.<br />
<br />
{| border=1 cellpadding=2 cellspacing=0<br />
|'''Build Number'''||'''Patches available'''||'''Build description'''<br />
|-<br />
|Build 37625||auto-patch to 40040||English Online Release<br />
|-<br />
|Build 38017||auto-patch to 40040||[[TS2009 SP1]]<br />
|-<br />
|Build 38411||auto-patch to 40040||English Retail<br />
|-<br />
|Build 38599||auto-patch to 40040||[[TS2009 SP1]] hotfix<br />
|-<br />
|Build 38610||PROTECTED||Steam English Retail<br />
|-<br />
|Build 38808||auto-patch to 41590||French Retail<br />
|-<br />
|Build 38824||-||Dutch Retail<br />
|-<br />
|Build 38869||PROTECTED||UK Retail<br />
|-<br />
|Build 39176||-||German Retail<br />
|-<br />
|Build 39413||auto-patch to 40040||Czech, Polish, Hungarian Retail<br />
|-<br />
|Build 39561||-||Spanish Retail<br />
|-<br />
|Build 39979||auto-patch to 40040||[[TS2009 SP2]]<br />
|-<br />
|Build 40040||-||[[TS2009 SP2]] hotfix<br />
|-<br />
|Build 40357||-||Cabon City English Online Release<br />
|-<br />
|Build 40542||-||Russian Retail<br />
|-<br />
|Build 40702||-||Cabon City English Online Release<br />
|-<br />
|Build 40702||-||Treez English Online Release<br />
|-<br />
|Build 40762||-||Murchison English Online Release<br />
|-<br />
|Build 40837||-||S&C English Online Release<br />
|-<br />
|Build 40895||-||Spanish pre-SP3<br />
|-<br />
|Build 41497||-||Dutch, German pre-SP3<br />
|-<br />
|Build 41546||-||Italian Retail<br />
|-<br />
|Build 41590||-||French pre-SP3<br />
|-<br />
|Build 41844||-||[[TS2009 SP3]]<br />
|-<br />
|Build 44653||-||[[TS2009 SP4]]<br />
|}<br />
<br />
==TS2010==<br />
<br />
The following builds exist for [[TS2010]]. Where patches are available, these are noted beside the build number.<br />
<br />
{| border=1 cellpadding=2 cellspacing=0<br />
|'''Build Number'''||'''Patches available'''||'''Build description'''<br />
|-<br />
|Build 41491||manual patch to 41615||English Online Release<br />
|-<br />
|Build 41615||manual patch to 43434||[[TS2010 SP1]]<br />
|-<br />
|Build 41622||manual patch to 43434||English Online Release<br />
|-<br />
|Build 42203||manual patch to 43434||[[TS2010 SP2]] English, Swedish Retail Release<br />
|-<br />
|Build 42534||-||French Retail<br />
|-<br />
|Build 42763||-||German Retail<br />
|-<br />
|Build 42831||-||Dutch Retail<br />
|-<br />
|Build 42953||-||Russian Retail<br />
|-<br />
|Build 43030||-||Czech, Polish Retail<br />
|-<br />
|Build 43233||-||Spanish Retail<br />
|-<br />
|Build 43434||-||[[TS2010 SP3]]<br />
|-<br />
|Build 44088||-||[[TS2010 SP3]] Minor revision<br />
|-<br />
|Build 45467||auto patch to 46170||[[TS2010 SP4]] (including Trainz Multiplayer Beta)<br />
|-<br />
|Build 45607||auto patch to 46170||[[TS2010 SP4]] patch 1 (including Trainz Multiplayer Beta)<br />
|-<br />
|Build 46170||manual patch to 49938||[[TS2010 SP4]] patch 2 (including Trainz Multiplayer Beta)<br />
|-<br />
|Build 49933||-||[[TS2010 SP3]] Minor revision, added support for Aerotrain DLC<br />
|-<br />
|Build 49938||-||[[TS2010 SP4]] patch 3 (including Trainz Multiplayer Beta), added support for Aerotrain DLC<br />
|-<br />
|}<br />
<br />
==TS12==<br />
<br />
The following builds exist for [[TS12]]. Where patches are available, these are noted beside the build number.<br />
<br />
{| border=1 cellpadding=2 cellspacing=0<br />
|'''Build Number'''||'''Patches available'''||'''Build description'''<br />
|-<br />
|Build 46957||auto-patch to 48054||Planet Auran release version<br />
|-<br />
|Build 47059||auto-patch to 48054||Minor revision<br />
|-<br />
|Build 47103||-||Steam release<br />
|-<br />
|Build 47452||auto-patch to 48054||Just Trainz release version<br />
|-<br />
|Build 47772||auto-patch to 48054||Just Trainz release version (minor revision)<br />
|-<br />
|Build 48054||manual patch to 48249||Minor revision<br />
|-<br />
|Build 48249||manual patch to 49922||Minor revision<br />
|-<br />
|Build 49922||-||Minor revision, added support for Aerotrain DLC<br />
|-<br />
|Build 52143||-||Russian Release<br />
|-<br />
|Build 57720||-||TS12 SP1 English<br />
|-<br />
|Build 57825||-||TS12 SP1 Hotfix 1 English<br />
|}<br />
<br />
==Trainz Simulator Mac==<br />
<br />
The following builds exist for [[Trainz Simulator Mac]]. Where patches are available, these are noted beside the build number.<br />
<br />
{| border=1 cellpadding=2 cellspacing=0<br />
|'''Build Number'''||'''Patches available'''||'''Build description'''<br />
|-<br />
|Build 47652||-||Planet Auran Digital Store release<br />
|-<br />
|Build 47770||-||Third-party Digital Store release<br />
|-<br />
|Build 48159||-||Feral retail release<br />
|}<br />
<br />
== Content Builds ==<br />
<br />
Auran's patch technology has the capability of updating the base Trainz version and installed addon content independently. The following is a list of released content build versions for addon content.<br />
<br />
{| border=1 cellpadding=2 cellspacing=0<br />
|'''Content Build Number'''||'''Content Patches available'''||'''Build description'''<br />
|-<br />
|Content Build 40355||-||Cabon City English Online Release<br />
|-<br />
|Content Build 40400||-||Cabon City English Online Release<br />
|-<br />
|Content Build 40563||-||Treez English Online Release<br />
|-<br />
|Content Build 40761||-||Murchison English Online Release<br />
|-<br />
|Content Build 40836||-||S&C English Online Release<br />
|-<br />
|Content Build 49210||-||Duchess Online Release<br />
|-<br />
|Content Build 49474||-||Duchess Steam Release<br />
|-<br />
|Content Build 49631||-||Coronation Scot Online Release<br />
|-<br />
|Content Build 49694||-||Coronation Scot Steam Release<br />
|}</div>Vvmmhttps://online.ts2009.com/mediaWiki/index.php/User_talk:VvmmUser talk:Vvmm2013-04-22T17:20:13Z<p>Vvmm: </p>
<hr />
<div>Here you can talk about my contributions to the wiki.</div>Vvmmhttps://online.ts2009.com/mediaWiki/index.php/User_talk:VvmmUser talk:Vvmm2013-04-22T17:19:32Z<p>Vvmm: Created page with "--not defined--"</p>
<hr />
<div>--not defined--</div>Vvmmhttps://online.ts2009.com/mediaWiki/index.php/Category_ClassCategory Class2013-04-20T22:38:43Z<p>Vvmm: added YX class region</p>
<hr />
<div>Each Trainz asset [[config.txt file]] includes a single [[KIND_TrainzBaseSpec#category-class|category-class tag]] which helps describe the 'intent' of the Asset in the game, as opposed to the internal structure of the Asset. The classes represent a standardized system for referring to the various types of Locos, Rolling stock, Scenery, Spline and Industry assets.<br />
<br />
==Category-class Codes==<br />
<br />
===Class A: MOTIVE POWER===<br />
*AA Electric Multi-current<br />
*AC AC Electric<br />
*AD DC Electric<br />
*AE Experimental or Special<br />
*AG Gas Turbine<br />
*AH Diesel Hydraulic<br />
*AL Diesel & Diesel Electric<br />
*AM Mammal<br />
*AS Steam Loco & Tender<br />
*AT Steam Tank<br />
<br />
===Class B: BUILDINGS & STRUCTURES===<br />
*BB Buildable (Kind Buildable)<br />
*BC Commercial (scenery non-functional)<br />
*BI Industrial (scenery non-functional)<br />
**BIN Industry asset with product processing functionality<br />
*BH Home & Residential (scenery non-functional)<br />
*''Subclass BP: Passenger Station''<br />
**BPF Passenger Station with passenger processing functionality<br />
**BPN Passenger Station (non-functional)<br />
*BR Railway (scenery non-functional)<br />
*BS Special (e.g. military) (scenery non-functional)<br />
*BT Traffic & Streetscape (scenery non-functional)<br />
*BU Utility (incl. Civil buildings) (scenery non-functional)<br />
<br />
===Class C: CABEESE===<br />
*CB Brake van<br />
*CC Caboose<br />
<br />
===Class D: DEFENCE===<br />
*DA Military motive power<br />
*DE Military experimental & special vehicles<br />
*DP Military equipment - lab & personnel vehicles<br />
*DX Military equipment - freight<br />
<br />
===Class E: ENVIRONMENT===<br />
*ES Sky<br />
*EW Water<br />
<br />
===Class F: FOLIAGE===<br />
*FC Cactii<br />
*FF Flowers<br />
*FO Orchards & Crops<br />
*FS Shrub<br />
*FT Trees<br />
<br />
===Class G: GROUND===<br />
*GA Arid<br />
*GL Lush<br />
*GS Seasonal<br />
<br />
===Class H: MESHES===<br />
*HM Mesh<br />
<br />
===Class I: PRODUCT===<br />
*IC Container Category<br />
*IP Passenger Category<br />
*IB Bulkload Category<br />
*IL Liquid Category<br />
<br />
===Class J: TEXTURES===<br />
*JC Corona<br />
*JI Icon<br />
*JP Particle Effects Texture<br />
*JO Other Texture<br />
<br />
===Class L: LIGHT RAIL & MONORAIL===<br />
*LS Articulated train sets<br />
*LT Trolleys, trams & streetcars<br />
*LM Monorail vehicles<br />
<br />
===Class M: MAINTENANCE of WAY===<br />
*MA Camp vehicles<br />
*MB Ballast cars<br />
*MC Cranes/lifting<br />
*MD Diagnostic vehicles (e.g. dynamometer)<br />
*ME Instructional vehicles<br />
*MF Fire vehicles<br />
*MI Inspection vehicles<br />
*MT Track vehicles (e.g. tamper)<br />
*MP Snow ploughs<br />
*MS Section cars (e.g. fairmont)<br />
*MX Freight equipment (for MoW traffic)<br />
*MW Weed spray<br />
<br />
===Class O: ORGANISM===<br />
*OA Animal Kingdom<br />
*OH Human<br />
**OHD Locomotive Driver<br />
<br />
===Class P: PASSENGER & MAIL CARS===<br />
*PA Suburban/short haul (no W.C.)<br />
*PB Baggage cars<br />
*PC Coach/chair cars<br />
*PD Dome cars<br />
*PH Bar/cafeteria cars<br />
*PL Lounge cars<br />
*PM Mail cars<br />
*PO Observation cars<br />
*PP Power cars<br />
*PR Buffet/dining/restaurant cars<br />
*PS Sleeping cars<br />
*PU Special cars (e.g. Gaming Cars)<br />
*PV Private cars<br />
*PX Composite passenger cars<br />
<br />
===Class R: RAILCARS & MULTIPLE UNIT SETS===<br />
*RA AC electric<br />
*RC DC electric<br />
*RD Diesel & diesel electric<br />
*RH Diesel hydraulic<br />
*RP Petrol<br />
*RS Steam<br />
<br />
===Class S: SPLINES===<br />
*SF Fences<br />
*SR Roads<br />
*SP Platforms<br />
*SS Structure<br />
*SV Vegetation<br />
<br />
===Class T: TRACK===<br />
*TB Bridge<br />
*TR Rails<br />
*TT Tunnel<br />
*TF Fixed Track<br />
<br />
===Class V: VEHICLES===<br />
*VA Air<br />
*VL Land<br />
*VS Sea<br />
<br />
===Class W: WAYSIDE===<br />
*WA Signalling<br />
*WS Trackside signage<br />
*WX Accessories<br />
<br />
===Class X: FREIGHT CARS===<br />
*XA Auto transporter<br />
**XAA Open sides<br />
**XAB Auto box car<br />
*XB Box car/covered van<br />
**XBD Dangerous goods<br />
**XBG General service<br />
**XBI Insulated<br />
*XF Flat<br />
**XFA Articulated<br />
**XFC Intermodal<br />
**XFD Depressed center<br />
**XFH Heavy duty<br />
**XFM General service<br />
*XG Gondola/open wagon<br />
**XGB Bottom dumping<br />
**XGC Combination bottom/end/side dumping<br />
**XGE End dumping<br />
**XGR Rotary dumping<br />
**XGS Side dumping<br />
**XGT Covered<br />
*XH Hopper<br />
**XHB Bottom dumping<br />
**XHC Combination bottom/end/side dumping<br />
**XHE End dumping<br />
**XHR Rotary dumping<br />
**XHS Side dumping<br />
**XHT Covered<br />
*XI Foundry<br />
**XIB Bottle/torpedo cars<br />
**XIT Tipper/slag cars<br />
*XL Livestock<br />
**XLA Single deck<br />
**XLC Multiple deck and convertible<br />
**XLH Horse box<br />
*XR Refrigerated<br />
**XRI Ice chilled<br />
**XRM Mechanically chilled<br />
*XS Special<br />
**XSN Novelty<br />
**XSU Unclassified<br />
*XT Tanker<br />
**XTA Domeless<br />
**XTS Single dome<br />
**XTM Multiple dome<br />
*XV Ventilated car/louvred van<br />
**XVG General service<br />
**XVP Produce service<br />
<br />
===Class Y: MAPS & SCENARIOS===<br />
*YM Map<br />
*YS Scenario<br />
*YP Profile/Session<br />
*YT Tutorial<br />
*YR Rule<br />
*YD Driver Command<br />
*YH HTML-Asset<br />
*YX Region<br />
<br />
===Class Z: TRAIN PARTS===<br />
*ZB Bogie/Truck<br />
*ZE Enginespec<br />
*ZH Hornsound<br />
*ZI Interior<br />
*ZP Pantographs<br />
*ZS Enginesound<br />
*ZX PaintShed-Template<br />
<br />
[[Category:Config Tag|"]]</div>Vvmmhttps://online.ts2009.com/mediaWiki/index.php/Class_BrowserClass Browser2013-04-19T17:50:06Z<p>Vvmm: added browser style</p>
<hr />
<div>*[[TrainzScript Language Reference|API Hierarchy]]<br />
**[[Class GSObject|GSObject]] *<br />
***[[Class GameObject|GameObject]]<br />
****Browser<br />
<br><br />
<br />
*This class provides an interface with the Trainz [[MiniBrowser]] allowing the programmer to provide a simple HTML interface.<br />
*The browser supports a small subset of HTML code.<br />
*Muliple browsers are supported.<br />
*To create a new Browser, use [[Class Constructors#NewBrowser|Constructors.NewBrowser()]].<br />
*To populate with HTML code use either [[#LoadHTMLString|LoadHTMLString]] or [[#LoadHTMLFile|LoadHTMLFile]]<br />
*Refer to the [[MiniBrowser]] page for details of supported tags.<br />
<br><br />
<br />
==Messages==<br />
*Messages sent to and from Signal objects are listed below:<br />
<br><br />
{{TableHeader|width=50%|margin=15px}}<br />
|-<br />
|bgcolor="#EEEEEE"|'''Major'''||bgcolor="#EEEEEE"|'''Minor'''||bgcolor="#EEEEEE"|'''Source'''||bgcolor="#EEEEEE" |'''Destination'''<br />
|-<br />
|[[Browser Messages|Browser-URL]]||''URL''||Browser||Broadcast<br />
|-<br />
|[[Browser Messages|Browser-Closed]]||null||Browser||Broadcast<br />
|}<br />
<br><br />
*The ''URL '' in a ''Browser-URL'' message uses a special hyperlink tag in the form ''live://linkname''.<br />
*If your HTML contains the link ''<a href=live://anthem>Play the national anthem</a>'' and the user clicks on the link, then the Browser-URL message will take the form of ''Browser-URL,live://anthem'' and your script can intercept the message and respond accordingly.<br />
*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.<br />
*When the user closes the browser window by either clicking on the close button or pressing the Esc key, a message with a ''Browser-Closed'' message is broadcast. The Browser object would normally be reset to null in response, so that the browser window disappears. <br />
<br><br />
<br />
==Constants==<br />
*Constants defined in this class are:<br />
<br><br />
{{TableHeader|width=95%|margin=15px}}<br />
|bgcolor=#EEEEEE|<b>Browser Window Styles</b>||bgcolor=#EEEEEE| <br />
|-<br />
|width=300|public define int STYLE_NO_FRAME = 0 ||Frameless Browser (not in a bordered window).<br />
|-<br />
|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.<br />
|-<br />
|public define int STYLE_TOOLTIP = 2 ||Browser with no frame and no facility for user interaction.<br />
|}<br />
<br><br />
<br />
==General Methods==<br />
===BringToFront===<br />
{{MethodHeader|public native void BringToFront(void)}}<br />
;Parameters<br />
*None<br />
;Returned Value<br />
*None<br />
;Syntax<br />
browser.BringToFront();<br />
;Notes<br />
*Brings the window in front of all other browsers.<br />
<br><br />
<br />
===GetAsset===<br />
{{MethodHeader|public native Asset GetAsset(void)}}<br />
;Parameters<br />
*None<br />
;Returned Value<br />
*The Asset from which this Browser is loading html data and resources.<br />
;Syntax<br />
Asset asset = browser.GetAsset();<br />
;Notes<br />
*The returned asset will be the asset used in the last call to [[#LoadHTMLFile|LoadHTMLFile]] or [[#LoadHTMLString|LoadHTMLString]].<br />
*If there has been no such call the returned value will be null.<br />
<br><br />
<br />
===GetWindowVisible===<br />
{{MethodHeader|public native bool GetWindowVisible(void)}}<br />
;Parameters<br />
*None<br />
;Returned Value<br />
*True to indicate that the browser is currently visible on screen, false that the browser is hidden.<br />
;Syntax<br />
hidden = !browser.GetWindowVisible();<br />
;Notes<br />
<br><br />
<br />
===LoadHTMLFile===<br />
{{MethodHeader|public native void LoadHTMLFile(Asset asset, string filename)}}<br />
;Parameters<br />
*'''asset''' = reference to the asset where the HTML file and other resources are located.<br />
*'''filename''' = HTML file to load, may include a relative path specifier.<br />
;Returned Value<br />
*None<br />
;Syntax<br />
browser.LoadHTMLFile(resourceAsset,"/html/File-01.html");<br />
;Notes<br />
*The asset may be of any type, as long as the appropriate files are included in its folder structure.<br />
<br><br />
<br />
===LoadHTMLString===<br />
{{MethodHeader|public native void LoadHTMLString(Asset asset, string htmlData)}}<br />
;Parameters<br />
*'''asset''' = reference to the asset where any resources required are located.<br />
*'''htmlData''' = string containing HTML code to load into browser.<br />
;Returned Value<br />
*None<br />
;Syntax<br />
browser.LoadHTMLString(resourceAsset,htmlData);<br />
;Notes<br />
*The asset may be of any type, as long as the appropriate files are included in its folder structure.<br />
<br><br />
<br />
===ResetScrollBar===<br />
{{MethodHeader|public native void ResetScrollBar(void)}}<br />
;Parameters<br />
*None<br />
;Returned Value<br />
*None<br />
;Syntax<br />
browser.ResetScrollBar();<br />
;Notes<br />
*Moves the scrollbar grip and the html contents to the top.<br />
<br><br />
<br />
===SetCloseEnabled===<br />
{{MethodHeader|public native void SetCloseEnabled(bool enabled)}}<br />
;Parameters<br />
*'''enabled''' = Set to false to prevent the user from closing the browser, set to true to enable closure.<br />
;Returned Value<br />
*None<br />
;Syntax<br />
browser.SetCloseEnabled(false);<br />
;Notes<br />
<br><br />
<br />
===SetParam===<br />
{{MethodHeader|public native void SetParam(int index, string value)}}<br />
;Parameters<br />
*'''index''' = index of parameter to set.<br />
*'''value''' = string value to assign to the specified parameter.<br />
;Returnd Value<br />
*None<br />
;Syntax<br />
browser.SetParam(2,"Birmingham New Street");<br />
;Notes<br />
*HTML code may contain changeable parameters denoted by the placeholder characters ''$#'', where # is a number.<br />
*SetParam() intructs the parser to substitute the text in the function parameter for the placeholder when the browser is loaded.<br />
<br><br />
<br />
===SetScrollEnabled===<br />
{{MethodHeader|public native void SetScrollEnabled(bool enabled)}}<br />
;Parameters<br />
*'''enabled''' = Set to false to prevent the user from scrolling the browser, set to true to enable.<br />
;Returned Value<br />
*None<br />
;Syntax<br />
browser.SetScrollEnabled(false);<br />
;Notes<br />
<br><br />
<br />
===SetWindowStyle===<br />
{{MethodHeader|public native void SetWindowStyle(int style)}}<br />
;Parameters<br />
*'''style''' = One of the [[#Constants|Browser Window Style]] constants defining the type of browser to be provided.<br />
;Returned Value<br />
*None<br />
;Syntax<br />
browser.SetWindowStyle(Browser.STYLE_DEFAULT);<br />
;Notes<br />
<br><br />
<br />
===SetWindowVisible===<br />
{{MethodHeader|public native void SetWindowVisible(bool visible)}}<br />
;Parameters<br />
*'''visible''' = true to show the browser window, false to hide it.<br />
;Returned Value<br />
*None<br />
;Syntax<br />
SetWindowVisible(!GetWindowVisible());<br />
;Notes<br />
<br><br />
<br />
==Browser Size & Position==<br />
*This group of methods are used to retrieve and set the position and size of the Browser window.<br />
*A pixel coordinate system is used with 0,0 being the top left and ScreenWidth - 1, ScreenHeight - 1 being the bottom right.<br />
===GetWindowLeft===<br />
{{MethodHeader|public native int GetWindowLeft(void)}}<br />
*Retrieves the pixel coordinate of the left hand edge.<br />
===GetWindowTop===<br />
{{MethodHeader|public native int GetWindowTop(void)}}<br />
*Retrieves the pixel coordinate of the top edge.<br />
===GetWindowRight===<br />
{{MethodHeader|public native int GetWindowRight(void)}}<br />
*Retrieves the pixel coordinate of the right hand edge.<br />
===GetWindowBottom===<br />
{{MethodHeader|public native int GetWindowBottom(void)}}<br />
*Retrieves the pixel coordinate of the bottom edge.<br />
===GetWindowWidth===<br />
{{MethodHeader|public native int GetWindowWidth(void)}}<br />
*Retrieves the width of the window in pixels.<br />
===GetWindowHeight===<br />
{{MethodHeader|public native int GetWindowHeight(void)}}<br />
*Retrieves the height of the window in pixels.<br />
;Parameters<br />
*None<br />
;Syntax<br />
int width = browser.GetWindowWidth();<br />
;Notes<br />
<br><br />
<br />
===SetWindowLeft===<br />
{{MethodHeader|public native void SetWindowLeft(int left)}}<br />
*Sets the pixel coordinate of the left hand edge.<br />
===SetWindowTop===<br />
{{MethodHeader|public native void SetWindowTop(int top)}}<br />
*Sets the pixel coordinate of the top edge.<br />
===SetWindowRight===<br />
{{MethodHeader|public native void SetWindowRight(int right)}}<br />
*Sets the pixel coordinate of the right hand edge.<br />
===SetWindowBottom===<br />
{{MethodHeader|public native void SetWindowBottom(int bottom)}}<br />
*Sets the pixel coordinate of the bottom edge.<br />
===SetWindowRect===<br />
{{MethodHeader|public native void SetWindowRect(int left, int, top, int right, int bottom)}}<br />
*Sets the pixel coordinates of all four edges in a single call.<br />
===SetWindowWidth===<br />
{{MethodHeader|public native void SetWindowWidth(int width)}}<br />
*Sets the width of the window in pixels.<br />
===SetWindowHeight===<br />
{{MethodHeader|public native void SetWindowHeight(int height )}}<br />
*Sets the height of the window in pixels.<br />
===SetWindowSize===<br />
{{MethodHeader|public native void SetWindowSize(int width, int height )}}<br />
*Sets the height and width of the window in pixels.<br />
===SetWindowPosition===<br />
{{MethodHeader|public native void SetWindowPosition(int left, int top)}}<br />
*Moves the window to the specified coordinates without affecting its size.<br />
;Parameters<br />
*'''left''' = Pixel coordinate of the left hand edge.<br />
*'''top''' = Pixel coordinate of the top edge.<br />
*'''right''' = Pixel coordinate of the right hand edge.<br />
*'''bottom''' = Pixel coordinate of the bottom edge.<br />
*'''width''' = Window width in pixels.<br />
*'''height''' = Window height in pixels.<br />
;Returned Value<br />
*None<br />
;Syntax<br />
browser.SetWindowRect(0,0,200,300);<br />
;Notes<br />
<br><br />
<br />
===SetWindowGrow===<br />
{{MethodHeader|public native void SetWindowGrow(int minWidth, int minHeight, int maxWidth, int maxHeight)}}<br />
;Parameters<br />
*'''minWidth,minHeight''' = Minimum width and height in pixels.<br />
*'''maxWidth,maxHeight''' = Maximum width and height in pixels.<br />
;Returned Value<br />
*None<br />
;Syntax<br />
browser.SetWindowGrow(100,100,300,300);<br />
;Notes<br />
*Defines a maximum and minimum height and width that the browser window will be constrained to.<br />
<br><br />
<br />
==Trainz Object HTML Element==<br />
*<nowiki><trainz-object></nowiki> tags define special browser objects which the user can interact with.<br />
*These include a graphic dial, a text entry box or a browser frame and a range of parameters can be applied.<br />
<br><br />
{{TableHeader|width=50%|margin=15px}}<br />
|-<br />
|bgcolor="#EEEEEE"|'''Property'''||bgcolor="#EEEEEE"|'''Value'''||bgcolor="#EEEEEE"|'''Description'''<br />
|-<br />
|style||string||Type of control, "dial", "text-line" or "browser"<br />
|-<br />
|id||string||Name of this object in the browser. <br />
|-<br />
|width||integer||Pixel width of area to display object in. <br />
|-<br />
|height||integer||Pixel height of area to display object in. <br />
|-<br />
|texture||filename||Filename of texture for the object. <br />
|-<br />
|min||float||Maximum value of control. <br />
|-<br />
|max||float||Maximum value of control. <br />
|-<br />
|valmin||float||Minimum possible value the object can be. <br />
|-<br />
|valmax||float||Maximum possible value the object can be. <br />
|-<br />
|step||integer||Steps in this control. <br />
|-<br />
|clickstep||integer||Number of steps per click <br />
|-<br />
|value||float||initial default value of the object. <br />
|}<br />
<br><br />
*The HTML definition for a dial would be<br />
<nowiki><a href="live://dial/dcc" tooltip="Speed control"></nowiki><br />
<trainz-object style=dial <br />
width=100 <br />
height=100<br />
id="dcc"<br />
texture="newdriver/dcc/dcc_controller.tga"<br />
min=0.1<br />
max=0.9<br />
valmin=-1.0<br />
valmax=1.0<br />
step=0<br />
clickstep=1<br />
value=0.5><br />
</trainz-object><br />
</a><br />
<br><br />
*This HTML code implements the issuing of a Browser-URL message whenever the dial is adjusted by the user.<br />
*When the asset script receives the message it will be able to query the control to determine what it needs to do.<br />
*Similarly if the script updates any of the dial's properties the HTML graphics will reflect the change.<br />
<br><br />
<br />
===GetElementProperty===<br />
{{MethodHeader|public native string GetElementProperty(string elementId, string propertyId)}}<br />
;Parameters<br />
*'''elementId''' = Name of HTML element to query.<br />
*'''propertyId''' = Name of trainz-object property to retrieve.<br />
;Returned Value<br />
*Current value of specified property.<br />
;Syntax<br />
float speed = (float)browser.GetElementProperty("dcc","value"); // returns the current dial position<br />
;Notes<br />
*All values are returned in string format and must be cast or converted as appropriate.<br />
<br><br />
<br />
===SetElementObjectProperty===<br />
{{MethodHeader|public native void SetElementProperty(string elementId, string propertyId, object value)}}<br />
<font color=red>I quote N3V's definition verbatim</font><br><br />
Sets the property of the named object element in this browser to the given object. <br />
<br />
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. <br />
<br />
An element in a HTML page is usually a something like a text entry box, dial or button defined by a <trainz-object> tag. Each element has multiple properties in it and this method allows those property items to be set by name.<br />
<br />
Parameters: <br />
*elementID Name of element to set the property of. <br />
*propertyID Property in the element to set. Properties the <trainz-object> tag supports can be used. <br />
*value Object the is the value the property will be assigned. <br><br />
<font color=red>I can't make any sense out of that so you are on your own!</font><br />
<br><br><br />
<br />
===SetElementProperty===<br />
{{MethodHeader|public native void SetElementProperty(string elementId, string propertyId, string value)}}<br />
;Parameters<br />
*'''elementId''' = Name of HTML element to update.<br />
*'''propertyId''' = Name of trainz-object property to update.<br />
*'''value''' = New value to set.<br />
;Returned Value<br />
*None<br />
;Syntax<br />
browser.SetElementProperty("dcc","value",(string)speed); // updates the current dial position<br />
;Notes<br />
*All values must be cast or converted to string format for use in this method.<br />
<br><br />
<br />
==Trainz Text HTML Element==<br />
*<nowiki><trainz-text></nowiki> tags define text strings which can be updated without the need to reload the page.<br />
*These take the form <nowiki><trainz-text id="speed" text="0mph"></trainz-text></nowiki><br />
*The text tag specifies the default text that is displayed for the item when the page is initially created.<br />
*Once the page is loaded, a script can use SetTrainzText() to provide a dynamic update.<br />
<br><br />
<br />
===SetTrainzText===<br />
{{MethodHeader|public native void SetTrainzText(string id, string text)}}<br />
;Parameters<br />
*'''id''' = The id of the ''trainz-text'' item to update.<br />
*'''text''' = The string value to provide.<br />
;Returned Value<br />
*None<br />
;Syntax<br />
browser.SetTrainzText("speed","90mph");<br />
;Notes<br />
<br><br />
<br />
==Code Examples==<br />
*This code illustrates the basics of handling a browser.<br />
class TestBrowser isclass MapObject {<br />
<br />
<font color=#808080>// A global variable to hold the browser object</font><br />
Browser browser;<br />
<br />
void OpenBrowser(void) {<br />
<font color=#808080>// if the browser doesn't already exist it needs to be created</font><br />
if (!browser) browser = Constructors.NewBrowser();<br />
<font color=#808080>// define the size and style and load HTML, in this case from a file in the calling asset</font><br />
browser.SetWindowPosition(0,0);<br />
browser.SetWindowStyle(browser.STYLE_DEFAULT);<br />
browser.SetWindowSize(200,500);<br />
browser.LoadHTMLFile(GetAsset(),"HTMLSource.html");<br />
}<br />
<br />
void CloseBrowser(Message msg) {<br />
<font color=#808080>// if the browser has been closed we need to destroy the reference to it</font><br />
if (msg.src == browser) browser = null;<br />
}<br />
<br />
void BrowserLink(Message msg) {<br />
<font color=#808080>// make sure that we are responding to the correct browser object</font><br />
if (msg.src != browser) return;<br />
<font color=#808080>// carry out the appropriate response to the link</font><br />
string link = msg.minor;<br />
if (link == "live://anthem") {<br />
World.Play2DSound(GetAsset(),"God Save the Queen.wav");<br />
}<br />
else if (link == "live://travesty") {<br />
World.Play2DSound(GetAsset(),"Advance Australia Fair.wav");<br />
}<br />
}<br />
<br />
public void Init(void) {<br />
inherited();<br />
<font color=#808080>// create handlers for the browser messages</font><br />
AddHandler(me,"Browser-URL","","BrowserLink");<br />
AddHandler(me,"Browser-Closed","","CloseBrowser");<br />
<font color=#808080>// open the browser window</font><br />
OpenBrowser();<br />
}<br />
<br />
};<br />
<br><br />
<br />
==Related Methods==<br />
[[Class Constructors#NewBrowser|Constructors.NewBrowser()]]<br><br />
<br><br />
<br />
==Categories==<br />
[[Category:Script Class]]</div>Vvmmhttps://online.ts2009.com/mediaWiki/index.php/Category_ClassCategory Class2013-04-17T19:29:37Z<p>Vvmm: Added YT Class</p>
<hr />
<div>Each Trainz asset [[config.txt file]] includes a single [[KIND_TrainzBaseSpec#category-class|category-class tag]] which helps describe the 'intent' of the Asset in the game, as opposed to the internal structure of the Asset. The classes represent a standardized system for referring to the various types of Locos, Rolling stock, Scenery, Spline and Industry assets.<br />
<br />
==Category-class Codes==<br />
<br />
===Class A: MOTIVE POWER===<br />
*AA Electric Multi-current<br />
*AC AC Electric<br />
*AD DC Electric<br />
*AE Experimental or Special<br />
*AG Gas Turbine<br />
*AH Diesel Hydraulic<br />
*AL Diesel & Diesel Electric<br />
*AM Mammal<br />
*AS Steam Loco & Tender<br />
*AT Steam Tank<br />
<br />
===Class B: BUILDINGS & STRUCTURES===<br />
*BB Buildable (Kind Buildable)<br />
*BC Commercial (scenery non-functional)<br />
*BI Industrial (scenery non-functional)<br />
**BIN Industry asset with product processing functionality<br />
*BH Home & Residential (scenery non-functional)<br />
*''Subclass BP: Passenger Station''<br />
**BPF Passenger Station with passenger processing functionality<br />
**BPN Passenger Station (non-functional)<br />
*BR Railway (scenery non-functional)<br />
*BS Special (e.g. military) (scenery non-functional)<br />
*BT Traffic & Streetscape (scenery non-functional)<br />
*BU Utility (incl. Civil buildings) (scenery non-functional)<br />
<br />
===Class C: CABEESE===<br />
*CB Brake van<br />
*CC Caboose<br />
<br />
===Class D: DEFENCE===<br />
*DA Military motive power<br />
*DE Military experimental & special vehicles<br />
*DP Military equipment - lab & personnel vehicles<br />
*DX Military equipment - freight<br />
<br />
===Class E: ENVIRONMENT===<br />
*ES Sky<br />
*EW Water<br />
<br />
===Class F: FOLIAGE===<br />
*FC Cactii<br />
*FF Flowers<br />
*FO Orchards & Crops<br />
*FS Shrub<br />
*FT Trees<br />
<br />
===Class G: GROUND===<br />
*GA Arid<br />
*GL Lush<br />
*GS Seasonal<br />
<br />
===Class H: MESHES===<br />
*HM Mesh<br />
<br />
===Class I: PRODUCT===<br />
*IC Container Category<br />
*IP Passenger Category<br />
*IB Bulkload Category<br />
*IL Liquid Category<br />
<br />
===Class J: TEXTURES===<br />
*JC Corona<br />
*JI Icon<br />
*JP Particle Effects Texture<br />
*JO Other Texture<br />
<br />
===Class L: LIGHT RAIL & MONORAIL===<br />
*LS Articulated train sets<br />
*LT Trolleys, trams & streetcars<br />
*LM Monorail vehicles<br />
<br />
===Class M: MAINTENANCE of WAY===<br />
*MA Camp vehicles<br />
*MB Ballast cars<br />
*MC Cranes/lifting<br />
*MD Diagnostic vehicles (e.g. dynamometer)<br />
*ME Instructional vehicles<br />
*MF Fire vehicles<br />
*MI Inspection vehicles<br />
*MT Track vehicles (e.g. tamper)<br />
*MP Snow ploughs<br />
*MS Section cars (e.g. fairmont)<br />
*MX Freight equipment (for MoW traffic)<br />
*MW Weed spray<br />
<br />
===Class O: ORGANISM===<br />
*OA Animal Kingdom<br />
*OH Human<br />
**OHD Locomotive Driver<br />
<br />
===Class P: PASSENGER & MAIL CARS===<br />
*PA Suburban/short haul (no W.C.)<br />
*PB Baggage cars<br />
*PC Coach/chair cars<br />
*PD Dome cars<br />
*PH Bar/cafeteria cars<br />
*PL Lounge cars<br />
*PM Mail cars<br />
*PO Observation cars<br />
*PP Power cars<br />
*PR Buffet/dining/restaurant cars<br />
*PS Sleeping cars<br />
*PU Special cars (e.g. Gaming Cars)<br />
*PV Private cars<br />
*PX Composite passenger cars<br />
<br />
===Class R: RAILCARS & MULTIPLE UNIT SETS===<br />
*RA AC electric<br />
*RC DC electric<br />
*RD Diesel & diesel electric<br />
*RH Diesel hydraulic<br />
*RP Petrol<br />
*RS Steam<br />
<br />
===Class S: SPLINES===<br />
*SF Fences<br />
*SR Roads<br />
*SP Platforms<br />
*SS Structure<br />
*SV Vegetation<br />
<br />
===Class T: TRACK===<br />
*TB Bridge<br />
*TR Rails<br />
*TT Tunnel<br />
*TF Fixed Track<br />
<br />
===Class V: VEHICLES===<br />
*VA Air<br />
*VL Land<br />
*VS Sea<br />
<br />
===Class W: WAYSIDE===<br />
*WA Signalling<br />
*WS Trackside signage<br />
*WX Accessories<br />
<br />
===Class X: FREIGHT CARS===<br />
*XA Auto transporter<br />
**XAA Open sides<br />
**XAB Auto box car<br />
*XB Box car/covered van<br />
**XBD Dangerous goods<br />
**XBG General service<br />
**XBI Insulated<br />
*XF Flat<br />
**XFA Articulated<br />
**XFC Intermodal<br />
**XFD Depressed center<br />
**XFH Heavy duty<br />
**XFM General service<br />
*XG Gondola/open wagon<br />
**XGB Bottom dumping<br />
**XGC Combination bottom/end/side dumping<br />
**XGE End dumping<br />
**XGR Rotary dumping<br />
**XGS Side dumping<br />
**XGT Covered<br />
*XH Hopper<br />
**XHB Bottom dumping<br />
**XHC Combination bottom/end/side dumping<br />
**XHE End dumping<br />
**XHR Rotary dumping<br />
**XHS Side dumping<br />
**XHT Covered<br />
*XI Foundry<br />
**XIB Bottle/torpedo cars<br />
**XIT Tipper/slag cars<br />
*XL Livestock<br />
**XLA Single deck<br />
**XLC Multiple deck and convertible<br />
**XLH Horse box<br />
*XR Refrigerated<br />
**XRI Ice chilled<br />
**XRM Mechanically chilled<br />
*XS Special<br />
**XSN Novelty<br />
**XSU Unclassified<br />
*XT Tanker<br />
**XTA Domeless<br />
**XTS Single dome<br />
**XTM Multiple dome<br />
*XV Ventilated car/louvred van<br />
**XVG General service<br />
**XVP Produce service<br />
<br />
===Class Y: MAPS & SCENARIOS===<br />
*YM Map<br />
*YS Scenario<br />
*YP Profile/Session<br />
*YT Tutorial<br />
*YR Rule<br />
*YD Driver Command<br />
*YH HTML-Asset<br />
<br />
===Class Z: TRAIN PARTS===<br />
*ZB Bogie/Truck<br />
*ZE Enginespec<br />
*ZH Hornsound<br />
*ZI Interior<br />
*ZP Pantographs<br />
*ZS Enginesound<br />
*ZX PaintShed-Template<br />
<br />
[[Category:Config Tag|"]]</div>Vvmmhttps://online.ts2009.com/mediaWiki/index.php/%22privileges%22_container"privileges" container2013-04-17T19:27:05Z<p>Vvmm: added is-payware-content tag</p>
<hr />
<div>The privileges container is a top-level [[config.txt file]] entry used by [[KIND TrainzBaseSpec]] and all derived assets.<br />
<br />
==Supported Tags==<br />
<br />
The privileges container supports the following tags. Each tag is show here with its default value.<br />
<br />
privileges<br />
{<br />
permit-commit 1<br />
permit-edit 1<br />
permit-listing 1<br />
is-payware-content 0<br />
}<br />
<br />
It should be noted that this container only takes effect when content is packaged for distribution with Trainz or an official Trainz addon pack.<br />
<br />
====permit-commit====<br />
:Type: Boolean<br />
:Desc: Controls whether local modifications to this asset can be committed. Note: '''base''' assets can never have modifications committed in order to prevent corruption of the core program.<br />
<br />
====permit-edit====<br />
:Type: Boolean<br />
:Desc: Controls whether a user may open this asset for editing. This is mainly used to prevent simple viewing of content which resides in archive files, where the content creator wishes to protect their techniques against prying eyes.<br />
<br />
====permit-listing====<br />
:Type: Boolean<br />
:Desc: Controls whether the asset shows in in-game listings. The asset will always show in [[Content Manager]] listings, regardless of this setting.<br />
<br />
====is-payware-content====<br />
''TBD''<br />
<br />
==Example privileges container==<br />
<br />
''TBD''<br />
<br />
[[Category:Config Container]]</div>Vvmmhttps://online.ts2009.com/mediaWiki/index.php/KIND_TrainzBaseSpecKIND TrainzBaseSpec2013-04-17T19:25:48Z<p>Vvmm: Added kind gameplaymenu</p>
<hr />
<div>[[KIND TrainzBaseSpec]] provides the basis for all Trainz asset types. It provides for a number of "Standard Tags" which are common to all Trainz assets.<br />
<br />
=KIND Hierarchy=<br />
==Parent Classes==<br />
* ''none.''<br />
==Child Classes==<br />
* [[KIND Environment]]<br />
* [[KIND Scenariobehavior]]<br />
* [[KIND Mesh]]<br />
* [[KIND Activity]]<br />
* [[KIND Consist]]<br />
* [[KIND Drivercommand]]<br />
* [[KIND Enginesound]]<br />
* [[KIND Engine]]<br />
* [[KIND Gameplaymenu]]<br />
* [[KIND Groundbrush]]<br />
* [[KIND Hornsound]]<br />
* [[KIND HTML-asset]]<br />
* [[KIND Map]]<br />
* [[KIND Module]]<br />
* [[KIND Product-category]]<br />
* [[KIND Profile]]<br />
* [[KIND Texture]]<br />
* [[KIND Texture-group]]<br />
* [[KIND Tracksound]]<br />
* [[KIND Library]]<br />
* [[KIND Track]]<br />
<br />
=Supported Tags=<br />
The [[KIND TrainzBaseSpec]] [[config.txt file]] supports the following tags. Each tag is show here with its default value.<br />
<br />
kind ""<br />
kuid <NULL><br />
trainz-build ?<br />
script ""<br />
class ""<br />
script-include-table<br />
{<br />
}<br />
username ""<br />
username-XX ""<br />
description ""<br />
description-XX ""<br />
kuid-table<br />
{<br />
}<br />
obsolete-table<br />
{<br />
}<br />
string-table<br />
{<br />
}<br />
string-table-XX<br />
{<br />
}<br />
category-region ""<br />
category-class ""<br />
category-era ""<br />
category-keyword ""<br />
custom-category-list ""<br />
must-have-product-rights ""<br />
must-not-have-product-rights ""<br />
privileges<br />
{<br />
}<br />
thumbnails<br />
{<br />
}<br />
extensions<br />
{<br />
}<br />
license ""<br />
author ""<br />
organisation ""<br />
contact-email ""<br />
contact-website ""<br />
member-of-groups<br />
{<br />
}<br />
<br />
<br />
<br />
====kind====<br />
:''type:'' string.<br />
:''desc:'' The asset type which this [[config.txt file]] represents.<br />
<br />
====kuid====<br />
:''type:'' [[KUID]]<br />
:''desc:'' The unique asset ID referencing this asset.<br />
<br />
====trainz-build====<br />
:''type:'' floating point number (must exactly match a released Trainz version number.)<br />
:''desc:'' The file format version to which this asset is built. This number should generally be set to the trainz version number of the Trainz installation on which the asset is being created and tested. Some asset kinds are parsed significantly differently depending on their ''trainz-build'' version tag. NOTE: The ''trainz-build'' tag is compulsory. If not specified, Trainz will make a primitive attempt to guess at a legacy Trainz version based on the contents of the [[config.txt file]].<br />
<br />
====script====<br />
:''type:'' string.<br />
:''desc:'' Indicates the filepath of the primary script file for this asset, if any. This filepath should always end in a ".gs" extension - the runtime will attempt to add or substitute a ".gs" extension if the filepath has an alternative extension.<br />
<br />
====class====<br />
:''type:'' string.<br />
:''desc:'' Indicates the script class name to load as the primary class for this asset, if any. This class is loaded from the primary script file for this asset.<br />
<br />
====script-include-table====<br />
:''type:'' The [["script-include-table" container]].<br />
:''desc:'' A key-value table of scripted assets which are searched for script includes when compiling this asset's script file(s). The key is currently unused but must be unique; the value indicates the KUID of the asset to include.<br />
<br />
====username====<br />
:''type:'' UTF-8 string, [["Username" tag]].<br />
:''desc:'' The '''English''' human-visible name for this asset. This field should never contain non-English text, except where the asset name is a Proper Noun (eg. a place name) with no English localized variant.<br />
<br />
====username-XX====<br />
:''type:'' UTF-8 string, [["Username" tag]].<br />
:''desc:'' (Where ''XX'' is replaced with the appropriate [[localization code]] for the language being represented.) The localized human-visible name for this asset. This field is similar to the ''username'' field except representing a non-English locale. Multiple ''username-XX'' tags may be present in an asset, once for each supported locale. If the appropriate 'username-XX' tag is not present to represent this asset on a given end-user system, the English ''username'' tag is used instead.<br />
<br />
====description====<br />
:''type:'' UTF-8 multi-line string, [["Description" tag]].<br />
:''desc:'' The '''English''' human-visible descriptive summary for this asset. This field should be kept to a short (1-2 paragraph) blurb describing the asset. Extended details should be provided via an ''info-url'' page. This field must be comprised of English descriptive text, although the text may reference non-English Proper Nouns as explained above.<br />
<br />
====description-XX====<br />
:''type:'' UTF-8 multi-line string, [["Description" tag]].<br />
:''desc:'' (Where ''XX'' is replaced with the appropriate [[localization code]] for the language being represented.) The localized human-visible descriptive summary for this asset. This field is similar to the ''description'' field except representing a non-English locale. Multiple ''description-XX'' tags may be present in an asset, once for each supported locale. If the appropriate 'description-XX' tag is not present to represent this asset on a given end-user system, the English ''description'' tag is used instead.<br />
<br />
====string-table====<br />
:''type:'' UTF-8 string list container, the [["String-table" container]].<br />
:''desc:'' A key-value list of '''English''' strings. Each key is a meaningful script identifier. Each value is an '''English''' string. As described above, an English string may comprise of or reference a non-English Proper Noun.<br />
<br />
====string-table-XX====<br />
:''type:'' UTF-8 string list container, the [["String-table" container]]. <br />
:''desc:'' (Where ''XX'' is replaced with the appropriate [[localization code]] for the language being represented.) This field is similar to the ''string-table'' field except representing a non-English locale. Multiple ''string-table-XX'' tags may be present in an asset, once for each supported locale. Each should contain a list of strings with the same Keys as in the ''string-table'' list, but with different Values. If the appropriate 'string-table-XX' tag is not present to represent this asset on a given end-user system, or the appropriate string is missing from the that list, the English ''string-table'' container is referenced instead.<br />
<br />
====kuid-table====<br />
:''type:'' KUID list container, TBD.<br />
:''desc:'' A key-value list of assets upon which this asset is dependent. The keys may be any unique value (typically sequential integers if meaningless, or script identifiers if the asset reference is referenced from script.) Entries in this table serve two purposes - firstly, to ensure that the game systems are aware of the dependency such that installing and loading this asset will successfully install and load any dependencies, and secondly to allow scripts to locate relevant child assets. Circular dependencies are legal. An asset cannot be listed as a dependency if it is also marked as an obsolete version of this asset. An asset cannot be listed as its own dependency.<br />
<br />
====obsolete-table====<br />
:''type:'' KUID list container, TBD.<br />
:''desc:'' A key-value list of assets which are made obsolete by this asset. Any attempt to load an asset referenced in this list will result in this asset being loaded instead. The assets referenced in this list must have the same creator as this asset. It is illegal for two assets to both mark a third asset obsolete, unless one of the two also marks the other as obsolete. Circular obsolete references are illegal. All preceding KUID2 versions of this asset are implied as obsolete and need not be included in this list. It is illegal to mark a future KUID2 version of this asset as obsolete as that creates an implicit circular reference.<br />
<br />
====category-region====<br />
:''type:'' string.<br />
:''desc:'' A list of two-character [[Category Region]] codes, separated by semi-colons (';'). No other characters (including whitespace, etc.) should be present in the string. This asset is considered relevant to each of the specified regions - this is most relevant for [[KIND Traincar]] and [[KIND MOSignal]] assets, but may be supplied for any asset.<br />
<br />
====category-class====<br />
:''type:'' string.<br />
:''desc:'' A single 2-3 character [[Category Class]] code which describes this content item. The ''category-class'' tag is used to provide additional human sub-categorization beyond what is implicit from the Asset Kind. Note that many category-class codes are only relevant to specific Asset Kinds - category-class codes must not be applied to assets of an inappropriate Kind.<br />
<br />
====category-era====<br />
:''type:'' string.<br />
:''desc:'' A list of five-character [[era code]]s, separated by semi-colons (';'). Each era code token must be an exact match for one of the specified legal [[era code]]s. No other characters (including whitespace, etc.) should be present in the string. This asset is considered relevant to the specified era range.<br />
<br />
====category-keyword====<br />
:''type:'' UTF-8 string.<br />
:''desc:'' A list of natural-language keywords, separated by semi-colons (';'). No other characters (including whitespace or irrelevant punctuation) should be present in the string. These keywords form the basis for asset keyword searching. The asset's name need not be repeated in the ''category-keyword'' list. Various [[default search keywords]] are supplied automatically based on the asset type.<br />
<br />
====custom-category-list====<br />
:''type:'' ascii string.<br />
:''desc:'' A list of custom category identifiers, separated by semi-colons (';'). Each [[custom category identifier]] should be a short (eg. 3-6 character) alphanumeric token. No other characters (including whitespace) should be present in the string. These custom categories are used to enable scripts to rapidly locate certain classes of asset. It is strongly recommended that new custom category identifiers are introduced sparingly. The ''custom-category-list'' tag value may have no more than 64 characters total. This tag should be left blank unless there is an existing specific script requirement that can only be fulfilled via the custom-category-list approach.<br />
<br />
====must-have-product-rights====<br />
:''type:'' ascii string.<br />
:''desc:'' A list of required product rights, separated by semi-colons (';'). If the local installation does not have the required product rights then the asset may not be loaded by certain game systems.<br />
<br />
====must-not-have-product-rights====<br />
:''type:'' ascii string.<br />
:''desc:'' A list of conflicting product rights, separated by semi-colons (';'). If the local installation has one of the listed product rights then the asset may not be loaded by certain game systems.<br />
<br />
====privileges====<br />
:''type:'' The [["privileges" container]].<br />
:''desc:'' A set of privileges set by the asset creator to control how this asset can be used.<br />
<br />
====thumbnails====<br />
:''type:'' The [["Thumbnails" container]].<br />
:''desc:'' The thumbnail(s) which are used to represent this asset in 2D preview boxes, lists, and icon form throughout the game environment (including in-game, in [[Content Manager]], and on the [[Download Station]].)<br />
<br />
====extensions====<br />
:''type:'' The [["Extensions" container]].<br />
:''desc:'' A set of extended attributes which provide additional information to scripts beyond the [[Config.txt file]] specifications defined for this asset type. Care should be taken to abide by the extensions naming guidelines when creating a new extension, and to abide by the extension-creator's guidelines when providing data for an existing extension. Auran reserves the right to add validation for specific entries in the [["Extensions" container]] at a later date, based on the extension-creator's guidelines.<br />
<br />
====license====<br />
:''type:'' UTF-8 multi-line string.<br />
:''desc:'' A license describing how the asset creator would like this asset to be used. The meaning of the ''license'' tag is ambiguous and its usage is not recommended. Content uploaded to the [[Download Station]] or provided for inclusion into the game may be under a specific redistribution contract or license agreement which supersedes any text in this field. The license field does not provide for localization support. The text of the license field is not validated or enforced by Auran and may or may not be legally binding to end users.<br />
<br />
====author====<br />
:''type:'' UTF-8 string.<br />
:''desc:'' The author's name or mark. The use of this field is not recommended as attribution can be determined programmatically. <br />
<br />
====organisation====<br />
:''type:'' UTF-8 string.<br />
:''desc:'' The name or mark of the organization responsible for the creation of this asset. The use of this field is not recommended as attribution can be determined programmatically. <br />
<br />
====contact-email====<br />
:''type:'' email address string.<br />
:''desc:'' The contact email address for the creator of this asset. The use of this field is not recommended as attribution can be determined programmatically and contact details can be registered against the creator's [[Planet Auran account]] where they can be limited or updated as necessary. <br />
<br />
====contact-website====<br />
:''type:'' URL string.<br />
:''desc:'' The contact website for the creator of this asset. The use of this field is not recommended as attribution can be determined programmatically and contact details can be registered against the creator's [[Planet Auran account]] where they can be limited or updated as necessary. <br />
<br />
====info-url====<br />
:''type:'' URL string.<br />
:''desc:'' A link to an online description of this asset. The URL must resolve to a site within the [[Trainz Online Security Zone]]. The use of custom [[Trainz Short URL]] formats is recommended to future-proof the URL against possible future site layout changes. Where this tag is present, in-game buttons are provided to allow the user to view the asset description without leaving the game environment. It is recommended that generic group pages are used for entire classes of asset in any case where the assets provide similar functionality but minor differences in appearance. This reduces the time-expense of creating, maintaining and localizing such documentation.<br />
<br />
====member-of-groups====<br />
:''type:'' [["Member-of-groups" container]].<br />
:''desc:'' A list of [[KIND Asset-group]] assets to which this asset belongs. See the [[KIND Asset-group]] documentation for details on how and when this is used.<br />
<br />
=Downloads=<br />
''Attach sample files here''<br />
<br />
<br />
=Categories=<br />
[[Category:Asset KIND]]</div>Vvmmhttps://online.ts2009.com/mediaWiki/index.php/KIND_TrackKIND Track2013-04-12T01:57:00Z<p>Vvmm: </p>
<hr />
<div>[[KIND Track]] provides the sole asset kind for spline-based assets. Contrary to the name, assets of this kind include simple track, multitrack, bridges, tunnels, hedges, roads, walls, embankments, local power lines, high-voltage power lines, and so on. Assets of this kind use a rendering technique previously known as "stitched track". Now that all other spline rendering is obsolete, it is simply known as "track".<br />
<br />
This page describes [[trainz-build]] 3.7.<br />
<br />
=KIND Hierarchy=<br />
==Parent Classes==<br />
* [[KIND TrainzBaseSpec]]<br />
==Child Classes==<br />
* none<br />
<br />
<br />
=Supported Tags=<br />
The [[KIND Track]] [[config.txt file]] supports the following tags. Each tag is show here with its default value.<br />
<br />
mesh-table<br />
{<br />
}<br />
track<br />
{<br />
}<br />
endcap-prev<br />
{<br />
}<br />
endcap-next<br />
{<br />
}<br />
attached-splines<br />
{<br />
}<br />
season-selector<br />
{<br />
}<br />
carrate 0<br />
isroad 0<br />
isfreeway 0<br />
is_silent 0<br />
numlanes 0<br />
istrack 0<br />
istunnel 0<br />
surveyor-only 0<br />
visible-on-minimap (opposite of surveyor-only)<br />
track-sound<br />
{<br />
}<br />
traffic-speed 10.0<br />
tunnel-roof-height 0.0<br />
<br />
<br />
==mesh-table==<br />
The [["mesh-table" Container]] provides details about the track and end-cap meshes which comprise this asset. Most advanced mesh-table options are not available for use at the current time. The important thing is to specify the meshes. Specifically, the 'mesh' tag should be used to specify an IM file, and the 'mesh-asset' tag can be used to specify an alternative source asset for the mesh.<br />
<br />
<br />
==track==<br />
The "track" tag is compulsory and determines how the spline geometry is formed from meshes. It is specified as a [[Track Part Container]].<br />
<br />
<br />
==attached-splines==<br />
The [["attached-splines" container]] provides a mechanism for having child splines attached which follow the shape of this parent spline at a slightly offset. Attached splines are used where a spline with one set of rendering or functional behaviour needs to be coupled with a spline with a different set of rendering or functional behaviours. For example, a bridge (scenery) with attached track (functional), or a set of pylons (no stretching or shearing) with some wires strung between them (shearing and stretching to fit.) The attached splines may be render-only splines which effectively don't exist beyond their rendering behaviour, or they may be fully functional splines whose only specialty is that they move and delete with their parent.<br />
<br />
<br />
==endcap-prev & endcap-next==<br />
The "endcap-prev" and "endcap-next" tags are specified in the same way, but are not compulsory. If present, these end caps are inserted past the ends of the spline in each direction unless the spline flows onto another spline of the same type. This allows the content creator to "seal" the spline geometry without having to introduce inefficient sealing polygons at each subdivision. The endcaps obey the normal fit-to-spline behavior except that they continue straight in the instantaneous direction of the end of the spline. The endcaps inherit their default settings from the asset's "track" tag but any individual values may be overridden as desired.<br />
<br />
<br />
==Season-selector==<br />
The [["Season-selector" container]] allows for the selection of a season index, which may be used by the [["track-lod-tree" container]].<br />
<br />
<br />
==carrate==<br />
(Only applicable to splines which have 'isroad' set.)<br />
<br />
The game waits between 1x to 3x this decimal value between generating carz on this road.<br />
<br />
<br />
==isroad==<br />
If set (1), splines of this type are considered roads. Roads support the generation of Carz. Roads are flagged as blocked by [[KIND MOCrossing]] while the crossing gate is closed. Road splines can generally be joined, even if they are different assets.<br />
<br />
If not otherwise specified, assets with the 'isroad' tag set are members of the "Road Spline Group" [[KIND_Asset-group#Known Asset-groups|<kuid:30501:100045>]].<br />
<br />
<br />
==isfreeway==<br />
(Only applicable to splines which have 'isroad' set.)<br />
<br />
If set (1), this boolean tag causes a multilane road to act as a freeway. This allows carz to change lanes at will, and causes all traffic to flow in the spline's forward direction only. Overtaking is still allowed on non-freeway roads.<br />
<br />
<br />
==is_silent==<br />
(Only applicable to splines which have 'istrack' set.)<br />
<br />
If set (1), this boolean tag disables the playing of per-axle sounds for vehicles on the spline.<br />
<br />
<br />
==numlanes==<br />
(Only applicable to splines which have 'isroad' set.)<br />
<br />
Defines the number of carz lanes on a road. Each lane is considered to be 1.7 meters wide. If the road is a freeway, all traffic flows in the same direction.<br />
TBD: What, if anything, does this mean for a non-freeway road?<br />
<br />
<br />
==istrack==<br />
If set (1), this boolean tag causes the spline to be treated as a "track", meaning that trains can be expected to run on the spline.<br />
<br />
This affects the visibility of the spline on the minimap, where the spline assets shows up in the surveyor pickers, which surveyor tools can operator on the asset, and whether automatic junction placement is enabled.<br />
<br />
Track splines can generally be joined, even if they are different assets.<br />
<br />
If not otherwise specified, assets with the 'istrack' tag set are members of the "Track Spline Group" [[KIND_Asset-group#Known Asset-groups|<kuid:30501:100043>]].<br />
<br />
<br />
==istunnel==<br />
If set (1), this boolean tag causes the spline to be treated "like a tunnel". Despite the name, this does not directly relate to the true tunnel spline functionality (see the 'tunnel-roof-height' tag for details.)<br />
<br />
Some types of derailment are disabled while in a tunnel because the resultant user experience would be poor due to inter-penentration of the tunnel and terrain by the train vehicles and the player's camera.<br />
<br />
The script function Vehicle.IsInTunnel() returns 'true' while a vehicle's origin is on a tunnel spline.<br />
<br />
If the user is in 'external' or 'auto tracking' camera mode while the camera target is in a tunnel, the camera changes to "tunnel external" mode instead.<br />
<br />
While the camera target is in a tunnel, environmental sounds are reduced to 50% volume.<br />
<br />
Some types of vehicle particle emitter are disabled while the vehicle is in a tunnel.<br />
<br />
<br />
==surveyor-only==<br />
If set (1), this boolean value causes the asset to be invisible and non-functional in Driver. This is typically used for splines which provide editing assistance, such as templates, markers or rulers.<br />
<br />
<br />
==visible-on-minimap==<br />
If clear (0), hides this spline from the minimap. Splines with non-render-only children are never shown on the minimap. Note that this tag does not have a fixed default value, but rather defaults to the opposite of the 'surveyor-only' tag.<br />
<br />
<br />
==track-sound==<br />
(Only applicable to splines which have 'istrack' set.)<br />
<br />
An optional [["track-sound" container]] which assists in calculating which sound to play while a train vehicle is on this track.<br />
<br />
<br />
==traffic-speed==<br />
(Only applicable to splines which have 'isroad' set.)<br />
<br />
Defines the carz speed limit of the road in meters per second. Carz currently travel at up to 80%-110% (depending on the car) of the speed limit, except when overtaking. This tag does not relate to trains in any way.<br />
<br />
<br />
==tunnel-roof-height==<br />
Used by tunnels to determine the roof height in meters allowed by the terrain hole. If less than or equal to zero, no terrain holes are generated. If greater than zero, this spline is considered a true tunnel- it will generate holes in the terrain mesh, its approach angle to the terrain mesh will be locked to 45° increments, and the endpoints will snap to the 10m grid size.<br />
<br />
Tunnels are intended for running a spline underneath the terrain mesh.<br />
<br />
Tunnel splines attempt to curve such that the spline terminates at a 45° angle increment. This helps ensure that entrance holes can be successfully created through the terrain mesh.<br />
<br />
Tunnel splines have slightly modified editing semantics in Surveyor. Vertex markers are visible in different conditions. Smoothing the ground around a tunnel is not permitted. The tunnel spline always follows the spline gradient rather than reacting to the ground height.<br />
<br />
If not otherwise specified, assets with the 'istunnel' tag set are members of the "Tunnel Spline Group" [[KIND_Asset-group#Known Asset-groups|<kuid:30501:100044>]].<br />
<br />
<br />
<br />
=Meshes=<br />
<br />
A track asset is usually comprised of several meshes. Each mesh represents a piece of the spline, which is repeated end-of-end with various transformations in order to create the whole spline. Multiple meshes allow for LOD, detail randomisation, and so on - the selection of which mesh to use at various places on the spline is defined by the [["track-lod-tree" container]]s.<br />
<br />
Meshes should make use of a normal map and a single high resolution diffuse texture. For performance reasons, a single material (ie. single texture; see the notes on material sharing between meshes) should be used for all meshes, as opposed to using a separate material for each. The material may use either alpha masking (1-bit alpha) or alpha blending, however any alpha blends will not be sorted (not against other polygons in the track itself, nor against other alpha-blended polygons in the scene.) For this reason, alpha blending should only be used low to the ground such that a line from the camera to the mesh will pass through no other alpha-blended object before reaching the ground. Normal z-buffer behavior will apply to both alpha-blended and alpha-masked meshes.<br />
<br />
The various mesh pieces that comprise a track are modelled in such that any type may fit to any other without an obvious seam. Pieces are not strictly required to be symmetrical, as they will never be rotated with respect to the previous piece, however it should be noted that splines which support multi-way joins can result in a construct where a spline loops back and connects to itself coming in the opposite direction.<br />
<br />
Some approximate polygon guidelines follow. Creators should avoid using more polygons that they require to accurately depict the object in question.<br />
<br />
* Extreme detail mesh - used for close-ups. 1000 polys per 2m segment.<br />
<br />
* High detail mesh - used at close range. 200 polys per 2m segment.<br />
<br />
* Mid detail mesh - used at mid range. 100 polys per 10m segment.<br />
<br />
* Low detail mesh - used at far range. 6 polys per 10m segment. Tracks are textured onto the ballast, rather than polygon-modelled.<br />
<br />
* Initial end-cap - used at the start of the spline. 100 polys.<br />
<br />
* Final end-cap - used at the end of the spline. 100 polys.<br />
<br />
The end-caps provide any polygons necessary to "close" the spline so that it does not appear hollow when seen from end-on. The other meshes do not include any such polygons. The end-caps are automatically applied by the game wherever a transition is made from one track type to another, or where the track begins or ends abruptly.<br />
<br />
The length of each mesh is specified independantly. It is recommended that each is made as long as reasonably possible within the alloted polygon budget.<br />
<br />
When modelling a track spline, care should be taken to ensure that the top of the rail is exactly 0.3m above the origin. This ensures that it meets the train vehicle's wheels with no overlap and no gap.<br />
<br />
<br />
=Spline Placement=<br />
<br />
Meshes may be specified to follow their placement spline as closely as possible (previously: bendy) or to stay straight but shear to prevent seams. This is discussed in detail in the [["track-lod-tree" container]].<br />
<br />
Vertices on the mesh may fall into one of two height categories:<br />
* Grounded - The vertex positioning is based on the ground height.<br />
* Spline - The vertex positioning is based on the placement spline.<br />
The height category of a vertex is determined from it's relative height within the mesh - if it is less than or equal to the per-mesh-specified grounding height, it is considered grounded.<br />
<br />
<br />
=Performance=<br />
Actual performance will vary based on the following factors:<br />
* Distance at which the High-detail LODs drop out. Generally this should be extremely close.<br />
* Number of polygons in the lower LODs. Generally this should be very low.<br />
* Number of materials used. Ideally, a single material is used for all meshes, rather than one or more per mesh.<br />
* Length of each mesh (longer is better).<br />
* Efficiency of the [["track-lod-tree" container]].<br />
* User-customisable detail settings.<br />
* etc.<br />
<br />
<br />
=Downloads=<br />
* [[Media:TS2009-track.zip]] - The MAX source for the [[Auran]] [[TS2009]] example track. Distributed from the TrainzDev site for education purposes only. No license for the reproduction or redistribution of the included model or textures is granted.<br />
* [[Media:TS2012-tunnel.rar]] - The MAX source for a Tunnel asset. Distributed from the TrainzDev site for education purposes only. No license for the reproduction or redistribution of the included model or textures is granted.<br />
* [[Media:TS2012-bridge.rar]] - The MAX source for a Bridge asset. Distributed from the TrainzDev site for education purposes only. No license for the reproduction or redistribution of the included model or textures is granted.<br />
<br />
<br />
=Related Links=<br />
* [["track-lod-tree" container]]<br />
* [[Modeling Splines]]<br />
* [[Track Part Container]]<br />
<br />
<br />
=Categories=<br />
[[Category:Asset KIND]]</div>Vvmmhttps://online.ts2009.com/mediaWiki/index.php/%22track-lod-tree%22_container"track-lod-tree" container2013-04-12T01:01:44Z<p>Vvmm: /* Examples */</p>
<hr />
<div>The "track-lod-tree" container is a top-level [[config.txt file]] entry used by [[KIND Track]].<br />
<br />
The track-lod-tree is a recursive format which describes a binary tree structure. When stitching the track geometry, Trainz breaks the spline up into smaller parts (determined by the track's ''mesh-length'' tag) and then parses the track-lod-tree to determine which meshes to use.<br />
<br />
This page describes [[trainz-build]] 3.7.<br />
<br />
<br />
==Supported Tags==<br />
Each node in the track-lod-tree supports the following tags. Each tag is shown here with its default value.<br />
<br />
mesh ""<br />
subdivisions 1<br />
lod-distance 0.0<br />
lod-length 0.0<br />
lod-tessellation-length 0.0<br />
lod-random-bias 0.0<br />
lod-is-surveyor 0<br />
lod-season-index 255<br />
high-detail<br />
{<br />
}<br />
low-detail<br />
{<br />
}<br />
<br />
Each node may either select a mesh from the [["mesh-table" Container]], or may branch into two new nodes.<br />
<br />
The ''subdivisions'' tag indicates that the specified data is to be used for several repeats. Exactly how this affects rendering depends on the node type and is detailed below. Trainz may choose to render only some of the repeats in specific scenarios such as very short track lengths - the details of this should overly concern the content creator.<br />
<br />
<br />
==Mesh Node==<br />
The mesh node selects a single mesh from the [["mesh-table" Container]], which is always used. It does not specify a .IM format file directly.<br />
subdivisions 1<br />
mesh "track-lod2"<br />
<br />
The ''subdivisions'' tag causes the mesh to be repeated the specified number of times.<br />
<br />
<br />
==Branch Node==<br />
The branch node specifies a ''high-detail'' and a ''low-detail'' path, and provides information for Trainz to choose between them.<br />
<br />
subdivisions 4<br />
lod-distance 100.0<br />
lod-length 10.0<br />
lod-tessellation-length 6.0<br />
high-detail<br />
{<br />
..<br />
}<br />
low-detail<br />
{<br />
..<br />
}<br />
<br />
Each of the ''high-detail'' and ''low-detail'' paths is another [["track-lod-tree" container]], causing this structure to be recursive.<br />
<br />
<br />
====subdivisions====<br />
<br />
:The ''subdivisions'' tag causes the current track part to be subdivided into multiple parts, which continue to be passed through the track-lod-tree. Each part may take a separate path through the tree, however they all start at the current tree node and move downward (ie. they do not re-parse from the root of the tree.)<br />
<br />
====lod-distance====<br />
<br />
:The ''lod-distance'' tag determines the distance (meters) at which Trainz will swap to using the lower detail path. This distance is a guideline and may be affected by user performance settings.<br />
<br />
====lod-length====<br />
<br />
:Track parts are scaled to some extent based on the length of the Track Stretch being generated and the ''mesh-length'' tag. The ''lod-length'' tag provides a mechanism for forcing the high-detail path for short parts, even when the low-detail path would be appropriate given the distance. Specifically, if the generated geometry will be shorter than the ''lod-length'' setting, the high-detail path is chosen. This tag should be used with extreme caution, since it has the potential to ruin the LOD scheme and thus kill performance. This tag should only be used to select between a long (efficient) low detail mesh and multiple short (less efficient) low detail meshes, and never to force a change to an actual high detail mesh.<br />
<br />
====lod-tessellation-length====<br />
<br />
:Trainz determines a desired tessellation length based on factors which include the ground bumpiness and the bend angle of the spline. <br />
The ''lod-tessellation-length'' tag provides a mechanism for forcing the high-detail path for track parts with high tessellation requirements. The length (m) specified in this tag refers to the distance between tessellation points in the mesh, not to the whole length of the mesh. For example, a ''lod-tessellation-length'' of 6.0 indicates that the ''low-detail'' path is suitable for tessellation at around six meters, whereas the ''high-detail'' path is required for tessellation finer than six meters. The high detail path in this case should generally look identical to the low detail path, but with slightly increased tessellation along the Y-axis. This allows Trainz to increase tessellation without the cost of changing to an actual high detail mesh.<br />
<br />
:The ''lod-tessellation-length'' branch should ideally be specified as deep in the ''track-lod-tree'' as possible, as Trainz may refine this data as it progresses through the tree - the more parameters that have been set in stone before tessellation is considered, the more accurate the tessellation process will be.<br />
<br />
====lod-random-bias====<br />
<br />
:The ''lod-random-bias'' isn't really a LOD scheme and instead allows for random selection between the high or low "detail" paths. At the default setting of 0.0, this has no effect. As the number is raised toward 1.0, the chance of forcing the high "detail" path is increased. At 1.0 or higher, the high detail path would always be chosen. While this tag can be used in tandem with other ''lod-*'' tags, the behavior is somewhat arbitrary so this isn't recommended. A value of 0.5 gives a 50% variation between high and low "detail" paths.<br />
<br />
====lod-is-surveyor====<br />
<br />
:The ''lod-is-surveyor'' isn't really a LOD scheme and instead allows for the display of different meshes in Surveyor (editing mode) versus Driver (gameplay mode.) When set to '1', this tag causes the high "detail" path to be chosen when in editing mode.<br />
<br />
====lod-season-index====<br />
<br />
:The ''lod-season-index'' isn't really a LOD scheme and instead allows for the display of seasonal meshes. When a specific season index (as per the [["Season-selector" container]]) is specified, this tag causes the high "detail" path to be chosen when that season is current.<br />
<br />
==Examples==<br />
<br />
Here is an exaple of a 2 LOD track-lod-tree container for a Track:<br />
<br />
track<br />
{<br />
mesh-length 20<br />
<br />
track-lod-tree<br />
{<br />
lod-distance 250<br />
<br />
high-detail<br />
{<br />
mesh "default-lod0"<br />
}<br />
<br />
low-detail<br />
{<br />
mesh "default-lod1"<br />
}<br />
}<br />
}<br />
<br />
The following example illustrates how to use the [["Season-selector" container]] to select a seasonal mesh for a track/spline/road (providing lod-season-index 1 refers to winter):<br />
<br />
track<br />
{<br />
mesh-length 4<br />
<br />
track-lod-tree<br />
{<br />
lod-distance 250<br />
<br />
high-detail<br />
{<br />
lod-season-index 1<br />
<br />
high-detail<br />
{<br />
mesh "track-lod0w"<br />
}<br />
<br />
low-detail <br />
{<br />
mesh "track-lod0"<br />
}<br />
}<br />
<br />
low-detail<br />
{<br />
lod-season-index 1<br />
<br />
high-detail<br />
{<br />
mesh "track-lod1w"<br />
}<br />
<br />
low-detail<br />
{<br />
mesh "track-lod1"<br />
}<br />
}<br />
}<br />
}<br />
<br />
<br />
<br />
<br />
[[Category:Config Container]]</div>Vvmmhttps://online.ts2009.com/mediaWiki/index.php/%22track-lod-tree%22_container"track-lod-tree" container2013-04-12T01:00:49Z<p>Vvmm: /* Examples */</p>
<hr />
<div>The "track-lod-tree" container is a top-level [[config.txt file]] entry used by [[KIND Track]].<br />
<br />
The track-lod-tree is a recursive format which describes a binary tree structure. When stitching the track geometry, Trainz breaks the spline up into smaller parts (determined by the track's ''mesh-length'' tag) and then parses the track-lod-tree to determine which meshes to use.<br />
<br />
This page describes [[trainz-build]] 3.7.<br />
<br />
<br />
==Supported Tags==<br />
Each node in the track-lod-tree supports the following tags. Each tag is shown here with its default value.<br />
<br />
mesh ""<br />
subdivisions 1<br />
lod-distance 0.0<br />
lod-length 0.0<br />
lod-tessellation-length 0.0<br />
lod-random-bias 0.0<br />
lod-is-surveyor 0<br />
lod-season-index 255<br />
high-detail<br />
{<br />
}<br />
low-detail<br />
{<br />
}<br />
<br />
Each node may either select a mesh from the [["mesh-table" Container]], or may branch into two new nodes.<br />
<br />
The ''subdivisions'' tag indicates that the specified data is to be used for several repeats. Exactly how this affects rendering depends on the node type and is detailed below. Trainz may choose to render only some of the repeats in specific scenarios such as very short track lengths - the details of this should overly concern the content creator.<br />
<br />
<br />
==Mesh Node==<br />
The mesh node selects a single mesh from the [["mesh-table" Container]], which is always used. It does not specify a .IM format file directly.<br />
subdivisions 1<br />
mesh "track-lod2"<br />
<br />
The ''subdivisions'' tag causes the mesh to be repeated the specified number of times.<br />
<br />
<br />
==Branch Node==<br />
The branch node specifies a ''high-detail'' and a ''low-detail'' path, and provides information for Trainz to choose between them.<br />
<br />
subdivisions 4<br />
lod-distance 100.0<br />
lod-length 10.0<br />
lod-tessellation-length 6.0<br />
high-detail<br />
{<br />
..<br />
}<br />
low-detail<br />
{<br />
..<br />
}<br />
<br />
Each of the ''high-detail'' and ''low-detail'' paths is another [["track-lod-tree" container]], causing this structure to be recursive.<br />
<br />
<br />
====subdivisions====<br />
<br />
:The ''subdivisions'' tag causes the current track part to be subdivided into multiple parts, which continue to be passed through the track-lod-tree. Each part may take a separate path through the tree, however they all start at the current tree node and move downward (ie. they do not re-parse from the root of the tree.)<br />
<br />
====lod-distance====<br />
<br />
:The ''lod-distance'' tag determines the distance (meters) at which Trainz will swap to using the lower detail path. This distance is a guideline and may be affected by user performance settings.<br />
<br />
====lod-length====<br />
<br />
:Track parts are scaled to some extent based on the length of the Track Stretch being generated and the ''mesh-length'' tag. The ''lod-length'' tag provides a mechanism for forcing the high-detail path for short parts, even when the low-detail path would be appropriate given the distance. Specifically, if the generated geometry will be shorter than the ''lod-length'' setting, the high-detail path is chosen. This tag should be used with extreme caution, since it has the potential to ruin the LOD scheme and thus kill performance. This tag should only be used to select between a long (efficient) low detail mesh and multiple short (less efficient) low detail meshes, and never to force a change to an actual high detail mesh.<br />
<br />
====lod-tessellation-length====<br />
<br />
:Trainz determines a desired tessellation length based on factors which include the ground bumpiness and the bend angle of the spline. <br />
The ''lod-tessellation-length'' tag provides a mechanism for forcing the high-detail path for track parts with high tessellation requirements. The length (m) specified in this tag refers to the distance between tessellation points in the mesh, not to the whole length of the mesh. For example, a ''lod-tessellation-length'' of 6.0 indicates that the ''low-detail'' path is suitable for tessellation at around six meters, whereas the ''high-detail'' path is required for tessellation finer than six meters. The high detail path in this case should generally look identical to the low detail path, but with slightly increased tessellation along the Y-axis. This allows Trainz to increase tessellation without the cost of changing to an actual high detail mesh.<br />
<br />
:The ''lod-tessellation-length'' branch should ideally be specified as deep in the ''track-lod-tree'' as possible, as Trainz may refine this data as it progresses through the tree - the more parameters that have been set in stone before tessellation is considered, the more accurate the tessellation process will be.<br />
<br />
====lod-random-bias====<br />
<br />
:The ''lod-random-bias'' isn't really a LOD scheme and instead allows for random selection between the high or low "detail" paths. At the default setting of 0.0, this has no effect. As the number is raised toward 1.0, the chance of forcing the high "detail" path is increased. At 1.0 or higher, the high detail path would always be chosen. While this tag can be used in tandem with other ''lod-*'' tags, the behavior is somewhat arbitrary so this isn't recommended. A value of 0.5 gives a 50% variation between high and low "detail" paths.<br />
<br />
====lod-is-surveyor====<br />
<br />
:The ''lod-is-surveyor'' isn't really a LOD scheme and instead allows for the display of different meshes in Surveyor (editing mode) versus Driver (gameplay mode.) When set to '1', this tag causes the high "detail" path to be chosen when in editing mode.<br />
<br />
====lod-season-index====<br />
<br />
:The ''lod-season-index'' isn't really a LOD scheme and instead allows for the display of seasonal meshes. When a specific season index (as per the [["Season-selector" container]]) is specified, this tag causes the high "detail" path to be chosen when that season is current.<br />
<br />
==Examples==<br />
<br />
Here is an exaple of a 2 LOD track-lod-tree container for a Track:<br />
<br />
track<br />
{<br />
mesh-length 20<br />
<br />
track-lod-tree<br />
{<br />
lod-distance 250<br />
<br />
high-detail<br />
{<br />
mesh "default-lod0"<br />
}<br />
<br />
low-detail<br />
{<br />
mesh "default-lod1"<br />
}<br />
}<br />
}<br />
<br />
The following example illustrates how to use the season-selector container to select a seasonal mesh for a track/spline/road (providing lod-season-index 1 refers to winter):<br />
<br />
track<br />
{<br />
mesh-length 4<br />
<br />
track-lod-tree<br />
{<br />
lod-distance 250<br />
<br />
high-detail<br />
{<br />
lod-season-index 1<br />
<br />
high-detail<br />
{<br />
mesh "track-lod0w"<br />
}<br />
<br />
low-detail <br />
{<br />
mesh "track-lod0"<br />
}<br />
}<br />
<br />
low-detail<br />
{<br />
lod-season-index 1<br />
<br />
high-detail<br />
{<br />
mesh "track-lod1w"<br />
}<br />
<br />
low-detail<br />
{<br />
mesh "track-lod1"<br />
}<br />
}<br />
}<br />
}<br />
<br />
<br />
<br />
<br />
[[Category:Config Container]]</div>Vvmmhttps://online.ts2009.com/mediaWiki/index.php/%22track-lod-tree%22_container"track-lod-tree" container2013-04-12T00:58:15Z<p>Vvmm: Added seasonal example for Trainz build 3.7</p>
<hr />
<div>The "track-lod-tree" container is a top-level [[config.txt file]] entry used by [[KIND Track]].<br />
<br />
The track-lod-tree is a recursive format which describes a binary tree structure. When stitching the track geometry, Trainz breaks the spline up into smaller parts (determined by the track's ''mesh-length'' tag) and then parses the track-lod-tree to determine which meshes to use.<br />
<br />
This page describes [[trainz-build]] 3.7.<br />
<br />
<br />
==Supported Tags==<br />
Each node in the track-lod-tree supports the following tags. Each tag is shown here with its default value.<br />
<br />
mesh ""<br />
subdivisions 1<br />
lod-distance 0.0<br />
lod-length 0.0<br />
lod-tessellation-length 0.0<br />
lod-random-bias 0.0<br />
lod-is-surveyor 0<br />
lod-season-index 255<br />
high-detail<br />
{<br />
}<br />
low-detail<br />
{<br />
}<br />
<br />
Each node may either select a mesh from the [["mesh-table" Container]], or may branch into two new nodes.<br />
<br />
The ''subdivisions'' tag indicates that the specified data is to be used for several repeats. Exactly how this affects rendering depends on the node type and is detailed below. Trainz may choose to render only some of the repeats in specific scenarios such as very short track lengths - the details of this should overly concern the content creator.<br />
<br />
<br />
==Mesh Node==<br />
The mesh node selects a single mesh from the [["mesh-table" Container]], which is always used. It does not specify a .IM format file directly.<br />
subdivisions 1<br />
mesh "track-lod2"<br />
<br />
The ''subdivisions'' tag causes the mesh to be repeated the specified number of times.<br />
<br />
<br />
==Branch Node==<br />
The branch node specifies a ''high-detail'' and a ''low-detail'' path, and provides information for Trainz to choose between them.<br />
<br />
subdivisions 4<br />
lod-distance 100.0<br />
lod-length 10.0<br />
lod-tessellation-length 6.0<br />
high-detail<br />
{<br />
..<br />
}<br />
low-detail<br />
{<br />
..<br />
}<br />
<br />
Each of the ''high-detail'' and ''low-detail'' paths is another [["track-lod-tree" container]], causing this structure to be recursive.<br />
<br />
<br />
====subdivisions====<br />
<br />
:The ''subdivisions'' tag causes the current track part to be subdivided into multiple parts, which continue to be passed through the track-lod-tree. Each part may take a separate path through the tree, however they all start at the current tree node and move downward (ie. they do not re-parse from the root of the tree.)<br />
<br />
====lod-distance====<br />
<br />
:The ''lod-distance'' tag determines the distance (meters) at which Trainz will swap to using the lower detail path. This distance is a guideline and may be affected by user performance settings.<br />
<br />
====lod-length====<br />
<br />
:Track parts are scaled to some extent based on the length of the Track Stretch being generated and the ''mesh-length'' tag. The ''lod-length'' tag provides a mechanism for forcing the high-detail path for short parts, even when the low-detail path would be appropriate given the distance. Specifically, if the generated geometry will be shorter than the ''lod-length'' setting, the high-detail path is chosen. This tag should be used with extreme caution, since it has the potential to ruin the LOD scheme and thus kill performance. This tag should only be used to select between a long (efficient) low detail mesh and multiple short (less efficient) low detail meshes, and never to force a change to an actual high detail mesh.<br />
<br />
====lod-tessellation-length====<br />
<br />
:Trainz determines a desired tessellation length based on factors which include the ground bumpiness and the bend angle of the spline. <br />
The ''lod-tessellation-length'' tag provides a mechanism for forcing the high-detail path for track parts with high tessellation requirements. The length (m) specified in this tag refers to the distance between tessellation points in the mesh, not to the whole length of the mesh. For example, a ''lod-tessellation-length'' of 6.0 indicates that the ''low-detail'' path is suitable for tessellation at around six meters, whereas the ''high-detail'' path is required for tessellation finer than six meters. The high detail path in this case should generally look identical to the low detail path, but with slightly increased tessellation along the Y-axis. This allows Trainz to increase tessellation without the cost of changing to an actual high detail mesh.<br />
<br />
:The ''lod-tessellation-length'' branch should ideally be specified as deep in the ''track-lod-tree'' as possible, as Trainz may refine this data as it progresses through the tree - the more parameters that have been set in stone before tessellation is considered, the more accurate the tessellation process will be.<br />
<br />
====lod-random-bias====<br />
<br />
:The ''lod-random-bias'' isn't really a LOD scheme and instead allows for random selection between the high or low "detail" paths. At the default setting of 0.0, this has no effect. As the number is raised toward 1.0, the chance of forcing the high "detail" path is increased. At 1.0 or higher, the high detail path would always be chosen. While this tag can be used in tandem with other ''lod-*'' tags, the behavior is somewhat arbitrary so this isn't recommended. A value of 0.5 gives a 50% variation between high and low "detail" paths.<br />
<br />
====lod-is-surveyor====<br />
<br />
:The ''lod-is-surveyor'' isn't really a LOD scheme and instead allows for the display of different meshes in Surveyor (editing mode) versus Driver (gameplay mode.) When set to '1', this tag causes the high "detail" path to be chosen when in editing mode.<br />
<br />
====lod-season-index====<br />
<br />
:The ''lod-season-index'' isn't really a LOD scheme and instead allows for the display of seasonal meshes. When a specific season index (as per the [["Season-selector" container]]) is specified, this tag causes the high "detail" path to be chosen when that season is current.<br />
<br />
==Examples==<br />
<br />
Here is an exaple of a 2 LOD track-lod-tree container for a Track:<br />
<br />
track<br />
{<br />
mesh-length 20<br />
<br />
track-lod-tree<br />
{<br />
lod-distance 250<br />
<br />
high-detail<br />
{<br />
mesh "default-lod0"<br />
}<br />
<br />
low-detail<br />
{<br />
mesh "default-lod1"<br />
}<br />
}<br />
}<br />
<br />
The following example illustrates how to use the season-selector container to select a seasonal mesh for a track/spline/road (providing lod-season-index 1 refers to winter):<br />
<br />
track<br />
{<br />
mesh-length 4<br />
<br />
track-lod-tree<br />
{<br />
lod-distance 250<br />
<br />
high-detail<br />
{<br />
lod-season-index 1<br />
<br />
high-detail<br />
{<br />
mesh "track-lod0w"<br />
}<br />
<br />
low-detail<br />
{<br />
mesh "track-lod0"<br />
}<br />
}<br />
<br />
low-detail<br />
{<br />
lod-season-index 1<br />
<br />
high-detail<br />
{<br />
mesh "track-lod1w"<br />
}<br />
<br />
low-detail<br />
{<br />
mesh "track-lod1"<br />
}<br />
}<br />
}<br />
}<br />
<br />
<br />
<br />
<br />
[[Category:Config Container]]</div>Vvmmhttps://online.ts2009.com/mediaWiki/index.php/TS12_SP1TS12 SP12013-04-10T15:24:29Z<p>Vvmm: /* Changelist */</p>
<hr />
<div><br />
== Download ==<br />
<br />
<br />
There is a manual patch available from: http://download2.ts2009.com/49922_to_57720.exe - 1,848,746 KB<br />
<br />
== New Features ==<br />
<br />
* In-game Downloadable Content (Payware and Freeware).<br />
* Improved multi-player support.<br />
* Updated support for tunnels, bridges, power lines etc (splines).<br />
* Improved session workflow (rules, nesting, copying etc).<br />
* Automatic thumbnail generation for routes and sessions.<br />
* Rewritten train coupling physics.<br />
* Improved CMP error detection and validation.<br />
<br />
Note: To take advantage of our new DLC system, this latest patch will need to be installed.<br />
<br />
Previously purchased DLC will now automatically attempt to download and install. If you wish to disable this feature you may do so via the in-game options menu (http://tinypic.com/r/ivkg80/6)<br />
<br />
== Changelist ==<br />
<br />
*Fixed multiplayer clients experiencing frequent disconnects.<br />
*Fixed multiplayer decoupling not being performed correctly.<br />
*Fixed weird partial disconnect state achieved after <10 minutes of play.<br />
*Fixed driver commands disappearing.<br />
*Corrected smoke emmisions from steam locos.<br />
*Fixed issues with sessions having random red signals occuring.<br />
*Fixed several "Derail on beginning of session" bugs.<br />
*Fixed several "Script/thread error on beginning of session" bugs.<br />
*Fixed HTML messages not showing appropriately in sessions.<br />
*Reworded several session instructions to improve player experience.<br />
*Patch installer progress bar issues fixed.<br />
*Solved "multiple new industry" asset problems.<br />
*Fixed several spelling mistakes.<br />
*Sessions missing passenger cars have been fixed.<br />
*Acheivements now correctly register and accumulate properly.<br />
*Various fixes within Content Manager to improve search, downloading and performance functions.<br />
*Fixed a bug where players couldn't switch drivers.<br />
*Autogenerated thumbnails are now created at the correct size.<br />
*In-Game browser correctly resizes.<br />
*In-Game browser drop-down menus reconfigured to work.<br />
*Payware DLS system intergrated, products, thumbnails, and prices added.<br />
*Issue fixed with NVTT where thread-safety locks were added around the NVTT texture compressor.<br />
*Fixed issue with game stopping rendering on exit of session.<br />
*Resolved issue with loading saved sessions when at locked junctions magically removes the locked state.<br />
*Fixed issue with database repair silently fails on Windows 8.<br />
*DLC content redownloads/installs each time the player disconnects and reconnects to Planet Auran.<br />
*Resolved issue where players were unable to Connect to iTrainz Server.<br />
*Camera shake effect happening in CAB view when driving has been fixed.<br />
*Official Trainz DLC Content not automatically being favourited is resolved.<br />
*Fixed cab controls not moving properly when moused.<br />
*OpenGL UI disappearance and texture disruption when using certain assets.<br />
*Fixed thread crash when moving around in large routes.<br />
*Overwriting route via [Save] -> [Save new route and session] causes the route thumbnail to disappear has been solved.<br />
*Fixed bug where changing a driver removed all driver orders from a driver's schedule.<br />
*Improved updates to the DLS faulty asset list.<br />
*Crash to desktop when merging routes is fixed.<br />
*Fixed many session completion issues across all builtin sessions.<br />
*Fixed an issue where sessions would remove driver schedules when changing driver details.<br />
*Fixed misinformation in the tutorials.<br />
*Fixed an issue where "Edit Route" wouldn't work when run first thing from launch.<br />
*Fixed issues where PA login was incorrectly being marked as not set.<br />
*Fixed multiple script exception bugs.<br />
*Non-derailed sections of consist are no longer automatically cleaned up.<br />
*Timeout message now shows when a host unexpectedly disconnects in multiplayer.<br />
*Fixed various bits of odd behaviour when using the chatbox in multiplayer.<br />
*Fixed a possible crash when TADDaemon shuts down.<br />
*Fixed a possible freeze in TrainzUtil when updating/installing bulk assets.<br />
*Attached track now visible in driver mode for some effected assets.<br />
*Cinematic Camera rule no longer pauses oddly.<br />
*Fixed an issue where downloading sessions would not download their dependencies as well.<br />
*Occasional crash when transitioning to map view has been fixed.<br />
*Added ability to lock entire session in Surveyor.<br />
*Various performance improvements for asset related issues.<br />
*Fixed side by side errors on Win8 machine.<br />
*Fixed issue where TADDaemon stops working on Win8 Pro.<br />
*Various improvements to text input in various areas around the game.<br />
*Fixed issues with vehicle displacement/derailment in relation to new coupling system.<br />
*Dropped support for "old style" DLC content.<br />
*Fixed a crash when viewing properties of "TZL MultimeshBlend" asset.</div>Vvmmhttps://online.ts2009.com/mediaWiki/index.php/TS12_SP1TS12 SP12013-04-10T15:23:02Z<p>Vvmm: </p>
<hr />
<div><br />
== Download ==<br />
<br />
<br />
There is a manual patch available from: http://download2.ts2009.com/49922_to_57720.exe - 1,848,746 KB<br />
<br />
== New Features ==<br />
<br />
* In-game Downloadable Content (Payware and Freeware).<br />
* Improved multi-player support.<br />
* Updated support for tunnels, bridges, power lines etc (splines).<br />
* Improved session workflow (rules, nesting, copying etc).<br />
* Automatic thumbnail generation for routes and sessions.<br />
* Rewritten train coupling physics.<br />
* Improved CMP error detection and validation.<br />
<br />
Note: To take advantage of our new DLC system, this latest patch will need to be installed.<br />
<br />
Previously purchased DLC will now automatically attempt to download and install. If you wish to disable this feature you may do so via the in-game options menu (http://tinypic.com/r/ivkg80/6)<br />
<br />
== Changelist ==<br />
<br />
Fixed multiplayer clients experiencing frequent disconnects.<br />
<br />
Fixed multiplayer decoupling not being performed correctly.<br />
<br />
Fixed weird partial disconnect state achieved after <10 minutes of play.<br />
<br />
Fixed driver commands disappearing.<br />
<br />
Corrected smoke emmisions from steam locos.<br />
<br />
Fixed issues with sessions having random red signals occuring.<br />
<br />
Fixed several "Derail on beginning of session" bugs.<br />
<br />
Fixed several "Script/thread error on beginning of session" bugs.<br />
<br />
Fixed HTML messages not showing appropriately in sessions.<br />
<br />
Reworded several session instructions to improve player experience.<br />
<br />
Patch installer progress bar issues fixed.<br />
<br />
Solved "multiple new industry" asset problems.<br />
<br />
Fixed several spelling mistakes.<br />
<br />
Sessions missing passenger cars have been fixed.<br />
<br />
Acheivements now correctly register and accumulate properly.<br />
<br />
Various fixes within Content Manager to improve search, downloading and performance functions.<br />
<br />
Fixed a bug where players couldn't switch drivers.<br />
<br />
Autogenerated thumbnails are now created at the correct size.<br />
<br />
In-Game browser correctly resizes.<br />
<br />
In-Game browser drop-down menus reconfigured to work.<br />
<br />
Payware DLS system intergrated, products, thumbnails, and prices added.<br />
<br />
Issue fixed with NVTT where thread-safety locks were added around the NVTT texture compressor.<br />
<br />
Fixed issue with game stopping rendering on exit of session.<br />
<br />
Resolved issue with loading saved sessions when at locked junctions magically removes the locked state.<br />
<br />
Fixed issue with database repair silently fails on Windows 8.<br />
<br />
DLC content redownloads/installs each time the player disconnects and reconnects to Planet Auran.<br />
<br />
Resolved issue where players were unable to Connect to iTrainz Server.<br />
<br />
Camera shake effect happening in CAB view when driving has been fixed.<br />
<br />
Official Trainz DLC Content not automatically being favourited is resolved.<br />
<br />
Fixed cab controls not moving properly when moused.<br />
<br />
OpenGL UI disappearance and texture disruption when using certain assets.<br />
<br />
Fixed thread crash when moving around in large routes.<br />
<br />
Overwriting route via [Save] -> [Save new route and session] causes the route thumbnail to disappear has been solved.<br />
<br />
Fixed bug where changing a driver removed all driver orders from a driver's schedule.<br />
<br />
Improved updates to the DLS faulty asset list.<br />
<br />
Crash to desktop when merging routes is fixed.<br />
<br />
Fixed many session completion issues across all builtin sessions.<br />
<br />
Fixed an issue where sessions would remove driver schedules when changing driver details.<br />
<br />
Fixed misinformation in the tutorials.<br />
<br />
Fixed an issue where "Edit Route" wouldn't work when run first thing from launch.<br />
<br />
Fixed issues where PA login was incorrectly being marked as not set.<br />
<br />
Fixed multiple script exception bugs.<br />
<br />
Non-derailed sections of consist are no longer automatically cleaned up.<br />
<br />
Timeout message now shows when a host unexpectedly disconnects in multiplayer.<br />
<br />
Fixed various bits of odd behaviour when using the chatbox in multiplayer.<br />
<br />
Fixed a possible crash when TADDaemon shuts down.<br />
<br />
Fixed a possible freeze in TrainzUtil when updating/installing bulk assets.<br />
<br />
Attached track now visible in driver mode for some effected assets.<br />
<br />
Cinematic Camera rule no longer pauses oddly.<br />
<br />
Fixed an issue where downloading sessions would not download their dependencies as well.<br />
<br />
Occasional crash when transitioning to map view has been fixed.<br />
<br />
Added ability to lock entire session in Surveyor.<br />
<br />
Various performance improvements for asset related issues.<br />
<br />
Fixed side by side errors on Win8 machine.<br />
<br />
Fixed issue where TADDaemon stops working on Win8 Pro.<br />
<br />
Various improvements to text input in various areas around the game.<br />
<br />
Fixed issues with vehicle displacement/derailment in relation to new coupling system.<br />
<br />
Dropped support for "old style" DLC content.<br />
<br />
Fixed a crash when viewing properties of "TZL MultimeshBlend" asset.</div>Vvmm