<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.trainzsimulator.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Callavsg</id>
	<title>TrainzOnline - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.trainzsimulator.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Callavsg"/>
	<link rel="alternate" type="text/html" href="https://wiki.trainzsimulator.com/wiki/Special:Contributions/Callavsg"/>
	<updated>2026-11-05T06:30:24Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.46.2</generator>
	<entry>
		<id>https://wiki.trainzsimulator.com/index.php?title=File:TrainzScriptNpp.rar&amp;diff=25479</id>
		<title>File:TrainzScriptNpp.rar</title>
		<link rel="alternate" type="text/html" href="https://wiki.trainzsimulator.com/index.php?title=File:TrainzScriptNpp.rar&amp;diff=25479"/>
		<updated>2020-11-22T18:51:29Z</updated>

		<summary type="html">&lt;p&gt;Callavsg: Callavsg uploaded a new version of &amp;amp;quot;File:TrainzScriptNpp.rar&amp;amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Syntax highlightning files for use with Notepad++&lt;/div&gt;</summary>
		<author><name>Callavsg</name></author>
	</entry>
	<entry>
		<id>https://wiki.trainzsimulator.com/index.php?title=User:Callavsg&amp;diff=25478</id>
		<title>User:Callavsg</title>
		<link rel="alternate" type="text/html" href="https://wiki.trainzsimulator.com/index.php?title=User:Callavsg&amp;diff=25478"/>
		<updated>2020-11-22T18:38:35Z</updated>

		<summary type="html">&lt;p&gt;Callavsg: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;I&#039;m just a normal guy living in Germany. I have a normal job with working for Amazon in Workflow Management.&lt;br /&gt;
&lt;br /&gt;
Writing code in my free time now for 14 years, mainly by using C++. I like to experiment, find hacks/workarounds and always try to find another point of view.&lt;br /&gt;
&lt;br /&gt;
[[Category:Script Creators]]&lt;/div&gt;</summary>
		<author><name>Callavsg</name></author>
	</entry>
	<entry>
		<id>https://wiki.trainzsimulator.com/index.php?title=Callavsg%27s_Scripting_Tools&amp;diff=25477</id>
		<title>Callavsg&#039;s Scripting Tools</title>
		<link rel="alternate" type="text/html" href="https://wiki.trainzsimulator.com/index.php?title=Callavsg%27s_Scripting_Tools&amp;diff=25477"/>
		<updated>2020-11-22T18:34:17Z</updated>

		<summary type="html">&lt;p&gt;Callavsg: /* Syntax Highlighting */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Syntax Highlighting==&lt;br /&gt;
&lt;br /&gt;
Syntax highlightning is one of the basics that makes your life easier when writing code. &lt;br /&gt;
&lt;br /&gt;
[[Media:TrainzScriptNpp.rar]] offers you even this and also includes auto-completion for Notepad++. Just follow the ReadMe.txt and have fun!&lt;br /&gt;
&lt;br /&gt;
[[File:Syntax_highlight.png|758px]]&lt;br /&gt;
&lt;br /&gt;
==Exit==&lt;br /&gt;
&lt;br /&gt;
[[Tools|Return to Tools]]&lt;/div&gt;</summary>
		<author><name>Callavsg</name></author>
	</entry>
	<entry>
		<id>https://wiki.trainzsimulator.com/index.php?title=File:Syntax_highlight.png&amp;diff=25476</id>
		<title>File:Syntax highlight.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.trainzsimulator.com/index.php?title=File:Syntax_highlight.png&amp;diff=25476"/>
		<updated>2020-11-22T18:31:01Z</updated>

		<summary type="html">&lt;p&gt;Callavsg: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Callavsg</name></author>
	</entry>
	<entry>
		<id>https://wiki.trainzsimulator.com/index.php?title=Callavsg%27s_Scripting_Tools&amp;diff=25475</id>
		<title>Callavsg&#039;s Scripting Tools</title>
		<link rel="alternate" type="text/html" href="https://wiki.trainzsimulator.com/index.php?title=Callavsg%27s_Scripting_Tools&amp;diff=25475"/>
		<updated>2020-11-22T18:28:52Z</updated>

		<summary type="html">&lt;p&gt;Callavsg: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Syntax Highlighting==&lt;br /&gt;
&lt;br /&gt;
Syntax highlightning is one of the basics that makes your life easier when writing code. &lt;br /&gt;
&lt;br /&gt;
[[Media:TrainzScriptNpp.rar]] offers you even this for Notepad++. Just follow the ReadMe.txt and have fun!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Exit==&lt;br /&gt;
&lt;br /&gt;
[[Tools|Return to Tools]]&lt;/div&gt;</summary>
		<author><name>Callavsg</name></author>
	</entry>
	<entry>
		<id>https://wiki.trainzsimulator.com/index.php?title=Tools&amp;diff=25474</id>
		<title>Tools</title>
		<link rel="alternate" type="text/html" href="https://wiki.trainzsimulator.com/index.php?title=Tools&amp;diff=25474"/>
		<updated>2020-11-22T18:26:42Z</updated>

		<summary type="html">&lt;p&gt;Callavsg: /* Third-party Tools */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Auran-provided Tools==&lt;br /&gt;
&lt;br /&gt;
The following executable tools are made available to Trainz users.&lt;br /&gt;
&lt;br /&gt;
[[Content Manager]] - &#039;&#039;Auran&#039;s included content management GUI, which provides functionality for downloading, installing, managing and building custom content.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[Content Creator Plus]] - &#039;&#039;Auran&#039;s included content creation GUI, which provides functionality for creating, editing, viewing and validating asset configurations.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[Trainz Mesh Importer]] - &#039;&#039;An xml-to-im converter that can be used to simplify conversion of models from various formats into Trainz .im format.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[TrainzUtil]] - &#039;&#039;A command line content management tool.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Third-party Tools==&lt;br /&gt;
&lt;br /&gt;
The following Trainz-related tools are maintained by Trainz 3rd-party developers.&lt;br /&gt;
&lt;br /&gt;
[[AssetX Wiki|AssetX]] - &#039;&#039;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.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[Basemapz]] - &#039;&#039;A tool to assist in creating Model Trainz baseboards from scale plans by ModelerMJ.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[Retain My Asset Names]] (RMAN) - &#039;&#039;A Trainz Asset Name management and organization tool that projects user-assigned custom asset names from a local user database across various and future Trainz version asset libraries (by [https://forums.auran.com/trainz/member.php?41964-deneban deneban])&lt;br /&gt;
&lt;br /&gt;
[[Shane Turner&#039;s Trainz Tools]] - &#039;&#039;Tools to enhance and help resolve some Trainz technical problems. Hosted on the same site as the PEV Trainz Tools&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[Trainz Tools by PEV]] - &#039;&#039;Editing and repair tools for most Trainz Content files.  Shane Turner now hosts these.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[TransDEM]] - Converts digital elevation files to efficently model prototype railroads.&lt;br /&gt;
&lt;br /&gt;
[[vvmm&#039;s Trainz Tools]] - Tools for opening TZarc files, explore CDP files contents, list kuids etc.&lt;br /&gt;
&lt;br /&gt;
[[callavsg&#039;s Scripting Tools]] - Tools for scripting, such as synatx highlighting and No-Code tools&lt;br /&gt;
&lt;br /&gt;
More &#039;&#039;TBA&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Native APIs==&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
[[TrainzNativeInterface]] - A helper DLL which provides the basic functionality for communication between Trainz executables and third-party DLLs.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Documentation==&lt;br /&gt;
&lt;br /&gt;
[[Command Line Guidelines]] - &#039;&#039;Details guidelines for developing Trainz-related command-line utilities with the intention of creating a standardised, easy-to-use interface.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;TBD&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[Category:TBD]]&lt;br /&gt;
[[Category:Trainz Wiki]]&lt;/div&gt;</summary>
		<author><name>Callavsg</name></author>
	</entry>
	<entry>
		<id>https://wiki.trainzsimulator.com/index.php?title=Tools&amp;diff=25473</id>
		<title>Tools</title>
		<link rel="alternate" type="text/html" href="https://wiki.trainzsimulator.com/index.php?title=Tools&amp;diff=25473"/>
		<updated>2020-11-22T18:25:29Z</updated>

		<summary type="html">&lt;p&gt;Callavsg: /* Third-party Tools */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Auran-provided Tools==&lt;br /&gt;
&lt;br /&gt;
The following executable tools are made available to Trainz users.&lt;br /&gt;
&lt;br /&gt;
[[Content Manager]] - &#039;&#039;Auran&#039;s included content management GUI, which provides functionality for downloading, installing, managing and building custom content.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[Content Creator Plus]] - &#039;&#039;Auran&#039;s included content creation GUI, which provides functionality for creating, editing, viewing and validating asset configurations.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[Trainz Mesh Importer]] - &#039;&#039;An xml-to-im converter that can be used to simplify conversion of models from various formats into Trainz .im format.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[TrainzUtil]] - &#039;&#039;A command line content management tool.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Third-party Tools==&lt;br /&gt;
&lt;br /&gt;
The following Trainz-related tools are maintained by Trainz 3rd-party developers.&lt;br /&gt;
&lt;br /&gt;
[[AssetX Wiki|AssetX]] - &#039;&#039;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.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[Basemapz]] - &#039;&#039;A tool to assist in creating Model Trainz baseboards from scale plans by ModelerMJ.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[Retain My Asset Names]] (RMAN) - &#039;&#039;A Trainz Asset Name management and organization tool that projects user-assigned custom asset names from a local user database across various and future Trainz version asset libraries (by [https://forums.auran.com/trainz/member.php?41964-deneban deneban])&lt;br /&gt;
&lt;br /&gt;
[[Shane Turner&#039;s Trainz Tools]] - &#039;&#039;Tools to enhance and help resolve some Trainz technical problems. Hosted on the same site as the PEV Trainz Tools&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[Trainz Tools by PEV]] - &#039;&#039;Editing and repair tools for most Trainz Content files.  Shane Turner now hosts these.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[TransDEM]] - Converts digital elevation files to efficently model prototype railroads.&lt;br /&gt;
&lt;br /&gt;
[[vvmm&#039;s Trainz Tools]] - Tools for opening TZarc files, explore CDP files contents, list kuids etc.&lt;br /&gt;
&lt;br /&gt;
[[callavsg&#039;s Scripting Tools]] - Tools for synatx highlighting and scripting helpers&lt;br /&gt;
&lt;br /&gt;
More &#039;&#039;TBA&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Native APIs==&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
[[TrainzNativeInterface]] - A helper DLL which provides the basic functionality for communication between Trainz executables and third-party DLLs.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Documentation==&lt;br /&gt;
&lt;br /&gt;
[[Command Line Guidelines]] - &#039;&#039;Details guidelines for developing Trainz-related command-line utilities with the intention of creating a standardised, easy-to-use interface.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;TBD&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[Category:TBD]]&lt;br /&gt;
[[Category:Trainz Wiki]]&lt;/div&gt;</summary>
		<author><name>Callavsg</name></author>
	</entry>
	<entry>
		<id>https://wiki.trainzsimulator.com/index.php?title=Callavsg%27s_Scripting_Tools&amp;diff=25472</id>
		<title>Callavsg&#039;s Scripting Tools</title>
		<link rel="alternate" type="text/html" href="https://wiki.trainzsimulator.com/index.php?title=Callavsg%27s_Scripting_Tools&amp;diff=25472"/>
		<updated>2020-11-22T18:23:28Z</updated>

		<summary type="html">&lt;p&gt;Callavsg: Created page with &amp;quot;==Syntax Highlighting==  Syntax highlightning is one of the basics that makes your life easier when writing code.   Media:TrainzScriptNpp.rar offers you even this for Note...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Syntax Highlighting==&lt;br /&gt;
&lt;br /&gt;
Syntax highlightning is one of the basics that makes your life easier when writing code. &lt;br /&gt;
&lt;br /&gt;
[[Media:TrainzScriptNpp.rar]] offers you even this for Notepad++. Just follow the ReadMe.txt and have fun!&lt;/div&gt;</summary>
		<author><name>Callavsg</name></author>
	</entry>
	<entry>
		<id>https://wiki.trainzsimulator.com/index.php?title=Tools&amp;diff=25471</id>
		<title>Tools</title>
		<link rel="alternate" type="text/html" href="https://wiki.trainzsimulator.com/index.php?title=Tools&amp;diff=25471"/>
		<updated>2020-11-22T18:17:41Z</updated>

		<summary type="html">&lt;p&gt;Callavsg: /* Third-party Tools */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Auran-provided Tools==&lt;br /&gt;
&lt;br /&gt;
The following executable tools are made available to Trainz users.&lt;br /&gt;
&lt;br /&gt;
[[Content Manager]] - &#039;&#039;Auran&#039;s included content management GUI, which provides functionality for downloading, installing, managing and building custom content.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[Content Creator Plus]] - &#039;&#039;Auran&#039;s included content creation GUI, which provides functionality for creating, editing, viewing and validating asset configurations.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[Trainz Mesh Importer]] - &#039;&#039;An xml-to-im converter that can be used to simplify conversion of models from various formats into Trainz .im format.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[TrainzUtil]] - &#039;&#039;A command line content management tool.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Third-party Tools==&lt;br /&gt;
&lt;br /&gt;
The following Trainz-related tools are maintained by Trainz 3rd-party developers.&lt;br /&gt;
&lt;br /&gt;
[[AssetX Wiki|AssetX]] - &#039;&#039;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.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[Basemapz]] - &#039;&#039;A tool to assist in creating Model Trainz baseboards from scale plans by ModelerMJ.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[Retain My Asset Names]] (RMAN) - &#039;&#039;A Trainz Asset Name management and organization tool that projects user-assigned custom asset names from a local user database across various and future Trainz version asset libraries (by [https://forums.auran.com/trainz/member.php?41964-deneban deneban])&lt;br /&gt;
&lt;br /&gt;
[[Shane Turner&#039;s Trainz Tools]] - &#039;&#039;Tools to enhance and help resolve some Trainz technical problems. Hosted on the same site as the PEV Trainz Tools&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[Trainz Tools by PEV]] - &#039;&#039;Editing and repair tools for most Trainz Content files.  Shane Turner now hosts these.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[TransDEM]] - Converts digital elevation files to efficently model prototype railroads.&lt;br /&gt;
&lt;br /&gt;
[[vvmm&#039;s Trainz Tools]] - Tools for opening TZarc files, explore CDP files contents, list kuids etc.&lt;br /&gt;
&lt;br /&gt;
[[callavsg&#039;s Scripting Tools]] - Tools for synatx highlightning and scripting helpers&lt;br /&gt;
&lt;br /&gt;
More &#039;&#039;TBA&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Native APIs==&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
[[TrainzNativeInterface]] - A helper DLL which provides the basic functionality for communication between Trainz executables and third-party DLLs.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Documentation==&lt;br /&gt;
&lt;br /&gt;
[[Command Line Guidelines]] - &#039;&#039;Details guidelines for developing Trainz-related command-line utilities with the intention of creating a standardised, easy-to-use interface.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;TBD&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[Category:TBD]]&lt;br /&gt;
[[Category:Trainz Wiki]]&lt;/div&gt;</summary>
		<author><name>Callavsg</name></author>
	</entry>
	<entry>
		<id>https://wiki.trainzsimulator.com/index.php?title=File:TrainzScriptNpp.rar&amp;diff=25470</id>
		<title>File:TrainzScriptNpp.rar</title>
		<link rel="alternate" type="text/html" href="https://wiki.trainzsimulator.com/index.php?title=File:TrainzScriptNpp.rar&amp;diff=25470"/>
		<updated>2020-11-22T18:16:15Z</updated>

		<summary type="html">&lt;p&gt;Callavsg: Syntax highlightning files for use with Notepad++&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Syntax highlightning files for use with Notepad++&lt;/div&gt;</summary>
		<author><name>Callavsg</name></author>
	</entry>
	<entry>
		<id>https://wiki.trainzsimulator.com/index.php?title=Class_Browser&amp;diff=18369</id>
		<title>Class Browser</title>
		<link rel="alternate" type="text/html" href="https://wiki.trainzsimulator.com/index.php?title=Class_Browser&amp;diff=18369"/>
		<updated>2019-04-12T09:16:53Z</updated>

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

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

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

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

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

		<summary type="html">&lt;p&gt;Callavsg: /* score-gauge */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The [[MiniBrowser]] is a trivial HTML renderer used for simple layout control within the Trainz game environment. It is specifically not a replacement for a real browser (see [[Trainz Online]] instead), is not remotely standards compliant, and does not support a full range of HTML tags. If a tag isn&#039;t mentioned here then it is NOT supported. There is no javascript support ([[Scripting|TrainzScript]] is used instead.) The [[MiniBrowser]] is used exclusively by the Trainz [[class Browser|Browser]] script object.&lt;br /&gt;
&lt;br /&gt;
Feature requests relating primarily to the MiniBrowser should be placed on the [[MiniBrowser Feature Requests]] page.&lt;br /&gt;
&lt;br /&gt;
Trainz HTML is NOT standards compliant and is best thought of as an HTML-alike chosen so users and developers are familiar with the style of syntax being used.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Supported Tags=&lt;br /&gt;
The MiniBrowser supports the following HTML tags:&lt;br /&gt;
&lt;br /&gt;
==HTML==&lt;br /&gt;
This tag wraps the entire HTML document. No parameters are supported. This tag should be at the top level of the document and should contain a single &#039;[[#BODY |BODY]]&#039; tag.&lt;br /&gt;
&lt;br /&gt;
Usage:&lt;br /&gt;
:&amp;amp;lt;html&amp;gt;&lt;br /&gt;
::...&lt;br /&gt;
:&amp;amp;lt;/html&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==BODY==&lt;br /&gt;
This tag wraps the entire body of the HTML document. The &#039;scale&#039; parameter is provided to force the document to be rescaled to a specified number of pixels wide, but its usage is strongly discouraged. This tag should exist within the &#039;[[#HTML |HTML]]&#039; tag and may contain any number of other elements.&lt;br /&gt;
&lt;br /&gt;
Usage:&lt;br /&gt;
:&amp;amp;lt;body scale=?&amp;gt;&lt;br /&gt;
::...&lt;br /&gt;
:&amp;amp;lt;/body&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==P (paragraph)==&lt;br /&gt;
This tag causes the contained elements to be formatted as a separate paragraph. This is similar to prefixing and suffixing the elements with a linebreak. Paragraph tag has no parameters.&lt;br /&gt;
&lt;br /&gt;
Usage:&lt;br /&gt;
:&amp;amp;lt;p&amp;gt;...&amp;amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==BR (linebreak)==&lt;br /&gt;
A forced linebreak. BR has no parameters.&lt;br /&gt;
&lt;br /&gt;
BR is an unclosed tag, unlike XHTML there is no &amp;amp;lt;br /&amp;gt; or &amp;amp;lt;/br&amp;gt;. In fact using such a thing will most likely be interpreted as an error by the Trainz HTML parser.&lt;br /&gt;
&lt;br /&gt;
Usage:&lt;br /&gt;
:...&amp;amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==TABLE==&lt;br /&gt;
This tag forms a table element. Any number of &amp;amp;lt;[[#TR |TR]]&amp;gt; (table row) elements may be present within the &#039;TABLE&#039; tag and that is all it should contain directly. Table height cannot be specified, this can be controlled by setting each &amp;amp;lt;[[#TR |TR]]&amp;gt; element within the table to add up to the desired table height.&lt;br /&gt;
&lt;br /&gt;
Table does NOT support the following parameters; rules, summary, align. Nor does it support the &amp;amp;lt;TH&amp;gt; element (the same effect can be achieved by making the contents of a &amp;amp;lt;[[#TD |TD]]&amp;gt; [[#B |BOLD]] or even more so by the use of [[#FONT |FONT]]). Table is best thought of as a grid, like that of a spreadsheet or a table inserted into a document. Tables are described by &amp;amp;lt;[[#TR |TR]]&amp;gt;; a row in a table and &amp;amp;lt;[[#TD |TD]]&amp;gt;; a cell in a row. &lt;br /&gt;
&lt;br /&gt;
Tables are not askew, meaning if 1 row has 3 cells then all rows will have at least 3 cells, this does not mean the coder must put at least 3 &amp;amp;lt;[[#TD |TD]]&amp;gt;s in each &amp;amp;lt;[[#TR |TR]]&amp;gt; it means when formatted for display on screen the html render will organise the table as such (as it is uniform). Furthermore, cells conform to the dimensions of their siblings; meaning a cell has the same width as the widest cell in its column (controllable by width in &amp;amp;lt;[[#TD |TD]]&amp;gt;) and the same height as the tallest cell in its row (controllable by height in &amp;amp;lt;[[#TR |TR]]&amp;gt;). This is very important to keep in mind when using tables for formatting/layout purposes.&lt;br /&gt;
&lt;br /&gt;
The documentation on &amp;amp;lt;[[#TR |TR]]&amp;gt; and &amp;amp;lt;[[#TD |TD]]&amp;gt; have more information about the use of tables in Trainz HTML. For more info and a place to try out some of these properties of tables try the [http://www.w3schools.com/tags/tag_table.asp w3schools table tag page], but remember Trainz HTML is not the same as HTML proper.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
All parameters are optional.&lt;br /&gt;
*cellpadding - specifies the minimum pixel space between the cell wall and its content. Default is 0.&lt;br /&gt;
*cellspacing - specifies the pixels between cells. Default is 0.&lt;br /&gt;
*width - specifies the pixel width of the table. If none is given the table will grow to fit its content. If width is given cell content will be wrapped if it would force table width beyond that.&lt;br /&gt;
*border - specifies the pixel width between the table and content around it. Default is 0.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Usage:&lt;br /&gt;
:&amp;amp;lt;table cellpadding=? cellspacing=? border=? width=? inherit-font&amp;gt;...&amp;amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==TR==&lt;br /&gt;
TR is Table Row. This tag forms a single horizontal row of a table. Any number of &#039;[[#TD |TD]]&#039; (table data) elements may be present within the &#039;TR&#039; tag and that is all it should directly contain. &amp;amp;lt;TR&amp;gt; does NOT support the following parameters; align, valign, char, charoff.&lt;br /&gt;
&lt;br /&gt;
All parameters are optional. Height, if specified, will limit how many pixels high this row can be, causing cells to expand in width if they were to approach this height.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
When using tables for formatting it is important to remember that cell size is dependent upon both column and row (see &amp;amp;lt;[[#TD |TD]]&amp;gt; and/or &amp;amp;lt;[[#TABLE |TABLE]]&amp;gt; for more info) thus it may be useful to consider creating a &amp;amp;lt;TR&amp;gt; with no data that exists only to set up the size of the columns ie.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;amp;lt;tr&amp;gt; &amp;amp;lt;td width=&#039;20&#039;&amp;gt;&amp;amp;lt;/td&amp;gt; &amp;amp;lt;td width=&#039;50&#039;&amp;gt;&amp;amp;lt;/td&amp;gt; &amp;amp;lt;td width=&#039;200&#039;&amp;gt;&amp;amp;lt;/td&amp;gt; &amp;amp;lt;td width=&#039;20&#039;&amp;gt;&amp;amp;lt;/td&amp;gt;  &amp;amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
now unless a &amp;amp;lt;TR&amp;gt; with more than 4 &amp;amp;lt;[[#TD |TD]]&amp;gt;s is created, the formatting for all columns is already done and as this &amp;amp;lt;TR&amp;gt; has no height specified and no data in its &amp;amp;lt;[[#TD |TD]]&amp;gt; cells it will take up only the space specified by the &amp;amp;lt;[[#TABLE |TABLE]]&amp;gt;&#039;s border, cellspacing and cellpadding (default 0).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Usage:&lt;br /&gt;
:&amp;amp;lt;tr height=? bgcolor=?&amp;gt;...&amp;amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==TD==&lt;br /&gt;
TD is Table Data. This tag forms a single cell within a table row. &amp;amp;lt;TD&amp;gt; does NOT support the following parameters; abbr, axis, char, charoff, headers, height, scope.&lt;br /&gt;
&lt;br /&gt;
Height of a cell is controlled by the tallest cell in the row or by the &amp;amp;lt;[[#TR |TR]]&amp;gt; height parameter if it is specified.&lt;br /&gt;
&lt;br /&gt;
&amp;amp;lt;TD&amp;gt; is the work horse of tables, as the name implies all contents of a table are contained within a &amp;amp;lt;TD&amp;gt; tag. Anything can be placed within a cell, even a table eg.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;html&amp;gt; &amp;lt;body&amp;gt;&lt;br /&gt;
  &amp;lt;table border=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt; &lt;br /&gt;
      &amp;lt;td&amp;gt;Some text &amp;lt;/td&amp;gt;&lt;br /&gt;
      &amp;lt;td&amp;gt;Some text &amp;lt;/td&amp;gt; &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt; &lt;br /&gt;
      &amp;lt;td&amp;gt;Some text &amp;lt;/td&amp;gt;&lt;br /&gt;
      &amp;lt;td&amp;gt;Some text &amp;lt;/td&amp;gt; &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt; &lt;br /&gt;
      &amp;lt;td&amp;gt; &lt;br /&gt;
        &amp;lt;table border=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;tr&amp;gt;&lt;br /&gt;
            &amp;lt;td&amp;gt;Some text in a sub table &amp;lt;/td&amp;gt;&lt;br /&gt;
            &amp;lt;td&amp;gt;Some other text in a sub table &amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;/tr&amp;gt;&lt;br /&gt;
        &amp;lt;/table&amp;gt;&lt;br /&gt;
      &amp;lt;/td&amp;gt;&lt;br /&gt;
      &amp;lt;td&amp;gt;&amp;lt;---Wow thats a sub table over there &amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
  &amp;lt;/table&amp;gt;&lt;br /&gt;
&amp;lt;/body&amp;gt; &amp;lt;/html&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
coping and pasting the above into the left pane of [http://www.w3schools.com/HTML/tryit.asp?filename=tryhtml_basic this Tryit window](open it in a new tab or window) and clicking &amp;quot;Edit and Click me &amp;gt;&amp;gt;&amp;quot; button will show you a table with a table in it on the right hand side.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
All parameters are optional.&lt;br /&gt;
*rowspan and colspan allows this cell to consume the space that would normally be allocated to neighboring cells on the right and bottom sides. Default values are 1, meaning the &amp;amp;lt;TD&amp;gt; spans its own cell and nothing more. [http://www.w3schools.com/tags/tryit.asp?filename=tryhtml_table_span Visual example of spanning], but remember Trainz HTML is not the same as HTML proper.&lt;br /&gt;
*width - specifies the pixel width of this cell, useful for formatting.&lt;br /&gt;
*align - &#039;left&#039;, &#039;center&#039;, &#039;right&#039;. (default &#039;left&#039;.) Controls the horizontal alignment of the content data within the table cell.&lt;br /&gt;
*valign - &#039;top&#039;, &#039;center&#039;, &#039;bottom&#039; (default &#039;top&#039;) Controls the vertical alignment of the content data within the table cell.&lt;br /&gt;
&lt;br /&gt;
Usage:&lt;br /&gt;
:&amp;amp;lt;td rowspawn=? colspan=? width=? bgcolor=? align=? valign=?&amp;gt;...&amp;amp;lt;/td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==A==&lt;br /&gt;
A is the Anchor tag. This tag marks all contained elements as a hyperlink with the specified attributes. Hyperlinked text will be underlined.&lt;br /&gt;
&lt;br /&gt;
Tooltip text will be displayed when the mouse hovers over the hyperlinked elements.&lt;br /&gt;
&lt;br /&gt;
The href is the minor message in a [[Browser Messages |Browser-URL message]] sent by the [[class Browser |Browser]] to whomever is listening to it. ie. the major=&amp;quot;Browser-URL&amp;quot; minor=&amp;quot;live://button/horn&amp;quot; message is produced by a hyperlinked button (horn) in the driver user interface.&lt;br /&gt;
&lt;br /&gt;
A hyperlink is considered clicked when the user has pressed and released mouse button 1 while over it.&lt;br /&gt;
&lt;br /&gt;
Usage:&lt;br /&gt;
:&amp;amp;lt;a href=? target=? help-label=? mousedown=? disabled-href=? tooltip=?&amp;gt;...&amp;amp;lt;/a&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==IMG==&lt;br /&gt;
IMG is the IMaGe tag. This tag displays an image with the specified attributes. Does NOT support the alt or title tags. &lt;br /&gt;
&lt;br /&gt;
All parameters are optional however, the src or the kuid parameter needs to be filled out for anything to show up apart from a fill.&lt;br /&gt;
&lt;br /&gt;
The width and height parameters define the pixel size the image will occupy on screen, these can be made larger or smaller than the image&#039;s actual size to zoom, stretch or squash the image as needed. Keep in mind that users don&#039;t all use the same resolution, so it is usually best to make pictures either fixed size in a screen position via the use of tables or calculating a pixel size relative to the current resolution.&lt;br /&gt;
&lt;br /&gt;
Usage:&lt;br /&gt;
:&amp;amp;lt;img src=? mouseover=? kuid=? width=? height=? srcwidth=? srcheight=? color=? hflip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==TRAINZ-TEXT==&lt;br /&gt;
A section of text that can be changed without having to recalculate or reset the entire HTML string in a [[class Browser |browser]]. &lt;br /&gt;
&lt;br /&gt;
In the Driver interface the speed panel shows the selected train&#039;s current speed, the current speed limit on its segment of track and the current world time. Below is the speed HTML, which is retrieved via the localisation method described in &amp;amp;lt;[[#FONT |FONT]]&amp;gt;;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;font color=#00FF00 locale=&#039;english&#039;&amp;gt;&amp;lt;b&amp;gt;&amp;lt;trainz-text id=&#039;speed&#039; text=&#039;0 KM/H&#039;&amp;gt;&amp;lt;/trainz-text&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This specifies green bold text that is bound to an id of &amp;quot;speed&amp;quot;. Now in every heartbeat in DriverModule.gs, the currently selected train&#039;s speed is calculated and applied to this trainz-text by calling SetTrainzText(&amp;quot;speed&amp;quot;, &amp;quot;10 kph&amp;quot;) [10 kph used only for illustrative purposes] on the [[class Browser |browser]] that contains the speed html.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The id parameter is required to be able to update this section of text via the SetTrainzText [[class Browser |browser]] call. The text parameter does not need to be filled out int HTML can be specified using the SetTrainzText method at a later time.&lt;br /&gt;
&lt;br /&gt;
Usage:&lt;br /&gt;
:&amp;amp;lt;trainz-text id=? text=?&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==B==&lt;br /&gt;
B is Boldface. Causes any text in contained elements to be rendered as boldface. The bold tag has no parameters.&lt;br /&gt;
&lt;br /&gt;
Usage:&lt;br /&gt;
:&amp;amp;lt;b&amp;gt;...&amp;amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==NOWRAP==&lt;br /&gt;
Suppresses automatic word wrap in the contained elements. The nowrap tag has no parameters.&lt;br /&gt;
&lt;br /&gt;
Usage:&lt;br /&gt;
:&amp;amp;lt;nowrap&amp;gt;...&amp;amp;lt;/nowrap&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==I==&lt;br /&gt;
I is the Italics tag. Causes any text in the contained elements to be rendered as italic. The italic tag has no parameters.&lt;br /&gt;
&lt;br /&gt;
Usage:&lt;br /&gt;
:&amp;amp;lt;i&amp;gt;...&amp;amp;lt;/i&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==FONT==&lt;br /&gt;
Causes the specified text attributes to be applied to any text in the contained elements. Text in Trainz HTML does not have to be enclosed in font tags, if none are found around any given text it will receive the default font settings.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Localisation note; the follow statement has special meaning to the Trains HTML parser;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;font locale=generic&amp;gt;A_TAG&amp;lt;/font&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
When a tag such as this is parsed, Trainz will look in the current users selected language [[class StringTable | string table]] of the current asset for a string with the name found between the &amp;amp;lt;font&amp;gt; &amp;amp;lt;/font&amp;gt; tags, in this case A_TAG. It will replace the entire statement from here &amp;quot;&amp;amp;lt;font... &amp;amp;lt;/font&amp;gt;&amp;quot; to here with what is found in the [[class StringTable | string table]]. An example of this at work is in the Driver interface where the camera types are defined in the string tables of the Driver asset [[config.txt file | config.txt]] in all available languages so that each camera button has the selected language tooltip for each camera mode.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Usage:&lt;br /&gt;
:&amp;amp;lt;font size=? color=? locale=? face=?&amp;gt;...&amp;amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==TRAINZ-OBJECT==&lt;br /&gt;
Documented below under [[#Embedded Objects |embedded objects]]. Embedded objects fill the style parameter. The width and height parameters specify the pixel size of the given object, eg. how big a button is.&lt;br /&gt;
&lt;br /&gt;
Usage:&lt;br /&gt;
:&amp;amp;lt;trainz-object width=? height=? style=?&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Supported Characters=&lt;br /&gt;
The MiniBrowser parses its input from UTF-8 encoded HTML. The full range of unicode characters may be included without special escape sequences. The following escape sequences are permitted and may be necessary to prevent the characters from being parsed as HTML markup.&lt;br /&gt;
* &amp;amp;amp;nbsp; - the HTML non-breaking space character.&lt;br /&gt;
* &amp;amp;amp;gt; - the &amp;quot;greater than&amp;quot; character (&#039; &amp;amp;gt; &#039;) &lt;br /&gt;
* &amp;amp;amp;lt; - the &amp;quot;less than&amp;quot; character (&#039; &amp;amp;lt; &#039;)&lt;br /&gt;
* &amp;amp;amp;amp; - the &amp;quot;ampersand&amp;quot; character (&#039; &amp;amp;amp; &#039;)&lt;br /&gt;
* &amp;amp;amp;quot; - the &amp;quot;quote&amp;quot; character (&#039; &amp;amp;quot; &#039;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Embedded Objects=&lt;br /&gt;
The following embedded objects are supported by the trainz-object tag:&lt;br /&gt;
&lt;br /&gt;
==dirver-menu-button==&lt;br /&gt;
:style=driver-menu-button name=?&lt;br /&gt;
&lt;br /&gt;
==dial==&lt;br /&gt;
Works like an analogue volume knob. A dial is used in the driver interface, in the dcc panel to control the speed/power of the train. These are its settings;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;trainz-object style=dial width=95 height=95 id=&#039;dcc&#039; &lt;br /&gt;
texture=&#039;newdriver/dcc/dcc_controller.tga&#039; min=0.1 max=0.9 &lt;br /&gt;
valmin=-1.0 valmax=1.0 step=0 clickstep=1 value=0.5&amp;gt;&amp;lt;/trainz-object&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Driver wraps the dial in an &amp;amp;lt;[[#A |A]]&amp;gt; as to receive messages from user interactions with it, it then uses the GetElementProperty(&amp;quot;dcc&amp;quot;, &amp;quot;value&amp;quot;) on the [[class Browser |Browser]] the dial resides in to extract its current value.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Parameters explained;&lt;br /&gt;
*The style, width, height and id parameters belong to the [[#TRAINZ-OBJECT |TRAINZ-OBJECT]].&lt;br /&gt;
*The min and max parameters specify the rotation (as a percent between 0 and 1) the dial can have in the interface. For the driver speed knob its 0.1 to 0.9; imagining this as a clock face this means the dial is allowed to rotate between approximately 7 clockwise around to approximately 5 and vice versa anticlockwise anywhere between 5 and 7. The dial&#039;s rotation can never be clockwise between 5 and 7.&lt;br /&gt;
*valmin and valmax specify the values returned by the dial, that is how its values map to its rotation. Using the clockface analogy again, at approximately 7 the dial will return the value of -1, at approximately 5 it will return the value 1 and at 12 it will return 0.&lt;br /&gt;
*step specifies the minimum change that can occur in the dial, 0 means it can move completely freely, if step were 0.1 and the user had rotated it by 0.04 no rotation would be registered and the dial would snap back to its previous position.&lt;br /&gt;
*clickstep TBD&lt;br /&gt;
*value sets the initial starting position (as a percentage 0 to 1) of its range. 0.5 being half between max and min.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
:style=dial texture=? min=? max=? valmin=? valmax=? step=? clickstep=? value=?&lt;br /&gt;
&lt;br /&gt;
==graphic-button==&lt;br /&gt;
:style=graphic-button text-color=? texture_off=? texture_on=? name=? toggle=?&lt;br /&gt;
&lt;br /&gt;
==thumbnail-downloader==&lt;br /&gt;
:style=thumbnail-downloader asset=? index=? thumb-size=? crop=?&lt;br /&gt;
&lt;br /&gt;
==button==&lt;br /&gt;
A Button is essentially 8 [[#IMG |image]]s; where only 1 is shown at a time determined by the button&#039;s on or off-ness and the user&#039;s cursor location.&lt;br /&gt;
&lt;br /&gt;
Buttons can be set either &#039;off&#039; or &#039;on&#039; by calling SetElementProperty(&amp;quot;button name&amp;quot;, &amp;quot;value&amp;quot;, &amp;quot;1&amp;quot;) [for on or &amp;quot;0&amp;quot; for off] on the [[class Browser |browser]] that contains the button. All buttons start in the off state.&lt;br /&gt;
&lt;br /&gt;
Both &#039;on&#039; and &#039;off&#039; states have 4 states within them for showing interaction with the cursor. Off is explained below, on is the same replacing &amp;quot;off&amp;quot; with &amp;quot;on&amp;quot;;&lt;br /&gt;
* &amp;quot;off&amp;quot; - button is in the off state and has no cursor interaction.&lt;br /&gt;
* &amp;quot;off-over&amp;quot; - button is in the off state and the cursor is hovering over the button.&lt;br /&gt;
* &amp;quot;off-down&amp;quot; - button is in the off state and the cursor has been clicked on the button, is held down (mouse button 1 is down) but the cursor is not (is no longer) hovering over the button meaning the user has dragged the cursor off the button after clicking it.&lt;br /&gt;
* &amp;quot;off-down-over&amp;quot; - button is in the off state and the cursor is hovering over the button and the cursor has been clicked on it and is being held down (mouse button 1 is down).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The size of a button is determined by the width and height parameters of its containing [[#TRAINZ-OBJECT |TRAINZ-OBJECT]] tag.&lt;br /&gt;
&lt;br /&gt;
Typically a button trainz-object will be contained within an &amp;amp;lt;[[#A |A]]&amp;gt; tag giving the appearance that buttons send messages. As buttons do not send clicked messages themselves, they do not directly know when they have been clicked on or off, this must be done manually by listening to the message that will be sent by the anchor tag and changing the buttons state using the SetElementProperty(&amp;quot;button name&amp;quot;, &amp;quot;value&amp;quot;, &amp;quot;1&amp;quot;) command on its containing browser.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Usage:&lt;br /&gt;
? represent image files within the asset.&lt;br /&gt;
:style=button id=&amp;amp;lt;button name&amp;gt; off=? off-over=? off-down=? off-down-over=? on=? on-over=? on-down=? on-down-over=? link-held=?&lt;br /&gt;
&lt;br /&gt;
==minimap==&lt;br /&gt;
:style=minimap&lt;br /&gt;
&lt;br /&gt;
==preview==&lt;br /&gt;
An asset preview as used in the Surveyor tabs.&lt;br /&gt;
&lt;br /&gt;
* &amp;quot;asset&amp;quot; - the kuid of the asset to be shown (pass KUID by KUID::GetHTMLString())&lt;br /&gt;
&lt;br /&gt;
Usage:&lt;br /&gt;
:style=preview asset=&amp;lt;asset-kuid&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==text-line==&lt;br /&gt;
:style=text-line background=? align=?&lt;br /&gt;
&lt;br /&gt;
==asset-picker==&lt;br /&gt;
:style=asset-picker background=? align=?&lt;br /&gt;
&lt;br /&gt;
==driver-order-bar==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Incorrect&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Is a very specific case. As the name implies it is the list of driver commands that appears at the bottom of the screen next to the current driver image in Driver. This is already created and managed for you, users probably don&#039;t want to make these in any useful way, just to mess around or break things.&lt;br /&gt;
&lt;br /&gt;
:style=driver-order-bar&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;this isn&#039;t really accurate. i think you&#039;ll find this is already used elsewhere in the game (for example, in the driver command rule?) and in fact possibly isn&#039;t used by the main driver interface - it&#039;s likely that is not HTML although it&#039;s the same underlying control. this is a general-purpose control: the functionality is specific to assigning orders, but it should be fairly flexible what the calling script does with the orders.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==clock==&lt;br /&gt;
:style=clock face-texture=? seconds-texture=? minutes-texture=? hours-texture=? seconds-visible=? minutes-visible=? hours-visible=? seconds=? minutes=? hours=?&lt;br /&gt;
&lt;br /&gt;
==slider==&lt;br /&gt;
Slider is a horizontal bar similar to a horizontal scroll bar with a linear range of values mapped to it, similar to the [[#dial |dial]]. &lt;br /&gt;
&lt;br /&gt;
There are several in the video settings menu/asset and those will be used as an example here. The most important attributes are;&lt;br /&gt;
*min the minimum value the slider represents (far left).&lt;br /&gt;
*max the maximum value the slider represents (far right).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
:style=slider min=? max=? page-size=? draw-lines=? draw-marks=? thumb=? thumb-over=? less=? less-over=? more=? more-over=? thumb-width=? thumb-height=? theme=? background=? arrow-width=? arrow-height=?&lt;br /&gt;
&lt;br /&gt;
==browser==&lt;br /&gt;
[[class Browser |browser]] is updated through call to SetElementProperty(&amp;quot;component-name&amp;quot;,&amp;quot;html&amp;quot;,sub-browser html  string) from the parent browser level. An example of this at work can be found in the waybillmanager.gs&lt;br /&gt;
&lt;br /&gt;
:style=browser id=&#039;component-name&#039; width=? height=? clip=?&lt;br /&gt;
&lt;br /&gt;
==edit-box==&lt;br /&gt;
The edit box allows a text entry field such as that provided on the Routes Menu search field or the iTrainz Chat windows.&lt;br /&gt;
&lt;br /&gt;
:style=edit-box multi-line read-only masked link-on-focus-loss&lt;br /&gt;
&lt;br /&gt;
==static-line==&lt;br /&gt;
A divider line graphic.&lt;br /&gt;
&lt;br /&gt;
:style=static-line color=?&lt;br /&gt;
&lt;br /&gt;
==progress==&lt;br /&gt;
A progress bar.&lt;br /&gt;
&lt;br /&gt;
:style=progress progress=?&lt;br /&gt;
&lt;br /&gt;
==keyinput==&lt;br /&gt;
&lt;br /&gt;
:style=keyinput context=? id=?&lt;br /&gt;
&lt;br /&gt;
==score-gauge==&lt;br /&gt;
:style=score-gauge star-thresholds=? points=? high-score=?&lt;br /&gt;
&lt;br /&gt;
==date-picker==&lt;br /&gt;
:style=date-picker day=? month=? year=?&lt;br /&gt;
&lt;br /&gt;
==video==&lt;br /&gt;
&amp;lt;font color=red&amp;gt;Seems to be removed in TRS19?&amp;lt;/font&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
This control plays back a video. Some platforms do not support this control; support can be tested through the &#039;PR_VideoPlayback&#039; product right. Video format support depends on the client system.&lt;br /&gt;
&lt;br /&gt;
*The play-on-load tag should be either &#039;1&#039; or &#039;0&#039; being yes or no respectively and it means exactly what it sounds like, should the video start playing once it has loaded.&lt;br /&gt;
*The is-video-looping is likewise a &#039;1&#039; or &#039;0&#039; value indicating the video should or shouldn&#039;t repeat once finished.&lt;br /&gt;
&lt;br /&gt;
:style=video play-on-load=? video-filename=? is-video-looping=?&lt;br /&gt;
&lt;br /&gt;
==internet-browser==&lt;br /&gt;
&amp;lt;font color=red&amp;gt;Seems to be removed in TRS19?&amp;lt;/font&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
The internet browser is a native (eg. mozilla, safari, etc.) web browser which can be used to display information from this wiki. Some platforms do not support this control; support can be tested through the &#039;PR_WebBrowser&#039; product right. For platforms that do support this control, the exact feature set may vary.&lt;br /&gt;
&lt;br /&gt;
:style=internet-browser address=?&lt;/div&gt;</summary>
		<author><name>Callavsg</name></author>
	</entry>
	<entry>
		<id>https://wiki.trainzsimulator.com/index.php?title=MiniBrowser&amp;diff=18315</id>
		<title>MiniBrowser</title>
		<link rel="alternate" type="text/html" href="https://wiki.trainzsimulator.com/index.php?title=MiniBrowser&amp;diff=18315"/>
		<updated>2019-04-08T10:11:47Z</updated>

		<summary type="html">&lt;p&gt;Callavsg: /* preview */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The [[MiniBrowser]] is a trivial HTML renderer used for simple layout control within the Trainz game environment. It is specifically not a replacement for a real browser (see [[Trainz Online]] instead), is not remotely standards compliant, and does not support a full range of HTML tags. If a tag isn&#039;t mentioned here then it is NOT supported. There is no javascript support ([[Scripting|TrainzScript]] is used instead.) The [[MiniBrowser]] is used exclusively by the Trainz [[class Browser|Browser]] script object.&lt;br /&gt;
&lt;br /&gt;
Feature requests relating primarily to the MiniBrowser should be placed on the [[MiniBrowser Feature Requests]] page.&lt;br /&gt;
&lt;br /&gt;
Trainz HTML is NOT standards compliant and is best thought of as an HTML-alike chosen so users and developers are familiar with the style of syntax being used.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Supported Tags=&lt;br /&gt;
The MiniBrowser supports the following HTML tags:&lt;br /&gt;
&lt;br /&gt;
==HTML==&lt;br /&gt;
This tag wraps the entire HTML document. No parameters are supported. This tag should be at the top level of the document and should contain a single &#039;[[#BODY |BODY]]&#039; tag.&lt;br /&gt;
&lt;br /&gt;
Usage:&lt;br /&gt;
:&amp;amp;lt;html&amp;gt;&lt;br /&gt;
::...&lt;br /&gt;
:&amp;amp;lt;/html&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==BODY==&lt;br /&gt;
This tag wraps the entire body of the HTML document. The &#039;scale&#039; parameter is provided to force the document to be rescaled to a specified number of pixels wide, but its usage is strongly discouraged. This tag should exist within the &#039;[[#HTML |HTML]]&#039; tag and may contain any number of other elements.&lt;br /&gt;
&lt;br /&gt;
Usage:&lt;br /&gt;
:&amp;amp;lt;body scale=?&amp;gt;&lt;br /&gt;
::...&lt;br /&gt;
:&amp;amp;lt;/body&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==P (paragraph)==&lt;br /&gt;
This tag causes the contained elements to be formatted as a separate paragraph. This is similar to prefixing and suffixing the elements with a linebreak. Paragraph tag has no parameters.&lt;br /&gt;
&lt;br /&gt;
Usage:&lt;br /&gt;
:&amp;amp;lt;p&amp;gt;...&amp;amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==BR (linebreak)==&lt;br /&gt;
A forced linebreak. BR has no parameters.&lt;br /&gt;
&lt;br /&gt;
BR is an unclosed tag, unlike XHTML there is no &amp;amp;lt;br /&amp;gt; or &amp;amp;lt;/br&amp;gt;. In fact using such a thing will most likely be interpreted as an error by the Trainz HTML parser.&lt;br /&gt;
&lt;br /&gt;
Usage:&lt;br /&gt;
:...&amp;amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==TABLE==&lt;br /&gt;
This tag forms a table element. Any number of &amp;amp;lt;[[#TR |TR]]&amp;gt; (table row) elements may be present within the &#039;TABLE&#039; tag and that is all it should contain directly. Table height cannot be specified, this can be controlled by setting each &amp;amp;lt;[[#TR |TR]]&amp;gt; element within the table to add up to the desired table height.&lt;br /&gt;
&lt;br /&gt;
Table does NOT support the following parameters; rules, summary, align. Nor does it support the &amp;amp;lt;TH&amp;gt; element (the same effect can be achieved by making the contents of a &amp;amp;lt;[[#TD |TD]]&amp;gt; [[#B |BOLD]] or even more so by the use of [[#FONT |FONT]]). Table is best thought of as a grid, like that of a spreadsheet or a table inserted into a document. Tables are described by &amp;amp;lt;[[#TR |TR]]&amp;gt;; a row in a table and &amp;amp;lt;[[#TD |TD]]&amp;gt;; a cell in a row. &lt;br /&gt;
&lt;br /&gt;
Tables are not askew, meaning if 1 row has 3 cells then all rows will have at least 3 cells, this does not mean the coder must put at least 3 &amp;amp;lt;[[#TD |TD]]&amp;gt;s in each &amp;amp;lt;[[#TR |TR]]&amp;gt; it means when formatted for display on screen the html render will organise the table as such (as it is uniform). Furthermore, cells conform to the dimensions of their siblings; meaning a cell has the same width as the widest cell in its column (controllable by width in &amp;amp;lt;[[#TD |TD]]&amp;gt;) and the same height as the tallest cell in its row (controllable by height in &amp;amp;lt;[[#TR |TR]]&amp;gt;). This is very important to keep in mind when using tables for formatting/layout purposes.&lt;br /&gt;
&lt;br /&gt;
The documentation on &amp;amp;lt;[[#TR |TR]]&amp;gt; and &amp;amp;lt;[[#TD |TD]]&amp;gt; have more information about the use of tables in Trainz HTML. For more info and a place to try out some of these properties of tables try the [http://www.w3schools.com/tags/tag_table.asp w3schools table tag page], but remember Trainz HTML is not the same as HTML proper.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
All parameters are optional.&lt;br /&gt;
*cellpadding - specifies the minimum pixel space between the cell wall and its content. Default is 0.&lt;br /&gt;
*cellspacing - specifies the pixels between cells. Default is 0.&lt;br /&gt;
*width - specifies the pixel width of the table. If none is given the table will grow to fit its content. If width is given cell content will be wrapped if it would force table width beyond that.&lt;br /&gt;
*border - specifies the pixel width between the table and content around it. Default is 0.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Usage:&lt;br /&gt;
:&amp;amp;lt;table cellpadding=? cellspacing=? border=? width=? inherit-font&amp;gt;...&amp;amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==TR==&lt;br /&gt;
TR is Table Row. This tag forms a single horizontal row of a table. Any number of &#039;[[#TD |TD]]&#039; (table data) elements may be present within the &#039;TR&#039; tag and that is all it should directly contain. &amp;amp;lt;TR&amp;gt; does NOT support the following parameters; align, valign, char, charoff.&lt;br /&gt;
&lt;br /&gt;
All parameters are optional. Height, if specified, will limit how many pixels high this row can be, causing cells to expand in width if they were to approach this height.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
When using tables for formatting it is important to remember that cell size is dependent upon both column and row (see &amp;amp;lt;[[#TD |TD]]&amp;gt; and/or &amp;amp;lt;[[#TABLE |TABLE]]&amp;gt; for more info) thus it may be useful to consider creating a &amp;amp;lt;TR&amp;gt; with no data that exists only to set up the size of the columns ie.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;amp;lt;tr&amp;gt; &amp;amp;lt;td width=&#039;20&#039;&amp;gt;&amp;amp;lt;/td&amp;gt; &amp;amp;lt;td width=&#039;50&#039;&amp;gt;&amp;amp;lt;/td&amp;gt; &amp;amp;lt;td width=&#039;200&#039;&amp;gt;&amp;amp;lt;/td&amp;gt; &amp;amp;lt;td width=&#039;20&#039;&amp;gt;&amp;amp;lt;/td&amp;gt;  &amp;amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
now unless a &amp;amp;lt;TR&amp;gt; with more than 4 &amp;amp;lt;[[#TD |TD]]&amp;gt;s is created, the formatting for all columns is already done and as this &amp;amp;lt;TR&amp;gt; has no height specified and no data in its &amp;amp;lt;[[#TD |TD]]&amp;gt; cells it will take up only the space specified by the &amp;amp;lt;[[#TABLE |TABLE]]&amp;gt;&#039;s border, cellspacing and cellpadding (default 0).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Usage:&lt;br /&gt;
:&amp;amp;lt;tr height=? bgcolor=?&amp;gt;...&amp;amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==TD==&lt;br /&gt;
TD is Table Data. This tag forms a single cell within a table row. &amp;amp;lt;TD&amp;gt; does NOT support the following parameters; abbr, axis, char, charoff, headers, height, scope.&lt;br /&gt;
&lt;br /&gt;
Height of a cell is controlled by the tallest cell in the row or by the &amp;amp;lt;[[#TR |TR]]&amp;gt; height parameter if it is specified.&lt;br /&gt;
&lt;br /&gt;
&amp;amp;lt;TD&amp;gt; is the work horse of tables, as the name implies all contents of a table are contained within a &amp;amp;lt;TD&amp;gt; tag. Anything can be placed within a cell, even a table eg.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;html&amp;gt; &amp;lt;body&amp;gt;&lt;br /&gt;
  &amp;lt;table border=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt; &lt;br /&gt;
      &amp;lt;td&amp;gt;Some text &amp;lt;/td&amp;gt;&lt;br /&gt;
      &amp;lt;td&amp;gt;Some text &amp;lt;/td&amp;gt; &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt; &lt;br /&gt;
      &amp;lt;td&amp;gt;Some text &amp;lt;/td&amp;gt;&lt;br /&gt;
      &amp;lt;td&amp;gt;Some text &amp;lt;/td&amp;gt; &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt; &lt;br /&gt;
      &amp;lt;td&amp;gt; &lt;br /&gt;
        &amp;lt;table border=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;tr&amp;gt;&lt;br /&gt;
            &amp;lt;td&amp;gt;Some text in a sub table &amp;lt;/td&amp;gt;&lt;br /&gt;
            &amp;lt;td&amp;gt;Some other text in a sub table &amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;/tr&amp;gt;&lt;br /&gt;
        &amp;lt;/table&amp;gt;&lt;br /&gt;
      &amp;lt;/td&amp;gt;&lt;br /&gt;
      &amp;lt;td&amp;gt;&amp;lt;---Wow thats a sub table over there &amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
  &amp;lt;/table&amp;gt;&lt;br /&gt;
&amp;lt;/body&amp;gt; &amp;lt;/html&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
coping and pasting the above into the left pane of [http://www.w3schools.com/HTML/tryit.asp?filename=tryhtml_basic this Tryit window](open it in a new tab or window) and clicking &amp;quot;Edit and Click me &amp;gt;&amp;gt;&amp;quot; button will show you a table with a table in it on the right hand side.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
All parameters are optional.&lt;br /&gt;
*rowspan and colspan allows this cell to consume the space that would normally be allocated to neighboring cells on the right and bottom sides. Default values are 1, meaning the &amp;amp;lt;TD&amp;gt; spans its own cell and nothing more. [http://www.w3schools.com/tags/tryit.asp?filename=tryhtml_table_span Visual example of spanning], but remember Trainz HTML is not the same as HTML proper.&lt;br /&gt;
*width - specifies the pixel width of this cell, useful for formatting.&lt;br /&gt;
*align - &#039;left&#039;, &#039;center&#039;, &#039;right&#039;. (default &#039;left&#039;.) Controls the horizontal alignment of the content data within the table cell.&lt;br /&gt;
*valign - &#039;top&#039;, &#039;center&#039;, &#039;bottom&#039; (default &#039;top&#039;) Controls the vertical alignment of the content data within the table cell.&lt;br /&gt;
&lt;br /&gt;
Usage:&lt;br /&gt;
:&amp;amp;lt;td rowspawn=? colspan=? width=? bgcolor=? align=? valign=?&amp;gt;...&amp;amp;lt;/td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==A==&lt;br /&gt;
A is the Anchor tag. This tag marks all contained elements as a hyperlink with the specified attributes. Hyperlinked text will be underlined.&lt;br /&gt;
&lt;br /&gt;
Tooltip text will be displayed when the mouse hovers over the hyperlinked elements.&lt;br /&gt;
&lt;br /&gt;
The href is the minor message in a [[Browser Messages |Browser-URL message]] sent by the [[class Browser |Browser]] to whomever is listening to it. ie. the major=&amp;quot;Browser-URL&amp;quot; minor=&amp;quot;live://button/horn&amp;quot; message is produced by a hyperlinked button (horn) in the driver user interface.&lt;br /&gt;
&lt;br /&gt;
A hyperlink is considered clicked when the user has pressed and released mouse button 1 while over it.&lt;br /&gt;
&lt;br /&gt;
Usage:&lt;br /&gt;
:&amp;amp;lt;a href=? target=? help-label=? mousedown=? disabled-href=? tooltip=?&amp;gt;...&amp;amp;lt;/a&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==IMG==&lt;br /&gt;
IMG is the IMaGe tag. This tag displays an image with the specified attributes. Does NOT support the alt or title tags. &lt;br /&gt;
&lt;br /&gt;
All parameters are optional however, the src or the kuid parameter needs to be filled out for anything to show up apart from a fill.&lt;br /&gt;
&lt;br /&gt;
The width and height parameters define the pixel size the image will occupy on screen, these can be made larger or smaller than the image&#039;s actual size to zoom, stretch or squash the image as needed. Keep in mind that users don&#039;t all use the same resolution, so it is usually best to make pictures either fixed size in a screen position via the use of tables or calculating a pixel size relative to the current resolution.&lt;br /&gt;
&lt;br /&gt;
Usage:&lt;br /&gt;
:&amp;amp;lt;img src=? mouseover=? kuid=? width=? height=? srcwidth=? srcheight=? color=? hflip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==TRAINZ-TEXT==&lt;br /&gt;
A section of text that can be changed without having to recalculate or reset the entire HTML string in a [[class Browser |browser]]. &lt;br /&gt;
&lt;br /&gt;
In the Driver interface the speed panel shows the selected train&#039;s current speed, the current speed limit on its segment of track and the current world time. Below is the speed HTML, which is retrieved via the localisation method described in &amp;amp;lt;[[#FONT |FONT]]&amp;gt;;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;font color=#00FF00 locale=&#039;english&#039;&amp;gt;&amp;lt;b&amp;gt;&amp;lt;trainz-text id=&#039;speed&#039; text=&#039;0 KM/H&#039;&amp;gt;&amp;lt;/trainz-text&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This specifies green bold text that is bound to an id of &amp;quot;speed&amp;quot;. Now in every heartbeat in DriverModule.gs, the currently selected train&#039;s speed is calculated and applied to this trainz-text by calling SetTrainzText(&amp;quot;speed&amp;quot;, &amp;quot;10 kph&amp;quot;) [10 kph used only for illustrative purposes] on the [[class Browser |browser]] that contains the speed html.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The id parameter is required to be able to update this section of text via the SetTrainzText [[class Browser |browser]] call. The text parameter does not need to be filled out int HTML can be specified using the SetTrainzText method at a later time.&lt;br /&gt;
&lt;br /&gt;
Usage:&lt;br /&gt;
:&amp;amp;lt;trainz-text id=? text=?&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==B==&lt;br /&gt;
B is Boldface. Causes any text in contained elements to be rendered as boldface. The bold tag has no parameters.&lt;br /&gt;
&lt;br /&gt;
Usage:&lt;br /&gt;
:&amp;amp;lt;b&amp;gt;...&amp;amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==NOWRAP==&lt;br /&gt;
Suppresses automatic word wrap in the contained elements. The nowrap tag has no parameters.&lt;br /&gt;
&lt;br /&gt;
Usage:&lt;br /&gt;
:&amp;amp;lt;nowrap&amp;gt;...&amp;amp;lt;/nowrap&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==I==&lt;br /&gt;
I is the Italics tag. Causes any text in the contained elements to be rendered as italic. The italic tag has no parameters.&lt;br /&gt;
&lt;br /&gt;
Usage:&lt;br /&gt;
:&amp;amp;lt;i&amp;gt;...&amp;amp;lt;/i&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==FONT==&lt;br /&gt;
Causes the specified text attributes to be applied to any text in the contained elements. Text in Trainz HTML does not have to be enclosed in font tags, if none are found around any given text it will receive the default font settings.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Localisation note; the follow statement has special meaning to the Trains HTML parser;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;font locale=generic&amp;gt;A_TAG&amp;lt;/font&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
When a tag such as this is parsed, Trainz will look in the current users selected language [[class StringTable | string table]] of the current asset for a string with the name found between the &amp;amp;lt;font&amp;gt; &amp;amp;lt;/font&amp;gt; tags, in this case A_TAG. It will replace the entire statement from here &amp;quot;&amp;amp;lt;font... &amp;amp;lt;/font&amp;gt;&amp;quot; to here with what is found in the [[class StringTable | string table]]. An example of this at work is in the Driver interface where the camera types are defined in the string tables of the Driver asset [[config.txt file | config.txt]] in all available languages so that each camera button has the selected language tooltip for each camera mode.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Usage:&lt;br /&gt;
:&amp;amp;lt;font size=? color=? locale=? face=?&amp;gt;...&amp;amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==TRAINZ-OBJECT==&lt;br /&gt;
Documented below under [[#Embedded Objects |embedded objects]]. Embedded objects fill the style parameter. The width and height parameters specify the pixel size of the given object, eg. how big a button is.&lt;br /&gt;
&lt;br /&gt;
Usage:&lt;br /&gt;
:&amp;amp;lt;trainz-object width=? height=? style=?&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Supported Characters=&lt;br /&gt;
The MiniBrowser parses its input from UTF-8 encoded HTML. The full range of unicode characters may be included without special escape sequences. The following escape sequences are permitted and may be necessary to prevent the characters from being parsed as HTML markup.&lt;br /&gt;
* &amp;amp;amp;nbsp; - the HTML non-breaking space character.&lt;br /&gt;
* &amp;amp;amp;gt; - the &amp;quot;greater than&amp;quot; character (&#039; &amp;amp;gt; &#039;) &lt;br /&gt;
* &amp;amp;amp;lt; - the &amp;quot;less than&amp;quot; character (&#039; &amp;amp;lt; &#039;)&lt;br /&gt;
* &amp;amp;amp;amp; - the &amp;quot;ampersand&amp;quot; character (&#039; &amp;amp;amp; &#039;)&lt;br /&gt;
* &amp;amp;amp;quot; - the &amp;quot;quote&amp;quot; character (&#039; &amp;amp;quot; &#039;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Embedded Objects=&lt;br /&gt;
The following embedded objects are supported by the trainz-object tag:&lt;br /&gt;
&lt;br /&gt;
==dirver-menu-button==&lt;br /&gt;
:style=driver-menu-button name=?&lt;br /&gt;
&lt;br /&gt;
==dial==&lt;br /&gt;
Works like an analogue volume knob. A dial is used in the driver interface, in the dcc panel to control the speed/power of the train. These are its settings;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;trainz-object style=dial width=95 height=95 id=&#039;dcc&#039; &lt;br /&gt;
texture=&#039;newdriver/dcc/dcc_controller.tga&#039; min=0.1 max=0.9 &lt;br /&gt;
valmin=-1.0 valmax=1.0 step=0 clickstep=1 value=0.5&amp;gt;&amp;lt;/trainz-object&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Driver wraps the dial in an &amp;amp;lt;[[#A |A]]&amp;gt; as to receive messages from user interactions with it, it then uses the GetElementProperty(&amp;quot;dcc&amp;quot;, &amp;quot;value&amp;quot;) on the [[class Browser |Browser]] the dial resides in to extract its current value.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Parameters explained;&lt;br /&gt;
*The style, width, height and id parameters belong to the [[#TRAINZ-OBJECT |TRAINZ-OBJECT]].&lt;br /&gt;
*The min and max parameters specify the rotation (as a percent between 0 and 1) the dial can have in the interface. For the driver speed knob its 0.1 to 0.9; imagining this as a clock face this means the dial is allowed to rotate between approximately 7 clockwise around to approximately 5 and vice versa anticlockwise anywhere between 5 and 7. The dial&#039;s rotation can never be clockwise between 5 and 7.&lt;br /&gt;
*valmin and valmax specify the values returned by the dial, that is how its values map to its rotation. Using the clockface analogy again, at approximately 7 the dial will return the value of -1, at approximately 5 it will return the value 1 and at 12 it will return 0.&lt;br /&gt;
*step specifies the minimum change that can occur in the dial, 0 means it can move completely freely, if step were 0.1 and the user had rotated it by 0.04 no rotation would be registered and the dial would snap back to its previous position.&lt;br /&gt;
*clickstep TBD&lt;br /&gt;
*value sets the initial starting position (as a percentage 0 to 1) of its range. 0.5 being half between max and min.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
:style=dial texture=? min=? max=? valmin=? valmax=? step=? clickstep=? value=?&lt;br /&gt;
&lt;br /&gt;
==graphic-button==&lt;br /&gt;
:style=graphic-button text-color=? texture_off=? texture_on=? name=? toggle=?&lt;br /&gt;
&lt;br /&gt;
==thumbnail-downloader==&lt;br /&gt;
:style=thumbnail-downloader asset=? index=? thumb-size=? crop=?&lt;br /&gt;
&lt;br /&gt;
==button==&lt;br /&gt;
A Button is essentially 8 [[#IMG |image]]s; where only 1 is shown at a time determined by the button&#039;s on or off-ness and the user&#039;s cursor location.&lt;br /&gt;
&lt;br /&gt;
Buttons can be set either &#039;off&#039; or &#039;on&#039; by calling SetElementProperty(&amp;quot;button name&amp;quot;, &amp;quot;value&amp;quot;, &amp;quot;1&amp;quot;) [for on or &amp;quot;0&amp;quot; for off] on the [[class Browser |browser]] that contains the button. All buttons start in the off state.&lt;br /&gt;
&lt;br /&gt;
Both &#039;on&#039; and &#039;off&#039; states have 4 states within them for showing interaction with the cursor. Off is explained below, on is the same replacing &amp;quot;off&amp;quot; with &amp;quot;on&amp;quot;;&lt;br /&gt;
* &amp;quot;off&amp;quot; - button is in the off state and has no cursor interaction.&lt;br /&gt;
* &amp;quot;off-over&amp;quot; - button is in the off state and the cursor is hovering over the button.&lt;br /&gt;
* &amp;quot;off-down&amp;quot; - button is in the off state and the cursor has been clicked on the button, is held down (mouse button 1 is down) but the cursor is not (is no longer) hovering over the button meaning the user has dragged the cursor off the button after clicking it.&lt;br /&gt;
* &amp;quot;off-down-over&amp;quot; - button is in the off state and the cursor is hovering over the button and the cursor has been clicked on it and is being held down (mouse button 1 is down).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The size of a button is determined by the width and height parameters of its containing [[#TRAINZ-OBJECT |TRAINZ-OBJECT]] tag.&lt;br /&gt;
&lt;br /&gt;
Typically a button trainz-object will be contained within an &amp;amp;lt;[[#A |A]]&amp;gt; tag giving the appearance that buttons send messages. As buttons do not send clicked messages themselves, they do not directly know when they have been clicked on or off, this must be done manually by listening to the message that will be sent by the anchor tag and changing the buttons state using the SetElementProperty(&amp;quot;button name&amp;quot;, &amp;quot;value&amp;quot;, &amp;quot;1&amp;quot;) command on its containing browser.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Usage:&lt;br /&gt;
? represent image files within the asset.&lt;br /&gt;
:style=button id=&amp;amp;lt;button name&amp;gt; off=? off-over=? off-down=? off-down-over=? on=? on-over=? on-down=? on-down-over=? link-held=?&lt;br /&gt;
&lt;br /&gt;
==minimap==&lt;br /&gt;
:style=minimap&lt;br /&gt;
&lt;br /&gt;
==preview==&lt;br /&gt;
An asset preview as used in the Surveyor tabs.&lt;br /&gt;
&lt;br /&gt;
* &amp;quot;asset&amp;quot; - the kuid of the asset to be shown (pass KUID by KUID::GetHTMLString())&lt;br /&gt;
&lt;br /&gt;
Usage:&lt;br /&gt;
:style=preview asset=&amp;lt;asset-kuid&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==text-line==&lt;br /&gt;
:style=text-line background=? align=?&lt;br /&gt;
&lt;br /&gt;
==asset-picker==&lt;br /&gt;
:style=asset-picker background=? align=?&lt;br /&gt;
&lt;br /&gt;
==driver-order-bar==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Incorrect&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Is a very specific case. As the name implies it is the list of driver commands that appears at the bottom of the screen next to the current driver image in Driver. This is already created and managed for you, users probably don&#039;t want to make these in any useful way, just to mess around or break things.&lt;br /&gt;
&lt;br /&gt;
:style=driver-order-bar&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;this isn&#039;t really accurate. i think you&#039;ll find this is already used elsewhere in the game (for example, in the driver command rule?) and in fact possibly isn&#039;t used by the main driver interface - it&#039;s likely that is not HTML although it&#039;s the same underlying control. this is a general-purpose control: the functionality is specific to assigning orders, but it should be fairly flexible what the calling script does with the orders.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==clock==&lt;br /&gt;
:style=clock face-texture=? seconds-texture=? minutes-texture=? hours-texture=? seconds-visible=? minutes-visible=? hours-visible=? seconds=? minutes=? hours=?&lt;br /&gt;
&lt;br /&gt;
==slider==&lt;br /&gt;
Slider is a horizontal bar similar to a horizontal scroll bar with a linear range of values mapped to it, similar to the [[#dial |dial]]. &lt;br /&gt;
&lt;br /&gt;
There are several in the video settings menu/asset and those will be used as an example here. The most important attributes are;&lt;br /&gt;
*min the minimum value the slider represents (far left).&lt;br /&gt;
*max the maximum value the slider represents (far right).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
:style=slider min=? max=? page-size=? draw-lines=? draw-marks=? thumb=? thumb-over=? less=? less-over=? more=? more-over=? thumb-width=? thumb-height=? theme=? background=? arrow-width=? arrow-height=?&lt;br /&gt;
&lt;br /&gt;
==browser==&lt;br /&gt;
[[class Browser |browser]] is updated through call to SetElementProperty(&amp;quot;component-name&amp;quot;,&amp;quot;html&amp;quot;,sub-browser html  string) from the parent browser level. An example of this at work can be found in the waybillmanager.gs&lt;br /&gt;
&lt;br /&gt;
:style=browser id=&#039;component-name&#039; width=? height=? clip=?&lt;br /&gt;
&lt;br /&gt;
==edit-box==&lt;br /&gt;
The edit box allows a text entry field such as that provided on the Routes Menu search field or the iTrainz Chat windows.&lt;br /&gt;
&lt;br /&gt;
:style=edit-box multi-line read-only masked link-on-focus-loss&lt;br /&gt;
&lt;br /&gt;
==static-line==&lt;br /&gt;
A divider line graphic.&lt;br /&gt;
&lt;br /&gt;
:style=static-line color=?&lt;br /&gt;
&lt;br /&gt;
==progress==&lt;br /&gt;
A progress bar.&lt;br /&gt;
&lt;br /&gt;
:style=progress progress=?&lt;br /&gt;
&lt;br /&gt;
==keyinput==&lt;br /&gt;
&lt;br /&gt;
:style=keyinput context=? id=?&lt;br /&gt;
&lt;br /&gt;
==score-gauge==&lt;br /&gt;
:style=score-gauge star-thresholds=? points=? hight-score=?&lt;br /&gt;
&lt;br /&gt;
==date-picker==&lt;br /&gt;
:style=date-picker day=? month=? year=?&lt;br /&gt;
&lt;br /&gt;
==video==&lt;br /&gt;
&amp;lt;font color=red&amp;gt;Seems to be removed in TRS19?&amp;lt;/font&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
This control plays back a video. Some platforms do not support this control; support can be tested through the &#039;PR_VideoPlayback&#039; product right. Video format support depends on the client system.&lt;br /&gt;
&lt;br /&gt;
*The play-on-load tag should be either &#039;1&#039; or &#039;0&#039; being yes or no respectively and it means exactly what it sounds like, should the video start playing once it has loaded.&lt;br /&gt;
*The is-video-looping is likewise a &#039;1&#039; or &#039;0&#039; value indicating the video should or shouldn&#039;t repeat once finished.&lt;br /&gt;
&lt;br /&gt;
:style=video play-on-load=? video-filename=? is-video-looping=?&lt;br /&gt;
&lt;br /&gt;
==internet-browser==&lt;br /&gt;
&amp;lt;font color=red&amp;gt;Seems to be removed in TRS19?&amp;lt;/font&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
The internet browser is a native (eg. mozilla, safari, etc.) web browser which can be used to display information from this wiki. Some platforms do not support this control; support can be tested through the &#039;PR_WebBrowser&#039; product right. For platforms that do support this control, the exact feature set may vary.&lt;br /&gt;
&lt;br /&gt;
:style=internet-browser address=?&lt;/div&gt;</summary>
		<author><name>Callavsg</name></author>
	</entry>
	<entry>
		<id>https://wiki.trainzsimulator.com/index.php?title=MiniBrowser&amp;diff=18314</id>
		<title>MiniBrowser</title>
		<link rel="alternate" type="text/html" href="https://wiki.trainzsimulator.com/index.php?title=MiniBrowser&amp;diff=18314"/>
		<updated>2019-04-08T10:10:13Z</updated>

		<summary type="html">&lt;p&gt;Callavsg: /* preview */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The [[MiniBrowser]] is a trivial HTML renderer used for simple layout control within the Trainz game environment. It is specifically not a replacement for a real browser (see [[Trainz Online]] instead), is not remotely standards compliant, and does not support a full range of HTML tags. If a tag isn&#039;t mentioned here then it is NOT supported. There is no javascript support ([[Scripting|TrainzScript]] is used instead.) The [[MiniBrowser]] is used exclusively by the Trainz [[class Browser|Browser]] script object.&lt;br /&gt;
&lt;br /&gt;
Feature requests relating primarily to the MiniBrowser should be placed on the [[MiniBrowser Feature Requests]] page.&lt;br /&gt;
&lt;br /&gt;
Trainz HTML is NOT standards compliant and is best thought of as an HTML-alike chosen so users and developers are familiar with the style of syntax being used.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Supported Tags=&lt;br /&gt;
The MiniBrowser supports the following HTML tags:&lt;br /&gt;
&lt;br /&gt;
==HTML==&lt;br /&gt;
This tag wraps the entire HTML document. No parameters are supported. This tag should be at the top level of the document and should contain a single &#039;[[#BODY |BODY]]&#039; tag.&lt;br /&gt;
&lt;br /&gt;
Usage:&lt;br /&gt;
:&amp;amp;lt;html&amp;gt;&lt;br /&gt;
::...&lt;br /&gt;
:&amp;amp;lt;/html&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==BODY==&lt;br /&gt;
This tag wraps the entire body of the HTML document. The &#039;scale&#039; parameter is provided to force the document to be rescaled to a specified number of pixels wide, but its usage is strongly discouraged. This tag should exist within the &#039;[[#HTML |HTML]]&#039; tag and may contain any number of other elements.&lt;br /&gt;
&lt;br /&gt;
Usage:&lt;br /&gt;
:&amp;amp;lt;body scale=?&amp;gt;&lt;br /&gt;
::...&lt;br /&gt;
:&amp;amp;lt;/body&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==P (paragraph)==&lt;br /&gt;
This tag causes the contained elements to be formatted as a separate paragraph. This is similar to prefixing and suffixing the elements with a linebreak. Paragraph tag has no parameters.&lt;br /&gt;
&lt;br /&gt;
Usage:&lt;br /&gt;
:&amp;amp;lt;p&amp;gt;...&amp;amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==BR (linebreak)==&lt;br /&gt;
A forced linebreak. BR has no parameters.&lt;br /&gt;
&lt;br /&gt;
BR is an unclosed tag, unlike XHTML there is no &amp;amp;lt;br /&amp;gt; or &amp;amp;lt;/br&amp;gt;. In fact using such a thing will most likely be interpreted as an error by the Trainz HTML parser.&lt;br /&gt;
&lt;br /&gt;
Usage:&lt;br /&gt;
:...&amp;amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==TABLE==&lt;br /&gt;
This tag forms a table element. Any number of &amp;amp;lt;[[#TR |TR]]&amp;gt; (table row) elements may be present within the &#039;TABLE&#039; tag and that is all it should contain directly. Table height cannot be specified, this can be controlled by setting each &amp;amp;lt;[[#TR |TR]]&amp;gt; element within the table to add up to the desired table height.&lt;br /&gt;
&lt;br /&gt;
Table does NOT support the following parameters; rules, summary, align. Nor does it support the &amp;amp;lt;TH&amp;gt; element (the same effect can be achieved by making the contents of a &amp;amp;lt;[[#TD |TD]]&amp;gt; [[#B |BOLD]] or even more so by the use of [[#FONT |FONT]]). Table is best thought of as a grid, like that of a spreadsheet or a table inserted into a document. Tables are described by &amp;amp;lt;[[#TR |TR]]&amp;gt;; a row in a table and &amp;amp;lt;[[#TD |TD]]&amp;gt;; a cell in a row. &lt;br /&gt;
&lt;br /&gt;
Tables are not askew, meaning if 1 row has 3 cells then all rows will have at least 3 cells, this does not mean the coder must put at least 3 &amp;amp;lt;[[#TD |TD]]&amp;gt;s in each &amp;amp;lt;[[#TR |TR]]&amp;gt; it means when formatted for display on screen the html render will organise the table as such (as it is uniform). Furthermore, cells conform to the dimensions of their siblings; meaning a cell has the same width as the widest cell in its column (controllable by width in &amp;amp;lt;[[#TD |TD]]&amp;gt;) and the same height as the tallest cell in its row (controllable by height in &amp;amp;lt;[[#TR |TR]]&amp;gt;). This is very important to keep in mind when using tables for formatting/layout purposes.&lt;br /&gt;
&lt;br /&gt;
The documentation on &amp;amp;lt;[[#TR |TR]]&amp;gt; and &amp;amp;lt;[[#TD |TD]]&amp;gt; have more information about the use of tables in Trainz HTML. For more info and a place to try out some of these properties of tables try the [http://www.w3schools.com/tags/tag_table.asp w3schools table tag page], but remember Trainz HTML is not the same as HTML proper.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
All parameters are optional.&lt;br /&gt;
*cellpadding - specifies the minimum pixel space between the cell wall and its content. Default is 0.&lt;br /&gt;
*cellspacing - specifies the pixels between cells. Default is 0.&lt;br /&gt;
*width - specifies the pixel width of the table. If none is given the table will grow to fit its content. If width is given cell content will be wrapped if it would force table width beyond that.&lt;br /&gt;
*border - specifies the pixel width between the table and content around it. Default is 0.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Usage:&lt;br /&gt;
:&amp;amp;lt;table cellpadding=? cellspacing=? border=? width=? inherit-font&amp;gt;...&amp;amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==TR==&lt;br /&gt;
TR is Table Row. This tag forms a single horizontal row of a table. Any number of &#039;[[#TD |TD]]&#039; (table data) elements may be present within the &#039;TR&#039; tag and that is all it should directly contain. &amp;amp;lt;TR&amp;gt; does NOT support the following parameters; align, valign, char, charoff.&lt;br /&gt;
&lt;br /&gt;
All parameters are optional. Height, if specified, will limit how many pixels high this row can be, causing cells to expand in width if they were to approach this height.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
When using tables for formatting it is important to remember that cell size is dependent upon both column and row (see &amp;amp;lt;[[#TD |TD]]&amp;gt; and/or &amp;amp;lt;[[#TABLE |TABLE]]&amp;gt; for more info) thus it may be useful to consider creating a &amp;amp;lt;TR&amp;gt; with no data that exists only to set up the size of the columns ie.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;amp;lt;tr&amp;gt; &amp;amp;lt;td width=&#039;20&#039;&amp;gt;&amp;amp;lt;/td&amp;gt; &amp;amp;lt;td width=&#039;50&#039;&amp;gt;&amp;amp;lt;/td&amp;gt; &amp;amp;lt;td width=&#039;200&#039;&amp;gt;&amp;amp;lt;/td&amp;gt; &amp;amp;lt;td width=&#039;20&#039;&amp;gt;&amp;amp;lt;/td&amp;gt;  &amp;amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
now unless a &amp;amp;lt;TR&amp;gt; with more than 4 &amp;amp;lt;[[#TD |TD]]&amp;gt;s is created, the formatting for all columns is already done and as this &amp;amp;lt;TR&amp;gt; has no height specified and no data in its &amp;amp;lt;[[#TD |TD]]&amp;gt; cells it will take up only the space specified by the &amp;amp;lt;[[#TABLE |TABLE]]&amp;gt;&#039;s border, cellspacing and cellpadding (default 0).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Usage:&lt;br /&gt;
:&amp;amp;lt;tr height=? bgcolor=?&amp;gt;...&amp;amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==TD==&lt;br /&gt;
TD is Table Data. This tag forms a single cell within a table row. &amp;amp;lt;TD&amp;gt; does NOT support the following parameters; abbr, axis, char, charoff, headers, height, scope.&lt;br /&gt;
&lt;br /&gt;
Height of a cell is controlled by the tallest cell in the row or by the &amp;amp;lt;[[#TR |TR]]&amp;gt; height parameter if it is specified.&lt;br /&gt;
&lt;br /&gt;
&amp;amp;lt;TD&amp;gt; is the work horse of tables, as the name implies all contents of a table are contained within a &amp;amp;lt;TD&amp;gt; tag. Anything can be placed within a cell, even a table eg.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;html&amp;gt; &amp;lt;body&amp;gt;&lt;br /&gt;
  &amp;lt;table border=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt; &lt;br /&gt;
      &amp;lt;td&amp;gt;Some text &amp;lt;/td&amp;gt;&lt;br /&gt;
      &amp;lt;td&amp;gt;Some text &amp;lt;/td&amp;gt; &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt; &lt;br /&gt;
      &amp;lt;td&amp;gt;Some text &amp;lt;/td&amp;gt;&lt;br /&gt;
      &amp;lt;td&amp;gt;Some text &amp;lt;/td&amp;gt; &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt; &lt;br /&gt;
      &amp;lt;td&amp;gt; &lt;br /&gt;
        &amp;lt;table border=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;tr&amp;gt;&lt;br /&gt;
            &amp;lt;td&amp;gt;Some text in a sub table &amp;lt;/td&amp;gt;&lt;br /&gt;
            &amp;lt;td&amp;gt;Some other text in a sub table &amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;/tr&amp;gt;&lt;br /&gt;
        &amp;lt;/table&amp;gt;&lt;br /&gt;
      &amp;lt;/td&amp;gt;&lt;br /&gt;
      &amp;lt;td&amp;gt;&amp;lt;---Wow thats a sub table over there &amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
  &amp;lt;/table&amp;gt;&lt;br /&gt;
&amp;lt;/body&amp;gt; &amp;lt;/html&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
coping and pasting the above into the left pane of [http://www.w3schools.com/HTML/tryit.asp?filename=tryhtml_basic this Tryit window](open it in a new tab or window) and clicking &amp;quot;Edit and Click me &amp;gt;&amp;gt;&amp;quot; button will show you a table with a table in it on the right hand side.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
All parameters are optional.&lt;br /&gt;
*rowspan and colspan allows this cell to consume the space that would normally be allocated to neighboring cells on the right and bottom sides. Default values are 1, meaning the &amp;amp;lt;TD&amp;gt; spans its own cell and nothing more. [http://www.w3schools.com/tags/tryit.asp?filename=tryhtml_table_span Visual example of spanning], but remember Trainz HTML is not the same as HTML proper.&lt;br /&gt;
*width - specifies the pixel width of this cell, useful for formatting.&lt;br /&gt;
*align - &#039;left&#039;, &#039;center&#039;, &#039;right&#039;. (default &#039;left&#039;.) Controls the horizontal alignment of the content data within the table cell.&lt;br /&gt;
*valign - &#039;top&#039;, &#039;center&#039;, &#039;bottom&#039; (default &#039;top&#039;) Controls the vertical alignment of the content data within the table cell.&lt;br /&gt;
&lt;br /&gt;
Usage:&lt;br /&gt;
:&amp;amp;lt;td rowspawn=? colspan=? width=? bgcolor=? align=? valign=?&amp;gt;...&amp;amp;lt;/td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==A==&lt;br /&gt;
A is the Anchor tag. This tag marks all contained elements as a hyperlink with the specified attributes. Hyperlinked text will be underlined.&lt;br /&gt;
&lt;br /&gt;
Tooltip text will be displayed when the mouse hovers over the hyperlinked elements.&lt;br /&gt;
&lt;br /&gt;
The href is the minor message in a [[Browser Messages |Browser-URL message]] sent by the [[class Browser |Browser]] to whomever is listening to it. ie. the major=&amp;quot;Browser-URL&amp;quot; minor=&amp;quot;live://button/horn&amp;quot; message is produced by a hyperlinked button (horn) in the driver user interface.&lt;br /&gt;
&lt;br /&gt;
A hyperlink is considered clicked when the user has pressed and released mouse button 1 while over it.&lt;br /&gt;
&lt;br /&gt;
Usage:&lt;br /&gt;
:&amp;amp;lt;a href=? target=? help-label=? mousedown=? disabled-href=? tooltip=?&amp;gt;...&amp;amp;lt;/a&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==IMG==&lt;br /&gt;
IMG is the IMaGe tag. This tag displays an image with the specified attributes. Does NOT support the alt or title tags. &lt;br /&gt;
&lt;br /&gt;
All parameters are optional however, the src or the kuid parameter needs to be filled out for anything to show up apart from a fill.&lt;br /&gt;
&lt;br /&gt;
The width and height parameters define the pixel size the image will occupy on screen, these can be made larger or smaller than the image&#039;s actual size to zoom, stretch or squash the image as needed. Keep in mind that users don&#039;t all use the same resolution, so it is usually best to make pictures either fixed size in a screen position via the use of tables or calculating a pixel size relative to the current resolution.&lt;br /&gt;
&lt;br /&gt;
Usage:&lt;br /&gt;
:&amp;amp;lt;img src=? mouseover=? kuid=? width=? height=? srcwidth=? srcheight=? color=? hflip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==TRAINZ-TEXT==&lt;br /&gt;
A section of text that can be changed without having to recalculate or reset the entire HTML string in a [[class Browser |browser]]. &lt;br /&gt;
&lt;br /&gt;
In the Driver interface the speed panel shows the selected train&#039;s current speed, the current speed limit on its segment of track and the current world time. Below is the speed HTML, which is retrieved via the localisation method described in &amp;amp;lt;[[#FONT |FONT]]&amp;gt;;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;font color=#00FF00 locale=&#039;english&#039;&amp;gt;&amp;lt;b&amp;gt;&amp;lt;trainz-text id=&#039;speed&#039; text=&#039;0 KM/H&#039;&amp;gt;&amp;lt;/trainz-text&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This specifies green bold text that is bound to an id of &amp;quot;speed&amp;quot;. Now in every heartbeat in DriverModule.gs, the currently selected train&#039;s speed is calculated and applied to this trainz-text by calling SetTrainzText(&amp;quot;speed&amp;quot;, &amp;quot;10 kph&amp;quot;) [10 kph used only for illustrative purposes] on the [[class Browser |browser]] that contains the speed html.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The id parameter is required to be able to update this section of text via the SetTrainzText [[class Browser |browser]] call. The text parameter does not need to be filled out int HTML can be specified using the SetTrainzText method at a later time.&lt;br /&gt;
&lt;br /&gt;
Usage:&lt;br /&gt;
:&amp;amp;lt;trainz-text id=? text=?&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==B==&lt;br /&gt;
B is Boldface. Causes any text in contained elements to be rendered as boldface. The bold tag has no parameters.&lt;br /&gt;
&lt;br /&gt;
Usage:&lt;br /&gt;
:&amp;amp;lt;b&amp;gt;...&amp;amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==NOWRAP==&lt;br /&gt;
Suppresses automatic word wrap in the contained elements. The nowrap tag has no parameters.&lt;br /&gt;
&lt;br /&gt;
Usage:&lt;br /&gt;
:&amp;amp;lt;nowrap&amp;gt;...&amp;amp;lt;/nowrap&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==I==&lt;br /&gt;
I is the Italics tag. Causes any text in the contained elements to be rendered as italic. The italic tag has no parameters.&lt;br /&gt;
&lt;br /&gt;
Usage:&lt;br /&gt;
:&amp;amp;lt;i&amp;gt;...&amp;amp;lt;/i&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==FONT==&lt;br /&gt;
Causes the specified text attributes to be applied to any text in the contained elements. Text in Trainz HTML does not have to be enclosed in font tags, if none are found around any given text it will receive the default font settings.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Localisation note; the follow statement has special meaning to the Trains HTML parser;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;font locale=generic&amp;gt;A_TAG&amp;lt;/font&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
When a tag such as this is parsed, Trainz will look in the current users selected language [[class StringTable | string table]] of the current asset for a string with the name found between the &amp;amp;lt;font&amp;gt; &amp;amp;lt;/font&amp;gt; tags, in this case A_TAG. It will replace the entire statement from here &amp;quot;&amp;amp;lt;font... &amp;amp;lt;/font&amp;gt;&amp;quot; to here with what is found in the [[class StringTable | string table]]. An example of this at work is in the Driver interface where the camera types are defined in the string tables of the Driver asset [[config.txt file | config.txt]] in all available languages so that each camera button has the selected language tooltip for each camera mode.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Usage:&lt;br /&gt;
:&amp;amp;lt;font size=? color=? locale=? face=?&amp;gt;...&amp;amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==TRAINZ-OBJECT==&lt;br /&gt;
Documented below under [[#Embedded Objects |embedded objects]]. Embedded objects fill the style parameter. The width and height parameters specify the pixel size of the given object, eg. how big a button is.&lt;br /&gt;
&lt;br /&gt;
Usage:&lt;br /&gt;
:&amp;amp;lt;trainz-object width=? height=? style=?&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Supported Characters=&lt;br /&gt;
The MiniBrowser parses its input from UTF-8 encoded HTML. The full range of unicode characters may be included without special escape sequences. The following escape sequences are permitted and may be necessary to prevent the characters from being parsed as HTML markup.&lt;br /&gt;
* &amp;amp;amp;nbsp; - the HTML non-breaking space character.&lt;br /&gt;
* &amp;amp;amp;gt; - the &amp;quot;greater than&amp;quot; character (&#039; &amp;amp;gt; &#039;) &lt;br /&gt;
* &amp;amp;amp;lt; - the &amp;quot;less than&amp;quot; character (&#039; &amp;amp;lt; &#039;)&lt;br /&gt;
* &amp;amp;amp;amp; - the &amp;quot;ampersand&amp;quot; character (&#039; &amp;amp;amp; &#039;)&lt;br /&gt;
* &amp;amp;amp;quot; - the &amp;quot;quote&amp;quot; character (&#039; &amp;amp;quot; &#039;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Embedded Objects=&lt;br /&gt;
The following embedded objects are supported by the trainz-object tag:&lt;br /&gt;
&lt;br /&gt;
==dirver-menu-button==&lt;br /&gt;
:style=driver-menu-button name=?&lt;br /&gt;
&lt;br /&gt;
==dial==&lt;br /&gt;
Works like an analogue volume knob. A dial is used in the driver interface, in the dcc panel to control the speed/power of the train. These are its settings;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;trainz-object style=dial width=95 height=95 id=&#039;dcc&#039; &lt;br /&gt;
texture=&#039;newdriver/dcc/dcc_controller.tga&#039; min=0.1 max=0.9 &lt;br /&gt;
valmin=-1.0 valmax=1.0 step=0 clickstep=1 value=0.5&amp;gt;&amp;lt;/trainz-object&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Driver wraps the dial in an &amp;amp;lt;[[#A |A]]&amp;gt; as to receive messages from user interactions with it, it then uses the GetElementProperty(&amp;quot;dcc&amp;quot;, &amp;quot;value&amp;quot;) on the [[class Browser |Browser]] the dial resides in to extract its current value.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Parameters explained;&lt;br /&gt;
*The style, width, height and id parameters belong to the [[#TRAINZ-OBJECT |TRAINZ-OBJECT]].&lt;br /&gt;
*The min and max parameters specify the rotation (as a percent between 0 and 1) the dial can have in the interface. For the driver speed knob its 0.1 to 0.9; imagining this as a clock face this means the dial is allowed to rotate between approximately 7 clockwise around to approximately 5 and vice versa anticlockwise anywhere between 5 and 7. The dial&#039;s rotation can never be clockwise between 5 and 7.&lt;br /&gt;
*valmin and valmax specify the values returned by the dial, that is how its values map to its rotation. Using the clockface analogy again, at approximately 7 the dial will return the value of -1, at approximately 5 it will return the value 1 and at 12 it will return 0.&lt;br /&gt;
*step specifies the minimum change that can occur in the dial, 0 means it can move completely freely, if step were 0.1 and the user had rotated it by 0.04 no rotation would be registered and the dial would snap back to its previous position.&lt;br /&gt;
*clickstep TBD&lt;br /&gt;
*value sets the initial starting position (as a percentage 0 to 1) of its range. 0.5 being half between max and min.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
:style=dial texture=? min=? max=? valmin=? valmax=? step=? clickstep=? value=?&lt;br /&gt;
&lt;br /&gt;
==graphic-button==&lt;br /&gt;
:style=graphic-button text-color=? texture_off=? texture_on=? name=? toggle=?&lt;br /&gt;
&lt;br /&gt;
==thumbnail-downloader==&lt;br /&gt;
:style=thumbnail-downloader asset=? index=? thumb-size=? crop=?&lt;br /&gt;
&lt;br /&gt;
==button==&lt;br /&gt;
A Button is essentially 8 [[#IMG |image]]s; where only 1 is shown at a time determined by the button&#039;s on or off-ness and the user&#039;s cursor location.&lt;br /&gt;
&lt;br /&gt;
Buttons can be set either &#039;off&#039; or &#039;on&#039; by calling SetElementProperty(&amp;quot;button name&amp;quot;, &amp;quot;value&amp;quot;, &amp;quot;1&amp;quot;) [for on or &amp;quot;0&amp;quot; for off] on the [[class Browser |browser]] that contains the button. All buttons start in the off state.&lt;br /&gt;
&lt;br /&gt;
Both &#039;on&#039; and &#039;off&#039; states have 4 states within them for showing interaction with the cursor. Off is explained below, on is the same replacing &amp;quot;off&amp;quot; with &amp;quot;on&amp;quot;;&lt;br /&gt;
* &amp;quot;off&amp;quot; - button is in the off state and has no cursor interaction.&lt;br /&gt;
* &amp;quot;off-over&amp;quot; - button is in the off state and the cursor is hovering over the button.&lt;br /&gt;
* &amp;quot;off-down&amp;quot; - button is in the off state and the cursor has been clicked on the button, is held down (mouse button 1 is down) but the cursor is not (is no longer) hovering over the button meaning the user has dragged the cursor off the button after clicking it.&lt;br /&gt;
* &amp;quot;off-down-over&amp;quot; - button is in the off state and the cursor is hovering over the button and the cursor has been clicked on it and is being held down (mouse button 1 is down).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The size of a button is determined by the width and height parameters of its containing [[#TRAINZ-OBJECT |TRAINZ-OBJECT]] tag.&lt;br /&gt;
&lt;br /&gt;
Typically a button trainz-object will be contained within an &amp;amp;lt;[[#A |A]]&amp;gt; tag giving the appearance that buttons send messages. As buttons do not send clicked messages themselves, they do not directly know when they have been clicked on or off, this must be done manually by listening to the message that will be sent by the anchor tag and changing the buttons state using the SetElementProperty(&amp;quot;button name&amp;quot;, &amp;quot;value&amp;quot;, &amp;quot;1&amp;quot;) command on its containing browser.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Usage:&lt;br /&gt;
? represent image files within the asset.&lt;br /&gt;
:style=button id=&amp;amp;lt;button name&amp;gt; off=? off-over=? off-down=? off-down-over=? on=? on-over=? on-down=? on-down-over=? link-held=?&lt;br /&gt;
&lt;br /&gt;
==minimap==&lt;br /&gt;
:style=minimap&lt;br /&gt;
&lt;br /&gt;
==preview==&lt;br /&gt;
An asset preview as used in the Surveyor tabs.&lt;br /&gt;
&lt;br /&gt;
* &amp;quot;asset&amp;quot; - the assets kuid to be shown (pass KUID by KUID::GetHTMLString())&lt;br /&gt;
&lt;br /&gt;
Usage:&lt;br /&gt;
:style=preview asset=&amp;lt;asset-kuid&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==text-line==&lt;br /&gt;
:style=text-line background=? align=?&lt;br /&gt;
&lt;br /&gt;
==asset-picker==&lt;br /&gt;
:style=asset-picker background=? align=?&lt;br /&gt;
&lt;br /&gt;
==driver-order-bar==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Incorrect&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Is a very specific case. As the name implies it is the list of driver commands that appears at the bottom of the screen next to the current driver image in Driver. This is already created and managed for you, users probably don&#039;t want to make these in any useful way, just to mess around or break things.&lt;br /&gt;
&lt;br /&gt;
:style=driver-order-bar&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;this isn&#039;t really accurate. i think you&#039;ll find this is already used elsewhere in the game (for example, in the driver command rule?) and in fact possibly isn&#039;t used by the main driver interface - it&#039;s likely that is not HTML although it&#039;s the same underlying control. this is a general-purpose control: the functionality is specific to assigning orders, but it should be fairly flexible what the calling script does with the orders.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==clock==&lt;br /&gt;
:style=clock face-texture=? seconds-texture=? minutes-texture=? hours-texture=? seconds-visible=? minutes-visible=? hours-visible=? seconds=? minutes=? hours=?&lt;br /&gt;
&lt;br /&gt;
==slider==&lt;br /&gt;
Slider is a horizontal bar similar to a horizontal scroll bar with a linear range of values mapped to it, similar to the [[#dial |dial]]. &lt;br /&gt;
&lt;br /&gt;
There are several in the video settings menu/asset and those will be used as an example here. The most important attributes are;&lt;br /&gt;
*min the minimum value the slider represents (far left).&lt;br /&gt;
*max the maximum value the slider represents (far right).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
:style=slider min=? max=? page-size=? draw-lines=? draw-marks=? thumb=? thumb-over=? less=? less-over=? more=? more-over=? thumb-width=? thumb-height=? theme=? background=? arrow-width=? arrow-height=?&lt;br /&gt;
&lt;br /&gt;
==browser==&lt;br /&gt;
[[class Browser |browser]] is updated through call to SetElementProperty(&amp;quot;component-name&amp;quot;,&amp;quot;html&amp;quot;,sub-browser html  string) from the parent browser level. An example of this at work can be found in the waybillmanager.gs&lt;br /&gt;
&lt;br /&gt;
:style=browser id=&#039;component-name&#039; width=? height=? clip=?&lt;br /&gt;
&lt;br /&gt;
==edit-box==&lt;br /&gt;
The edit box allows a text entry field such as that provided on the Routes Menu search field or the iTrainz Chat windows.&lt;br /&gt;
&lt;br /&gt;
:style=edit-box multi-line read-only masked link-on-focus-loss&lt;br /&gt;
&lt;br /&gt;
==static-line==&lt;br /&gt;
A divider line graphic.&lt;br /&gt;
&lt;br /&gt;
:style=static-line color=?&lt;br /&gt;
&lt;br /&gt;
==progress==&lt;br /&gt;
A progress bar.&lt;br /&gt;
&lt;br /&gt;
:style=progress progress=?&lt;br /&gt;
&lt;br /&gt;
==keyinput==&lt;br /&gt;
&lt;br /&gt;
:style=keyinput context=? id=?&lt;br /&gt;
&lt;br /&gt;
==score-gauge==&lt;br /&gt;
:style=score-gauge star-thresholds=? points=? hight-score=?&lt;br /&gt;
&lt;br /&gt;
==date-picker==&lt;br /&gt;
:style=date-picker day=? month=? year=?&lt;br /&gt;
&lt;br /&gt;
==video==&lt;br /&gt;
&amp;lt;font color=red&amp;gt;Seems to be removed in TRS19?&amp;lt;/font&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
This control plays back a video. Some platforms do not support this control; support can be tested through the &#039;PR_VideoPlayback&#039; product right. Video format support depends on the client system.&lt;br /&gt;
&lt;br /&gt;
*The play-on-load tag should be either &#039;1&#039; or &#039;0&#039; being yes or no respectively and it means exactly what it sounds like, should the video start playing once it has loaded.&lt;br /&gt;
*The is-video-looping is likewise a &#039;1&#039; or &#039;0&#039; value indicating the video should or shouldn&#039;t repeat once finished.&lt;br /&gt;
&lt;br /&gt;
:style=video play-on-load=? video-filename=? is-video-looping=?&lt;br /&gt;
&lt;br /&gt;
==internet-browser==&lt;br /&gt;
&amp;lt;font color=red&amp;gt;Seems to be removed in TRS19?&amp;lt;/font&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
The internet browser is a native (eg. mozilla, safari, etc.) web browser which can be used to display information from this wiki. Some platforms do not support this control; support can be tested through the &#039;PR_WebBrowser&#039; product right. For platforms that do support this control, the exact feature set may vary.&lt;br /&gt;
&lt;br /&gt;
:style=internet-browser address=?&lt;/div&gt;</summary>
		<author><name>Callavsg</name></author>
	</entry>
	<entry>
		<id>https://wiki.trainzsimulator.com/index.php?title=MiniBrowser&amp;diff=18313</id>
		<title>MiniBrowser</title>
		<link rel="alternate" type="text/html" href="https://wiki.trainzsimulator.com/index.php?title=MiniBrowser&amp;diff=18313"/>
		<updated>2019-04-08T10:02:39Z</updated>

		<summary type="html">&lt;p&gt;Callavsg: /* score-gauge */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The [[MiniBrowser]] is a trivial HTML renderer used for simple layout control within the Trainz game environment. It is specifically not a replacement for a real browser (see [[Trainz Online]] instead), is not remotely standards compliant, and does not support a full range of HTML tags. If a tag isn&#039;t mentioned here then it is NOT supported. There is no javascript support ([[Scripting|TrainzScript]] is used instead.) The [[MiniBrowser]] is used exclusively by the Trainz [[class Browser|Browser]] script object.&lt;br /&gt;
&lt;br /&gt;
Feature requests relating primarily to the MiniBrowser should be placed on the [[MiniBrowser Feature Requests]] page.&lt;br /&gt;
&lt;br /&gt;
Trainz HTML is NOT standards compliant and is best thought of as an HTML-alike chosen so users and developers are familiar with the style of syntax being used.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Supported Tags=&lt;br /&gt;
The MiniBrowser supports the following HTML tags:&lt;br /&gt;
&lt;br /&gt;
==HTML==&lt;br /&gt;
This tag wraps the entire HTML document. No parameters are supported. This tag should be at the top level of the document and should contain a single &#039;[[#BODY |BODY]]&#039; tag.&lt;br /&gt;
&lt;br /&gt;
Usage:&lt;br /&gt;
:&amp;amp;lt;html&amp;gt;&lt;br /&gt;
::...&lt;br /&gt;
:&amp;amp;lt;/html&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==BODY==&lt;br /&gt;
This tag wraps the entire body of the HTML document. The &#039;scale&#039; parameter is provided to force the document to be rescaled to a specified number of pixels wide, but its usage is strongly discouraged. This tag should exist within the &#039;[[#HTML |HTML]]&#039; tag and may contain any number of other elements.&lt;br /&gt;
&lt;br /&gt;
Usage:&lt;br /&gt;
:&amp;amp;lt;body scale=?&amp;gt;&lt;br /&gt;
::...&lt;br /&gt;
:&amp;amp;lt;/body&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==P (paragraph)==&lt;br /&gt;
This tag causes the contained elements to be formatted as a separate paragraph. This is similar to prefixing and suffixing the elements with a linebreak. Paragraph tag has no parameters.&lt;br /&gt;
&lt;br /&gt;
Usage:&lt;br /&gt;
:&amp;amp;lt;p&amp;gt;...&amp;amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==BR (linebreak)==&lt;br /&gt;
A forced linebreak. BR has no parameters.&lt;br /&gt;
&lt;br /&gt;
BR is an unclosed tag, unlike XHTML there is no &amp;amp;lt;br /&amp;gt; or &amp;amp;lt;/br&amp;gt;. In fact using such a thing will most likely be interpreted as an error by the Trainz HTML parser.&lt;br /&gt;
&lt;br /&gt;
Usage:&lt;br /&gt;
:...&amp;amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==TABLE==&lt;br /&gt;
This tag forms a table element. Any number of &amp;amp;lt;[[#TR |TR]]&amp;gt; (table row) elements may be present within the &#039;TABLE&#039; tag and that is all it should contain directly. Table height cannot be specified, this can be controlled by setting each &amp;amp;lt;[[#TR |TR]]&amp;gt; element within the table to add up to the desired table height.&lt;br /&gt;
&lt;br /&gt;
Table does NOT support the following parameters; rules, summary, align. Nor does it support the &amp;amp;lt;TH&amp;gt; element (the same effect can be achieved by making the contents of a &amp;amp;lt;[[#TD |TD]]&amp;gt; [[#B |BOLD]] or even more so by the use of [[#FONT |FONT]]). Table is best thought of as a grid, like that of a spreadsheet or a table inserted into a document. Tables are described by &amp;amp;lt;[[#TR |TR]]&amp;gt;; a row in a table and &amp;amp;lt;[[#TD |TD]]&amp;gt;; a cell in a row. &lt;br /&gt;
&lt;br /&gt;
Tables are not askew, meaning if 1 row has 3 cells then all rows will have at least 3 cells, this does not mean the coder must put at least 3 &amp;amp;lt;[[#TD |TD]]&amp;gt;s in each &amp;amp;lt;[[#TR |TR]]&amp;gt; it means when formatted for display on screen the html render will organise the table as such (as it is uniform). Furthermore, cells conform to the dimensions of their siblings; meaning a cell has the same width as the widest cell in its column (controllable by width in &amp;amp;lt;[[#TD |TD]]&amp;gt;) and the same height as the tallest cell in its row (controllable by height in &amp;amp;lt;[[#TR |TR]]&amp;gt;). This is very important to keep in mind when using tables for formatting/layout purposes.&lt;br /&gt;
&lt;br /&gt;
The documentation on &amp;amp;lt;[[#TR |TR]]&amp;gt; and &amp;amp;lt;[[#TD |TD]]&amp;gt; have more information about the use of tables in Trainz HTML. For more info and a place to try out some of these properties of tables try the [http://www.w3schools.com/tags/tag_table.asp w3schools table tag page], but remember Trainz HTML is not the same as HTML proper.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
All parameters are optional.&lt;br /&gt;
*cellpadding - specifies the minimum pixel space between the cell wall and its content. Default is 0.&lt;br /&gt;
*cellspacing - specifies the pixels between cells. Default is 0.&lt;br /&gt;
*width - specifies the pixel width of the table. If none is given the table will grow to fit its content. If width is given cell content will be wrapped if it would force table width beyond that.&lt;br /&gt;
*border - specifies the pixel width between the table and content around it. Default is 0.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Usage:&lt;br /&gt;
:&amp;amp;lt;table cellpadding=? cellspacing=? border=? width=? inherit-font&amp;gt;...&amp;amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==TR==&lt;br /&gt;
TR is Table Row. This tag forms a single horizontal row of a table. Any number of &#039;[[#TD |TD]]&#039; (table data) elements may be present within the &#039;TR&#039; tag and that is all it should directly contain. &amp;amp;lt;TR&amp;gt; does NOT support the following parameters; align, valign, char, charoff.&lt;br /&gt;
&lt;br /&gt;
All parameters are optional. Height, if specified, will limit how many pixels high this row can be, causing cells to expand in width if they were to approach this height.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
When using tables for formatting it is important to remember that cell size is dependent upon both column and row (see &amp;amp;lt;[[#TD |TD]]&amp;gt; and/or &amp;amp;lt;[[#TABLE |TABLE]]&amp;gt; for more info) thus it may be useful to consider creating a &amp;amp;lt;TR&amp;gt; with no data that exists only to set up the size of the columns ie.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;amp;lt;tr&amp;gt; &amp;amp;lt;td width=&#039;20&#039;&amp;gt;&amp;amp;lt;/td&amp;gt; &amp;amp;lt;td width=&#039;50&#039;&amp;gt;&amp;amp;lt;/td&amp;gt; &amp;amp;lt;td width=&#039;200&#039;&amp;gt;&amp;amp;lt;/td&amp;gt; &amp;amp;lt;td width=&#039;20&#039;&amp;gt;&amp;amp;lt;/td&amp;gt;  &amp;amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
now unless a &amp;amp;lt;TR&amp;gt; with more than 4 &amp;amp;lt;[[#TD |TD]]&amp;gt;s is created, the formatting for all columns is already done and as this &amp;amp;lt;TR&amp;gt; has no height specified and no data in its &amp;amp;lt;[[#TD |TD]]&amp;gt; cells it will take up only the space specified by the &amp;amp;lt;[[#TABLE |TABLE]]&amp;gt;&#039;s border, cellspacing and cellpadding (default 0).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Usage:&lt;br /&gt;
:&amp;amp;lt;tr height=? bgcolor=?&amp;gt;...&amp;amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==TD==&lt;br /&gt;
TD is Table Data. This tag forms a single cell within a table row. &amp;amp;lt;TD&amp;gt; does NOT support the following parameters; abbr, axis, char, charoff, headers, height, scope.&lt;br /&gt;
&lt;br /&gt;
Height of a cell is controlled by the tallest cell in the row or by the &amp;amp;lt;[[#TR |TR]]&amp;gt; height parameter if it is specified.&lt;br /&gt;
&lt;br /&gt;
&amp;amp;lt;TD&amp;gt; is the work horse of tables, as the name implies all contents of a table are contained within a &amp;amp;lt;TD&amp;gt; tag. Anything can be placed within a cell, even a table eg.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;html&amp;gt; &amp;lt;body&amp;gt;&lt;br /&gt;
  &amp;lt;table border=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt; &lt;br /&gt;
      &amp;lt;td&amp;gt;Some text &amp;lt;/td&amp;gt;&lt;br /&gt;
      &amp;lt;td&amp;gt;Some text &amp;lt;/td&amp;gt; &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt; &lt;br /&gt;
      &amp;lt;td&amp;gt;Some text &amp;lt;/td&amp;gt;&lt;br /&gt;
      &amp;lt;td&amp;gt;Some text &amp;lt;/td&amp;gt; &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt; &lt;br /&gt;
      &amp;lt;td&amp;gt; &lt;br /&gt;
        &amp;lt;table border=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;tr&amp;gt;&lt;br /&gt;
            &amp;lt;td&amp;gt;Some text in a sub table &amp;lt;/td&amp;gt;&lt;br /&gt;
            &amp;lt;td&amp;gt;Some other text in a sub table &amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;/tr&amp;gt;&lt;br /&gt;
        &amp;lt;/table&amp;gt;&lt;br /&gt;
      &amp;lt;/td&amp;gt;&lt;br /&gt;
      &amp;lt;td&amp;gt;&amp;lt;---Wow thats a sub table over there &amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
  &amp;lt;/table&amp;gt;&lt;br /&gt;
&amp;lt;/body&amp;gt; &amp;lt;/html&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
coping and pasting the above into the left pane of [http://www.w3schools.com/HTML/tryit.asp?filename=tryhtml_basic this Tryit window](open it in a new tab or window) and clicking &amp;quot;Edit and Click me &amp;gt;&amp;gt;&amp;quot; button will show you a table with a table in it on the right hand side.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
All parameters are optional.&lt;br /&gt;
*rowspan and colspan allows this cell to consume the space that would normally be allocated to neighboring cells on the right and bottom sides. Default values are 1, meaning the &amp;amp;lt;TD&amp;gt; spans its own cell and nothing more. [http://www.w3schools.com/tags/tryit.asp?filename=tryhtml_table_span Visual example of spanning], but remember Trainz HTML is not the same as HTML proper.&lt;br /&gt;
*width - specifies the pixel width of this cell, useful for formatting.&lt;br /&gt;
*align - &#039;left&#039;, &#039;center&#039;, &#039;right&#039;. (default &#039;left&#039;.) Controls the horizontal alignment of the content data within the table cell.&lt;br /&gt;
*valign - &#039;top&#039;, &#039;center&#039;, &#039;bottom&#039; (default &#039;top&#039;) Controls the vertical alignment of the content data within the table cell.&lt;br /&gt;
&lt;br /&gt;
Usage:&lt;br /&gt;
:&amp;amp;lt;td rowspawn=? colspan=? width=? bgcolor=? align=? valign=?&amp;gt;...&amp;amp;lt;/td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==A==&lt;br /&gt;
A is the Anchor tag. This tag marks all contained elements as a hyperlink with the specified attributes. Hyperlinked text will be underlined.&lt;br /&gt;
&lt;br /&gt;
Tooltip text will be displayed when the mouse hovers over the hyperlinked elements.&lt;br /&gt;
&lt;br /&gt;
The href is the minor message in a [[Browser Messages |Browser-URL message]] sent by the [[class Browser |Browser]] to whomever is listening to it. ie. the major=&amp;quot;Browser-URL&amp;quot; minor=&amp;quot;live://button/horn&amp;quot; message is produced by a hyperlinked button (horn) in the driver user interface.&lt;br /&gt;
&lt;br /&gt;
A hyperlink is considered clicked when the user has pressed and released mouse button 1 while over it.&lt;br /&gt;
&lt;br /&gt;
Usage:&lt;br /&gt;
:&amp;amp;lt;a href=? target=? help-label=? mousedown=? disabled-href=? tooltip=?&amp;gt;...&amp;amp;lt;/a&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==IMG==&lt;br /&gt;
IMG is the IMaGe tag. This tag displays an image with the specified attributes. Does NOT support the alt or title tags. &lt;br /&gt;
&lt;br /&gt;
All parameters are optional however, the src or the kuid parameter needs to be filled out for anything to show up apart from a fill.&lt;br /&gt;
&lt;br /&gt;
The width and height parameters define the pixel size the image will occupy on screen, these can be made larger or smaller than the image&#039;s actual size to zoom, stretch or squash the image as needed. Keep in mind that users don&#039;t all use the same resolution, so it is usually best to make pictures either fixed size in a screen position via the use of tables or calculating a pixel size relative to the current resolution.&lt;br /&gt;
&lt;br /&gt;
Usage:&lt;br /&gt;
:&amp;amp;lt;img src=? mouseover=? kuid=? width=? height=? srcwidth=? srcheight=? color=? hflip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==TRAINZ-TEXT==&lt;br /&gt;
A section of text that can be changed without having to recalculate or reset the entire HTML string in a [[class Browser |browser]]. &lt;br /&gt;
&lt;br /&gt;
In the Driver interface the speed panel shows the selected train&#039;s current speed, the current speed limit on its segment of track and the current world time. Below is the speed HTML, which is retrieved via the localisation method described in &amp;amp;lt;[[#FONT |FONT]]&amp;gt;;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;font color=#00FF00 locale=&#039;english&#039;&amp;gt;&amp;lt;b&amp;gt;&amp;lt;trainz-text id=&#039;speed&#039; text=&#039;0 KM/H&#039;&amp;gt;&amp;lt;/trainz-text&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This specifies green bold text that is bound to an id of &amp;quot;speed&amp;quot;. Now in every heartbeat in DriverModule.gs, the currently selected train&#039;s speed is calculated and applied to this trainz-text by calling SetTrainzText(&amp;quot;speed&amp;quot;, &amp;quot;10 kph&amp;quot;) [10 kph used only for illustrative purposes] on the [[class Browser |browser]] that contains the speed html.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The id parameter is required to be able to update this section of text via the SetTrainzText [[class Browser |browser]] call. The text parameter does not need to be filled out int HTML can be specified using the SetTrainzText method at a later time.&lt;br /&gt;
&lt;br /&gt;
Usage:&lt;br /&gt;
:&amp;amp;lt;trainz-text id=? text=?&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==B==&lt;br /&gt;
B is Boldface. Causes any text in contained elements to be rendered as boldface. The bold tag has no parameters.&lt;br /&gt;
&lt;br /&gt;
Usage:&lt;br /&gt;
:&amp;amp;lt;b&amp;gt;...&amp;amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==NOWRAP==&lt;br /&gt;
Suppresses automatic word wrap in the contained elements. The nowrap tag has no parameters.&lt;br /&gt;
&lt;br /&gt;
Usage:&lt;br /&gt;
:&amp;amp;lt;nowrap&amp;gt;...&amp;amp;lt;/nowrap&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==I==&lt;br /&gt;
I is the Italics tag. Causes any text in the contained elements to be rendered as italic. The italic tag has no parameters.&lt;br /&gt;
&lt;br /&gt;
Usage:&lt;br /&gt;
:&amp;amp;lt;i&amp;gt;...&amp;amp;lt;/i&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==FONT==&lt;br /&gt;
Causes the specified text attributes to be applied to any text in the contained elements. Text in Trainz HTML does not have to be enclosed in font tags, if none are found around any given text it will receive the default font settings.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Localisation note; the follow statement has special meaning to the Trains HTML parser;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;font locale=generic&amp;gt;A_TAG&amp;lt;/font&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
When a tag such as this is parsed, Trainz will look in the current users selected language [[class StringTable | string table]] of the current asset for a string with the name found between the &amp;amp;lt;font&amp;gt; &amp;amp;lt;/font&amp;gt; tags, in this case A_TAG. It will replace the entire statement from here &amp;quot;&amp;amp;lt;font... &amp;amp;lt;/font&amp;gt;&amp;quot; to here with what is found in the [[class StringTable | string table]]. An example of this at work is in the Driver interface where the camera types are defined in the string tables of the Driver asset [[config.txt file | config.txt]] in all available languages so that each camera button has the selected language tooltip for each camera mode.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Usage:&lt;br /&gt;
:&amp;amp;lt;font size=? color=? locale=? face=?&amp;gt;...&amp;amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==TRAINZ-OBJECT==&lt;br /&gt;
Documented below under [[#Embedded Objects |embedded objects]]. Embedded objects fill the style parameter. The width and height parameters specify the pixel size of the given object, eg. how big a button is.&lt;br /&gt;
&lt;br /&gt;
Usage:&lt;br /&gt;
:&amp;amp;lt;trainz-object width=? height=? style=?&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Supported Characters=&lt;br /&gt;
The MiniBrowser parses its input from UTF-8 encoded HTML. The full range of unicode characters may be included without special escape sequences. The following escape sequences are permitted and may be necessary to prevent the characters from being parsed as HTML markup.&lt;br /&gt;
* &amp;amp;amp;nbsp; - the HTML non-breaking space character.&lt;br /&gt;
* &amp;amp;amp;gt; - the &amp;quot;greater than&amp;quot; character (&#039; &amp;amp;gt; &#039;) &lt;br /&gt;
* &amp;amp;amp;lt; - the &amp;quot;less than&amp;quot; character (&#039; &amp;amp;lt; &#039;)&lt;br /&gt;
* &amp;amp;amp;amp; - the &amp;quot;ampersand&amp;quot; character (&#039; &amp;amp;amp; &#039;)&lt;br /&gt;
* &amp;amp;amp;quot; - the &amp;quot;quote&amp;quot; character (&#039; &amp;amp;quot; &#039;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Embedded Objects=&lt;br /&gt;
The following embedded objects are supported by the trainz-object tag:&lt;br /&gt;
&lt;br /&gt;
==dirver-menu-button==&lt;br /&gt;
:style=driver-menu-button name=?&lt;br /&gt;
&lt;br /&gt;
==dial==&lt;br /&gt;
Works like an analogue volume knob. A dial is used in the driver interface, in the dcc panel to control the speed/power of the train. These are its settings;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;trainz-object style=dial width=95 height=95 id=&#039;dcc&#039; &lt;br /&gt;
texture=&#039;newdriver/dcc/dcc_controller.tga&#039; min=0.1 max=0.9 &lt;br /&gt;
valmin=-1.0 valmax=1.0 step=0 clickstep=1 value=0.5&amp;gt;&amp;lt;/trainz-object&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Driver wraps the dial in an &amp;amp;lt;[[#A |A]]&amp;gt; as to receive messages from user interactions with it, it then uses the GetElementProperty(&amp;quot;dcc&amp;quot;, &amp;quot;value&amp;quot;) on the [[class Browser |Browser]] the dial resides in to extract its current value.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Parameters explained;&lt;br /&gt;
*The style, width, height and id parameters belong to the [[#TRAINZ-OBJECT |TRAINZ-OBJECT]].&lt;br /&gt;
*The min and max parameters specify the rotation (as a percent between 0 and 1) the dial can have in the interface. For the driver speed knob its 0.1 to 0.9; imagining this as a clock face this means the dial is allowed to rotate between approximately 7 clockwise around to approximately 5 and vice versa anticlockwise anywhere between 5 and 7. The dial&#039;s rotation can never be clockwise between 5 and 7.&lt;br /&gt;
*valmin and valmax specify the values returned by the dial, that is how its values map to its rotation. Using the clockface analogy again, at approximately 7 the dial will return the value of -1, at approximately 5 it will return the value 1 and at 12 it will return 0.&lt;br /&gt;
*step specifies the minimum change that can occur in the dial, 0 means it can move completely freely, if step were 0.1 and the user had rotated it by 0.04 no rotation would be registered and the dial would snap back to its previous position.&lt;br /&gt;
*clickstep TBD&lt;br /&gt;
*value sets the initial starting position (as a percentage 0 to 1) of its range. 0.5 being half between max and min.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
:style=dial texture=? min=? max=? valmin=? valmax=? step=? clickstep=? value=?&lt;br /&gt;
&lt;br /&gt;
==graphic-button==&lt;br /&gt;
:style=graphic-button text-color=? texture_off=? texture_on=? name=? toggle=?&lt;br /&gt;
&lt;br /&gt;
==thumbnail-downloader==&lt;br /&gt;
:style=thumbnail-downloader asset=? index=? thumb-size=? crop=?&lt;br /&gt;
&lt;br /&gt;
==button==&lt;br /&gt;
A Button is essentially 8 [[#IMG |image]]s; where only 1 is shown at a time determined by the button&#039;s on or off-ness and the user&#039;s cursor location.&lt;br /&gt;
&lt;br /&gt;
Buttons can be set either &#039;off&#039; or &#039;on&#039; by calling SetElementProperty(&amp;quot;button name&amp;quot;, &amp;quot;value&amp;quot;, &amp;quot;1&amp;quot;) [for on or &amp;quot;0&amp;quot; for off] on the [[class Browser |browser]] that contains the button. All buttons start in the off state.&lt;br /&gt;
&lt;br /&gt;
Both &#039;on&#039; and &#039;off&#039; states have 4 states within them for showing interaction with the cursor. Off is explained below, on is the same replacing &amp;quot;off&amp;quot; with &amp;quot;on&amp;quot;;&lt;br /&gt;
* &amp;quot;off&amp;quot; - button is in the off state and has no cursor interaction.&lt;br /&gt;
* &amp;quot;off-over&amp;quot; - button is in the off state and the cursor is hovering over the button.&lt;br /&gt;
* &amp;quot;off-down&amp;quot; - button is in the off state and the cursor has been clicked on the button, is held down (mouse button 1 is down) but the cursor is not (is no longer) hovering over the button meaning the user has dragged the cursor off the button after clicking it.&lt;br /&gt;
* &amp;quot;off-down-over&amp;quot; - button is in the off state and the cursor is hovering over the button and the cursor has been clicked on it and is being held down (mouse button 1 is down).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The size of a button is determined by the width and height parameters of its containing [[#TRAINZ-OBJECT |TRAINZ-OBJECT]] tag.&lt;br /&gt;
&lt;br /&gt;
Typically a button trainz-object will be contained within an &amp;amp;lt;[[#A |A]]&amp;gt; tag giving the appearance that buttons send messages. As buttons do not send clicked messages themselves, they do not directly know when they have been clicked on or off, this must be done manually by listening to the message that will be sent by the anchor tag and changing the buttons state using the SetElementProperty(&amp;quot;button name&amp;quot;, &amp;quot;value&amp;quot;, &amp;quot;1&amp;quot;) command on its containing browser.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Usage:&lt;br /&gt;
? represent image files within the asset.&lt;br /&gt;
:style=button id=&amp;amp;lt;button name&amp;gt; off=? off-over=? off-down=? off-down-over=? on=? on-over=? on-down=? on-down-over=? link-held=?&lt;br /&gt;
&lt;br /&gt;
==minimap==&lt;br /&gt;
:style=minimap&lt;br /&gt;
&lt;br /&gt;
==preview==&lt;br /&gt;
:style=preview asset=?&lt;br /&gt;
&lt;br /&gt;
==text-line==&lt;br /&gt;
:style=text-line background=? align=?&lt;br /&gt;
&lt;br /&gt;
==asset-picker==&lt;br /&gt;
:style=asset-picker background=? align=?&lt;br /&gt;
&lt;br /&gt;
==driver-order-bar==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Incorrect&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Is a very specific case. As the name implies it is the list of driver commands that appears at the bottom of the screen next to the current driver image in Driver. This is already created and managed for you, users probably don&#039;t want to make these in any useful way, just to mess around or break things.&lt;br /&gt;
&lt;br /&gt;
:style=driver-order-bar&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;this isn&#039;t really accurate. i think you&#039;ll find this is already used elsewhere in the game (for example, in the driver command rule?) and in fact possibly isn&#039;t used by the main driver interface - it&#039;s likely that is not HTML although it&#039;s the same underlying control. this is a general-purpose control: the functionality is specific to assigning orders, but it should be fairly flexible what the calling script does with the orders.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==clock==&lt;br /&gt;
:style=clock face-texture=? seconds-texture=? minutes-texture=? hours-texture=? seconds-visible=? minutes-visible=? hours-visible=? seconds=? minutes=? hours=?&lt;br /&gt;
&lt;br /&gt;
==slider==&lt;br /&gt;
Slider is a horizontal bar similar to a horizontal scroll bar with a linear range of values mapped to it, similar to the [[#dial |dial]]. &lt;br /&gt;
&lt;br /&gt;
There are several in the video settings menu/asset and those will be used as an example here. The most important attributes are;&lt;br /&gt;
*min the minimum value the slider represents (far left).&lt;br /&gt;
*max the maximum value the slider represents (far right).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
:style=slider min=? max=? page-size=? draw-lines=? draw-marks=? thumb=? thumb-over=? less=? less-over=? more=? more-over=? thumb-width=? thumb-height=? theme=? background=? arrow-width=? arrow-height=?&lt;br /&gt;
&lt;br /&gt;
==browser==&lt;br /&gt;
[[class Browser |browser]] is updated through call to SetElementProperty(&amp;quot;component-name&amp;quot;,&amp;quot;html&amp;quot;,sub-browser html  string) from the parent browser level. An example of this at work can be found in the waybillmanager.gs&lt;br /&gt;
&lt;br /&gt;
:style=browser id=&#039;component-name&#039; width=? height=? clip=?&lt;br /&gt;
&lt;br /&gt;
==edit-box==&lt;br /&gt;
The edit box allows a text entry field such as that provided on the Routes Menu search field or the iTrainz Chat windows.&lt;br /&gt;
&lt;br /&gt;
:style=edit-box multi-line read-only masked link-on-focus-loss&lt;br /&gt;
&lt;br /&gt;
==static-line==&lt;br /&gt;
A divider line graphic.&lt;br /&gt;
&lt;br /&gt;
:style=static-line color=?&lt;br /&gt;
&lt;br /&gt;
==progress==&lt;br /&gt;
A progress bar.&lt;br /&gt;
&lt;br /&gt;
:style=progress progress=?&lt;br /&gt;
&lt;br /&gt;
==keyinput==&lt;br /&gt;
&lt;br /&gt;
:style=keyinput context=? id=?&lt;br /&gt;
&lt;br /&gt;
==score-gauge==&lt;br /&gt;
:style=score-gauge star-thresholds=? points=? hight-score=?&lt;br /&gt;
&lt;br /&gt;
==date-picker==&lt;br /&gt;
:style=date-picker day=? month=? year=?&lt;br /&gt;
&lt;br /&gt;
==video==&lt;br /&gt;
&amp;lt;font color=red&amp;gt;Seems to be removed in TRS19?&amp;lt;/font&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
This control plays back a video. Some platforms do not support this control; support can be tested through the &#039;PR_VideoPlayback&#039; product right. Video format support depends on the client system.&lt;br /&gt;
&lt;br /&gt;
*The play-on-load tag should be either &#039;1&#039; or &#039;0&#039; being yes or no respectively and it means exactly what it sounds like, should the video start playing once it has loaded.&lt;br /&gt;
*The is-video-looping is likewise a &#039;1&#039; or &#039;0&#039; value indicating the video should or shouldn&#039;t repeat once finished.&lt;br /&gt;
&lt;br /&gt;
:style=video play-on-load=? video-filename=? is-video-looping=?&lt;br /&gt;
&lt;br /&gt;
==internet-browser==&lt;br /&gt;
&amp;lt;font color=red&amp;gt;Seems to be removed in TRS19?&amp;lt;/font&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
The internet browser is a native (eg. mozilla, safari, etc.) web browser which can be used to display information from this wiki. Some platforms do not support this control; support can be tested through the &#039;PR_WebBrowser&#039; product right. For platforms that do support this control, the exact feature set may vary.&lt;br /&gt;
&lt;br /&gt;
:style=internet-browser address=?&lt;/div&gt;</summary>
		<author><name>Callavsg</name></author>
	</entry>
	<entry>
		<id>https://wiki.trainzsimulator.com/index.php?title=MiniBrowser&amp;diff=18312</id>
		<title>MiniBrowser</title>
		<link rel="alternate" type="text/html" href="https://wiki.trainzsimulator.com/index.php?title=MiniBrowser&amp;diff=18312"/>
		<updated>2019-04-08T10:02:17Z</updated>

		<summary type="html">&lt;p&gt;Callavsg: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The [[MiniBrowser]] is a trivial HTML renderer used for simple layout control within the Trainz game environment. It is specifically not a replacement for a real browser (see [[Trainz Online]] instead), is not remotely standards compliant, and does not support a full range of HTML tags. If a tag isn&#039;t mentioned here then it is NOT supported. There is no javascript support ([[Scripting|TrainzScript]] is used instead.) The [[MiniBrowser]] is used exclusively by the Trainz [[class Browser|Browser]] script object.&lt;br /&gt;
&lt;br /&gt;
Feature requests relating primarily to the MiniBrowser should be placed on the [[MiniBrowser Feature Requests]] page.&lt;br /&gt;
&lt;br /&gt;
Trainz HTML is NOT standards compliant and is best thought of as an HTML-alike chosen so users and developers are familiar with the style of syntax being used.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Supported Tags=&lt;br /&gt;
The MiniBrowser supports the following HTML tags:&lt;br /&gt;
&lt;br /&gt;
==HTML==&lt;br /&gt;
This tag wraps the entire HTML document. No parameters are supported. This tag should be at the top level of the document and should contain a single &#039;[[#BODY |BODY]]&#039; tag.&lt;br /&gt;
&lt;br /&gt;
Usage:&lt;br /&gt;
:&amp;amp;lt;html&amp;gt;&lt;br /&gt;
::...&lt;br /&gt;
:&amp;amp;lt;/html&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==BODY==&lt;br /&gt;
This tag wraps the entire body of the HTML document. The &#039;scale&#039; parameter is provided to force the document to be rescaled to a specified number of pixels wide, but its usage is strongly discouraged. This tag should exist within the &#039;[[#HTML |HTML]]&#039; tag and may contain any number of other elements.&lt;br /&gt;
&lt;br /&gt;
Usage:&lt;br /&gt;
:&amp;amp;lt;body scale=?&amp;gt;&lt;br /&gt;
::...&lt;br /&gt;
:&amp;amp;lt;/body&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==P (paragraph)==&lt;br /&gt;
This tag causes the contained elements to be formatted as a separate paragraph. This is similar to prefixing and suffixing the elements with a linebreak. Paragraph tag has no parameters.&lt;br /&gt;
&lt;br /&gt;
Usage:&lt;br /&gt;
:&amp;amp;lt;p&amp;gt;...&amp;amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==BR (linebreak)==&lt;br /&gt;
A forced linebreak. BR has no parameters.&lt;br /&gt;
&lt;br /&gt;
BR is an unclosed tag, unlike XHTML there is no &amp;amp;lt;br /&amp;gt; or &amp;amp;lt;/br&amp;gt;. In fact using such a thing will most likely be interpreted as an error by the Trainz HTML parser.&lt;br /&gt;
&lt;br /&gt;
Usage:&lt;br /&gt;
:...&amp;amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==TABLE==&lt;br /&gt;
This tag forms a table element. Any number of &amp;amp;lt;[[#TR |TR]]&amp;gt; (table row) elements may be present within the &#039;TABLE&#039; tag and that is all it should contain directly. Table height cannot be specified, this can be controlled by setting each &amp;amp;lt;[[#TR |TR]]&amp;gt; element within the table to add up to the desired table height.&lt;br /&gt;
&lt;br /&gt;
Table does NOT support the following parameters; rules, summary, align. Nor does it support the &amp;amp;lt;TH&amp;gt; element (the same effect can be achieved by making the contents of a &amp;amp;lt;[[#TD |TD]]&amp;gt; [[#B |BOLD]] or even more so by the use of [[#FONT |FONT]]). Table is best thought of as a grid, like that of a spreadsheet or a table inserted into a document. Tables are described by &amp;amp;lt;[[#TR |TR]]&amp;gt;; a row in a table and &amp;amp;lt;[[#TD |TD]]&amp;gt;; a cell in a row. &lt;br /&gt;
&lt;br /&gt;
Tables are not askew, meaning if 1 row has 3 cells then all rows will have at least 3 cells, this does not mean the coder must put at least 3 &amp;amp;lt;[[#TD |TD]]&amp;gt;s in each &amp;amp;lt;[[#TR |TR]]&amp;gt; it means when formatted for display on screen the html render will organise the table as such (as it is uniform). Furthermore, cells conform to the dimensions of their siblings; meaning a cell has the same width as the widest cell in its column (controllable by width in &amp;amp;lt;[[#TD |TD]]&amp;gt;) and the same height as the tallest cell in its row (controllable by height in &amp;amp;lt;[[#TR |TR]]&amp;gt;). This is very important to keep in mind when using tables for formatting/layout purposes.&lt;br /&gt;
&lt;br /&gt;
The documentation on &amp;amp;lt;[[#TR |TR]]&amp;gt; and &amp;amp;lt;[[#TD |TD]]&amp;gt; have more information about the use of tables in Trainz HTML. For more info and a place to try out some of these properties of tables try the [http://www.w3schools.com/tags/tag_table.asp w3schools table tag page], but remember Trainz HTML is not the same as HTML proper.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
All parameters are optional.&lt;br /&gt;
*cellpadding - specifies the minimum pixel space between the cell wall and its content. Default is 0.&lt;br /&gt;
*cellspacing - specifies the pixels between cells. Default is 0.&lt;br /&gt;
*width - specifies the pixel width of the table. If none is given the table will grow to fit its content. If width is given cell content will be wrapped if it would force table width beyond that.&lt;br /&gt;
*border - specifies the pixel width between the table and content around it. Default is 0.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Usage:&lt;br /&gt;
:&amp;amp;lt;table cellpadding=? cellspacing=? border=? width=? inherit-font&amp;gt;...&amp;amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==TR==&lt;br /&gt;
TR is Table Row. This tag forms a single horizontal row of a table. Any number of &#039;[[#TD |TD]]&#039; (table data) elements may be present within the &#039;TR&#039; tag and that is all it should directly contain. &amp;amp;lt;TR&amp;gt; does NOT support the following parameters; align, valign, char, charoff.&lt;br /&gt;
&lt;br /&gt;
All parameters are optional. Height, if specified, will limit how many pixels high this row can be, causing cells to expand in width if they were to approach this height.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
When using tables for formatting it is important to remember that cell size is dependent upon both column and row (see &amp;amp;lt;[[#TD |TD]]&amp;gt; and/or &amp;amp;lt;[[#TABLE |TABLE]]&amp;gt; for more info) thus it may be useful to consider creating a &amp;amp;lt;TR&amp;gt; with no data that exists only to set up the size of the columns ie.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;amp;lt;tr&amp;gt; &amp;amp;lt;td width=&#039;20&#039;&amp;gt;&amp;amp;lt;/td&amp;gt; &amp;amp;lt;td width=&#039;50&#039;&amp;gt;&amp;amp;lt;/td&amp;gt; &amp;amp;lt;td width=&#039;200&#039;&amp;gt;&amp;amp;lt;/td&amp;gt; &amp;amp;lt;td width=&#039;20&#039;&amp;gt;&amp;amp;lt;/td&amp;gt;  &amp;amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
now unless a &amp;amp;lt;TR&amp;gt; with more than 4 &amp;amp;lt;[[#TD |TD]]&amp;gt;s is created, the formatting for all columns is already done and as this &amp;amp;lt;TR&amp;gt; has no height specified and no data in its &amp;amp;lt;[[#TD |TD]]&amp;gt; cells it will take up only the space specified by the &amp;amp;lt;[[#TABLE |TABLE]]&amp;gt;&#039;s border, cellspacing and cellpadding (default 0).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Usage:&lt;br /&gt;
:&amp;amp;lt;tr height=? bgcolor=?&amp;gt;...&amp;amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==TD==&lt;br /&gt;
TD is Table Data. This tag forms a single cell within a table row. &amp;amp;lt;TD&amp;gt; does NOT support the following parameters; abbr, axis, char, charoff, headers, height, scope.&lt;br /&gt;
&lt;br /&gt;
Height of a cell is controlled by the tallest cell in the row or by the &amp;amp;lt;[[#TR |TR]]&amp;gt; height parameter if it is specified.&lt;br /&gt;
&lt;br /&gt;
&amp;amp;lt;TD&amp;gt; is the work horse of tables, as the name implies all contents of a table are contained within a &amp;amp;lt;TD&amp;gt; tag. Anything can be placed within a cell, even a table eg.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;html&amp;gt; &amp;lt;body&amp;gt;&lt;br /&gt;
  &amp;lt;table border=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt; &lt;br /&gt;
      &amp;lt;td&amp;gt;Some text &amp;lt;/td&amp;gt;&lt;br /&gt;
      &amp;lt;td&amp;gt;Some text &amp;lt;/td&amp;gt; &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt; &lt;br /&gt;
      &amp;lt;td&amp;gt;Some text &amp;lt;/td&amp;gt;&lt;br /&gt;
      &amp;lt;td&amp;gt;Some text &amp;lt;/td&amp;gt; &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt; &lt;br /&gt;
      &amp;lt;td&amp;gt; &lt;br /&gt;
        &amp;lt;table border=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;tr&amp;gt;&lt;br /&gt;
            &amp;lt;td&amp;gt;Some text in a sub table &amp;lt;/td&amp;gt;&lt;br /&gt;
            &amp;lt;td&amp;gt;Some other text in a sub table &amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;/tr&amp;gt;&lt;br /&gt;
        &amp;lt;/table&amp;gt;&lt;br /&gt;
      &amp;lt;/td&amp;gt;&lt;br /&gt;
      &amp;lt;td&amp;gt;&amp;lt;---Wow thats a sub table over there &amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
  &amp;lt;/table&amp;gt;&lt;br /&gt;
&amp;lt;/body&amp;gt; &amp;lt;/html&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
coping and pasting the above into the left pane of [http://www.w3schools.com/HTML/tryit.asp?filename=tryhtml_basic this Tryit window](open it in a new tab or window) and clicking &amp;quot;Edit and Click me &amp;gt;&amp;gt;&amp;quot; button will show you a table with a table in it on the right hand side.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
All parameters are optional.&lt;br /&gt;
*rowspan and colspan allows this cell to consume the space that would normally be allocated to neighboring cells on the right and bottom sides. Default values are 1, meaning the &amp;amp;lt;TD&amp;gt; spans its own cell and nothing more. [http://www.w3schools.com/tags/tryit.asp?filename=tryhtml_table_span Visual example of spanning], but remember Trainz HTML is not the same as HTML proper.&lt;br /&gt;
*width - specifies the pixel width of this cell, useful for formatting.&lt;br /&gt;
*align - &#039;left&#039;, &#039;center&#039;, &#039;right&#039;. (default &#039;left&#039;.) Controls the horizontal alignment of the content data within the table cell.&lt;br /&gt;
*valign - &#039;top&#039;, &#039;center&#039;, &#039;bottom&#039; (default &#039;top&#039;) Controls the vertical alignment of the content data within the table cell.&lt;br /&gt;
&lt;br /&gt;
Usage:&lt;br /&gt;
:&amp;amp;lt;td rowspawn=? colspan=? width=? bgcolor=? align=? valign=?&amp;gt;...&amp;amp;lt;/td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==A==&lt;br /&gt;
A is the Anchor tag. This tag marks all contained elements as a hyperlink with the specified attributes. Hyperlinked text will be underlined.&lt;br /&gt;
&lt;br /&gt;
Tooltip text will be displayed when the mouse hovers over the hyperlinked elements.&lt;br /&gt;
&lt;br /&gt;
The href is the minor message in a [[Browser Messages |Browser-URL message]] sent by the [[class Browser |Browser]] to whomever is listening to it. ie. the major=&amp;quot;Browser-URL&amp;quot; minor=&amp;quot;live://button/horn&amp;quot; message is produced by a hyperlinked button (horn) in the driver user interface.&lt;br /&gt;
&lt;br /&gt;
A hyperlink is considered clicked when the user has pressed and released mouse button 1 while over it.&lt;br /&gt;
&lt;br /&gt;
Usage:&lt;br /&gt;
:&amp;amp;lt;a href=? target=? help-label=? mousedown=? disabled-href=? tooltip=?&amp;gt;...&amp;amp;lt;/a&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==IMG==&lt;br /&gt;
IMG is the IMaGe tag. This tag displays an image with the specified attributes. Does NOT support the alt or title tags. &lt;br /&gt;
&lt;br /&gt;
All parameters are optional however, the src or the kuid parameter needs to be filled out for anything to show up apart from a fill.&lt;br /&gt;
&lt;br /&gt;
The width and height parameters define the pixel size the image will occupy on screen, these can be made larger or smaller than the image&#039;s actual size to zoom, stretch or squash the image as needed. Keep in mind that users don&#039;t all use the same resolution, so it is usually best to make pictures either fixed size in a screen position via the use of tables or calculating a pixel size relative to the current resolution.&lt;br /&gt;
&lt;br /&gt;
Usage:&lt;br /&gt;
:&amp;amp;lt;img src=? mouseover=? kuid=? width=? height=? srcwidth=? srcheight=? color=? hflip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==TRAINZ-TEXT==&lt;br /&gt;
A section of text that can be changed without having to recalculate or reset the entire HTML string in a [[class Browser |browser]]. &lt;br /&gt;
&lt;br /&gt;
In the Driver interface the speed panel shows the selected train&#039;s current speed, the current speed limit on its segment of track and the current world time. Below is the speed HTML, which is retrieved via the localisation method described in &amp;amp;lt;[[#FONT |FONT]]&amp;gt;;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;font color=#00FF00 locale=&#039;english&#039;&amp;gt;&amp;lt;b&amp;gt;&amp;lt;trainz-text id=&#039;speed&#039; text=&#039;0 KM/H&#039;&amp;gt;&amp;lt;/trainz-text&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This specifies green bold text that is bound to an id of &amp;quot;speed&amp;quot;. Now in every heartbeat in DriverModule.gs, the currently selected train&#039;s speed is calculated and applied to this trainz-text by calling SetTrainzText(&amp;quot;speed&amp;quot;, &amp;quot;10 kph&amp;quot;) [10 kph used only for illustrative purposes] on the [[class Browser |browser]] that contains the speed html.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The id parameter is required to be able to update this section of text via the SetTrainzText [[class Browser |browser]] call. The text parameter does not need to be filled out int HTML can be specified using the SetTrainzText method at a later time.&lt;br /&gt;
&lt;br /&gt;
Usage:&lt;br /&gt;
:&amp;amp;lt;trainz-text id=? text=?&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==B==&lt;br /&gt;
B is Boldface. Causes any text in contained elements to be rendered as boldface. The bold tag has no parameters.&lt;br /&gt;
&lt;br /&gt;
Usage:&lt;br /&gt;
:&amp;amp;lt;b&amp;gt;...&amp;amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==NOWRAP==&lt;br /&gt;
Suppresses automatic word wrap in the contained elements. The nowrap tag has no parameters.&lt;br /&gt;
&lt;br /&gt;
Usage:&lt;br /&gt;
:&amp;amp;lt;nowrap&amp;gt;...&amp;amp;lt;/nowrap&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==I==&lt;br /&gt;
I is the Italics tag. Causes any text in the contained elements to be rendered as italic. The italic tag has no parameters.&lt;br /&gt;
&lt;br /&gt;
Usage:&lt;br /&gt;
:&amp;amp;lt;i&amp;gt;...&amp;amp;lt;/i&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==FONT==&lt;br /&gt;
Causes the specified text attributes to be applied to any text in the contained elements. Text in Trainz HTML does not have to be enclosed in font tags, if none are found around any given text it will receive the default font settings.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Localisation note; the follow statement has special meaning to the Trains HTML parser;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;font locale=generic&amp;gt;A_TAG&amp;lt;/font&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
When a tag such as this is parsed, Trainz will look in the current users selected language [[class StringTable | string table]] of the current asset for a string with the name found between the &amp;amp;lt;font&amp;gt; &amp;amp;lt;/font&amp;gt; tags, in this case A_TAG. It will replace the entire statement from here &amp;quot;&amp;amp;lt;font... &amp;amp;lt;/font&amp;gt;&amp;quot; to here with what is found in the [[class StringTable | string table]]. An example of this at work is in the Driver interface where the camera types are defined in the string tables of the Driver asset [[config.txt file | config.txt]] in all available languages so that each camera button has the selected language tooltip for each camera mode.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Usage:&lt;br /&gt;
:&amp;amp;lt;font size=? color=? locale=? face=?&amp;gt;...&amp;amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==TRAINZ-OBJECT==&lt;br /&gt;
Documented below under [[#Embedded Objects |embedded objects]]. Embedded objects fill the style parameter. The width and height parameters specify the pixel size of the given object, eg. how big a button is.&lt;br /&gt;
&lt;br /&gt;
Usage:&lt;br /&gt;
:&amp;amp;lt;trainz-object width=? height=? style=?&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Supported Characters=&lt;br /&gt;
The MiniBrowser parses its input from UTF-8 encoded HTML. The full range of unicode characters may be included without special escape sequences. The following escape sequences are permitted and may be necessary to prevent the characters from being parsed as HTML markup.&lt;br /&gt;
* &amp;amp;amp;nbsp; - the HTML non-breaking space character.&lt;br /&gt;
* &amp;amp;amp;gt; - the &amp;quot;greater than&amp;quot; character (&#039; &amp;amp;gt; &#039;) &lt;br /&gt;
* &amp;amp;amp;lt; - the &amp;quot;less than&amp;quot; character (&#039; &amp;amp;lt; &#039;)&lt;br /&gt;
* &amp;amp;amp;amp; - the &amp;quot;ampersand&amp;quot; character (&#039; &amp;amp;amp; &#039;)&lt;br /&gt;
* &amp;amp;amp;quot; - the &amp;quot;quote&amp;quot; character (&#039; &amp;amp;quot; &#039;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Embedded Objects=&lt;br /&gt;
The following embedded objects are supported by the trainz-object tag:&lt;br /&gt;
&lt;br /&gt;
==dirver-menu-button==&lt;br /&gt;
:style=driver-menu-button name=?&lt;br /&gt;
&lt;br /&gt;
==dial==&lt;br /&gt;
Works like an analogue volume knob. A dial is used in the driver interface, in the dcc panel to control the speed/power of the train. These are its settings;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;trainz-object style=dial width=95 height=95 id=&#039;dcc&#039; &lt;br /&gt;
texture=&#039;newdriver/dcc/dcc_controller.tga&#039; min=0.1 max=0.9 &lt;br /&gt;
valmin=-1.0 valmax=1.0 step=0 clickstep=1 value=0.5&amp;gt;&amp;lt;/trainz-object&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Driver wraps the dial in an &amp;amp;lt;[[#A |A]]&amp;gt; as to receive messages from user interactions with it, it then uses the GetElementProperty(&amp;quot;dcc&amp;quot;, &amp;quot;value&amp;quot;) on the [[class Browser |Browser]] the dial resides in to extract its current value.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Parameters explained;&lt;br /&gt;
*The style, width, height and id parameters belong to the [[#TRAINZ-OBJECT |TRAINZ-OBJECT]].&lt;br /&gt;
*The min and max parameters specify the rotation (as a percent between 0 and 1) the dial can have in the interface. For the driver speed knob its 0.1 to 0.9; imagining this as a clock face this means the dial is allowed to rotate between approximately 7 clockwise around to approximately 5 and vice versa anticlockwise anywhere between 5 and 7. The dial&#039;s rotation can never be clockwise between 5 and 7.&lt;br /&gt;
*valmin and valmax specify the values returned by the dial, that is how its values map to its rotation. Using the clockface analogy again, at approximately 7 the dial will return the value of -1, at approximately 5 it will return the value 1 and at 12 it will return 0.&lt;br /&gt;
*step specifies the minimum change that can occur in the dial, 0 means it can move completely freely, if step were 0.1 and the user had rotated it by 0.04 no rotation would be registered and the dial would snap back to its previous position.&lt;br /&gt;
*clickstep TBD&lt;br /&gt;
*value sets the initial starting position (as a percentage 0 to 1) of its range. 0.5 being half between max and min.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
:style=dial texture=? min=? max=? valmin=? valmax=? step=? clickstep=? value=?&lt;br /&gt;
&lt;br /&gt;
==graphic-button==&lt;br /&gt;
:style=graphic-button text-color=? texture_off=? texture_on=? name=? toggle=?&lt;br /&gt;
&lt;br /&gt;
==thumbnail-downloader==&lt;br /&gt;
:style=thumbnail-downloader asset=? index=? thumb-size=? crop=?&lt;br /&gt;
&lt;br /&gt;
==button==&lt;br /&gt;
A Button is essentially 8 [[#IMG |image]]s; where only 1 is shown at a time determined by the button&#039;s on or off-ness and the user&#039;s cursor location.&lt;br /&gt;
&lt;br /&gt;
Buttons can be set either &#039;off&#039; or &#039;on&#039; by calling SetElementProperty(&amp;quot;button name&amp;quot;, &amp;quot;value&amp;quot;, &amp;quot;1&amp;quot;) [for on or &amp;quot;0&amp;quot; for off] on the [[class Browser |browser]] that contains the button. All buttons start in the off state.&lt;br /&gt;
&lt;br /&gt;
Both &#039;on&#039; and &#039;off&#039; states have 4 states within them for showing interaction with the cursor. Off is explained below, on is the same replacing &amp;quot;off&amp;quot; with &amp;quot;on&amp;quot;;&lt;br /&gt;
* &amp;quot;off&amp;quot; - button is in the off state and has no cursor interaction.&lt;br /&gt;
* &amp;quot;off-over&amp;quot; - button is in the off state and the cursor is hovering over the button.&lt;br /&gt;
* &amp;quot;off-down&amp;quot; - button is in the off state and the cursor has been clicked on the button, is held down (mouse button 1 is down) but the cursor is not (is no longer) hovering over the button meaning the user has dragged the cursor off the button after clicking it.&lt;br /&gt;
* &amp;quot;off-down-over&amp;quot; - button is in the off state and the cursor is hovering over the button and the cursor has been clicked on it and is being held down (mouse button 1 is down).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The size of a button is determined by the width and height parameters of its containing [[#TRAINZ-OBJECT |TRAINZ-OBJECT]] tag.&lt;br /&gt;
&lt;br /&gt;
Typically a button trainz-object will be contained within an &amp;amp;lt;[[#A |A]]&amp;gt; tag giving the appearance that buttons send messages. As buttons do not send clicked messages themselves, they do not directly know when they have been clicked on or off, this must be done manually by listening to the message that will be sent by the anchor tag and changing the buttons state using the SetElementProperty(&amp;quot;button name&amp;quot;, &amp;quot;value&amp;quot;, &amp;quot;1&amp;quot;) command on its containing browser.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Usage:&lt;br /&gt;
? represent image files within the asset.&lt;br /&gt;
:style=button id=&amp;amp;lt;button name&amp;gt; off=? off-over=? off-down=? off-down-over=? on=? on-over=? on-down=? on-down-over=? link-held=?&lt;br /&gt;
&lt;br /&gt;
==minimap==&lt;br /&gt;
:style=minimap&lt;br /&gt;
&lt;br /&gt;
==preview==&lt;br /&gt;
:style=preview asset=?&lt;br /&gt;
&lt;br /&gt;
==text-line==&lt;br /&gt;
:style=text-line background=? align=?&lt;br /&gt;
&lt;br /&gt;
==asset-picker==&lt;br /&gt;
:style=asset-picker background=? align=?&lt;br /&gt;
&lt;br /&gt;
==driver-order-bar==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Incorrect&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Is a very specific case. As the name implies it is the list of driver commands that appears at the bottom of the screen next to the current driver image in Driver. This is already created and managed for you, users probably don&#039;t want to make these in any useful way, just to mess around or break things.&lt;br /&gt;
&lt;br /&gt;
:style=driver-order-bar&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;this isn&#039;t really accurate. i think you&#039;ll find this is already used elsewhere in the game (for example, in the driver command rule?) and in fact possibly isn&#039;t used by the main driver interface - it&#039;s likely that is not HTML although it&#039;s the same underlying control. this is a general-purpose control: the functionality is specific to assigning orders, but it should be fairly flexible what the calling script does with the orders.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==clock==&lt;br /&gt;
:style=clock face-texture=? seconds-texture=? minutes-texture=? hours-texture=? seconds-visible=? minutes-visible=? hours-visible=? seconds=? minutes=? hours=?&lt;br /&gt;
&lt;br /&gt;
==slider==&lt;br /&gt;
Slider is a horizontal bar similar to a horizontal scroll bar with a linear range of values mapped to it, similar to the [[#dial |dial]]. &lt;br /&gt;
&lt;br /&gt;
There are several in the video settings menu/asset and those will be used as an example here. The most important attributes are;&lt;br /&gt;
*min the minimum value the slider represents (far left).&lt;br /&gt;
*max the maximum value the slider represents (far right).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
:style=slider min=? max=? page-size=? draw-lines=? draw-marks=? thumb=? thumb-over=? less=? less-over=? more=? more-over=? thumb-width=? thumb-height=? theme=? background=? arrow-width=? arrow-height=?&lt;br /&gt;
&lt;br /&gt;
==browser==&lt;br /&gt;
[[class Browser |browser]] is updated through call to SetElementProperty(&amp;quot;component-name&amp;quot;,&amp;quot;html&amp;quot;,sub-browser html  string) from the parent browser level. An example of this at work can be found in the waybillmanager.gs&lt;br /&gt;
&lt;br /&gt;
:style=browser id=&#039;component-name&#039; width=? height=? clip=?&lt;br /&gt;
&lt;br /&gt;
==edit-box==&lt;br /&gt;
The edit box allows a text entry field such as that provided on the Routes Menu search field or the iTrainz Chat windows.&lt;br /&gt;
&lt;br /&gt;
:style=edit-box multi-line read-only masked link-on-focus-loss&lt;br /&gt;
&lt;br /&gt;
==static-line==&lt;br /&gt;
A divider line graphic.&lt;br /&gt;
&lt;br /&gt;
:style=static-line color=?&lt;br /&gt;
&lt;br /&gt;
==progress==&lt;br /&gt;
A progress bar.&lt;br /&gt;
&lt;br /&gt;
:style=progress progress=?&lt;br /&gt;
&lt;br /&gt;
==keyinput==&lt;br /&gt;
&lt;br /&gt;
:style=keyinput context=? id=?&lt;br /&gt;
&lt;br /&gt;
==score-gauge==&lt;br /&gt;
:style=store-gauge star-thresholds=? points=? hight-score=?&lt;br /&gt;
&lt;br /&gt;
==date-picker==&lt;br /&gt;
:style=date-picker day=? month=? year=?&lt;br /&gt;
&lt;br /&gt;
==video==&lt;br /&gt;
&amp;lt;font color=red&amp;gt;Seems to be removed in TRS19?&amp;lt;/font&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
This control plays back a video. Some platforms do not support this control; support can be tested through the &#039;PR_VideoPlayback&#039; product right. Video format support depends on the client system.&lt;br /&gt;
&lt;br /&gt;
*The play-on-load tag should be either &#039;1&#039; or &#039;0&#039; being yes or no respectively and it means exactly what it sounds like, should the video start playing once it has loaded.&lt;br /&gt;
*The is-video-looping is likewise a &#039;1&#039; or &#039;0&#039; value indicating the video should or shouldn&#039;t repeat once finished.&lt;br /&gt;
&lt;br /&gt;
:style=video play-on-load=? video-filename=? is-video-looping=?&lt;br /&gt;
&lt;br /&gt;
==internet-browser==&lt;br /&gt;
&amp;lt;font color=red&amp;gt;Seems to be removed in TRS19?&amp;lt;/font&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
The internet browser is a native (eg. mozilla, safari, etc.) web browser which can be used to display information from this wiki. Some platforms do not support this control; support can be tested through the &#039;PR_WebBrowser&#039; product right. For platforms that do support this control, the exact feature set may vary.&lt;br /&gt;
&lt;br /&gt;
:style=internet-browser address=?&lt;/div&gt;</summary>
		<author><name>Callavsg</name></author>
	</entry>
	<entry>
		<id>https://wiki.trainzsimulator.com/index.php?title=User:Callavsg&amp;diff=17567</id>
		<title>User:Callavsg</title>
		<link rel="alternate" type="text/html" href="https://wiki.trainzsimulator.com/index.php?title=User:Callavsg&amp;diff=17567"/>
		<updated>2019-03-05T20:09:17Z</updated>

		<summary type="html">&lt;p&gt;Callavsg: Created page with &amp;quot;I&amp;#039;m a young developer from Germany :) Writing script for almost 10 years now and started coding in C/C++ when I was 12 years old.  Category:Script Creators&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;I&#039;m a young developer from Germany :)&lt;br /&gt;
Writing script for almost 10 years now and started coding in C/C++ when I was 12 years old.&lt;br /&gt;
&lt;br /&gt;
[[Category:Script Creators]]&lt;/div&gt;</summary>
		<author><name>Callavsg</name></author>
	</entry>
	<entry>
		<id>https://wiki.trainzsimulator.com/index.php?title=MiniBrowser_Feature_Requests&amp;diff=17566</id>
		<title>MiniBrowser Feature Requests</title>
		<link rel="alternate" type="text/html" href="https://wiki.trainzsimulator.com/index.php?title=MiniBrowser_Feature_Requests&amp;diff=17566"/>
		<updated>2019-03-05T20:01:39Z</updated>

		<summary type="html">&lt;p&gt;Callavsg: /* Requests */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page is where the scripting community gets to post MiniBrowser-specific feature requests. Request any additions that you think will enhance the game. Things to keep in mind: &lt;br /&gt;
&lt;br /&gt;
* We are unlikely to add a feature which breaks any existing content. &lt;br /&gt;
* The [[MiniBrowser]] is for high-performance interface layout, not web browsing. We are not going to spend significant resources on adding the functionality or standards compliance found in a regular browser. If you need a regular browser, try [[Trainz Online]] instead.&lt;br /&gt;
* We are far more likely to add features which are directly blocking something that the community is working on. If you have something cool, and need just a few minor additions then please detail what you&#039;re working on (ideally, on another wiki page linked from both here and your [[Content Creation Groups]] page) and why you need the additions.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Requests==&lt;br /&gt;
Requests are placed in this section by the community, for discussion and possible inclusion. Requests here may or may not make it into TS2009.&lt;br /&gt;
* Refering to the &#039;Image&#039; class that is currently only used in servlets (I think), it&#039;d be nice, if we could use it via the trainz-object minibrowser tag :) - callavsg&lt;br /&gt;
&lt;br /&gt;
* I&#039;m looking for an option to take the property window of an asset out to a browser object, that is visible in the GUI. - callavsg&lt;br /&gt;
&lt;br /&gt;
* I refer to the Asset &#039;Properties Window&#039; or &#039;Dialogue Box&#039; - Since TS 2010(09?) its been possible to copy and paste to the asset &#039;Name:&#039; area.  Could it be extended to allow &#039;copy&#039; from the Properties Window itself?  Some of my assets have encoded values in the Properties Window that allow saving settings to a map, (Route).  At the moment these have to be typed-in to the &#039;Name:&#039; area.  Copy and pasting this changing data would reduce errors here and make it simpler. - Boat.&lt;br /&gt;
&lt;br /&gt;
* I would like to ba able to open a minibrowser and load a HTML page that is located outside of the Trains Asset environment.  If you could provide a variation of the loadpage command that could open an HTML file located any where on my PC, it would be a big help to me..  I know the minibrowser has limited html capability, but it is sufficient for my proposed application... Thanks, PEV&lt;br /&gt;
&lt;br /&gt;
==Short List==&lt;br /&gt;
Requests are placed into this section by Auran if they are somewhat likely to make it into the TS2009 product. Requests from this list will be serviced by Auran as time permits.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Complete==&lt;br /&gt;
&lt;br /&gt;
* [[MiniBrowser]] to have left/right/center text image alignment.&lt;br /&gt;
&lt;br /&gt;
* Positioning text and images freely in the 2D space of the browser would have been also a great relief. - [[User:Klausm|Klausm]]&lt;br /&gt;
&lt;br /&gt;
* [[MiniBrowser]]: my TrackView rule periodically replaced the content of the browser. Unfortunately, if a user clicked on the link shortly before or after the update (could not be determined exactly), the click was somehow lost in the system. It could have been my fault, but back then I believed it was Aurans&#039; - [[User:Klausm|Klausm]]&lt;br /&gt;
: &#039;&#039;I&#039;m not aware of any bug that fits this description. We&#039;ll need more details and/or a repro case if you want anything done about this. ~chris&#039;&#039;&lt;br /&gt;
:: if you download my [http://www.malorny.de/vrails/download/TrackView-1.0.2.cdp TrackView Rule], add it to a layout of your choice and configure a rather high update rate (eg. 100-200ms or even below), you will notice that with an increasing update rate, more clicks on facing junction symbols are lost. Since the processing of the clicks does not depend on any internal state, I see the problem within Trainz itself. Source code can be provided if need be.&lt;br /&gt;
::: &#039;&#039;Okay, i think I understand what you&#039;re describing. There will be a one-frame delay between you refreshing the HTML string, and the layout engine formatting it. If you are doing this often enough, then clicks against the browser could easily fail due to no formatted text being present at the time of the click. I&#039;d strongly recommend changing your code so that you don&#039;t have to submit changes this often - try using trainzobject or trainztext tags instead - but I&#039;ll leave the request open for now.&#039;&#039; ~chris&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Rejected==&lt;br /&gt;
If there&#039;s a request that we&#039;re clearly not going to entertain at the current time, we&#039;ll move it to here. This includes both flat rejections and also requests which sound good but won&#039;t be done for the next version of Trainz.&lt;br /&gt;
&lt;br /&gt;
* Minibrowser able to show animated gifs (including tranparency) ~Jenolan&lt;br /&gt;
: &#039;&#039;GIF is a pretty dated format in general, and not one that we want to promote. TGAs support transparency and we don&#039;t support animated textures so there won&#039;t be any animated image support in the [[MiniBrowser]]. ~chris&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* [[MiniBrowser]]: well, it probably would deserve an own page for the wishes. One improvement could be some kind of DOM like access to the content. This would reduce the need to regenerate the content of the window from scratch each time.  - [[User:Klausm|Klausm]]&lt;br /&gt;
: &#039;&#039;Are you aware of the ability to embed child browsers and update their content without modifying the parent? It&#039;s not clear what you&#039;re looking for here so I&#039;m not sure if that is sufficient for your needs. ~chris&#039;&#039;&lt;br /&gt;
: &#039;&#039;Rejected due to lack of updates. ~chris&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Feature Request]]&lt;/div&gt;</summary>
		<author><name>Callavsg</name></author>
	</entry>
	<entry>
		<id>https://wiki.trainzsimulator.com/index.php?title=MiniBrowser_Feature_Requests&amp;diff=17565</id>
		<title>MiniBrowser Feature Requests</title>
		<link rel="alternate" type="text/html" href="https://wiki.trainzsimulator.com/index.php?title=MiniBrowser_Feature_Requests&amp;diff=17565"/>
		<updated>2019-03-05T20:01:25Z</updated>

		<summary type="html">&lt;p&gt;Callavsg: /* Requests */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page is where the scripting community gets to post MiniBrowser-specific feature requests. Request any additions that you think will enhance the game. Things to keep in mind: &lt;br /&gt;
&lt;br /&gt;
* We are unlikely to add a feature which breaks any existing content. &lt;br /&gt;
* The [[MiniBrowser]] is for high-performance interface layout, not web browsing. We are not going to spend significant resources on adding the functionality or standards compliance found in a regular browser. If you need a regular browser, try [[Trainz Online]] instead.&lt;br /&gt;
* We are far more likely to add features which are directly blocking something that the community is working on. If you have something cool, and need just a few minor additions then please detail what you&#039;re working on (ideally, on another wiki page linked from both here and your [[Content Creation Groups]] page) and why you need the additions.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Requests==&lt;br /&gt;
Requests are placed in this section by the community, for discussion and possible inclusion. Requests here may or may not make it into TS2009.&lt;br /&gt;
* Refering to the &#039;Image&#039; class that is currently only used in servlets (I think), it&#039;d be nice, if we could use it via the trainz-object minibrowser tag :)&lt;br /&gt;
&lt;br /&gt;
* I&#039;m looking for an option to take the property window of an asset out to a browser object, that is visible in the GUI. - callavsg&lt;br /&gt;
&lt;br /&gt;
* I refer to the Asset &#039;Properties Window&#039; or &#039;Dialogue Box&#039; - Since TS 2010(09?) its been possible to copy and paste to the asset &#039;Name:&#039; area.  Could it be extended to allow &#039;copy&#039; from the Properties Window itself?  Some of my assets have encoded values in the Properties Window that allow saving settings to a map, (Route).  At the moment these have to be typed-in to the &#039;Name:&#039; area.  Copy and pasting this changing data would reduce errors here and make it simpler. - Boat.&lt;br /&gt;
&lt;br /&gt;
* I would like to ba able to open a minibrowser and load a HTML page that is located outside of the Trains Asset environment.  If you could provide a variation of the loadpage command that could open an HTML file located any where on my PC, it would be a big help to me..  I know the minibrowser has limited html capability, but it is sufficient for my proposed application... Thanks, PEV&lt;br /&gt;
&lt;br /&gt;
==Short List==&lt;br /&gt;
Requests are placed into this section by Auran if they are somewhat likely to make it into the TS2009 product. Requests from this list will be serviced by Auran as time permits.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Complete==&lt;br /&gt;
&lt;br /&gt;
* [[MiniBrowser]] to have left/right/center text image alignment.&lt;br /&gt;
&lt;br /&gt;
* Positioning text and images freely in the 2D space of the browser would have been also a great relief. - [[User:Klausm|Klausm]]&lt;br /&gt;
&lt;br /&gt;
* [[MiniBrowser]]: my TrackView rule periodically replaced the content of the browser. Unfortunately, if a user clicked on the link shortly before or after the update (could not be determined exactly), the click was somehow lost in the system. It could have been my fault, but back then I believed it was Aurans&#039; - [[User:Klausm|Klausm]]&lt;br /&gt;
: &#039;&#039;I&#039;m not aware of any bug that fits this description. We&#039;ll need more details and/or a repro case if you want anything done about this. ~chris&#039;&#039;&lt;br /&gt;
:: if you download my [http://www.malorny.de/vrails/download/TrackView-1.0.2.cdp TrackView Rule], add it to a layout of your choice and configure a rather high update rate (eg. 100-200ms or even below), you will notice that with an increasing update rate, more clicks on facing junction symbols are lost. Since the processing of the clicks does not depend on any internal state, I see the problem within Trainz itself. Source code can be provided if need be.&lt;br /&gt;
::: &#039;&#039;Okay, i think I understand what you&#039;re describing. There will be a one-frame delay between you refreshing the HTML string, and the layout engine formatting it. If you are doing this often enough, then clicks against the browser could easily fail due to no formatted text being present at the time of the click. I&#039;d strongly recommend changing your code so that you don&#039;t have to submit changes this often - try using trainzobject or trainztext tags instead - but I&#039;ll leave the request open for now.&#039;&#039; ~chris&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Rejected==&lt;br /&gt;
If there&#039;s a request that we&#039;re clearly not going to entertain at the current time, we&#039;ll move it to here. This includes both flat rejections and also requests which sound good but won&#039;t be done for the next version of Trainz.&lt;br /&gt;
&lt;br /&gt;
* Minibrowser able to show animated gifs (including tranparency) ~Jenolan&lt;br /&gt;
: &#039;&#039;GIF is a pretty dated format in general, and not one that we want to promote. TGAs support transparency and we don&#039;t support animated textures so there won&#039;t be any animated image support in the [[MiniBrowser]]. ~chris&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* [[MiniBrowser]]: well, it probably would deserve an own page for the wishes. One improvement could be some kind of DOM like access to the content. This would reduce the need to regenerate the content of the window from scratch each time.  - [[User:Klausm|Klausm]]&lt;br /&gt;
: &#039;&#039;Are you aware of the ability to embed child browsers and update their content without modifying the parent? It&#039;s not clear what you&#039;re looking for here so I&#039;m not sure if that is sufficient for your needs. ~chris&#039;&#039;&lt;br /&gt;
: &#039;&#039;Rejected due to lack of updates. ~chris&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Feature Request]]&lt;/div&gt;</summary>
		<author><name>Callavsg</name></author>
	</entry>
	<entry>
		<id>https://wiki.trainzsimulator.com/index.php?title=Class_Menu&amp;diff=11706</id>
		<title>Class Menu</title>
		<link rel="alternate" type="text/html" href="https://wiki.trainzsimulator.com/index.php?title=Class_Menu&amp;diff=11706"/>
		<updated>2018-03-22T23:49:09Z</updated>

		<summary type="html">&lt;p&gt;Callavsg: Created page with &amp;quot;*API Hierarchy **Menu &amp;lt;br&amp;gt; A menu is a list of items that can selected by the user with the mouse cursor. Menus can be constructed in hiera...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;*[[TrainzScript Language Reference|API Hierarchy]]&lt;br /&gt;
**Menu&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
A menu is a list of items that can selected by the user with the mouse cursor. Menus can be constructed in hierarchies so a menu item could open up a sub-menu of its own. Sub-menus can also have sub-menus of their own as well.  Menu items can have messages sent when clicked on.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Methods==&lt;br /&gt;
{{MethodHeader|public native void InitialiseAsMapObjectSelector(string sCategoryFilter, GameObject msgDst, string sMsgMajor)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;sCtageroyFilter&#039;&#039;&#039; = The category filter string for the MapObjects to be displayed&lt;br /&gt;
*&#039;&#039;&#039;msgDst&#039;&#039;&#039; = Receiver of a message containing the selection data&lt;br /&gt;
*&#039;&#039;&#039;sMsgMajor&#039;&#039;&#039; = A message major string&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Notes&lt;br /&gt;
*Initialises this Menu object to automatically add map objects matching a specific category filter. This menu will dynamically generate sorted sub-menus as required&lt;br /&gt;
*Upon selection of a menu item by the player, a message will be posted to msgDst, using the sMsgMajor string provided and with the message parameter soup containing the following data:&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;object-id       (GameObjectID) - The ID of the object selected&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;object-name     (string) - The localised name of the object selected&#039;&#039;&lt;/div&gt;</summary>
		<author><name>Callavsg</name></author>
	</entry>
	<entry>
		<id>https://wiki.trainzsimulator.com/index.php?title=TrainzScript_Library_Reference&amp;diff=11705</id>
		<title>TrainzScript Library Reference</title>
		<link rel="alternate" type="text/html" href="https://wiki.trainzsimulator.com/index.php?title=TrainzScript_Library_Reference&amp;diff=11705"/>
		<updated>2018-03-22T23:04:17Z</updated>

		<summary type="html">&lt;p&gt;Callavsg: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The following is a list of all classes provided by Auran for use with the Trainz game runtime environment. Some of these classes may not be available from other runtime environments. Please see the [[TrainzScript Language Reference]] for a list of the &amp;quot;core&amp;quot; TrainzScript classes that are present in all runtime environments. This list may not be complete, but will be extended in future.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Classes marked with an asterisk have no parent class.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*[[class GSObject|GSObject]] *&lt;br /&gt;
**[[class Asset|Asset]]&lt;br /&gt;
**[[class DLCInfo|DLCInfo]]&lt;br /&gt;
**[[class GameObjectID|GameObjectID]]&lt;br /&gt;
**[[class GameObject|GameObject]]&lt;br /&gt;
***[[class AsyncObjectSearchResult|AsyncObjectSearchResult]]&lt;br /&gt;
***[[class AsyncTrainzAssetSearchObject|AsyncTrainzAssetSearchObject]]&lt;br /&gt;
***[[class Browser|Browser]]&lt;br /&gt;
***[[class BrowserInterface|BrowserInterface]]&lt;br /&gt;
***[[class CabinControl|CabinControl]]&lt;br /&gt;
***[[class ConstructorsBase|ConstructorsBase]]&lt;br /&gt;
****[[class Constructors|Constructors]]&lt;br /&gt;
***[[class DLCStore|DLCStore]]&lt;br /&gt;
***[[class DriverCommand|DriverCommand]]&lt;br /&gt;
***[[class DriverCommands|DriverCommands]]&lt;br /&gt;
***[[class HTMLPropertyHandler|HTMLProprtyHandler]]&lt;br /&gt;
***[[class Interface|Interface]]&lt;br /&gt;
***[[class InterlockingTowerPath|InterlockingTowerPath]]&lt;br /&gt;
***[[class JunctionBaseGameObject|JunctionBaseGameObject]] (Additional parent class: [[class JunctionBase|JunctionBase]] *)&lt;br /&gt;
***[[class NavPoints|NavPoints]]&lt;br /&gt;
***[[class ChatChannel|ChatChannel]]&lt;br /&gt;
***[[class OnlineAccess|OnlineAccess]]&lt;br /&gt;
***[[class OnlineGroup|OnlineGroup]]&lt;br /&gt;
***[[class Track|Track]]&lt;br /&gt;
***[[class TrackCircuitBlock|TrackCircuitBlock]]&lt;br /&gt;
***[[class Train|Train]]&lt;br /&gt;
***[[class TrainzAssetSearch|TrainzAssetSearch]]&lt;br /&gt;
***[[class TrainzGameObject|TrainzGameObject]]&lt;br /&gt;
****[[class GameplayMenuBase|GameplayMenuBase]]&lt;br /&gt;
*****[[class GameplayMenu|GameplayMenu]]&lt;br /&gt;
*****[[class GameplayMenuMobile|GameplayMenuMobile]]&lt;br /&gt;
****[[class Library|Library]] (Additional parent class: [[class PropertyObject|PropertyObject]] *)&lt;br /&gt;
*****[[class OAChat|OAChat]]&lt;br /&gt;
*****[[class Servlet|Servlet]]&lt;br /&gt;
*****[[class SessionVariables|SessionVariables]]&lt;br /&gt;
*****[[class WaybillManager|WaybillManager]]&lt;br /&gt;
****[[class MeshObject|MeshObject]] (Additional parent class: [[class PropertyObject|PropertyObject]] *)&lt;br /&gt;
*****[[class Bogey|Bogey]]&lt;br /&gt;
*****[[class Cabin|Cabin]]&lt;br /&gt;
*****[[class MapObject|MapObject]]&lt;br /&gt;
******[[class InterlockingTower|InterlockingTower]]&lt;br /&gt;
******[[class SceneryWithTrack|SceneryWithTrack]]&lt;br /&gt;
*******[[class Buildable|Buildable]]&lt;br /&gt;
********[[class Industry|Industry]]&lt;br /&gt;
*********[[class BaseIndustry|BaseIndustry]]&lt;br /&gt;
**********[[class GenericPassengerStation|GenericPassengerStation]]&lt;br /&gt;
*********[[class BasePortal|BasePortal]]&lt;br /&gt;
*********[[class GenericIndustry|GenericIndustry]]&lt;br /&gt;
*******[[class Crossing|Crossing]]&lt;br /&gt;
*******[[class TurnTable|TurnTable]]&lt;br /&gt;
******[[class Trackside|Trackside]]&lt;br /&gt;
*******[[class CarSignal|CarSignal]]&lt;br /&gt;
*******[[class Junction|Junction]] (Additional parent class: [[class JunctionBase|JunctionBase]] *)&lt;br /&gt;
*******[[class Signal|Signal]]&lt;br /&gt;
*******[[class TrackMark|TrackMark]]&lt;br /&gt;
*******[[class Trigger|Trigger]]&lt;br /&gt;
*******[[class Vehicle|Vehicle]]&lt;br /&gt;
********[[class Locomotive|Locomotive]]&lt;br /&gt;
****[[class ModulScript|ModulScript]]&lt;br /&gt;
*****[[class DriverCharacter|DriverCharacter]]&lt;br /&gt;
****[[class ScenarioBehavior|ScenarioBehavior]]&lt;br /&gt;
*****[[class ConditionalScenarioBehavior|ConditionalScenarioBehavior]]&lt;br /&gt;
*****[[class ScenarioBehaviorTemplate|ScenarioBehaviorTemplate]]&lt;br /&gt;
***[[class TrainzScriptBase|TrainzScriptBase]]&lt;br /&gt;
****[[class World|World]]&lt;br /&gt;
***[[class World1|World1]]&lt;br /&gt;
**[[class HTMLBuffer|HTMLBuffer]]&lt;br /&gt;
**[[class IndustryTrainController|IndustryTrainController]]&lt;br /&gt;
**[[class KUID|KUID]]&lt;br /&gt;
**[[class KUIDList|KUIDList]]&lt;br /&gt;
**[[class LoadingReport|LoadingReport]]&lt;br /&gt;
**[[class Menu|Menu]]&lt;br /&gt;
**[[class Permit|Permit]]&lt;br /&gt;
**[[class ProductFilter|ProductFilter]]&lt;br /&gt;
**[[class ProductQueue|ProductQueue]]&lt;br /&gt;
**[[class SecurityToken|SecurityToken]]&lt;br /&gt;
**[[class Soup|Soup]]&lt;br /&gt;
**[[class StringTable|StringTable]]&lt;br /&gt;
**[[class TrackPathDisplay|TrackPathDisplay]]&lt;br /&gt;
**[[class TrainTimeTable|TrainTimeTable]]&lt;br /&gt;
*[[class GSTrackSearch|GSTrackSearch]] *&lt;br /&gt;
*[[class Math|Math]] *&lt;br /&gt;
*[[class Router|Router]] *&lt;br /&gt;
*[[class Str|Str]] *&lt;br /&gt;
*[[class TrainUtil|TrainUtil]] *&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Categories=&lt;br /&gt;
[[Category:TrainzScript]]&lt;/div&gt;</summary>
		<author><name>Callavsg</name></author>
	</entry>
	<entry>
		<id>https://wiki.trainzsimulator.com/index.php?title=TrainzScript_Library_Reference&amp;diff=11704</id>
		<title>TrainzScript Library Reference</title>
		<link rel="alternate" type="text/html" href="https://wiki.trainzsimulator.com/index.php?title=TrainzScript_Library_Reference&amp;diff=11704"/>
		<updated>2018-03-22T11:54:35Z</updated>

		<summary type="html">&lt;p&gt;Callavsg: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The following is a list of all classes provided by Auran for use with the Trainz game runtime environment. Some of these classes may not be available from other runtime environments. Please see the [[TrainzScript Language Reference]] for a list of the &amp;quot;core&amp;quot; TrainzScript classes that are present in all runtime environments. This list may not be complete, but will be extended in future.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Classes marked with an asterisk have no parent class.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*[[class GSObject|GSObject]] *&lt;br /&gt;
**[[class Asset|Asset]]&lt;br /&gt;
**[[class DLCInfo|DLCInfo]]&lt;br /&gt;
**[[class GameObjectID|GameObjectID]]&lt;br /&gt;
**[[class GameObject|GameObject]]&lt;br /&gt;
***[[class AsyncObjectSearchResult|AsyncObjectSearchResult]]&lt;br /&gt;
***[[class AsyncTrainzAssetSearchObject|AsyncTrainzAssetSearchObject]]&lt;br /&gt;
***[[class Browser|Browser]]&lt;br /&gt;
***[[class BrowserInterface|BrowserInterface]]&lt;br /&gt;
***[[class CabinControl|CabinControl]]&lt;br /&gt;
***[[class ConstructorsBase|ConstructorsBase]]&lt;br /&gt;
****[[class Constructors|Constructors]]&lt;br /&gt;
***[[class DLCStore|DLCStore]]&lt;br /&gt;
***[[class DriverCommand|DriverCommand]]&lt;br /&gt;
***[[class DriverCommands|DriverCommands]]&lt;br /&gt;
***[[class HTMLPropertyHandler|HTMLProprtyHandler]]&lt;br /&gt;
***[[class Interface|Interface]]&lt;br /&gt;
***[[class InterlockingTowerPath|InterlockingTowerPath]]&lt;br /&gt;
***[[class JunctionBaseGameObject|JunctionBaseGameObject]] (Additional parent class: [[class JunctionBase|JunctionBase]] *)&lt;br /&gt;
***[[class NavPoints|NavPoints]]&lt;br /&gt;
***[[class ChatChannel|ChatChannel]]&lt;br /&gt;
***[[class OnlineAccess|OnlineAccess]]&lt;br /&gt;
***[[class OnlineGroup|OnlineGroup]]&lt;br /&gt;
***[[class Track|Track]]&lt;br /&gt;
***[[class TrackCircuitBlock|TrackCircuitBlock]]&lt;br /&gt;
***[[class Train|Train]]&lt;br /&gt;
***[[class TrainzAssetSearch|TrainzAssetSearch]]&lt;br /&gt;
***[[class TrainzGameObject|TrainzGameObject]]&lt;br /&gt;
****[[class GameplayMenuBase|GameplayMenuBase]]&lt;br /&gt;
*****[[class GameplayMenu|GameplayMenu]]&lt;br /&gt;
*****[[class GameplayMenuMobile|GameplayMenuMobile]]&lt;br /&gt;
****[[class Library|Library]] (Additional parent class: [[class PropertyObject|PropertyObject]] *)&lt;br /&gt;
*****[[class OAChat|OAChat]]&lt;br /&gt;
*****[[class Servlet|Servlet]]&lt;br /&gt;
*****[[class SessionVariables|SessionVariables]]&lt;br /&gt;
*****[[class WaybillManager|WaybillManager]]&lt;br /&gt;
****[[class MeshObject|MeshObject]] (Additional parent class: [[class PropertyObject|PropertyObject]] *)&lt;br /&gt;
*****[[class Bogey|Bogey]]&lt;br /&gt;
*****[[class Cabin|Cabin]]&lt;br /&gt;
*****[[class MapObject|MapObject]]&lt;br /&gt;
******[[class InterlockingTower|InterlockingTower]]&lt;br /&gt;
******[[class SceneryWithTrack|SceneryWithTrack]]&lt;br /&gt;
*******[[class Buildable|Buildable]]&lt;br /&gt;
********[[class Industry|Industry]]&lt;br /&gt;
*********[[class BaseIndustry|BaseIndustry]]&lt;br /&gt;
**********[[class GenericPassengerStation|GenericPassengerStation]]&lt;br /&gt;
*********[[class BasePortal|BasePortal]]&lt;br /&gt;
*********[[class GenericIndustry|GenericIndustry]]&lt;br /&gt;
*******[[class Crossing|Crossing]]&lt;br /&gt;
*******[[class TurnTable|TurnTable]]&lt;br /&gt;
******[[class Trackside|Trackside]]&lt;br /&gt;
*******[[class CarSignal|CarSignal]]&lt;br /&gt;
*******[[class Junction|Junction]] (Additional parent class: [[class JunctionBase|JunctionBase]] *)&lt;br /&gt;
*******[[class Signal|Signal]]&lt;br /&gt;
*******[[class TrackMark|TrackMark]]&lt;br /&gt;
*******[[class Trigger|Trigger]]&lt;br /&gt;
*******[[class Vehicle|Vehicle]]&lt;br /&gt;
********[[class Locomotive|Locomotive]]&lt;br /&gt;
****[[class ModulScript|ModulScript]]&lt;br /&gt;
*****[[class DriverCharacter|DriverCharacter]]&lt;br /&gt;
****[[class ScenarioBehavior|ScenarioBehavior]]&lt;br /&gt;
*****[[class ConditionalScenarioBehavior|ConditionalScenarioBehavior]]&lt;br /&gt;
*****[[class ScenarioBehaviorTemplate|ScenarioBehaviorTemplate]]&lt;br /&gt;
***[[class TrainzScriptBase|TrainzScriptBase]]&lt;br /&gt;
****[[class World|World]]&lt;br /&gt;
***[[class World1|World1]]&lt;br /&gt;
**[[class HTMLBuffer|HTMLBuffer]]&lt;br /&gt;
**[[class IndustryTrainController|IndustryTrainController]]&lt;br /&gt;
**[[class KUID|KUID]]&lt;br /&gt;
**[[class KUIDList|KUIDList]]&lt;br /&gt;
**[[class LoadingReport|LoadingReport]]&lt;br /&gt;
**[[class Menu|Menu]]&lt;br /&gt;
**[[class Permit|Permit]]&lt;br /&gt;
**[[class ProductFilter|ProductFilter]]&lt;br /&gt;
**[[class ProductQueue|ProductQueue]]&lt;br /&gt;
**[[class SecurityToken|SecurityToken]]&lt;br /&gt;
**[[class Soup|Soup]]&lt;br /&gt;
**[[class StringTable|StringTable]]&lt;br /&gt;
**[[class TrackPathDisplay|TrackPathDisplay]]&lt;br /&gt;
**[[class TrainTimeTable|TrainTimeTable]]&lt;br /&gt;
*[[class GSTrackSearch|GSTrackSearch]] *&lt;br /&gt;
*[[Class Interface|Interface]] *&lt;br /&gt;
*[[class Math|Math]] *&lt;br /&gt;
*[[class Router|Router]] *&lt;br /&gt;
*[[class Str|Str]] *&lt;br /&gt;
*[[class TrainUtil|TrainUtil]] *&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Categories=&lt;br /&gt;
[[Category:TrainzScript]]&lt;/div&gt;</summary>
		<author><name>Callavsg</name></author>
	</entry>
	<entry>
		<id>https://wiki.trainzsimulator.com/index.php?title=MiniBrowser_Feature_Requests&amp;diff=11681</id>
		<title>MiniBrowser Feature Requests</title>
		<link rel="alternate" type="text/html" href="https://wiki.trainzsimulator.com/index.php?title=MiniBrowser_Feature_Requests&amp;diff=11681"/>
		<updated>2018-03-09T15:12:22Z</updated>

		<summary type="html">&lt;p&gt;Callavsg: /* Requests */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page is where the scripting community gets to post MiniBrowser-specific feature requests. Request any additions that you think will enhance the game. Things to keep in mind: &lt;br /&gt;
&lt;br /&gt;
* We are unlikely to add a feature which breaks any existing content. &lt;br /&gt;
* The [[MiniBrowser]] is for high-performance interface layout, not web browsing. We are not going to spend significant resources on adding the functionality or standards compliance found in a regular browser. If you need a regular browser, try [[Trainz Online]] instead.&lt;br /&gt;
* We are far more likely to add features which are directly blocking something that the community is working on. If you have something cool, and need just a few minor additions then please detail what you&#039;re working on (ideally, on another wiki page linked from both here and your [[Content Creation Groups]] page) and why you need the additions.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Requests==&lt;br /&gt;
Requests are placed in this section by the community, for discussion and possible inclusion. Requests here may or may not make it into TS2009.&lt;br /&gt;
&lt;br /&gt;
* I&#039;m looking for an option to take the property window of an asset out to a browser object, that is visible in the GUI. - callavsg&lt;br /&gt;
&lt;br /&gt;
* I refer to the Asset &#039;Properties Window&#039; or &#039;Dialogue Box&#039; - Since TS 2010(09?) its been possible to copy and paste to the asset &#039;Name:&#039; area.  Could it be extended to allow &#039;copy&#039; from the Properties Window itself?  Some of my assets have encoded values in the Properties Window that allow saving settings to a map, (Route).  At the moment these have to be typed-in to the &#039;Name:&#039; area.  Copy and pasting this changing data would reduce errors here and make it simpler. - Boat.&lt;br /&gt;
&lt;br /&gt;
* I would like to ba able to open a minibrowser and load a HTML page that is located outside of the Trains Asset environment.  If you could provide a variation of the loadpage command that could open an HTML file located any where on my PC, it would be a big help to me..  I know the minibrowser has limited html capability, but it is sufficient for my proposed application... Thanks, PEV&lt;br /&gt;
&lt;br /&gt;
==Short List==&lt;br /&gt;
Requests are placed into this section by Auran if they are somewhat likely to make it into the TS2009 product. Requests from this list will be serviced by Auran as time permits.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Complete==&lt;br /&gt;
&lt;br /&gt;
* [[MiniBrowser]] to have left/right/center text image alignment.&lt;br /&gt;
&lt;br /&gt;
* Positioning text and images freely in the 2D space of the browser would have been also a great relief. - [[User:Klausm|Klausm]]&lt;br /&gt;
&lt;br /&gt;
* [[MiniBrowser]]: my TrackView rule periodically replaced the content of the browser. Unfortunately, if a user clicked on the link shortly before or after the update (could not be determined exactly), the click was somehow lost in the system. It could have been my fault, but back then I believed it was Aurans&#039; - [[User:Klausm|Klausm]]&lt;br /&gt;
: &#039;&#039;I&#039;m not aware of any bug that fits this description. We&#039;ll need more details and/or a repro case if you want anything done about this. ~chris&#039;&#039;&lt;br /&gt;
:: if you download my [http://www.malorny.de/vrails/download/TrackView-1.0.2.cdp TrackView Rule], add it to a layout of your choice and configure a rather high update rate (eg. 100-200ms or even below), you will notice that with an increasing update rate, more clicks on facing junction symbols are lost. Since the processing of the clicks does not depend on any internal state, I see the problem within Trainz itself. Source code can be provided if need be.&lt;br /&gt;
::: &#039;&#039;Okay, i think I understand what you&#039;re describing. There will be a one-frame delay between you refreshing the HTML string, and the layout engine formatting it. If you are doing this often enough, then clicks against the browser could easily fail due to no formatted text being present at the time of the click. I&#039;d strongly recommend changing your code so that you don&#039;t have to submit changes this often - try using trainzobject or trainztext tags instead - but I&#039;ll leave the request open for now.&#039;&#039; ~chris&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Rejected==&lt;br /&gt;
If there&#039;s a request that we&#039;re clearly not going to entertain at the current time, we&#039;ll move it to here. This includes both flat rejections and also requests which sound good but won&#039;t be done for the next version of Trainz.&lt;br /&gt;
&lt;br /&gt;
* Minibrowser able to show animated gifs (including tranparency) ~Jenolan&lt;br /&gt;
: &#039;&#039;GIF is a pretty dated format in general, and not one that we want to promote. TGAs support transparency and we don&#039;t support animated textures so there won&#039;t be any animated image support in the [[MiniBrowser]]. ~chris&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* [[MiniBrowser]]: well, it probably would deserve an own page for the wishes. One improvement could be some kind of DOM like access to the content. This would reduce the need to regenerate the content of the window from scratch each time.  - [[User:Klausm|Klausm]]&lt;br /&gt;
: &#039;&#039;Are you aware of the ability to embed child browsers and update their content without modifying the parent? It&#039;s not clear what you&#039;re looking for here so I&#039;m not sure if that is sufficient for your needs. ~chris&#039;&#039;&lt;br /&gt;
: &#039;&#039;Rejected due to lack of updates. ~chris&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Feature Request]]&lt;/div&gt;</summary>
		<author><name>Callavsg</name></author>
	</entry>
	<entry>
		<id>https://wiki.trainzsimulator.com/index.php?title=Script_Feature_Requests&amp;diff=11680</id>
		<title>Script Feature Requests</title>
		<link rel="alternate" type="text/html" href="https://wiki.trainzsimulator.com/index.php?title=Script_Feature_Requests&amp;diff=11680"/>
		<updated>2018-03-09T15:08:01Z</updated>

		<summary type="html">&lt;p&gt;Callavsg: /* Requests */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page is where the [[scripting]] community gets to post all their API feature requests. Request any additions that you think will enhance the game. Things to keep in mind:&lt;br /&gt;
* We are unlikely to add a feature which breaks any existing content.&lt;br /&gt;
* Script is for control purposes, and is not intended to enable significant modifications to the underlying game engine. We are very unlikely to introduce a feature where the obvious uses are going to result in significant performance penalties.&lt;br /&gt;
* We are far more likely to add features which are directly blocking something that the community is working on. If you have something cool, and need just a few minor additions then please detail what you&#039;re working on (ideally, on another wiki page linked from both here and your [[Content Creation Groups]] page) and why you need the additions.&lt;br /&gt;
* [[MiniBrowser]] requests should go on the separate [[MiniBrowser Feature Requests]] page.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Requests==&lt;br /&gt;
Requests are placed in this section by the community, for discussion and possible inclusion.&lt;br /&gt;
&lt;br /&gt;
* Add a method that will let you identify the industry at which a vehicle is located. If an industry track section can also carry the industry identifier, it would be most helpful.&lt;br /&gt;
&lt;br /&gt;
* Add a handle to allow a custom bell animation to be played when the bell is played on a locomotive (Vehicle.StartBell() and Vehicle.StopBell(), perhaps?).  Justification: Script can currently listen for the bell message, but since the message is a toggle, it is easy to get out of synch with the true state of the bell. For example, when coupling a locomotive whose bell is ringing to a locomotive whose bell is not ringing, the end result depends on which locomotive is currently in focus. - Curtis&lt;br /&gt;
&lt;br /&gt;
* Scale the visible bulk load animation on a traincar such that it takes Vehicle.GetLoadTime() to complete.  For example, if Vehicle.GetLoadTime() returns 5 seconds, the bulk animation would take 5 seconds to transition from the full state to the empty state.  This would be useful for industries that take more than one second to load / unload a car, as the visible load animation could be synced more closely with the industry animation. -Curtis&lt;br /&gt;
&lt;br /&gt;
* Extension to the function World.GetAssetList(string kind, bool OnlyIfUsedInCurrentMap) -Andi06&lt;br /&gt;
&lt;br /&gt;
* Ability to play an avi and wait for it to finsh (no user interaction allowed) ~Jenolan&lt;br /&gt;
&lt;br /&gt;
* The ability to modify scenery trigger radii on the fly in script. This is really aimed at crossings so that train detection can be varied in line with track speed limits.  -Andi06&lt;br /&gt;
&lt;br /&gt;
* A method of refreshing the Property Browser to take account of any change in the target object&#039;s name during a property editing session. (Objects which have &#039;autoname 1&#039; in config will often be renamed by the user.  In some circumstances I am using the object name to set other properties. Typically an object might be created as &#039;Double Slip 1&#039; and might refer to its constituent nodes as &#039;Double Slip 1,Track 1&#039;.  This is to enable other objects to refer to it in a user friendly way.  On a name change the Property Browser continues to use the old name until the browser has been closed and reopened.  This is counter intuitive) -Andi&lt;br /&gt;
&lt;br /&gt;
* Ability for a script to be able to read/change loco/rolling stock parameters (ie to simulate one loco losing air etc etc etc) ~Jenolan&lt;br /&gt;
&lt;br /&gt;
* SetFXCoronaTexture() A means of resetting to config.txt defaults.&lt;br /&gt;
&lt;br /&gt;
* Be able to play mp3 as well as wav. ~Jenolan&lt;br /&gt;
: &#039;&#039;I&#039;ve been able to do this where the asset doing the playing is a script library, I had Acker Bilk coming over a station tannoy at one point.  Not sure why it doesn&#039;t seem to work elsewhere. -Andi&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Interface.MessageBox(Caption,Text), calling up a small browser with a close button would be helpful, especially for novices. Interface.Print() is a monumental PITA because it prints out upside down, doesn&#039;t hold enough lines, and only works in Driver. For sure its possible to write your own version of this but browsers aren&#039;t all that easy to get your head around and its a very basic facility that should be built in. -Andi&lt;br /&gt;
&lt;br /&gt;
* A standard config.txt tag &#039;junction-type normal/singleslip/doubleslip&#039; etc together with a spec for construction and behaviour might be helpful. I already have a complete schema for this. -Andi&lt;br /&gt;
: &#039;&#039;Uncertain what you&#039;re expecting to achieve here? -chris&#039;&#039;&lt;br /&gt;
: &#039;&#039;see Animated Fixed Junctions Thread&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Is it possible to make a mesh available which matches the existing graphic direction indicators, it appears to be some sort of directional corona or variant. If not could a new marker mesh be developed that could be used with both types? The existing one has nasty alpha effects in any case. -Andi&lt;br /&gt;
&lt;br /&gt;
* Ability to dynamically change the length of a piece of rolling stock as part of the load / unload process; to support logging disconnects (see http://www.trainzone.co.nz/logging.htm for examples)- Curtis&lt;br /&gt;
: &#039;&#039;This is an interesting concept, but sounds difficult to implement. I can&#039;t think of any way of adjusting the length unless it was the end item of a consist, since adjustment at any other time would require displacing the remainder of the consist. Could you expand on your ideas please.&#039;&#039; -chris&lt;br /&gt;
: &#039;&#039;The entire car, including lmfront &amp;amp; lmback, would be part of the loading / unloading animation. When loading, it would probably be necessary to displace the consist by moving one of the ends - perhaps the end with the locomotive? Potential issue: if when loading, the increase in consist length causes the end of the consist to run off the end of the track or collide with another train.  When unloading, you could break the consist at either or both lmfront / lmback - whichever move as part of the unloading animation.&#039;&#039; - Curtis&lt;br /&gt;
: &#039;&#039;May be simpler to just break the consist at both lmfront and lmback; centering the car in-between the two halves. -Curtis&lt;br /&gt;
&lt;br /&gt;
*Allow SetFXNameText(effect,text) to accept an empty string in the second parameter - Reason: It&#039;s really irritating having to write workarounds for this. ~Andi&lt;br /&gt;
&lt;br /&gt;
*SetMeshScale(X,Y,Z) and corresponding config tags. Positive or negative values would implement mesh mirroring at the same time. As an example of potential a placement option for trees might allow random scale factors (within reasonable limits) and random rotation.  Each tree placed would then vary in size, shape and rotation getting much more variation from the same mesh asset. ~Andi&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Update to product loading / unloading functionality to allow incremental loads and unloads.&lt;br /&gt;
:Potential usages:  &lt;br /&gt;
:- Animation that plays once per item being loaded; such as a forklift carrying a crate to a boxcar, or a crane lifting a log to a flatcar.&lt;br /&gt;
:- Allow dynamic load times of bulk loads (small cars load faster than large cars), with the animated load rising / lowering synchronously.&lt;br /&gt;
&lt;br /&gt;
:Potential implementation:&lt;br /&gt;
:Extend vehicle.LoadProduct(report,units) where units = integer number of queue to be loaded each increment.  0 would be everything, defaulting to current LoadProduct() behavior, and add additional calls BeginIncrementalLoad(), EndIncrementalLoad(), BeginIncrementalUnload(), and EndIncrementalUnload().&lt;br /&gt;
&lt;br /&gt;
:During a load operation that loads 3 increments (units=1, target queue on the car = 3), the flow would look like:&lt;br /&gt;
 BeginLoad() // open car doors; station doors&lt;br /&gt;
 &lt;br /&gt;
 BeginIncrementalLoad() //  start loading animation, start sounds; pfx; add any delays&lt;br /&gt;
 TransferProductFrom() // maximumToTransfer = units&lt;br /&gt;
 EndIncrementalLoad() // animate forklift returning to station / end sounds / pfx / other cleanup&lt;br /&gt;
 &lt;br /&gt;
 BeginIncrementalLoad()&lt;br /&gt;
 TransferProductFrom()&lt;br /&gt;
 EndIncrementalLoad()&lt;br /&gt;
 &lt;br /&gt;
 BeginIncrementalLoad()&lt;br /&gt;
 TransferProductFrom()&lt;br /&gt;
 EndIncrementalLoad()&lt;br /&gt;
 &lt;br /&gt;
 EndLoad() // close car &amp;amp; station doors&lt;br /&gt;
&lt;br /&gt;
* Ability to add a vehicle to an existing consist like Vehicle.Reposition( Train, MyCouple, OtherCouple ) this would save needing a work track mark to add vehicles which would be very helpful ~Jenolan&lt;br /&gt;
&lt;br /&gt;
* Extension to AddHandler to allow this syntax: AddHandler(target,&amp;quot;&amp;quot;,&amp;quot;&amp;quot;,&amp;quot;MessageHandler&amp;quot;), passing all messages to the specified handler, for justification see discussion page. -Andi&lt;br /&gt;
&lt;br /&gt;
* Ability to store any information along with the layout and not the session (i.e. &#039;&#039;PropertyObject.SetLayoutProperties&#039;&#039; and &#039;&#039;PropertyObject.GetLayoutProperties&#039;&#039;, taking/returning &#039;&#039;Soup&#039;&#039; objects respectively). Rationale: the non-existence is a major drawback with configurable signals - [[User:Klausm|Klausm]]&lt;br /&gt;
&lt;br /&gt;
* Access to asset location, height, rotation in script.  This came up twice - once when I wanted to keep traffic lights upright when the containing asset is rolled, and once when I wanted to add simple real time ground shadows to assets. -Andi06&lt;br /&gt;
&lt;br /&gt;
* Ability to arbitrarily add an attachment point to an item. To allow things like FRED/BOG sundry animations and so on ~Jenolan&lt;br /&gt;
&lt;br /&gt;
* Not really script. A generic clickable mesh object, its an easy hack using a fixedtrack junction but it would nice to have an official version - click on the engine shed to open the doors, click on the signal box to open a track browser etc etc. Mappable click regions too if its not too much to ask :-) -Andi&lt;br /&gt;
&lt;br /&gt;
* Extension/Alternative to World.GetJunctionList to return fixed track junction objects or nodes, I can script this easily for objects using my library but this would not be the case for all junctions. -Andi&lt;br /&gt;
&lt;br /&gt;
* World.Play2DSound(Asset,filename) allows sound files to be saved in a &#039;sound library&#039; asset and avoids duplication.  Can we have a similar facility for images to be used in html assets.  A lot of the dependencies that I use are images and icons.  I&#039;m consciously trying to avoid this now - its the source of much pain - but to do this for the Junction Kit for instance I would have to have copies of all necessary images in all of the placeable assets (there are more than 50) If I could simply keep one copy in the script library it would save much bandwidth, diskspace and support. -Andi06&lt;br /&gt;
&lt;br /&gt;
* genesteal : cab features.&lt;br /&gt;
- methods for light controls in cabin : Control.SetFlash (float frequency).Make the control visible/invisible on the intervall frequency. may be Meshobjects.gs for more general purpose. The same for texture swapping in texture replacement.&lt;br /&gt;
- New conrol cab &amp;quot;button&amp;quot; with vertical translation limit : method set and get value as usual, method for &amp;quot;while depressed&amp;quot; behavior: Setdepressed ( method to run).&lt;br /&gt;
&lt;br /&gt;
- Speedlimiter method : Set a speedlimit replacing the max speed possible on cab mode.(engine)&lt;br /&gt;
&lt;br /&gt;
- Set engine methods : &lt;br /&gt;
Locomotive.SwapEngine(kuid); replace engine by another for a locomotive. feature existing on actual loco to set a traction service if the loco have to drive freight or passengers consists. This method can replace speedlimit above and may be more accurate : speedlimit and power will be set together as prototypical setting before a journey. &lt;br /&gt;
- Locomotive.EngineStop(): stops the enginesound  and play a stop.wav, located in enginesound folder.&lt;br /&gt;
- Locomotive.EngineStart() : starts enginesound like this : play  a start.wav located in enginesound folder, then idle 0.wav.&lt;br /&gt;
&lt;br /&gt;
* Allow function Vehicle.SetTractionMultiplier(float) to set multiplier to 0. ~Mike&lt;br /&gt;
: UPD: sorry, misunderstood functionality of this function. But could there be a method to disable traction on locos?&lt;br /&gt;
&lt;br /&gt;
* Ability to change (or only to reduce) the presure in auxilary reservoir of a vehicle. This provides a way to create different types of tripte valves for long-length trains (~70  vehicles), where using Train.SetVelocity() is unrealistic&lt;br /&gt;
&lt;br /&gt;
* Make in addition to Vehice.GetTrackGradient() also float Vehice.GetTrackCurveRadius() which return 0 for straight sections of track (instead of infinity). ~tram&lt;br /&gt;
* Make a function for smooth control of &amp;quot;soundscript&amp;quot;&#039;s sound volume. For example like void MapObject.SetSoundScriptVolume(string soundTrigger, float NewVolume, float Duration).  ~tram&lt;br /&gt;
&lt;br /&gt;
* Ability to set the camera view within an interior by a script to one of the defined cameras in the cameralist container.  It would also be handy if the camera orientation be configurable via a method call. --[[User:Pcas1986|pcas1986]] ([[User talk:Pcas1986|talk]]) 18:14, 20 February 2014 (EST)&lt;br /&gt;
&lt;br /&gt;
* Ability to place a bogey in an interior via the interiors config file.  This would allow for me to make a realistic gangway for my Amlfeets ~ Ashton&lt;br /&gt;
&lt;br /&gt;
* Locomotive.SetEngineSetting(string setting, float value) - Ability to mute/activate engine sound for a locomotive adding setting &amp;quot;enginesound&amp;quot; to the list of settings, value 0 to mute, 1 to activate engine sound ~manweb&lt;br /&gt;
 - setting = The name of the setting to save (enginesound).&lt;br /&gt;
 - value = The value of the named setting. (0 - 1)&lt;br /&gt;
&lt;br /&gt;
==Complete==&lt;br /&gt;
* Simple destructor routine, or some other method of receiving notification of the deletion of scripted objects during a Surveyor session. (In the absence of World.GetJunctionBaseList() my new junction objects are maintaining a list of fixedtrack junctions via library calls in the Init() method of each object.  Apart from using the list myself, it is intended to be returned on demand to any script making the appropriate LibraryCall.  Since I have no way of telling that an object has been deleted, I need to rescan the entire list before returning it to ensure that each object still exists, this seems a touch inefficient when it could be easily kept up to date without a complete parse) -Andi&lt;br /&gt;
:&#039;&#039;Now a function of the [[TrackSearch]] system.&#039;&#039; -chris&lt;br /&gt;
&lt;br /&gt;
* The ability for [[TrackSearch]] to return the trigger or track reference found for SceneryWithTrack descendants, including turntables and the ability to initiate a search from a specified trigger or track in SceneryWithTrack descendants.  A million reasons for this including trains being able to detect which track of an industry they can see in a proposed &#039;Call-At All Stations&#039; rule. -Andi06&lt;br /&gt;
:&#039;&#039;Now a function of the [[TrackSearch]] system.&#039;&#039; -chris&lt;br /&gt;
&lt;br /&gt;
* Compatibility of the [[TrackSearch]] with the animated fixed junctions. When I first got TRS2006 in my hands, I tried out my TrackView rule, but quickly discovered that it was impossible to find out the track topology (forgot the exact details, though) - [[User:Klausm|Klausm]]&lt;br /&gt;
:&#039;&#039;[[TrackSearch]] system is now considerably more robust.&#039;&#039; -chris&lt;br /&gt;
&lt;br /&gt;
* Extensions to TrackSearch()/GSTrackSearch() covered elsewhere to be sufficient to allow the topography of multi node junctions to be fully discovered. -Andi&lt;br /&gt;
:&#039;&#039;[[TrackSearch]] system is now considerably more robust.&#039;&#039; -chris&lt;br /&gt;
&lt;br /&gt;
*If we are going to use radians now (SetMeshOrientation()) could we please have PI?&lt;br /&gt;
:&#039;&#039;Math.PI&#039;&#039; -chris&lt;br /&gt;
&lt;br /&gt;
* Ability to configure permit structure to allow multi node junctions to coexist with the AI, whilst denying conflicting paths, as discussed above. -Andi&lt;br /&gt;
:&#039;&#039;Added named mutex support for attached junctions. See [[KIND SceneryWithTrack]].&#039;&#039; ~chris&lt;br /&gt;
&lt;br /&gt;
* Fix World.GetAssetList(&amp;quot;texture-group&amp;quot;), this has been broken since TRS2004. -Andi06&lt;br /&gt;
:&#039;&#039;Now returns all assets with category-class &#039;JO&#039;. This seems to contain all &#039;texture-group&#039; type assets - though there maybe some unexpected extras.&#039;&#039; -James&lt;br /&gt;
&lt;br /&gt;
* Ability to detect the use of &#039;Pause&#039; easily (a message would do) to stop cheating in shunting puzzles ~Jenolan&lt;br /&gt;
:&#039;&#039;New messages &amp;quot;World&amp;quot;, &amp;quot;Paused&amp;quot; and &amp;quot;World&amp;quot;, &amp;quot;Unpaused&amp;quot; now exist and should be broadcast at the appropriate times.&#039;&#039; -James&lt;br /&gt;
&lt;br /&gt;
* World.GetCurrentTrain() Not essential obviously but it would save a lot of work. -Andi06&lt;br /&gt;
:&#039;&#039;Now exists.&#039;&#039; -James&lt;br /&gt;
&lt;br /&gt;
* Ability to optionally detect mouseclick/ Keys [J] &amp;amp; [^J] without switching the junction. This can be hacked by making node 0 an invisible junction, but this will result in other objects querying the junction structure not getting the answer they expect (or not one they can understand). This is needed to allow objects with more than one junction node to cycle through their options in response to the user. -Andi&lt;br /&gt;
:&#039;&#039;I believe this is now possible via script overrides on the map object in question.&#039;&#039; ~chris&lt;br /&gt;
&lt;br /&gt;
* A method of subclassing or outright using a script from another asset (ie. a script which is written once and reused heavily, allowing any fixes to be released as a single asset update.) - chris&lt;br /&gt;
:&#039;&#039;TS2009 now has the ability to cross-include scripts from another asset.&#039;&#039; ~chris&lt;br /&gt;
&lt;br /&gt;
* Dreamland, a new message: &#039;&#039;Junction,AboutToToggle&#039;&#039; -Andi&lt;br /&gt;
: &#039;&#039;How do you expect to act on this? -chris&#039;&#039;&lt;br /&gt;
: &#039;&#039;see Animated Fixed Junctions Thread&#039;&#039;&lt;br /&gt;
::&#039;I believe this concept has been fulfilled via the UserRequestToggle overrides.&#039;&#039; ~chris&lt;br /&gt;
&lt;br /&gt;
* On a similar note is there any chance you might amend the Exception dialogue to specify the object, (or even the Asset) which is causing the exception :-) -Andi&lt;br /&gt;
:: I think we did this one a while back. ~chris&lt;br /&gt;
&lt;br /&gt;
* SetMeshPosition(&amp;quot;meshname&amp;quot;, x,y,z) absolute positioning of a Mesh or Object. -Caby&lt;br /&gt;
: &amp;lt;font color=red&amp;gt;This exists ~Andi&amp;lt;/font&amp;gt;&lt;br /&gt;
:: &#039;&#039;Not necessarily - we support relative positioning, not absolute. This may or may not achieve what he wants.&#039;&#039; ~chris&lt;br /&gt;
:: This has been added. ~chris&lt;br /&gt;
&lt;br /&gt;
* GetMeshPosition(&amp;quot;meshname&amp;quot;, &amp;quot;x&amp;quot;)[&amp;quot;Y&amp;quot;][&amp;quot;Z&amp;quot;] receive the absolute position of a Mesh or Object. -Caby&lt;br /&gt;
: &amp;lt;font color=red&amp;gt;Since you have used SetMeshPosition() to move the mesh, this is unneccessary&amp;lt;/font&amp;gt;&lt;br /&gt;
:: &#039;&#039;Absolute position can be set in Surveyor. Relative position can be set in the [[config.txt file]]. I wouldn&#039;t say that this is completely unnecessary.&#039;&#039; ~chris&lt;br /&gt;
::: Thanks a lot for MapObject.GetMapObjectPosition() and MapObject.GetMapObjectOrientation() ~tram&lt;br /&gt;
:: This has been added. ~chris&lt;br /&gt;
&lt;br /&gt;
* Ability to load a menu asset directly from the command line ~Jenolan&lt;br /&gt;
:: This exists with &amp;quot;-scriptedmenu=&amp;lt;KUID&amp;gt;&amp;quot; ~chris&lt;br /&gt;
&lt;br /&gt;
==Rejected==&lt;br /&gt;
If there&#039;s a request that we&#039;re clearly not going to entertain at the current time, we&#039;ll move it to here. This includes both flat rejections and also requests which sound good but won&#039;t be done for the next version of Trainz.&lt;br /&gt;
&lt;br /&gt;
[[Rejected Script Feature Requests]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Feature Request]]&lt;/div&gt;</summary>
		<author><name>Callavsg</name></author>
	</entry>
	<entry>
		<id>https://wiki.trainzsimulator.com/index.php?title=Script_Feature_Requests&amp;diff=11679</id>
		<title>Script Feature Requests</title>
		<link rel="alternate" type="text/html" href="https://wiki.trainzsimulator.com/index.php?title=Script_Feature_Requests&amp;diff=11679"/>
		<updated>2018-03-09T15:07:20Z</updated>

		<summary type="html">&lt;p&gt;Callavsg: /* Requests */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page is where the [[scripting]] community gets to post all their API feature requests. Request any additions that you think will enhance the game. Things to keep in mind:&lt;br /&gt;
* We are unlikely to add a feature which breaks any existing content.&lt;br /&gt;
* Script is for control purposes, and is not intended to enable significant modifications to the underlying game engine. We are very unlikely to introduce a feature where the obvious uses are going to result in significant performance penalties.&lt;br /&gt;
* We are far more likely to add features which are directly blocking something that the community is working on. If you have something cool, and need just a few minor additions then please detail what you&#039;re working on (ideally, on another wiki page linked from both here and your [[Content Creation Groups]] page) and why you need the additions.&lt;br /&gt;
* [[MiniBrowser]] requests should go on the separate [[MiniBrowser Feature Requests]] page.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Requests==&lt;br /&gt;
Requests are placed in this section by the community, for discussion and possible inclusion.&lt;br /&gt;
&lt;br /&gt;
* Add a method to set the edited flag for a ScenarioBehavior. Useful for impementing a GUI for direct property access. Or add a method to set a browser window as property window. - callavsg&lt;br /&gt;
&lt;br /&gt;
* Add a method that will let you identify the industry at which a vehicle is located. If an industry track section can also carry the industry identifier, it would be most helpful.&lt;br /&gt;
&lt;br /&gt;
* Add a handle to allow a custom bell animation to be played when the bell is played on a locomotive (Vehicle.StartBell() and Vehicle.StopBell(), perhaps?).  Justification: Script can currently listen for the bell message, but since the message is a toggle, it is easy to get out of synch with the true state of the bell. For example, when coupling a locomotive whose bell is ringing to a locomotive whose bell is not ringing, the end result depends on which locomotive is currently in focus. - Curtis&lt;br /&gt;
&lt;br /&gt;
* Scale the visible bulk load animation on a traincar such that it takes Vehicle.GetLoadTime() to complete.  For example, if Vehicle.GetLoadTime() returns 5 seconds, the bulk animation would take 5 seconds to transition from the full state to the empty state.  This would be useful for industries that take more than one second to load / unload a car, as the visible load animation could be synced more closely with the industry animation. -Curtis&lt;br /&gt;
&lt;br /&gt;
* Extension to the function World.GetAssetList(string kind, bool OnlyIfUsedInCurrentMap) -Andi06&lt;br /&gt;
&lt;br /&gt;
* Ability to play an avi and wait for it to finsh (no user interaction allowed) ~Jenolan&lt;br /&gt;
&lt;br /&gt;
* The ability to modify scenery trigger radii on the fly in script. This is really aimed at crossings so that train detection can be varied in line with track speed limits.  -Andi06&lt;br /&gt;
&lt;br /&gt;
* A method of refreshing the Property Browser to take account of any change in the target object&#039;s name during a property editing session. (Objects which have &#039;autoname 1&#039; in config will often be renamed by the user.  In some circumstances I am using the object name to set other properties. Typically an object might be created as &#039;Double Slip 1&#039; and might refer to its constituent nodes as &#039;Double Slip 1,Track 1&#039;.  This is to enable other objects to refer to it in a user friendly way.  On a name change the Property Browser continues to use the old name until the browser has been closed and reopened.  This is counter intuitive) -Andi&lt;br /&gt;
&lt;br /&gt;
* Ability for a script to be able to read/change loco/rolling stock parameters (ie to simulate one loco losing air etc etc etc) ~Jenolan&lt;br /&gt;
&lt;br /&gt;
* SetFXCoronaTexture() A means of resetting to config.txt defaults.&lt;br /&gt;
&lt;br /&gt;
* Be able to play mp3 as well as wav. ~Jenolan&lt;br /&gt;
: &#039;&#039;I&#039;ve been able to do this where the asset doing the playing is a script library, I had Acker Bilk coming over a station tannoy at one point.  Not sure why it doesn&#039;t seem to work elsewhere. -Andi&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Interface.MessageBox(Caption,Text), calling up a small browser with a close button would be helpful, especially for novices. Interface.Print() is a monumental PITA because it prints out upside down, doesn&#039;t hold enough lines, and only works in Driver. For sure its possible to write your own version of this but browsers aren&#039;t all that easy to get your head around and its a very basic facility that should be built in. -Andi&lt;br /&gt;
&lt;br /&gt;
* A standard config.txt tag &#039;junction-type normal/singleslip/doubleslip&#039; etc together with a spec for construction and behaviour might be helpful. I already have a complete schema for this. -Andi&lt;br /&gt;
: &#039;&#039;Uncertain what you&#039;re expecting to achieve here? -chris&#039;&#039;&lt;br /&gt;
: &#039;&#039;see Animated Fixed Junctions Thread&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Is it possible to make a mesh available which matches the existing graphic direction indicators, it appears to be some sort of directional corona or variant. If not could a new marker mesh be developed that could be used with both types? The existing one has nasty alpha effects in any case. -Andi&lt;br /&gt;
&lt;br /&gt;
* Ability to dynamically change the length of a piece of rolling stock as part of the load / unload process; to support logging disconnects (see http://www.trainzone.co.nz/logging.htm for examples)- Curtis&lt;br /&gt;
: &#039;&#039;This is an interesting concept, but sounds difficult to implement. I can&#039;t think of any way of adjusting the length unless it was the end item of a consist, since adjustment at any other time would require displacing the remainder of the consist. Could you expand on your ideas please.&#039;&#039; -chris&lt;br /&gt;
: &#039;&#039;The entire car, including lmfront &amp;amp; lmback, would be part of the loading / unloading animation. When loading, it would probably be necessary to displace the consist by moving one of the ends - perhaps the end with the locomotive? Potential issue: if when loading, the increase in consist length causes the end of the consist to run off the end of the track or collide with another train.  When unloading, you could break the consist at either or both lmfront / lmback - whichever move as part of the unloading animation.&#039;&#039; - Curtis&lt;br /&gt;
: &#039;&#039;May be simpler to just break the consist at both lmfront and lmback; centering the car in-between the two halves. -Curtis&lt;br /&gt;
&lt;br /&gt;
*Allow SetFXNameText(effect,text) to accept an empty string in the second parameter - Reason: It&#039;s really irritating having to write workarounds for this. ~Andi&lt;br /&gt;
&lt;br /&gt;
*SetMeshScale(X,Y,Z) and corresponding config tags. Positive or negative values would implement mesh mirroring at the same time. As an example of potential a placement option for trees might allow random scale factors (within reasonable limits) and random rotation.  Each tree placed would then vary in size, shape and rotation getting much more variation from the same mesh asset. ~Andi&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Update to product loading / unloading functionality to allow incremental loads and unloads.&lt;br /&gt;
:Potential usages:  &lt;br /&gt;
:- Animation that plays once per item being loaded; such as a forklift carrying a crate to a boxcar, or a crane lifting a log to a flatcar.&lt;br /&gt;
:- Allow dynamic load times of bulk loads (small cars load faster than large cars), with the animated load rising / lowering synchronously.&lt;br /&gt;
&lt;br /&gt;
:Potential implementation:&lt;br /&gt;
:Extend vehicle.LoadProduct(report,units) where units = integer number of queue to be loaded each increment.  0 would be everything, defaulting to current LoadProduct() behavior, and add additional calls BeginIncrementalLoad(), EndIncrementalLoad(), BeginIncrementalUnload(), and EndIncrementalUnload().&lt;br /&gt;
&lt;br /&gt;
:During a load operation that loads 3 increments (units=1, target queue on the car = 3), the flow would look like:&lt;br /&gt;
 BeginLoad() // open car doors; station doors&lt;br /&gt;
 &lt;br /&gt;
 BeginIncrementalLoad() //  start loading animation, start sounds; pfx; add any delays&lt;br /&gt;
 TransferProductFrom() // maximumToTransfer = units&lt;br /&gt;
 EndIncrementalLoad() // animate forklift returning to station / end sounds / pfx / other cleanup&lt;br /&gt;
 &lt;br /&gt;
 BeginIncrementalLoad()&lt;br /&gt;
 TransferProductFrom()&lt;br /&gt;
 EndIncrementalLoad()&lt;br /&gt;
 &lt;br /&gt;
 BeginIncrementalLoad()&lt;br /&gt;
 TransferProductFrom()&lt;br /&gt;
 EndIncrementalLoad()&lt;br /&gt;
 &lt;br /&gt;
 EndLoad() // close car &amp;amp; station doors&lt;br /&gt;
&lt;br /&gt;
* Ability to add a vehicle to an existing consist like Vehicle.Reposition( Train, MyCouple, OtherCouple ) this would save needing a work track mark to add vehicles which would be very helpful ~Jenolan&lt;br /&gt;
&lt;br /&gt;
* Extension to AddHandler to allow this syntax: AddHandler(target,&amp;quot;&amp;quot;,&amp;quot;&amp;quot;,&amp;quot;MessageHandler&amp;quot;), passing all messages to the specified handler, for justification see discussion page. -Andi&lt;br /&gt;
&lt;br /&gt;
* Ability to store any information along with the layout and not the session (i.e. &#039;&#039;PropertyObject.SetLayoutProperties&#039;&#039; and &#039;&#039;PropertyObject.GetLayoutProperties&#039;&#039;, taking/returning &#039;&#039;Soup&#039;&#039; objects respectively). Rationale: the non-existence is a major drawback with configurable signals - [[User:Klausm|Klausm]]&lt;br /&gt;
&lt;br /&gt;
* Access to asset location, height, rotation in script.  This came up twice - once when I wanted to keep traffic lights upright when the containing asset is rolled, and once when I wanted to add simple real time ground shadows to assets. -Andi06&lt;br /&gt;
&lt;br /&gt;
* Ability to arbitrarily add an attachment point to an item. To allow things like FRED/BOG sundry animations and so on ~Jenolan&lt;br /&gt;
&lt;br /&gt;
* Not really script. A generic clickable mesh object, its an easy hack using a fixedtrack junction but it would nice to have an official version - click on the engine shed to open the doors, click on the signal box to open a track browser etc etc. Mappable click regions too if its not too much to ask :-) -Andi&lt;br /&gt;
&lt;br /&gt;
* Extension/Alternative to World.GetJunctionList to return fixed track junction objects or nodes, I can script this easily for objects using my library but this would not be the case for all junctions. -Andi&lt;br /&gt;
&lt;br /&gt;
* World.Play2DSound(Asset,filename) allows sound files to be saved in a &#039;sound library&#039; asset and avoids duplication.  Can we have a similar facility for images to be used in html assets.  A lot of the dependencies that I use are images and icons.  I&#039;m consciously trying to avoid this now - its the source of much pain - but to do this for the Junction Kit for instance I would have to have copies of all necessary images in all of the placeable assets (there are more than 50) If I could simply keep one copy in the script library it would save much bandwidth, diskspace and support. -Andi06&lt;br /&gt;
&lt;br /&gt;
* genesteal : cab features.&lt;br /&gt;
- methods for light controls in cabin : Control.SetFlash (float frequency).Make the control visible/invisible on the intervall frequency. may be Meshobjects.gs for more general purpose. The same for texture swapping in texture replacement.&lt;br /&gt;
- New conrol cab &amp;quot;button&amp;quot; with vertical translation limit : method set and get value as usual, method for &amp;quot;while depressed&amp;quot; behavior: Setdepressed ( method to run).&lt;br /&gt;
&lt;br /&gt;
- Speedlimiter method : Set a speedlimit replacing the max speed possible on cab mode.(engine)&lt;br /&gt;
&lt;br /&gt;
- Set engine methods : &lt;br /&gt;
Locomotive.SwapEngine(kuid); replace engine by another for a locomotive. feature existing on actual loco to set a traction service if the loco have to drive freight or passengers consists. This method can replace speedlimit above and may be more accurate : speedlimit and power will be set together as prototypical setting before a journey. &lt;br /&gt;
- Locomotive.EngineStop(): stops the enginesound  and play a stop.wav, located in enginesound folder.&lt;br /&gt;
- Locomotive.EngineStart() : starts enginesound like this : play  a start.wav located in enginesound folder, then idle 0.wav.&lt;br /&gt;
&lt;br /&gt;
* Allow function Vehicle.SetTractionMultiplier(float) to set multiplier to 0. ~Mike&lt;br /&gt;
: UPD: sorry, misunderstood functionality of this function. But could there be a method to disable traction on locos?&lt;br /&gt;
&lt;br /&gt;
* Ability to change (or only to reduce) the presure in auxilary reservoir of a vehicle. This provides a way to create different types of tripte valves for long-length trains (~70  vehicles), where using Train.SetVelocity() is unrealistic&lt;br /&gt;
&lt;br /&gt;
* Make in addition to Vehice.GetTrackGradient() also float Vehice.GetTrackCurveRadius() which return 0 for straight sections of track (instead of infinity). ~tram&lt;br /&gt;
* Make a function for smooth control of &amp;quot;soundscript&amp;quot;&#039;s sound volume. For example like void MapObject.SetSoundScriptVolume(string soundTrigger, float NewVolume, float Duration).  ~tram&lt;br /&gt;
&lt;br /&gt;
* Ability to set the camera view within an interior by a script to one of the defined cameras in the cameralist container.  It would also be handy if the camera orientation be configurable via a method call. --[[User:Pcas1986|pcas1986]] ([[User talk:Pcas1986|talk]]) 18:14, 20 February 2014 (EST)&lt;br /&gt;
&lt;br /&gt;
* Ability to place a bogey in an interior via the interiors config file.  This would allow for me to make a realistic gangway for my Amlfeets ~ Ashton&lt;br /&gt;
&lt;br /&gt;
* Locomotive.SetEngineSetting(string setting, float value) - Ability to mute/activate engine sound for a locomotive adding setting &amp;quot;enginesound&amp;quot; to the list of settings, value 0 to mute, 1 to activate engine sound ~manweb&lt;br /&gt;
 - setting = The name of the setting to save (enginesound).&lt;br /&gt;
 - value = The value of the named setting. (0 - 1)&lt;br /&gt;
&lt;br /&gt;
==Complete==&lt;br /&gt;
* Simple destructor routine, or some other method of receiving notification of the deletion of scripted objects during a Surveyor session. (In the absence of World.GetJunctionBaseList() my new junction objects are maintaining a list of fixedtrack junctions via library calls in the Init() method of each object.  Apart from using the list myself, it is intended to be returned on demand to any script making the appropriate LibraryCall.  Since I have no way of telling that an object has been deleted, I need to rescan the entire list before returning it to ensure that each object still exists, this seems a touch inefficient when it could be easily kept up to date without a complete parse) -Andi&lt;br /&gt;
:&#039;&#039;Now a function of the [[TrackSearch]] system.&#039;&#039; -chris&lt;br /&gt;
&lt;br /&gt;
* The ability for [[TrackSearch]] to return the trigger or track reference found for SceneryWithTrack descendants, including turntables and the ability to initiate a search from a specified trigger or track in SceneryWithTrack descendants.  A million reasons for this including trains being able to detect which track of an industry they can see in a proposed &#039;Call-At All Stations&#039; rule. -Andi06&lt;br /&gt;
:&#039;&#039;Now a function of the [[TrackSearch]] system.&#039;&#039; -chris&lt;br /&gt;
&lt;br /&gt;
* Compatibility of the [[TrackSearch]] with the animated fixed junctions. When I first got TRS2006 in my hands, I tried out my TrackView rule, but quickly discovered that it was impossible to find out the track topology (forgot the exact details, though) - [[User:Klausm|Klausm]]&lt;br /&gt;
:&#039;&#039;[[TrackSearch]] system is now considerably more robust.&#039;&#039; -chris&lt;br /&gt;
&lt;br /&gt;
* Extensions to TrackSearch()/GSTrackSearch() covered elsewhere to be sufficient to allow the topography of multi node junctions to be fully discovered. -Andi&lt;br /&gt;
:&#039;&#039;[[TrackSearch]] system is now considerably more robust.&#039;&#039; -chris&lt;br /&gt;
&lt;br /&gt;
*If we are going to use radians now (SetMeshOrientation()) could we please have PI?&lt;br /&gt;
:&#039;&#039;Math.PI&#039;&#039; -chris&lt;br /&gt;
&lt;br /&gt;
* Ability to configure permit structure to allow multi node junctions to coexist with the AI, whilst denying conflicting paths, as discussed above. -Andi&lt;br /&gt;
:&#039;&#039;Added named mutex support for attached junctions. See [[KIND SceneryWithTrack]].&#039;&#039; ~chris&lt;br /&gt;
&lt;br /&gt;
* Fix World.GetAssetList(&amp;quot;texture-group&amp;quot;), this has been broken since TRS2004. -Andi06&lt;br /&gt;
:&#039;&#039;Now returns all assets with category-class &#039;JO&#039;. This seems to contain all &#039;texture-group&#039; type assets - though there maybe some unexpected extras.&#039;&#039; -James&lt;br /&gt;
&lt;br /&gt;
* Ability to detect the use of &#039;Pause&#039; easily (a message would do) to stop cheating in shunting puzzles ~Jenolan&lt;br /&gt;
:&#039;&#039;New messages &amp;quot;World&amp;quot;, &amp;quot;Paused&amp;quot; and &amp;quot;World&amp;quot;, &amp;quot;Unpaused&amp;quot; now exist and should be broadcast at the appropriate times.&#039;&#039; -James&lt;br /&gt;
&lt;br /&gt;
* World.GetCurrentTrain() Not essential obviously but it would save a lot of work. -Andi06&lt;br /&gt;
:&#039;&#039;Now exists.&#039;&#039; -James&lt;br /&gt;
&lt;br /&gt;
* Ability to optionally detect mouseclick/ Keys [J] &amp;amp; [^J] without switching the junction. This can be hacked by making node 0 an invisible junction, but this will result in other objects querying the junction structure not getting the answer they expect (or not one they can understand). This is needed to allow objects with more than one junction node to cycle through their options in response to the user. -Andi&lt;br /&gt;
:&#039;&#039;I believe this is now possible via script overrides on the map object in question.&#039;&#039; ~chris&lt;br /&gt;
&lt;br /&gt;
* A method of subclassing or outright using a script from another asset (ie. a script which is written once and reused heavily, allowing any fixes to be released as a single asset update.) - chris&lt;br /&gt;
:&#039;&#039;TS2009 now has the ability to cross-include scripts from another asset.&#039;&#039; ~chris&lt;br /&gt;
&lt;br /&gt;
* Dreamland, a new message: &#039;&#039;Junction,AboutToToggle&#039;&#039; -Andi&lt;br /&gt;
: &#039;&#039;How do you expect to act on this? -chris&#039;&#039;&lt;br /&gt;
: &#039;&#039;see Animated Fixed Junctions Thread&#039;&#039;&lt;br /&gt;
::&#039;I believe this concept has been fulfilled via the UserRequestToggle overrides.&#039;&#039; ~chris&lt;br /&gt;
&lt;br /&gt;
* On a similar note is there any chance you might amend the Exception dialogue to specify the object, (or even the Asset) which is causing the exception :-) -Andi&lt;br /&gt;
:: I think we did this one a while back. ~chris&lt;br /&gt;
&lt;br /&gt;
* SetMeshPosition(&amp;quot;meshname&amp;quot;, x,y,z) absolute positioning of a Mesh or Object. -Caby&lt;br /&gt;
: &amp;lt;font color=red&amp;gt;This exists ~Andi&amp;lt;/font&amp;gt;&lt;br /&gt;
:: &#039;&#039;Not necessarily - we support relative positioning, not absolute. This may or may not achieve what he wants.&#039;&#039; ~chris&lt;br /&gt;
:: This has been added. ~chris&lt;br /&gt;
&lt;br /&gt;
* GetMeshPosition(&amp;quot;meshname&amp;quot;, &amp;quot;x&amp;quot;)[&amp;quot;Y&amp;quot;][&amp;quot;Z&amp;quot;] receive the absolute position of a Mesh or Object. -Caby&lt;br /&gt;
: &amp;lt;font color=red&amp;gt;Since you have used SetMeshPosition() to move the mesh, this is unneccessary&amp;lt;/font&amp;gt;&lt;br /&gt;
:: &#039;&#039;Absolute position can be set in Surveyor. Relative position can be set in the [[config.txt file]]. I wouldn&#039;t say that this is completely unnecessary.&#039;&#039; ~chris&lt;br /&gt;
::: Thanks a lot for MapObject.GetMapObjectPosition() and MapObject.GetMapObjectOrientation() ~tram&lt;br /&gt;
:: This has been added. ~chris&lt;br /&gt;
&lt;br /&gt;
* Ability to load a menu asset directly from the command line ~Jenolan&lt;br /&gt;
:: This exists with &amp;quot;-scriptedmenu=&amp;lt;KUID&amp;gt;&amp;quot; ~chris&lt;br /&gt;
&lt;br /&gt;
==Rejected==&lt;br /&gt;
If there&#039;s a request that we&#039;re clearly not going to entertain at the current time, we&#039;ll move it to here. This includes both flat rejections and also requests which sound good but won&#039;t be done for the next version of Trainz.&lt;br /&gt;
&lt;br /&gt;
[[Rejected Script Feature Requests]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Feature Request]]&lt;/div&gt;</summary>
		<author><name>Callavsg</name></author>
	</entry>
	<entry>
		<id>https://wiki.trainzsimulator.com/index.php?title=Script_Feature_Requests&amp;diff=11678</id>
		<title>Script Feature Requests</title>
		<link rel="alternate" type="text/html" href="https://wiki.trainzsimulator.com/index.php?title=Script_Feature_Requests&amp;diff=11678"/>
		<updated>2018-03-09T15:06:56Z</updated>

		<summary type="html">&lt;p&gt;Callavsg: /* Requests */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page is where the [[scripting]] community gets to post all their API feature requests. Request any additions that you think will enhance the game. Things to keep in mind:&lt;br /&gt;
* We are unlikely to add a feature which breaks any existing content.&lt;br /&gt;
* Script is for control purposes, and is not intended to enable significant modifications to the underlying game engine. We are very unlikely to introduce a feature where the obvious uses are going to result in significant performance penalties.&lt;br /&gt;
* We are far more likely to add features which are directly blocking something that the community is working on. If you have something cool, and need just a few minor additions then please detail what you&#039;re working on (ideally, on another wiki page linked from both here and your [[Content Creation Groups]] page) and why you need the additions.&lt;br /&gt;
* [[MiniBrowser]] requests should go on the separate [[MiniBrowser Feature Requests]] page.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Requests==&lt;br /&gt;
Requests are placed in this section by the community, for discussion and possible inclusion.&lt;br /&gt;
&lt;br /&gt;
* Add a method to set the edited flag for a ScenarioBehavior. Useful for impementing a GUI for direct property access.&lt;br /&gt;
Or add a method to set a browser window as property window. - callavsg&lt;br /&gt;
&lt;br /&gt;
* Add a method that will let you identify the industry at which a vehicle is located. If an industry track section can also carry the industry identifier, it would be most helpful.&lt;br /&gt;
&lt;br /&gt;
* Add a handle to allow a custom bell animation to be played when the bell is played on a locomotive (Vehicle.StartBell() and Vehicle.StopBell(), perhaps?).  Justification: Script can currently listen for the bell message, but since the message is a toggle, it is easy to get out of synch with the true state of the bell. For example, when coupling a locomotive whose bell is ringing to a locomotive whose bell is not ringing, the end result depends on which locomotive is currently in focus. - Curtis&lt;br /&gt;
&lt;br /&gt;
* Scale the visible bulk load animation on a traincar such that it takes Vehicle.GetLoadTime() to complete.  For example, if Vehicle.GetLoadTime() returns 5 seconds, the bulk animation would take 5 seconds to transition from the full state to the empty state.  This would be useful for industries that take more than one second to load / unload a car, as the visible load animation could be synced more closely with the industry animation. -Curtis&lt;br /&gt;
&lt;br /&gt;
* Extension to the function World.GetAssetList(string kind, bool OnlyIfUsedInCurrentMap) -Andi06&lt;br /&gt;
&lt;br /&gt;
* Ability to play an avi and wait for it to finsh (no user interaction allowed) ~Jenolan&lt;br /&gt;
&lt;br /&gt;
* The ability to modify scenery trigger radii on the fly in script. This is really aimed at crossings so that train detection can be varied in line with track speed limits.  -Andi06&lt;br /&gt;
&lt;br /&gt;
* A method of refreshing the Property Browser to take account of any change in the target object&#039;s name during a property editing session. (Objects which have &#039;autoname 1&#039; in config will often be renamed by the user.  In some circumstances I am using the object name to set other properties. Typically an object might be created as &#039;Double Slip 1&#039; and might refer to its constituent nodes as &#039;Double Slip 1,Track 1&#039;.  This is to enable other objects to refer to it in a user friendly way.  On a name change the Property Browser continues to use the old name until the browser has been closed and reopened.  This is counter intuitive) -Andi&lt;br /&gt;
&lt;br /&gt;
* Ability for a script to be able to read/change loco/rolling stock parameters (ie to simulate one loco losing air etc etc etc) ~Jenolan&lt;br /&gt;
&lt;br /&gt;
* SetFXCoronaTexture() A means of resetting to config.txt defaults.&lt;br /&gt;
&lt;br /&gt;
* Be able to play mp3 as well as wav. ~Jenolan&lt;br /&gt;
: &#039;&#039;I&#039;ve been able to do this where the asset doing the playing is a script library, I had Acker Bilk coming over a station tannoy at one point.  Not sure why it doesn&#039;t seem to work elsewhere. -Andi&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Interface.MessageBox(Caption,Text), calling up a small browser with a close button would be helpful, especially for novices. Interface.Print() is a monumental PITA because it prints out upside down, doesn&#039;t hold enough lines, and only works in Driver. For sure its possible to write your own version of this but browsers aren&#039;t all that easy to get your head around and its a very basic facility that should be built in. -Andi&lt;br /&gt;
&lt;br /&gt;
* A standard config.txt tag &#039;junction-type normal/singleslip/doubleslip&#039; etc together with a spec for construction and behaviour might be helpful. I already have a complete schema for this. -Andi&lt;br /&gt;
: &#039;&#039;Uncertain what you&#039;re expecting to achieve here? -chris&#039;&#039;&lt;br /&gt;
: &#039;&#039;see Animated Fixed Junctions Thread&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Is it possible to make a mesh available which matches the existing graphic direction indicators, it appears to be some sort of directional corona or variant. If not could a new marker mesh be developed that could be used with both types? The existing one has nasty alpha effects in any case. -Andi&lt;br /&gt;
&lt;br /&gt;
* Ability to dynamically change the length of a piece of rolling stock as part of the load / unload process; to support logging disconnects (see http://www.trainzone.co.nz/logging.htm for examples)- Curtis&lt;br /&gt;
: &#039;&#039;This is an interesting concept, but sounds difficult to implement. I can&#039;t think of any way of adjusting the length unless it was the end item of a consist, since adjustment at any other time would require displacing the remainder of the consist. Could you expand on your ideas please.&#039;&#039; -chris&lt;br /&gt;
: &#039;&#039;The entire car, including lmfront &amp;amp; lmback, would be part of the loading / unloading animation. When loading, it would probably be necessary to displace the consist by moving one of the ends - perhaps the end with the locomotive? Potential issue: if when loading, the increase in consist length causes the end of the consist to run off the end of the track or collide with another train.  When unloading, you could break the consist at either or both lmfront / lmback - whichever move as part of the unloading animation.&#039;&#039; - Curtis&lt;br /&gt;
: &#039;&#039;May be simpler to just break the consist at both lmfront and lmback; centering the car in-between the two halves. -Curtis&lt;br /&gt;
&lt;br /&gt;
*Allow SetFXNameText(effect,text) to accept an empty string in the second parameter - Reason: It&#039;s really irritating having to write workarounds for this. ~Andi&lt;br /&gt;
&lt;br /&gt;
*SetMeshScale(X,Y,Z) and corresponding config tags. Positive or negative values would implement mesh mirroring at the same time. As an example of potential a placement option for trees might allow random scale factors (within reasonable limits) and random rotation.  Each tree placed would then vary in size, shape and rotation getting much more variation from the same mesh asset. ~Andi&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Update to product loading / unloading functionality to allow incremental loads and unloads.&lt;br /&gt;
:Potential usages:  &lt;br /&gt;
:- Animation that plays once per item being loaded; such as a forklift carrying a crate to a boxcar, or a crane lifting a log to a flatcar.&lt;br /&gt;
:- Allow dynamic load times of bulk loads (small cars load faster than large cars), with the animated load rising / lowering synchronously.&lt;br /&gt;
&lt;br /&gt;
:Potential implementation:&lt;br /&gt;
:Extend vehicle.LoadProduct(report,units) where units = integer number of queue to be loaded each increment.  0 would be everything, defaulting to current LoadProduct() behavior, and add additional calls BeginIncrementalLoad(), EndIncrementalLoad(), BeginIncrementalUnload(), and EndIncrementalUnload().&lt;br /&gt;
&lt;br /&gt;
:During a load operation that loads 3 increments (units=1, target queue on the car = 3), the flow would look like:&lt;br /&gt;
 BeginLoad() // open car doors; station doors&lt;br /&gt;
 &lt;br /&gt;
 BeginIncrementalLoad() //  start loading animation, start sounds; pfx; add any delays&lt;br /&gt;
 TransferProductFrom() // maximumToTransfer = units&lt;br /&gt;
 EndIncrementalLoad() // animate forklift returning to station / end sounds / pfx / other cleanup&lt;br /&gt;
 &lt;br /&gt;
 BeginIncrementalLoad()&lt;br /&gt;
 TransferProductFrom()&lt;br /&gt;
 EndIncrementalLoad()&lt;br /&gt;
 &lt;br /&gt;
 BeginIncrementalLoad()&lt;br /&gt;
 TransferProductFrom()&lt;br /&gt;
 EndIncrementalLoad()&lt;br /&gt;
 &lt;br /&gt;
 EndLoad() // close car &amp;amp; station doors&lt;br /&gt;
&lt;br /&gt;
* Ability to add a vehicle to an existing consist like Vehicle.Reposition( Train, MyCouple, OtherCouple ) this would save needing a work track mark to add vehicles which would be very helpful ~Jenolan&lt;br /&gt;
&lt;br /&gt;
* Extension to AddHandler to allow this syntax: AddHandler(target,&amp;quot;&amp;quot;,&amp;quot;&amp;quot;,&amp;quot;MessageHandler&amp;quot;), passing all messages to the specified handler, for justification see discussion page. -Andi&lt;br /&gt;
&lt;br /&gt;
* Ability to store any information along with the layout and not the session (i.e. &#039;&#039;PropertyObject.SetLayoutProperties&#039;&#039; and &#039;&#039;PropertyObject.GetLayoutProperties&#039;&#039;, taking/returning &#039;&#039;Soup&#039;&#039; objects respectively). Rationale: the non-existence is a major drawback with configurable signals - [[User:Klausm|Klausm]]&lt;br /&gt;
&lt;br /&gt;
* Access to asset location, height, rotation in script.  This came up twice - once when I wanted to keep traffic lights upright when the containing asset is rolled, and once when I wanted to add simple real time ground shadows to assets. -Andi06&lt;br /&gt;
&lt;br /&gt;
* Ability to arbitrarily add an attachment point to an item. To allow things like FRED/BOG sundry animations and so on ~Jenolan&lt;br /&gt;
&lt;br /&gt;
* Not really script. A generic clickable mesh object, its an easy hack using a fixedtrack junction but it would nice to have an official version - click on the engine shed to open the doors, click on the signal box to open a track browser etc etc. Mappable click regions too if its not too much to ask :-) -Andi&lt;br /&gt;
&lt;br /&gt;
* Extension/Alternative to World.GetJunctionList to return fixed track junction objects or nodes, I can script this easily for objects using my library but this would not be the case for all junctions. -Andi&lt;br /&gt;
&lt;br /&gt;
* World.Play2DSound(Asset,filename) allows sound files to be saved in a &#039;sound library&#039; asset and avoids duplication.  Can we have a similar facility for images to be used in html assets.  A lot of the dependencies that I use are images and icons.  I&#039;m consciously trying to avoid this now - its the source of much pain - but to do this for the Junction Kit for instance I would have to have copies of all necessary images in all of the placeable assets (there are more than 50) If I could simply keep one copy in the script library it would save much bandwidth, diskspace and support. -Andi06&lt;br /&gt;
&lt;br /&gt;
* genesteal : cab features.&lt;br /&gt;
- methods for light controls in cabin : Control.SetFlash (float frequency).Make the control visible/invisible on the intervall frequency. may be Meshobjects.gs for more general purpose. The same for texture swapping in texture replacement.&lt;br /&gt;
- New conrol cab &amp;quot;button&amp;quot; with vertical translation limit : method set and get value as usual, method for &amp;quot;while depressed&amp;quot; behavior: Setdepressed ( method to run).&lt;br /&gt;
&lt;br /&gt;
- Speedlimiter method : Set a speedlimit replacing the max speed possible on cab mode.(engine)&lt;br /&gt;
&lt;br /&gt;
- Set engine methods : &lt;br /&gt;
Locomotive.SwapEngine(kuid); replace engine by another for a locomotive. feature existing on actual loco to set a traction service if the loco have to drive freight or passengers consists. This method can replace speedlimit above and may be more accurate : speedlimit and power will be set together as prototypical setting before a journey. &lt;br /&gt;
- Locomotive.EngineStop(): stops the enginesound  and play a stop.wav, located in enginesound folder.&lt;br /&gt;
- Locomotive.EngineStart() : starts enginesound like this : play  a start.wav located in enginesound folder, then idle 0.wav.&lt;br /&gt;
&lt;br /&gt;
* Allow function Vehicle.SetTractionMultiplier(float) to set multiplier to 0. ~Mike&lt;br /&gt;
: UPD: sorry, misunderstood functionality of this function. But could there be a method to disable traction on locos?&lt;br /&gt;
&lt;br /&gt;
* Ability to change (or only to reduce) the presure in auxilary reservoir of a vehicle. This provides a way to create different types of tripte valves for long-length trains (~70  vehicles), where using Train.SetVelocity() is unrealistic&lt;br /&gt;
&lt;br /&gt;
* Make in addition to Vehice.GetTrackGradient() also float Vehice.GetTrackCurveRadius() which return 0 for straight sections of track (instead of infinity). ~tram&lt;br /&gt;
* Make a function for smooth control of &amp;quot;soundscript&amp;quot;&#039;s sound volume. For example like void MapObject.SetSoundScriptVolume(string soundTrigger, float NewVolume, float Duration).  ~tram&lt;br /&gt;
&lt;br /&gt;
* Ability to set the camera view within an interior by a script to one of the defined cameras in the cameralist container.  It would also be handy if the camera orientation be configurable via a method call. --[[User:Pcas1986|pcas1986]] ([[User talk:Pcas1986|talk]]) 18:14, 20 February 2014 (EST)&lt;br /&gt;
&lt;br /&gt;
* Ability to place a bogey in an interior via the interiors config file.  This would allow for me to make a realistic gangway for my Amlfeets ~ Ashton&lt;br /&gt;
&lt;br /&gt;
* Locomotive.SetEngineSetting(string setting, float value) - Ability to mute/activate engine sound for a locomotive adding setting &amp;quot;enginesound&amp;quot; to the list of settings, value 0 to mute, 1 to activate engine sound ~manweb&lt;br /&gt;
 - setting = The name of the setting to save (enginesound).&lt;br /&gt;
 - value = The value of the named setting. (0 - 1)&lt;br /&gt;
&lt;br /&gt;
==Complete==&lt;br /&gt;
* Simple destructor routine, or some other method of receiving notification of the deletion of scripted objects during a Surveyor session. (In the absence of World.GetJunctionBaseList() my new junction objects are maintaining a list of fixedtrack junctions via library calls in the Init() method of each object.  Apart from using the list myself, it is intended to be returned on demand to any script making the appropriate LibraryCall.  Since I have no way of telling that an object has been deleted, I need to rescan the entire list before returning it to ensure that each object still exists, this seems a touch inefficient when it could be easily kept up to date without a complete parse) -Andi&lt;br /&gt;
:&#039;&#039;Now a function of the [[TrackSearch]] system.&#039;&#039; -chris&lt;br /&gt;
&lt;br /&gt;
* The ability for [[TrackSearch]] to return the trigger or track reference found for SceneryWithTrack descendants, including turntables and the ability to initiate a search from a specified trigger or track in SceneryWithTrack descendants.  A million reasons for this including trains being able to detect which track of an industry they can see in a proposed &#039;Call-At All Stations&#039; rule. -Andi06&lt;br /&gt;
:&#039;&#039;Now a function of the [[TrackSearch]] system.&#039;&#039; -chris&lt;br /&gt;
&lt;br /&gt;
* Compatibility of the [[TrackSearch]] with the animated fixed junctions. When I first got TRS2006 in my hands, I tried out my TrackView rule, but quickly discovered that it was impossible to find out the track topology (forgot the exact details, though) - [[User:Klausm|Klausm]]&lt;br /&gt;
:&#039;&#039;[[TrackSearch]] system is now considerably more robust.&#039;&#039; -chris&lt;br /&gt;
&lt;br /&gt;
* Extensions to TrackSearch()/GSTrackSearch() covered elsewhere to be sufficient to allow the topography of multi node junctions to be fully discovered. -Andi&lt;br /&gt;
:&#039;&#039;[[TrackSearch]] system is now considerably more robust.&#039;&#039; -chris&lt;br /&gt;
&lt;br /&gt;
*If we are going to use radians now (SetMeshOrientation()) could we please have PI?&lt;br /&gt;
:&#039;&#039;Math.PI&#039;&#039; -chris&lt;br /&gt;
&lt;br /&gt;
* Ability to configure permit structure to allow multi node junctions to coexist with the AI, whilst denying conflicting paths, as discussed above. -Andi&lt;br /&gt;
:&#039;&#039;Added named mutex support for attached junctions. See [[KIND SceneryWithTrack]].&#039;&#039; ~chris&lt;br /&gt;
&lt;br /&gt;
* Fix World.GetAssetList(&amp;quot;texture-group&amp;quot;), this has been broken since TRS2004. -Andi06&lt;br /&gt;
:&#039;&#039;Now returns all assets with category-class &#039;JO&#039;. This seems to contain all &#039;texture-group&#039; type assets - though there maybe some unexpected extras.&#039;&#039; -James&lt;br /&gt;
&lt;br /&gt;
* Ability to detect the use of &#039;Pause&#039; easily (a message would do) to stop cheating in shunting puzzles ~Jenolan&lt;br /&gt;
:&#039;&#039;New messages &amp;quot;World&amp;quot;, &amp;quot;Paused&amp;quot; and &amp;quot;World&amp;quot;, &amp;quot;Unpaused&amp;quot; now exist and should be broadcast at the appropriate times.&#039;&#039; -James&lt;br /&gt;
&lt;br /&gt;
* World.GetCurrentTrain() Not essential obviously but it would save a lot of work. -Andi06&lt;br /&gt;
:&#039;&#039;Now exists.&#039;&#039; -James&lt;br /&gt;
&lt;br /&gt;
* Ability to optionally detect mouseclick/ Keys [J] &amp;amp; [^J] without switching the junction. This can be hacked by making node 0 an invisible junction, but this will result in other objects querying the junction structure not getting the answer they expect (or not one they can understand). This is needed to allow objects with more than one junction node to cycle through their options in response to the user. -Andi&lt;br /&gt;
:&#039;&#039;I believe this is now possible via script overrides on the map object in question.&#039;&#039; ~chris&lt;br /&gt;
&lt;br /&gt;
* A method of subclassing or outright using a script from another asset (ie. a script which is written once and reused heavily, allowing any fixes to be released as a single asset update.) - chris&lt;br /&gt;
:&#039;&#039;TS2009 now has the ability to cross-include scripts from another asset.&#039;&#039; ~chris&lt;br /&gt;
&lt;br /&gt;
* Dreamland, a new message: &#039;&#039;Junction,AboutToToggle&#039;&#039; -Andi&lt;br /&gt;
: &#039;&#039;How do you expect to act on this? -chris&#039;&#039;&lt;br /&gt;
: &#039;&#039;see Animated Fixed Junctions Thread&#039;&#039;&lt;br /&gt;
::&#039;I believe this concept has been fulfilled via the UserRequestToggle overrides.&#039;&#039; ~chris&lt;br /&gt;
&lt;br /&gt;
* On a similar note is there any chance you might amend the Exception dialogue to specify the object, (or even the Asset) which is causing the exception :-) -Andi&lt;br /&gt;
:: I think we did this one a while back. ~chris&lt;br /&gt;
&lt;br /&gt;
* SetMeshPosition(&amp;quot;meshname&amp;quot;, x,y,z) absolute positioning of a Mesh or Object. -Caby&lt;br /&gt;
: &amp;lt;font color=red&amp;gt;This exists ~Andi&amp;lt;/font&amp;gt;&lt;br /&gt;
:: &#039;&#039;Not necessarily - we support relative positioning, not absolute. This may or may not achieve what he wants.&#039;&#039; ~chris&lt;br /&gt;
:: This has been added. ~chris&lt;br /&gt;
&lt;br /&gt;
* GetMeshPosition(&amp;quot;meshname&amp;quot;, &amp;quot;x&amp;quot;)[&amp;quot;Y&amp;quot;][&amp;quot;Z&amp;quot;] receive the absolute position of a Mesh or Object. -Caby&lt;br /&gt;
: &amp;lt;font color=red&amp;gt;Since you have used SetMeshPosition() to move the mesh, this is unneccessary&amp;lt;/font&amp;gt;&lt;br /&gt;
:: &#039;&#039;Absolute position can be set in Surveyor. Relative position can be set in the [[config.txt file]]. I wouldn&#039;t say that this is completely unnecessary.&#039;&#039; ~chris&lt;br /&gt;
::: Thanks a lot for MapObject.GetMapObjectPosition() and MapObject.GetMapObjectOrientation() ~tram&lt;br /&gt;
:: This has been added. ~chris&lt;br /&gt;
&lt;br /&gt;
* Ability to load a menu asset directly from the command line ~Jenolan&lt;br /&gt;
:: This exists with &amp;quot;-scriptedmenu=&amp;lt;KUID&amp;gt;&amp;quot; ~chris&lt;br /&gt;
&lt;br /&gt;
==Rejected==&lt;br /&gt;
If there&#039;s a request that we&#039;re clearly not going to entertain at the current time, we&#039;ll move it to here. This includes both flat rejections and also requests which sound good but won&#039;t be done for the next version of Trainz.&lt;br /&gt;
&lt;br /&gt;
[[Rejected Script Feature Requests]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Feature Request]]&lt;/div&gt;</summary>
		<author><name>Callavsg</name></author>
	</entry>
	<entry>
		<id>https://wiki.trainzsimulator.com/index.php?title=Script_Feature_Requests&amp;diff=11677</id>
		<title>Script Feature Requests</title>
		<link rel="alternate" type="text/html" href="https://wiki.trainzsimulator.com/index.php?title=Script_Feature_Requests&amp;diff=11677"/>
		<updated>2018-03-09T15:05:51Z</updated>

		<summary type="html">&lt;p&gt;Callavsg: /* Requests */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page is where the [[scripting]] community gets to post all their API feature requests. Request any additions that you think will enhance the game. Things to keep in mind:&lt;br /&gt;
* We are unlikely to add a feature which breaks any existing content.&lt;br /&gt;
* Script is for control purposes, and is not intended to enable significant modifications to the underlying game engine. We are very unlikely to introduce a feature where the obvious uses are going to result in significant performance penalties.&lt;br /&gt;
* We are far more likely to add features which are directly blocking something that the community is working on. If you have something cool, and need just a few minor additions then please detail what you&#039;re working on (ideally, on another wiki page linked from both here and your [[Content Creation Groups]] page) and why you need the additions.&lt;br /&gt;
* [[MiniBrowser]] requests should go on the separate [[MiniBrowser Feature Requests]] page.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Requests==&lt;br /&gt;
Requests are placed in this section by the community, for discussion and possible inclusion.&lt;br /&gt;
&lt;br /&gt;
* Add a method to set the edited flag for a ScenarioBehavior. Useful for impementing a GUI for direct property access. - callavsg&lt;br /&gt;
&lt;br /&gt;
* Add a method that will let you identify the industry at which a vehicle is located. If an industry track section can also carry the industry identifier, it would be most helpful.&lt;br /&gt;
&lt;br /&gt;
* Add a handle to allow a custom bell animation to be played when the bell is played on a locomotive (Vehicle.StartBell() and Vehicle.StopBell(), perhaps?).  Justification: Script can currently listen for the bell message, but since the message is a toggle, it is easy to get out of synch with the true state of the bell. For example, when coupling a locomotive whose bell is ringing to a locomotive whose bell is not ringing, the end result depends on which locomotive is currently in focus. - Curtis&lt;br /&gt;
&lt;br /&gt;
* Scale the visible bulk load animation on a traincar such that it takes Vehicle.GetLoadTime() to complete.  For example, if Vehicle.GetLoadTime() returns 5 seconds, the bulk animation would take 5 seconds to transition from the full state to the empty state.  This would be useful for industries that take more than one second to load / unload a car, as the visible load animation could be synced more closely with the industry animation. -Curtis&lt;br /&gt;
&lt;br /&gt;
* Extension to the function World.GetAssetList(string kind, bool OnlyIfUsedInCurrentMap) -Andi06&lt;br /&gt;
&lt;br /&gt;
* Ability to play an avi and wait for it to finsh (no user interaction allowed) ~Jenolan&lt;br /&gt;
&lt;br /&gt;
* The ability to modify scenery trigger radii on the fly in script. This is really aimed at crossings so that train detection can be varied in line with track speed limits.  -Andi06&lt;br /&gt;
&lt;br /&gt;
* A method of refreshing the Property Browser to take account of any change in the target object&#039;s name during a property editing session. (Objects which have &#039;autoname 1&#039; in config will often be renamed by the user.  In some circumstances I am using the object name to set other properties. Typically an object might be created as &#039;Double Slip 1&#039; and might refer to its constituent nodes as &#039;Double Slip 1,Track 1&#039;.  This is to enable other objects to refer to it in a user friendly way.  On a name change the Property Browser continues to use the old name until the browser has been closed and reopened.  This is counter intuitive) -Andi&lt;br /&gt;
&lt;br /&gt;
* Ability for a script to be able to read/change loco/rolling stock parameters (ie to simulate one loco losing air etc etc etc) ~Jenolan&lt;br /&gt;
&lt;br /&gt;
* SetFXCoronaTexture() A means of resetting to config.txt defaults.&lt;br /&gt;
&lt;br /&gt;
* Be able to play mp3 as well as wav. ~Jenolan&lt;br /&gt;
: &#039;&#039;I&#039;ve been able to do this where the asset doing the playing is a script library, I had Acker Bilk coming over a station tannoy at one point.  Not sure why it doesn&#039;t seem to work elsewhere. -Andi&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Interface.MessageBox(Caption,Text), calling up a small browser with a close button would be helpful, especially for novices. Interface.Print() is a monumental PITA because it prints out upside down, doesn&#039;t hold enough lines, and only works in Driver. For sure its possible to write your own version of this but browsers aren&#039;t all that easy to get your head around and its a very basic facility that should be built in. -Andi&lt;br /&gt;
&lt;br /&gt;
* A standard config.txt tag &#039;junction-type normal/singleslip/doubleslip&#039; etc together with a spec for construction and behaviour might be helpful. I already have a complete schema for this. -Andi&lt;br /&gt;
: &#039;&#039;Uncertain what you&#039;re expecting to achieve here? -chris&#039;&#039;&lt;br /&gt;
: &#039;&#039;see Animated Fixed Junctions Thread&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Is it possible to make a mesh available which matches the existing graphic direction indicators, it appears to be some sort of directional corona or variant. If not could a new marker mesh be developed that could be used with both types? The existing one has nasty alpha effects in any case. -Andi&lt;br /&gt;
&lt;br /&gt;
* Ability to dynamically change the length of a piece of rolling stock as part of the load / unload process; to support logging disconnects (see http://www.trainzone.co.nz/logging.htm for examples)- Curtis&lt;br /&gt;
: &#039;&#039;This is an interesting concept, but sounds difficult to implement. I can&#039;t think of any way of adjusting the length unless it was the end item of a consist, since adjustment at any other time would require displacing the remainder of the consist. Could you expand on your ideas please.&#039;&#039; -chris&lt;br /&gt;
: &#039;&#039;The entire car, including lmfront &amp;amp; lmback, would be part of the loading / unloading animation. When loading, it would probably be necessary to displace the consist by moving one of the ends - perhaps the end with the locomotive? Potential issue: if when loading, the increase in consist length causes the end of the consist to run off the end of the track or collide with another train.  When unloading, you could break the consist at either or both lmfront / lmback - whichever move as part of the unloading animation.&#039;&#039; - Curtis&lt;br /&gt;
: &#039;&#039;May be simpler to just break the consist at both lmfront and lmback; centering the car in-between the two halves. -Curtis&lt;br /&gt;
&lt;br /&gt;
*Allow SetFXNameText(effect,text) to accept an empty string in the second parameter - Reason: It&#039;s really irritating having to write workarounds for this. ~Andi&lt;br /&gt;
&lt;br /&gt;
*SetMeshScale(X,Y,Z) and corresponding config tags. Positive or negative values would implement mesh mirroring at the same time. As an example of potential a placement option for trees might allow random scale factors (within reasonable limits) and random rotation.  Each tree placed would then vary in size, shape and rotation getting much more variation from the same mesh asset. ~Andi&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Update to product loading / unloading functionality to allow incremental loads and unloads.&lt;br /&gt;
:Potential usages:  &lt;br /&gt;
:- Animation that plays once per item being loaded; such as a forklift carrying a crate to a boxcar, or a crane lifting a log to a flatcar.&lt;br /&gt;
:- Allow dynamic load times of bulk loads (small cars load faster than large cars), with the animated load rising / lowering synchronously.&lt;br /&gt;
&lt;br /&gt;
:Potential implementation:&lt;br /&gt;
:Extend vehicle.LoadProduct(report,units) where units = integer number of queue to be loaded each increment.  0 would be everything, defaulting to current LoadProduct() behavior, and add additional calls BeginIncrementalLoad(), EndIncrementalLoad(), BeginIncrementalUnload(), and EndIncrementalUnload().&lt;br /&gt;
&lt;br /&gt;
:During a load operation that loads 3 increments (units=1, target queue on the car = 3), the flow would look like:&lt;br /&gt;
 BeginLoad() // open car doors; station doors&lt;br /&gt;
 &lt;br /&gt;
 BeginIncrementalLoad() //  start loading animation, start sounds; pfx; add any delays&lt;br /&gt;
 TransferProductFrom() // maximumToTransfer = units&lt;br /&gt;
 EndIncrementalLoad() // animate forklift returning to station / end sounds / pfx / other cleanup&lt;br /&gt;
 &lt;br /&gt;
 BeginIncrementalLoad()&lt;br /&gt;
 TransferProductFrom()&lt;br /&gt;
 EndIncrementalLoad()&lt;br /&gt;
 &lt;br /&gt;
 BeginIncrementalLoad()&lt;br /&gt;
 TransferProductFrom()&lt;br /&gt;
 EndIncrementalLoad()&lt;br /&gt;
 &lt;br /&gt;
 EndLoad() // close car &amp;amp; station doors&lt;br /&gt;
&lt;br /&gt;
* Ability to add a vehicle to an existing consist like Vehicle.Reposition( Train, MyCouple, OtherCouple ) this would save needing a work track mark to add vehicles which would be very helpful ~Jenolan&lt;br /&gt;
&lt;br /&gt;
* Extension to AddHandler to allow this syntax: AddHandler(target,&amp;quot;&amp;quot;,&amp;quot;&amp;quot;,&amp;quot;MessageHandler&amp;quot;), passing all messages to the specified handler, for justification see discussion page. -Andi&lt;br /&gt;
&lt;br /&gt;
* Ability to store any information along with the layout and not the session (i.e. &#039;&#039;PropertyObject.SetLayoutProperties&#039;&#039; and &#039;&#039;PropertyObject.GetLayoutProperties&#039;&#039;, taking/returning &#039;&#039;Soup&#039;&#039; objects respectively). Rationale: the non-existence is a major drawback with configurable signals - [[User:Klausm|Klausm]]&lt;br /&gt;
&lt;br /&gt;
* Access to asset location, height, rotation in script.  This came up twice - once when I wanted to keep traffic lights upright when the containing asset is rolled, and once when I wanted to add simple real time ground shadows to assets. -Andi06&lt;br /&gt;
&lt;br /&gt;
* Ability to arbitrarily add an attachment point to an item. To allow things like FRED/BOG sundry animations and so on ~Jenolan&lt;br /&gt;
&lt;br /&gt;
* Not really script. A generic clickable mesh object, its an easy hack using a fixedtrack junction but it would nice to have an official version - click on the engine shed to open the doors, click on the signal box to open a track browser etc etc. Mappable click regions too if its not too much to ask :-) -Andi&lt;br /&gt;
&lt;br /&gt;
* Extension/Alternative to World.GetJunctionList to return fixed track junction objects or nodes, I can script this easily for objects using my library but this would not be the case for all junctions. -Andi&lt;br /&gt;
&lt;br /&gt;
* World.Play2DSound(Asset,filename) allows sound files to be saved in a &#039;sound library&#039; asset and avoids duplication.  Can we have a similar facility for images to be used in html assets.  A lot of the dependencies that I use are images and icons.  I&#039;m consciously trying to avoid this now - its the source of much pain - but to do this for the Junction Kit for instance I would have to have copies of all necessary images in all of the placeable assets (there are more than 50) If I could simply keep one copy in the script library it would save much bandwidth, diskspace and support. -Andi06&lt;br /&gt;
&lt;br /&gt;
* genesteal : cab features.&lt;br /&gt;
- methods for light controls in cabin : Control.SetFlash (float frequency).Make the control visible/invisible on the intervall frequency. may be Meshobjects.gs for more general purpose. The same for texture swapping in texture replacement.&lt;br /&gt;
- New conrol cab &amp;quot;button&amp;quot; with vertical translation limit : method set and get value as usual, method for &amp;quot;while depressed&amp;quot; behavior: Setdepressed ( method to run).&lt;br /&gt;
&lt;br /&gt;
- Speedlimiter method : Set a speedlimit replacing the max speed possible on cab mode.(engine)&lt;br /&gt;
&lt;br /&gt;
- Set engine methods : &lt;br /&gt;
Locomotive.SwapEngine(kuid); replace engine by another for a locomotive. feature existing on actual loco to set a traction service if the loco have to drive freight or passengers consists. This method can replace speedlimit above and may be more accurate : speedlimit and power will be set together as prototypical setting before a journey. &lt;br /&gt;
- Locomotive.EngineStop(): stops the enginesound  and play a stop.wav, located in enginesound folder.&lt;br /&gt;
- Locomotive.EngineStart() : starts enginesound like this : play  a start.wav located in enginesound folder, then idle 0.wav.&lt;br /&gt;
&lt;br /&gt;
* Allow function Vehicle.SetTractionMultiplier(float) to set multiplier to 0. ~Mike&lt;br /&gt;
: UPD: sorry, misunderstood functionality of this function. But could there be a method to disable traction on locos?&lt;br /&gt;
&lt;br /&gt;
* Ability to change (or only to reduce) the presure in auxilary reservoir of a vehicle. This provides a way to create different types of tripte valves for long-length trains (~70  vehicles), where using Train.SetVelocity() is unrealistic&lt;br /&gt;
&lt;br /&gt;
* Make in addition to Vehice.GetTrackGradient() also float Vehice.GetTrackCurveRadius() which return 0 for straight sections of track (instead of infinity). ~tram&lt;br /&gt;
* Make a function for smooth control of &amp;quot;soundscript&amp;quot;&#039;s sound volume. For example like void MapObject.SetSoundScriptVolume(string soundTrigger, float NewVolume, float Duration).  ~tram&lt;br /&gt;
&lt;br /&gt;
* Ability to set the camera view within an interior by a script to one of the defined cameras in the cameralist container.  It would also be handy if the camera orientation be configurable via a method call. --[[User:Pcas1986|pcas1986]] ([[User talk:Pcas1986|talk]]) 18:14, 20 February 2014 (EST)&lt;br /&gt;
&lt;br /&gt;
* Ability to place a bogey in an interior via the interiors config file.  This would allow for me to make a realistic gangway for my Amlfeets ~ Ashton&lt;br /&gt;
&lt;br /&gt;
* Locomotive.SetEngineSetting(string setting, float value) - Ability to mute/activate engine sound for a locomotive adding setting &amp;quot;enginesound&amp;quot; to the list of settings, value 0 to mute, 1 to activate engine sound ~manweb&lt;br /&gt;
 - setting = The name of the setting to save (enginesound).&lt;br /&gt;
 - value = The value of the named setting. (0 - 1)&lt;br /&gt;
&lt;br /&gt;
==Complete==&lt;br /&gt;
* Simple destructor routine, or some other method of receiving notification of the deletion of scripted objects during a Surveyor session. (In the absence of World.GetJunctionBaseList() my new junction objects are maintaining a list of fixedtrack junctions via library calls in the Init() method of each object.  Apart from using the list myself, it is intended to be returned on demand to any script making the appropriate LibraryCall.  Since I have no way of telling that an object has been deleted, I need to rescan the entire list before returning it to ensure that each object still exists, this seems a touch inefficient when it could be easily kept up to date without a complete parse) -Andi&lt;br /&gt;
:&#039;&#039;Now a function of the [[TrackSearch]] system.&#039;&#039; -chris&lt;br /&gt;
&lt;br /&gt;
* The ability for [[TrackSearch]] to return the trigger or track reference found for SceneryWithTrack descendants, including turntables and the ability to initiate a search from a specified trigger or track in SceneryWithTrack descendants.  A million reasons for this including trains being able to detect which track of an industry they can see in a proposed &#039;Call-At All Stations&#039; rule. -Andi06&lt;br /&gt;
:&#039;&#039;Now a function of the [[TrackSearch]] system.&#039;&#039; -chris&lt;br /&gt;
&lt;br /&gt;
* Compatibility of the [[TrackSearch]] with the animated fixed junctions. When I first got TRS2006 in my hands, I tried out my TrackView rule, but quickly discovered that it was impossible to find out the track topology (forgot the exact details, though) - [[User:Klausm|Klausm]]&lt;br /&gt;
:&#039;&#039;[[TrackSearch]] system is now considerably more robust.&#039;&#039; -chris&lt;br /&gt;
&lt;br /&gt;
* Extensions to TrackSearch()/GSTrackSearch() covered elsewhere to be sufficient to allow the topography of multi node junctions to be fully discovered. -Andi&lt;br /&gt;
:&#039;&#039;[[TrackSearch]] system is now considerably more robust.&#039;&#039; -chris&lt;br /&gt;
&lt;br /&gt;
*If we are going to use radians now (SetMeshOrientation()) could we please have PI?&lt;br /&gt;
:&#039;&#039;Math.PI&#039;&#039; -chris&lt;br /&gt;
&lt;br /&gt;
* Ability to configure permit structure to allow multi node junctions to coexist with the AI, whilst denying conflicting paths, as discussed above. -Andi&lt;br /&gt;
:&#039;&#039;Added named mutex support for attached junctions. See [[KIND SceneryWithTrack]].&#039;&#039; ~chris&lt;br /&gt;
&lt;br /&gt;
* Fix World.GetAssetList(&amp;quot;texture-group&amp;quot;), this has been broken since TRS2004. -Andi06&lt;br /&gt;
:&#039;&#039;Now returns all assets with category-class &#039;JO&#039;. This seems to contain all &#039;texture-group&#039; type assets - though there maybe some unexpected extras.&#039;&#039; -James&lt;br /&gt;
&lt;br /&gt;
* Ability to detect the use of &#039;Pause&#039; easily (a message would do) to stop cheating in shunting puzzles ~Jenolan&lt;br /&gt;
:&#039;&#039;New messages &amp;quot;World&amp;quot;, &amp;quot;Paused&amp;quot; and &amp;quot;World&amp;quot;, &amp;quot;Unpaused&amp;quot; now exist and should be broadcast at the appropriate times.&#039;&#039; -James&lt;br /&gt;
&lt;br /&gt;
* World.GetCurrentTrain() Not essential obviously but it would save a lot of work. -Andi06&lt;br /&gt;
:&#039;&#039;Now exists.&#039;&#039; -James&lt;br /&gt;
&lt;br /&gt;
* Ability to optionally detect mouseclick/ Keys [J] &amp;amp; [^J] without switching the junction. This can be hacked by making node 0 an invisible junction, but this will result in other objects querying the junction structure not getting the answer they expect (or not one they can understand). This is needed to allow objects with more than one junction node to cycle through their options in response to the user. -Andi&lt;br /&gt;
:&#039;&#039;I believe this is now possible via script overrides on the map object in question.&#039;&#039; ~chris&lt;br /&gt;
&lt;br /&gt;
* A method of subclassing or outright using a script from another asset (ie. a script which is written once and reused heavily, allowing any fixes to be released as a single asset update.) - chris&lt;br /&gt;
:&#039;&#039;TS2009 now has the ability to cross-include scripts from another asset.&#039;&#039; ~chris&lt;br /&gt;
&lt;br /&gt;
* Dreamland, a new message: &#039;&#039;Junction,AboutToToggle&#039;&#039; -Andi&lt;br /&gt;
: &#039;&#039;How do you expect to act on this? -chris&#039;&#039;&lt;br /&gt;
: &#039;&#039;see Animated Fixed Junctions Thread&#039;&#039;&lt;br /&gt;
::&#039;I believe this concept has been fulfilled via the UserRequestToggle overrides.&#039;&#039; ~chris&lt;br /&gt;
&lt;br /&gt;
* On a similar note is there any chance you might amend the Exception dialogue to specify the object, (or even the Asset) which is causing the exception :-) -Andi&lt;br /&gt;
:: I think we did this one a while back. ~chris&lt;br /&gt;
&lt;br /&gt;
* SetMeshPosition(&amp;quot;meshname&amp;quot;, x,y,z) absolute positioning of a Mesh or Object. -Caby&lt;br /&gt;
: &amp;lt;font color=red&amp;gt;This exists ~Andi&amp;lt;/font&amp;gt;&lt;br /&gt;
:: &#039;&#039;Not necessarily - we support relative positioning, not absolute. This may or may not achieve what he wants.&#039;&#039; ~chris&lt;br /&gt;
:: This has been added. ~chris&lt;br /&gt;
&lt;br /&gt;
* GetMeshPosition(&amp;quot;meshname&amp;quot;, &amp;quot;x&amp;quot;)[&amp;quot;Y&amp;quot;][&amp;quot;Z&amp;quot;] receive the absolute position of a Mesh or Object. -Caby&lt;br /&gt;
: &amp;lt;font color=red&amp;gt;Since you have used SetMeshPosition() to move the mesh, this is unneccessary&amp;lt;/font&amp;gt;&lt;br /&gt;
:: &#039;&#039;Absolute position can be set in Surveyor. Relative position can be set in the [[config.txt file]]. I wouldn&#039;t say that this is completely unnecessary.&#039;&#039; ~chris&lt;br /&gt;
::: Thanks a lot for MapObject.GetMapObjectPosition() and MapObject.GetMapObjectOrientation() ~tram&lt;br /&gt;
:: This has been added. ~chris&lt;br /&gt;
&lt;br /&gt;
* Ability to load a menu asset directly from the command line ~Jenolan&lt;br /&gt;
:: This exists with &amp;quot;-scriptedmenu=&amp;lt;KUID&amp;gt;&amp;quot; ~chris&lt;br /&gt;
&lt;br /&gt;
==Rejected==&lt;br /&gt;
If there&#039;s a request that we&#039;re clearly not going to entertain at the current time, we&#039;ll move it to here. This includes both flat rejections and also requests which sound good but won&#039;t be done for the next version of Trainz.&lt;br /&gt;
&lt;br /&gt;
[[Rejected Script Feature Requests]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Feature Request]]&lt;/div&gt;</summary>
		<author><name>Callavsg</name></author>
	</entry>
	<entry>
		<id>https://wiki.trainzsimulator.com/index.php?title=HowTo/Hide-_%26_Unhide_Meshes&amp;diff=8812</id>
		<title>HowTo/Hide- &amp; Unhide Meshes</title>
		<link rel="alternate" type="text/html" href="https://wiki.trainzsimulator.com/index.php?title=HowTo/Hide-_%26_Unhide_Meshes&amp;diff=8812"/>
		<updated>2016-04-21T09:05:15Z</updated>

		<summary type="html">&lt;p&gt;Callavsg: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;In [[HowTo/Your first Trainz Script]] we created the script:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
; myscript.gs&lt;br /&gt;
 &#039;&#039;&#039;&amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;include&amp;lt;/font&amp;gt;&#039;&#039;&#039; &amp;lt;font color=&amp;quot;#808080&amp;quot;&amp;gt;&amp;quot;MapObject.gs&amp;quot;&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &#039;&#039;&#039;&amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;class&amp;lt;/font&amp;gt;&#039;&#039;&#039; &amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;CMyClass&amp;lt;/font&amp;gt; &#039;&#039;&#039;&amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;isclass&amp;lt;/font&amp;gt;&#039;&#039;&#039; &#039;&#039;&#039;&amp;lt;font color=&amp;quot;#800000&amp;quot;&amp;gt;MapObject&amp;lt;/font&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
 {&lt;br /&gt;
     &amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;&#039;&#039;&#039;public void&#039;&#039;&#039; Init&amp;lt;/font&amp;gt;(&amp;lt;font color=&amp;quot;#800000&amp;quot;&amp;gt;&#039;&#039;&#039;Asset&#039;&#039;&#039;&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;pAsset&amp;lt;/font&amp;gt;)&lt;br /&gt;
     {&lt;br /&gt;
         &amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;&#039;&#039;&#039;inherited&#039;&#039;&#039;&amp;lt;/font&amp;gt;(&amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;pAsset&amp;lt;/font&amp;gt;);&lt;br /&gt;
     }&lt;br /&gt;
 };&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Today we&#039;re gonna use this little example for a vehicle. There is an ice cream truck on the DLS by misterairbrush (&amp;lt;kuid:414943:100987&amp;gt;). This ice cream truck has a door that can be set opened or closed.&lt;br /&gt;
It looks like:&lt;br /&gt;
&lt;br /&gt;
[[File:Scripting_02_Truck_1.jpg]] [[File:Scripting_02_Truck_2.jpg]]&lt;br /&gt;
&lt;br /&gt;
We&#039;ll learn today how to hide the &amp;quot;wrong&amp;quot; and show the right mesh. Also we want that the users may select the option in de &amp;quot;?&amp;quot;-Window of the scenery object.&lt;br /&gt;
First we need a member variable to store the information if the door is opened or closed, then we need functions to save and load the information every time the map[the vehicle] loads.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Variables may be described as kind of placeholders. These placeholders offers us the opportunity to save data temporary.&lt;br /&gt;
&lt;br /&gt;
In Trainz Script there are four (well, really there are five, but we will ignore one this time!) data [[Types]] we can use:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;bool&#039;&#039;&#039; - boolean constants true/false&lt;br /&gt;
* &#039;&#039;&#039;int&#039;&#039;&#039; - every number between -2147483647 and 2147483647 (a 32 Bit integer)&lt;br /&gt;
* &#039;&#039;&#039;string&#039;&#039;&#039; - characters&lt;br /&gt;
* &#039;&#039;&#039;float&#039;&#039;&#039; - floating numbers (32 Bit)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Today we&#039;ll have a closer look on the &#039;&#039;&#039;bool&#039;&#039;&#039; type. The others will be explained another time :)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In our case, we only need a true/false value.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;True&#039;&#039;&#039;: The user wants the door to be opened&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;False&#039;&#039;&#039;: The user wants the door to be closed&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
How do we declare a member variable? This is pretty easy:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
; icecreamtruck.gs&lt;br /&gt;
 &#039;&#039;&#039;&amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;include&amp;lt;/font&amp;gt;&#039;&#039;&#039; &amp;lt;font color=&amp;quot;#808080&amp;quot;&amp;gt;&amp;quot;MapObject.gs&amp;quot;&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &#039;&#039;&#039;&amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;class&amp;lt;/font&amp;gt;&#039;&#039;&#039; &amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;CIceCreamTruck&amp;lt;/font&amp;gt; &#039;&#039;&#039;&amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;isclass&amp;lt;/font&amp;gt;&#039;&#039;&#039; &#039;&#039;&#039;&amp;lt;font color=&amp;quot;#800000&amp;quot;&amp;gt;MapObject&amp;lt;/font&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
 {&lt;br /&gt;
     &amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;&#039;&#039;&#039;bool&#039;&#039;&#039;&amp;lt;/font&amp;gt;        &amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;m_bDoorOpened&amp;lt;/font&amp;gt;;&lt;br /&gt;
 &lt;br /&gt;
     &amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;&#039;&#039;&#039;public void&#039;&#039;&#039; Init&amp;lt;/font&amp;gt;(&amp;lt;font color=&amp;quot;#800000&amp;quot;&amp;gt;&#039;&#039;&#039;Asset&#039;&#039;&#039;&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;pAsset&amp;lt;/font&amp;gt;)&lt;br /&gt;
     {&lt;br /&gt;
         &amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;&#039;&#039;&#039;inherited&#039;&#039;&#039;&amp;lt;/font&amp;gt;(&amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;pAsset&amp;lt;/font&amp;gt;);&lt;br /&gt;
     }&lt;br /&gt;
 };&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
As you can see, we just have to begin with the type of our variable and then giving it a name. This is it. Now we can use it.&lt;br /&gt;
This variable now is available in the whole CIceCreamTruck-Class, because we declared it as member, so we may say it&#039;s a global variable (that isn&#039;t true, but it&#039;s easier to explain).&lt;br /&gt;
We also may declare variables within methods/functions. These then will only be accessable inside the function or method and not on other places in the script.&lt;br /&gt;
In Trainz Script there are now real global variables (that&#039;s why I think we may call the members global, even if it&#039;s not true). We only may declare variables inside classes.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Next, we will have a look an two new methods:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;[[Class_PropertyObject#GetProperties]] (GetProperties)&#039;&#039;&#039; - Save data to a soup&lt;br /&gt;
* &#039;&#039;&#039;[[Class_PropertyObject#SetProperties]] (SetProperties)&#039;&#039;&#039; - Fetch data from a Soup&lt;br /&gt;
&lt;br /&gt;
These methods are implemented in native code. That means we don&#039;t have to care about when they are called. We just have to override them. Trainz will call it every time it is needed.&lt;br /&gt;
Let&#039;s override them:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
; icecreamtruck.gs&lt;br /&gt;
 &#039;&#039;&#039;&amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;include&amp;lt;/font&amp;gt;&#039;&#039;&#039; &amp;lt;font color=&amp;quot;#808080&amp;quot;&amp;gt;&amp;quot;MapObject.gs&amp;quot;&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &#039;&#039;&#039;&amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;class&amp;lt;/font&amp;gt;&#039;&#039;&#039; &amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;CIceCreamTruck&amp;lt;/font&amp;gt; &#039;&#039;&#039;&amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;isclass&amp;lt;/font&amp;gt;&#039;&#039;&#039; &#039;&#039;&#039;&amp;lt;font color=&amp;quot;#800000&amp;quot;&amp;gt;MapObject&amp;lt;/font&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
 {&lt;br /&gt;
     &amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;&#039;&#039;&#039;bool&#039;&#039;&#039;&amp;lt;/font&amp;gt;        &amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;m_bDoorOpened&amp;lt;/font&amp;gt;;&lt;br /&gt;
 &lt;br /&gt;
     &amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;&#039;&#039;&#039;public void&#039;&#039;&#039; Init&amp;lt;/font&amp;gt;(&amp;lt;font color=&amp;quot;#800000&amp;quot;&amp;gt;&#039;&#039;&#039;Asset&#039;&#039;&#039;&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;pAsset&amp;lt;/font&amp;gt;)&lt;br /&gt;
     {&lt;br /&gt;
         &amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;&#039;&#039;&#039;inherited&#039;&#039;&#039;&amp;lt;/font&amp;gt;(&amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;pAsset&amp;lt;/font&amp;gt;);&lt;br /&gt;
     }&lt;br /&gt;
 &lt;br /&gt;
     &amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;&#039;&#039;&#039;public&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;#800000&amp;quot;&amp;gt;Soup&amp;lt;/font&amp;gt;&#039;&#039;&#039; &amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;GetProperties&amp;lt;/font&amp;gt;(&amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;&#039;&#039;&#039;void&#039;&#039;&#039;&amp;lt;/font&amp;gt;)&lt;br /&gt;
     {&lt;br /&gt;
         &#039;&#039;&#039;&amp;lt;font color=&amp;quot;#800000&amp;quot;&amp;gt;Soup&amp;lt;/font&amp;gt;&#039;&#039;&#039; &amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;pSoup&amp;lt;/font&amp;gt; = &amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;&#039;&#039;&#039;inherited&#039;&#039;&#039;&amp;lt;/font&amp;gt;();&lt;br /&gt;
         &amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;&#039;&#039;&#039;return&#039;&#039;&#039;&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;pSoup&amp;lt;/font&amp;gt;;&lt;br /&gt;
     }&lt;br /&gt;
 &lt;br /&gt;
     &amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;&#039;&#039;&#039;public void&#039;&#039;&#039; SetProperties&amp;lt;/font&amp;gt;(&amp;lt;font color=&amp;quot;#800000&amp;quot;&amp;gt;&#039;&#039;&#039;Soup&#039;&#039;&#039;&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;pSoup&amp;lt;/font&amp;gt;)&lt;br /&gt;
     {&lt;br /&gt;
         &amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;&#039;&#039;&#039;inherited&#039;&#039;&#039;&amp;lt;/font&amp;gt;(&amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;pSoup&amp;lt;/font&amp;gt;);&lt;br /&gt;
     }&lt;br /&gt;
 };&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
; GetProperties:&lt;br /&gt;
As I said above, this functions task is to save data into a Soup. It expects a Soup-Object to be returend. You&#039;ll see, that Soup is a class, not a data type,&lt;br /&gt;
&lt;br /&gt;
But we&#039;re able to declare class instances as variables too. (Look at: &#039;&#039;&#039;&amp;lt;font color=&amp;quot;#800000&amp;quot;&amp;gt;Soup&amp;lt;/font&amp;gt;&#039;&#039;&#039; &amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;pSoup&amp;lt;/font&amp;gt; = &amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;&#039;&#039;&#039;inherited&#039;&#039;&#039;&amp;lt;/font&amp;gt;();)&lt;br /&gt;
&lt;br /&gt;
And again: The inherited is in here!&lt;br /&gt;
Every function/method we override has in most cases to inherit the parent classes method. The inherited in here calls GetProperties of Class MapObject. This makes sure, that every operation inside a method of the parent class is called too. Remember: We overrided the method. If we don&#039;t inherit it here again, the parent classes GetProperties-Method will never be called!&lt;br /&gt;
Only miss the call to inherited if you want to disable functionallity for a class, if not, don&#039;t forget it.&lt;br /&gt;
&lt;br /&gt;
In the script above, we return the Soup directly, without any operation. What exactly return types are will be explained another time :) (it will be too much for us now!)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
; SetProperties:&lt;br /&gt;
In this method we get a paramter of type soup. We inherit the MapObject-Setproprties. This time we don&#039;t have to return any value. Here we will load the data from the Soup we got as paramter.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
; &#039;&#039;&#039;Saving data&#039;&#039;&#039;&lt;br /&gt;
I already explained that Soup is a class. So it may has members, and in fact, it has. Look at: [[Class_Soup]]&lt;br /&gt;
&lt;br /&gt;
A Soup is like a small database. We can set values by a name and a value. I use the variable name as name, because I don&#039;t have to look it up every time, and not to think, what name&lt;br /&gt;
the value inside the soup has. The method &amp;quot;SetNamedTag&amp;quot; in class Soup is the right here for us to save a value. We can access all public methods inside a class with the dereference operator, that&lt;br /&gt;
is a single dot (&#039;&#039;&#039;.&#039;&#039;&#039;). So, we call the function like this:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;pSoup&amp;lt;/font&amp;gt;.&amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;SetNamedTag&amp;lt;/font&amp;gt;(&amp;lt;font color=&amp;quot;#808080&amp;quot;&amp;gt;&amp;quot;NAME&amp;quot;&amp;lt;/font&amp;gt;, [VALUE]);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now in script, it looks like:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
; icecreamtruck.gs&lt;br /&gt;
 &#039;&#039;&#039;&amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;include&amp;lt;/font&amp;gt;&#039;&#039;&#039; &amp;lt;font color=&amp;quot;#808080&amp;quot;&amp;gt;&amp;quot;MapObject.gs&amp;quot;&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &#039;&#039;&#039;&amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;class&amp;lt;/font&amp;gt;&#039;&#039;&#039; &amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;CIceCreamTruck&amp;lt;/font&amp;gt; &#039;&#039;&#039;&amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;isclass&amp;lt;/font&amp;gt;&#039;&#039;&#039; &#039;&#039;&#039;&amp;lt;font color=&amp;quot;#800000&amp;quot;&amp;gt;MapObject&amp;lt;/font&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
 {&lt;br /&gt;
     &amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;&#039;&#039;&#039;bool&#039;&#039;&#039;&amp;lt;/font&amp;gt;        &amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;m_bDoorOpened&amp;lt;/font&amp;gt;;&lt;br /&gt;
 &lt;br /&gt;
     &amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;&#039;&#039;&#039;public void&#039;&#039;&#039; Init&amp;lt;/font&amp;gt;(&amp;lt;font color=&amp;quot;#800000&amp;quot;&amp;gt;&#039;&#039;&#039;Asset&#039;&#039;&#039;&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;pAsset&amp;lt;/font&amp;gt;)&lt;br /&gt;
     {&lt;br /&gt;
         &amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;&#039;&#039;&#039;inherited&#039;&#039;&#039;&amp;lt;/font&amp;gt;(&amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;pAsset&amp;lt;/font&amp;gt;);&lt;br /&gt;
     }&lt;br /&gt;
 &lt;br /&gt;
     &amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;&#039;&#039;&#039;public&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;#800000&amp;quot;&amp;gt;Soup&amp;lt;/font&amp;gt;&#039;&#039;&#039; &amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;GetProperties&amp;lt;/font&amp;gt;(&amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;&#039;&#039;&#039;void&#039;&#039;&#039;&amp;lt;/font&amp;gt;)&lt;br /&gt;
     {&lt;br /&gt;
         &#039;&#039;&#039;&amp;lt;font color=&amp;quot;#800000&amp;quot;&amp;gt;Soup&amp;lt;/font&amp;gt;&#039;&#039;&#039; &amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;pSoup&amp;lt;/font&amp;gt; = &amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;&#039;&#039;&#039;inherited&#039;&#039;&#039;&amp;lt;/font&amp;gt;();&lt;br /&gt;
         &amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;pSoup&amp;lt;/font&amp;gt;.&amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;SetNamedTag&amp;lt;/font&amp;gt;(&amp;lt;font color=&amp;quot;#808080&amp;quot;&amp;gt;&amp;quot;m_bDoorOpened&amp;quot;&amp;lt;/font&amp;gt;, &amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;m_bDoorOpened&amp;lt;/font&amp;gt;);&lt;br /&gt;
         &amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;&#039;&#039;&#039;return&#039;&#039;&#039;&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;pSoup&amp;lt;/font&amp;gt;;&lt;br /&gt;
     }&lt;br /&gt;
 &lt;br /&gt;
     &amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;&#039;&#039;&#039;public void&#039;&#039;&#039; SetProperties&amp;lt;/font&amp;gt;(&amp;lt;font color=&amp;quot;#800000&amp;quot;&amp;gt;&#039;&#039;&#039;Soup&#039;&#039;&#039;&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;pSoup&amp;lt;/font&amp;gt;)&lt;br /&gt;
     {&lt;br /&gt;
         &amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;&#039;&#039;&#039;inherited&#039;&#039;&#039;&amp;lt;/font&amp;gt;(&amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;pSoup&amp;lt;/font&amp;gt;);&lt;br /&gt;
     }&lt;br /&gt;
 };&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now you&#039;ll understand, why we have to return the Soup back to Trainz. We manipulate the values inside the Soup and Trainz has to know it, if Trainz should save the Soup for us.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
; &#039;&#039;&#039;Loading data&#039;&#039;&#039;&lt;br /&gt;
The oppisite of &amp;quot;Setting data&amp;quot; (SetNamedTag) is &amp;quot;Getting data&amp;quot; (GetNamedTag). And, yes, Soup has a method called &amp;quot;GetNamedTag&amp;quot;, but it&#039;ll return the value as a string. We need a boolean value.&lt;br /&gt;
So, we will use the method &amp;quot;GetNamedTagAsBool&amp;quot;. It expects only one paramter, the name of our value inside the Soup. We can directly assign the value of &amp;quot;GetNamedTagAsBool&amp;quot; to our variable.&lt;br /&gt;
But this is a oveerloaded function. There are some variants. Another variant expects two parameters. The first one is the name of our value, and the other one is a standard value, if the selected&lt;br /&gt;
value is not set in the Soup. We&#039;ll need that one! Because if we place an object in surveyor, there are no values inside the Soup. So, we can set an initial value for the door state. In our case we will set the initial door state to closed (so: m_bDoorOpened has to be false).&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;m_bDoorOpened&amp;lt;/font&amp;gt; = &amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;pSoup&amp;lt;/font&amp;gt;.&amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;GetNamedTagAsBool&amp;lt;/font&amp;gt;(&amp;lt;font color=&amp;quot;#808080&amp;quot;&amp;gt;&amp;quot;m_bDoorOpened&amp;quot;&amp;lt;/font&amp;gt;, &amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;&#039;&#039;&#039;false&#039;&#039;&#039;&amp;lt;/font&amp;gt;);&lt;br /&gt;
&lt;br /&gt;
If we put that part into our script it&#039;ll look like:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
; icecreamtruck.gs&lt;br /&gt;
 &#039;&#039;&#039;&amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;include&amp;lt;/font&amp;gt;&#039;&#039;&#039; &amp;lt;font color=&amp;quot;#808080&amp;quot;&amp;gt;&amp;quot;MapObject.gs&amp;quot;&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &#039;&#039;&#039;&amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;class&amp;lt;/font&amp;gt;&#039;&#039;&#039; &amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;CIceCreamTruck&amp;lt;/font&amp;gt; &#039;&#039;&#039;&amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;isclass&amp;lt;/font&amp;gt;&#039;&#039;&#039; &#039;&#039;&#039;&amp;lt;font color=&amp;quot;#800000&amp;quot;&amp;gt;MapObject&amp;lt;/font&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
 {&lt;br /&gt;
     &amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;&#039;&#039;&#039;bool&#039;&#039;&#039;&amp;lt;/font&amp;gt;        &amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;m_bDoorOpened&amp;lt;/font&amp;gt;;&lt;br /&gt;
 &lt;br /&gt;
     &amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;&#039;&#039;&#039;public void&#039;&#039;&#039; Init&amp;lt;/font&amp;gt;(&amp;lt;font color=&amp;quot;#800000&amp;quot;&amp;gt;&#039;&#039;&#039;Asset&#039;&#039;&#039;&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;pAsset&amp;lt;/font&amp;gt;)&lt;br /&gt;
     {&lt;br /&gt;
         &amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;&#039;&#039;&#039;inherited&#039;&#039;&#039;&amp;lt;/font&amp;gt;(&amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;pAsset&amp;lt;/font&amp;gt;);&lt;br /&gt;
     }&lt;br /&gt;
 &lt;br /&gt;
     &amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;&#039;&#039;&#039;public&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;#800000&amp;quot;&amp;gt;Soup&amp;lt;/font&amp;gt;&#039;&#039;&#039; &amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;GetProperties&amp;lt;/font&amp;gt;(&amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;&#039;&#039;&#039;void&#039;&#039;&#039;&amp;lt;/font&amp;gt;)&lt;br /&gt;
     {&lt;br /&gt;
         &#039;&#039;&#039;&amp;lt;font color=&amp;quot;#800000&amp;quot;&amp;gt;Soup&amp;lt;/font&amp;gt;&#039;&#039;&#039; &amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;pSoup&amp;lt;/font&amp;gt; = &amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;&#039;&#039;&#039;inherited&#039;&#039;&#039;&amp;lt;/font&amp;gt;();&lt;br /&gt;
         &amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;pSoup&amp;lt;/font&amp;gt;.&amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;SetNamedTag&amp;lt;/font&amp;gt;(&amp;lt;font color=&amp;quot;#808080&amp;quot;&amp;gt;&amp;quot;m_bDoorOpened&amp;quot;&amp;lt;/font&amp;gt;, &amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;m_bDoorOpened&amp;lt;/font&amp;gt;);&lt;br /&gt;
         &amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;&#039;&#039;&#039;return&#039;&#039;&#039;&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;pSoup&amp;lt;/font&amp;gt;;&lt;br /&gt;
     }&lt;br /&gt;
 &lt;br /&gt;
     &amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;&#039;&#039;&#039;public void&#039;&#039;&#039; SetProperties&amp;lt;/font&amp;gt;(&amp;lt;font color=&amp;quot;#800000&amp;quot;&amp;gt;&#039;&#039;&#039;Soup&#039;&#039;&#039;&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;pSoup&amp;lt;/font&amp;gt;)&lt;br /&gt;
     {&lt;br /&gt;
         &amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;&#039;&#039;&#039;inherited&#039;&#039;&#039;&amp;lt;/font&amp;gt;(&amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;pSoup&amp;lt;/font&amp;gt;);&lt;br /&gt;
         &amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;m_bDoorOpened&amp;lt;/font&amp;gt; = &amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;pSoup&amp;lt;/font&amp;gt;.&amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;GetNamedTagAsBool&amp;lt;/font&amp;gt;(&amp;lt;font color=&amp;quot;#808080&amp;quot;&amp;gt;&amp;quot;m_bDoorOpened&amp;quot;&amp;lt;/font&amp;gt;, &amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;&#039;&#039;&#039;false&#039;&#039;&#039;&amp;lt;/font&amp;gt;);&lt;br /&gt;
     }&lt;br /&gt;
 };&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now we can display and hide the meshes. But the object itself has to be prepared for it. The Ice cream truck has three meshes. The truck with a whole where the door is, a door in opened state and a door in closed state. You also may achieve this by using animations, but this way is pretty easier.&lt;br /&gt;
&lt;br /&gt;
[[File:Scripting_2_Truck_whole.jpg]]&amp;lt;br&amp;gt;&lt;br /&gt;
Truck with whole, where the door is&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Scripting_2_Doors_open.jpg]]&amp;lt;br&amp;gt;&lt;br /&gt;
Door in opened state&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Scripting_2_Doors_closed.jpg]]&amp;lt;br&amp;gt;&lt;br /&gt;
Door in closed state&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In script we reference the mesh-table entries of config.txt.&lt;br /&gt;
It may look like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[...]&lt;br /&gt;
&lt;br /&gt;
mesh-table&lt;br /&gt;
{  &lt;br /&gt;
   default&lt;br /&gt;
   {&lt;br /&gt;
     mesh                                &amp;quot;truck.im&amp;quot;&lt;br /&gt;
     auto-create                         1&lt;br /&gt;
   }&lt;br /&gt;
  &lt;br /&gt;
   door-opened&lt;br /&gt;
   {&lt;br /&gt;
     mesh                                &amp;quot;door_opened.im&amp;quot;&lt;br /&gt;
     auto-create                         0&lt;br /&gt;
   }&lt;br /&gt;
  &lt;br /&gt;
   door-closed&lt;br /&gt;
   {&lt;br /&gt;
     mesh                                &amp;quot;door_closed.im&amp;quot;&lt;br /&gt;
     auto-create                         0&lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
   [...]&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
[...]&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
All meshes we want to control by script may never have an auto-create value of 1! It has to be 0, otherwise we can&#039;t take the control over the meshes.&lt;br /&gt;
&lt;br /&gt;
Our CIceCreamTruck&#039;s parent class is MapObject. And MapObject&#039;s parent class is MeshObject, and there we will find a method that is called &amp;quot;SetMeshVisible&amp;quot;.&lt;br /&gt;
We can use it directly, because we automatically inherit from MeshObject, too.&lt;br /&gt;
SetMeshVsible expects three parameters. The name of our mesh-table entry, a state (true, false - [visible, invisible]) and a floating number that sets a fading time in seconds.&lt;br /&gt;
We&#039;ll leave the last parameter 0.0f.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;SetMeshVisible&amp;lt;/font&amp;gt;(&amp;lt;font color=&amp;quot;#808080&amp;quot;&amp;gt;&amp;quot;NAME&amp;quot;&amp;lt;/font&amp;gt;, &amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;&#039;&#039;&#039;true&#039;&#039;&#039;&amp;lt;/font&amp;gt;/&amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;&#039;&#039;&#039;false&#039;&#039;&#039;&amp;lt;/font&amp;gt;, &amp;lt;font color=&amp;quot;#FF8000&amp;quot;&amp;gt;0.0f&amp;lt;/font&amp;gt;);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We have two meshes, that has to be set. In script we&#039;ll hide/show them like this:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
; icecreamtruck.gs&lt;br /&gt;
 &#039;&#039;&#039;&amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;include&amp;lt;/font&amp;gt;&#039;&#039;&#039; &amp;lt;font color=&amp;quot;#808080&amp;quot;&amp;gt;&amp;quot;MapObject.gs&amp;quot;&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &#039;&#039;&#039;&amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;class&amp;lt;/font&amp;gt;&#039;&#039;&#039; &amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;CIceCreamTruck&amp;lt;/font&amp;gt; &#039;&#039;&#039;&amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;isclass&amp;lt;/font&amp;gt;&#039;&#039;&#039; &#039;&#039;&#039;&amp;lt;font color=&amp;quot;#800000&amp;quot;&amp;gt;MapObject&amp;lt;/font&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
 {&lt;br /&gt;
     &amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;&#039;&#039;&#039;bool&#039;&#039;&#039;&amp;lt;/font&amp;gt;        &amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;m_bDoorOpened&amp;lt;/font&amp;gt;;&lt;br /&gt;
 &lt;br /&gt;
     &amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;&#039;&#039;&#039;public void&#039;&#039;&#039; Init&amp;lt;/font&amp;gt;(&amp;lt;font color=&amp;quot;#800000&amp;quot;&amp;gt;&#039;&#039;&#039;Asset&#039;&#039;&#039;&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;pAsset&amp;lt;/font&amp;gt;)&lt;br /&gt;
     {&lt;br /&gt;
         &amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;&#039;&#039;&#039;inherited&#039;&#039;&#039;&amp;lt;/font&amp;gt;(&amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;pAsset&amp;lt;/font&amp;gt;);&lt;br /&gt;
     }&lt;br /&gt;
 &lt;br /&gt;
     &amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;&#039;&#039;&#039;public&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;#800000&amp;quot;&amp;gt;Soup&amp;lt;/font&amp;gt;&#039;&#039;&#039; &amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;GetProperties&amp;lt;/font&amp;gt;(&amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;&#039;&#039;&#039;void&#039;&#039;&#039;&amp;lt;/font&amp;gt;)&lt;br /&gt;
     {&lt;br /&gt;
         &#039;&#039;&#039;&amp;lt;font color=&amp;quot;#800000&amp;quot;&amp;gt;Soup&amp;lt;/font&amp;gt;&#039;&#039;&#039; &amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;pSoup&amp;lt;/font&amp;gt; = &amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;&#039;&#039;&#039;inherited&#039;&#039;&#039;&amp;lt;/font&amp;gt;();&lt;br /&gt;
         &amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;pSoup&amp;lt;/font&amp;gt;.&amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;SetNamedTag&amp;lt;/font&amp;gt;(&amp;lt;font color=&amp;quot;#808080&amp;quot;&amp;gt;&amp;quot;m_bDoorOpened&amp;quot;&amp;lt;/font&amp;gt;, &amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;m_bDoorOpened&amp;lt;/font&amp;gt;);&lt;br /&gt;
         &amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;&#039;&#039;&#039;return&#039;&#039;&#039;&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;pSoup&amp;lt;/font&amp;gt;;&lt;br /&gt;
     }&lt;br /&gt;
 &lt;br /&gt;
     &amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;&#039;&#039;&#039;public void&#039;&#039;&#039; SetProperties&amp;lt;/font&amp;gt;(&amp;lt;font color=&amp;quot;#800000&amp;quot;&amp;gt;&#039;&#039;&#039;Soup&#039;&#039;&#039;&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;pSoup&amp;lt;/font&amp;gt;)&lt;br /&gt;
     {&lt;br /&gt;
         &amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;&#039;&#039;&#039;inherited&#039;&#039;&#039;&amp;lt;/font&amp;gt;(&amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;pSoup&amp;lt;/font&amp;gt;);&lt;br /&gt;
         &amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;m_bDoorOpened&amp;lt;/font&amp;gt; = &amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;pSoup&amp;lt;/font&amp;gt;.&amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;GetNamedTagAsBool&amp;lt;/font&amp;gt;(&amp;lt;font color=&amp;quot;#808080&amp;quot;&amp;gt;&amp;quot;m_bDoorOpened&amp;quot;&amp;lt;/font&amp;gt;, &amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;&#039;&#039;&#039;false&#039;&#039;&#039;&amp;lt;/font&amp;gt;);&lt;br /&gt;
 &lt;br /&gt;
         &amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;SetMeshVisible&amp;lt;/font&amp;gt;(&amp;lt;font color=&amp;quot;#808080&amp;quot;&amp;gt;&amp;quot;door-opened&amp;quot;&amp;lt;/font&amp;gt;, &amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;m_bDoorOpened&amp;lt;/font&amp;gt;, &amp;lt;font color=&amp;quot;#FF8000&amp;quot;&amp;gt;0.0f&amp;lt;/font&amp;gt;);&lt;br /&gt;
         &amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;SetMeshVisible&amp;lt;/font&amp;gt;(&amp;lt;font color=&amp;quot;#808080&amp;quot;&amp;gt;&amp;quot;door-closed&amp;quot;&amp;lt;/font&amp;gt;, !&amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;m_bDoorOpened&amp;lt;/font&amp;gt;, &amp;lt;font color=&amp;quot;#FF8000&amp;quot;&amp;gt;0.0f&amp;lt;/font&amp;gt;);&lt;br /&gt;
     }&lt;br /&gt;
 };&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We can use our bool variable for indicating the mesh state. The opened mesh is set with the value of m_bDoorOpened. If m_bDoorOpened is true, the mesh will display, otherwise it&#039;ll hide.&lt;br /&gt;
The closed state mesh is set with the oppsite value of m_bDoorOpened. This can be easily done by using the &amp;quot;!&amp;quot;-operator. Just place it in front of a boolean variable, to use the opposite value.&lt;br /&gt;
&lt;br /&gt;
Now you know how to control meshes. Because it will be too much for now, I&#039;ll give the last part of the script without explanation and move it to another time :)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
; icecreamtruck.gs&lt;br /&gt;
 &#039;&#039;&#039;&amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;include&amp;lt;/font&amp;gt;&#039;&#039;&#039; &amp;lt;font color=&amp;quot;#808080&amp;quot;&amp;gt;&amp;quot;MapObject.gs&amp;quot;&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &#039;&#039;&#039;&amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;class&amp;lt;/font&amp;gt;&#039;&#039;&#039; &amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;CIceCreamTruck&amp;lt;/font&amp;gt; &#039;&#039;&#039;&amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;isclass&amp;lt;/font&amp;gt;&#039;&#039;&#039; &#039;&#039;&#039;&amp;lt;font color=&amp;quot;#800000&amp;quot;&amp;gt;MapObject&amp;lt;/font&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
 {&lt;br /&gt;
     &amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;&#039;&#039;&#039;bool&#039;&#039;&#039;&amp;lt;/font&amp;gt;        &amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;m_bDoorOpened&amp;lt;/font&amp;gt;;&lt;br /&gt;
 &lt;br /&gt;
     &amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;&#039;&#039;&#039;public void&#039;&#039;&#039; Init&amp;lt;/font&amp;gt;(&amp;lt;font color=&amp;quot;#800000&amp;quot;&amp;gt;&#039;&#039;&#039;Asset&#039;&#039;&#039;&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;pAsset&amp;lt;/font&amp;gt;)&lt;br /&gt;
     {&lt;br /&gt;
         &amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;&#039;&#039;&#039;inherited&#039;&#039;&#039;&amp;lt;/font&amp;gt;(&amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;pAsset&amp;lt;/font&amp;gt;);&lt;br /&gt;
     }&lt;br /&gt;
 &lt;br /&gt;
     &amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;&#039;&#039;&#039;public&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;#800000&amp;quot;&amp;gt;Soup&amp;lt;/font&amp;gt;&#039;&#039;&#039; &amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;GetProperties&amp;lt;/font&amp;gt;(&amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;&#039;&#039;&#039;void&#039;&#039;&#039;&amp;lt;/font&amp;gt;)&lt;br /&gt;
     {&lt;br /&gt;
         &#039;&#039;&#039;&amp;lt;font color=&amp;quot;#800000&amp;quot;&amp;gt;Soup&amp;lt;/font&amp;gt;&#039;&#039;&#039; &amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;pSoup&amp;lt;/font&amp;gt; = &amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;&#039;&#039;&#039;inherited&#039;&#039;&#039;&amp;lt;/font&amp;gt;();&lt;br /&gt;
         &amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;pSoup&amp;lt;/font&amp;gt;.&amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;SetNamedTag&amp;lt;/font&amp;gt;(&amp;lt;font color=&amp;quot;#808080&amp;quot;&amp;gt;&amp;quot;m_bDoorOpened&amp;quot;&amp;lt;/font&amp;gt;, &amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;m_bDoorOpened&amp;lt;/font&amp;gt;);&lt;br /&gt;
         &amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;&#039;&#039;&#039;return&#039;&#039;&#039;&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;pSoup&amp;lt;/font&amp;gt;;&lt;br /&gt;
     }&lt;br /&gt;
 &lt;br /&gt;
     &amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;&#039;&#039;&#039;public void&#039;&#039;&#039; SetProperties&amp;lt;/font&amp;gt;(&amp;lt;font color=&amp;quot;#800000&amp;quot;&amp;gt;&#039;&#039;&#039;Soup&#039;&#039;&#039;&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;pSoup&amp;lt;/font&amp;gt;)&lt;br /&gt;
     {&lt;br /&gt;
         &amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;&#039;&#039;&#039;inherited&#039;&#039;&#039;&amp;lt;/font&amp;gt;(&amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;pSoup&amp;lt;/font&amp;gt;);&lt;br /&gt;
         &amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;m_bDoorOpened&amp;lt;/font&amp;gt; = &amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;pSoup&amp;lt;/font&amp;gt;.&amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;GetNamedTagAsBool&amp;lt;/font&amp;gt;(&amp;lt;font color=&amp;quot;#808080&amp;quot;&amp;gt;&amp;quot;m_bDoorOpened&amp;quot;&amp;lt;/font&amp;gt;, &amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;&#039;&#039;&#039;false&#039;&#039;&#039;&amp;lt;/font&amp;gt;);&lt;br /&gt;
 &lt;br /&gt;
         &amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;SetMeshVisible&amp;lt;/font&amp;gt;(&amp;lt;font color=&amp;quot;#808080&amp;quot;&amp;gt;&amp;quot;door-opened&amp;quot;&amp;lt;/font&amp;gt;, &amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;m_bDoorOpened&amp;lt;/font&amp;gt;, &amp;lt;font color=&amp;quot;#FF8000&amp;quot;&amp;gt;0.0f&amp;lt;/font&amp;gt;);&lt;br /&gt;
         &amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;SetMeshVisible&amp;lt;/font&amp;gt;(&amp;lt;font color=&amp;quot;#808080&amp;quot;&amp;gt;&amp;quot;door-closed&amp;quot;&amp;lt;/font&amp;gt;, !&amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;m_bDoorOpened&amp;lt;/font&amp;gt;, &amp;lt;font color=&amp;quot;#FF8000&amp;quot;&amp;gt;0.0f&amp;lt;/font&amp;gt;);&lt;br /&gt;
     }&lt;br /&gt;
 &lt;br /&gt;
     &amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;//////////////////////////////////////////////////////////////////////////////////////////////////////////////&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
     &amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;&#039;&#039;&#039;public string&#039;&#039;&#039; GetDescriptionHTML&amp;lt;/font&amp;gt;(&amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;&#039;&#039;&#039;void&#039;&#039;&#039;&amp;lt;/font&amp;gt;)&lt;br /&gt;
     {&lt;br /&gt;
         &amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;&#039;&#039;&#039;string&#039;&#039;&#039;&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;sHtml&amp;lt;/font&amp;gt; = &amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;&#039;&#039;&#039;inherited&#039;&#039;&#039;&amp;lt;/font&amp;gt;();&lt;br /&gt;
         &amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;sHtml&amp;lt;/font&amp;gt; = &amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;sHtml&amp;lt;/font&amp;gt; + &amp;lt;font color=&amp;quot;#800000&amp;quot;&amp;gt;&#039;&#039;&#039;HTMLWindow&#039;&#039;&#039;&amp;lt;/font&amp;gt;.&amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;CheckBox&amp;lt;/font&amp;gt;(&amp;lt;font color=&amp;quot;#808080&amp;quot;&amp;gt;&amp;quot;live://property/m_bDoorOpened&amp;quot;&amp;lt;/font&amp;gt;, &amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;m_bDoorOpened&amp;lt;/font&amp;gt;) + &amp;lt;font color=&amp;quot;#808080&amp;quot;&amp;gt;&amp;quot;&amp;amp;amp;nbsp;Open door&amp;quot;&amp;lt;/font&amp;gt;;&lt;br /&gt;
         &amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;&#039;&#039;&#039;return&#039;&#039;&#039;&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;sHtml&amp;lt;/font&amp;gt;;&lt;br /&gt;
     }&lt;br /&gt;
 &lt;br /&gt;
     &amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;&#039;&#039;&#039;public string&#039;&#039;&#039; GetPropertyType&amp;lt;/font&amp;gt;(&amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;&#039;&#039;&#039;string&#039;&#039;&#039;&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;sPropertyId&amp;lt;/font&amp;gt;)&lt;br /&gt;
     {&lt;br /&gt;
         &amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;&#039;&#039;&#039;string&#039;&#039;&#039;&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;sRet&amp;lt;/font&amp;gt; = &amp;lt;font color=&amp;quot;#808080&amp;quot;&amp;gt;&amp;quot;link&amp;quot;&amp;lt;/font&amp;gt;;&lt;br /&gt;
         &amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;&#039;&#039;&#039;if&#039;&#039;&#039;&amp;lt;/font&amp;gt;(&amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;sPropertyId&amp;lt;/font&amp;gt; == &amp;lt;font color=&amp;quot;#808080&amp;quot;&amp;gt;&amp;quot;m_bDoorOpened&amp;quot;&amp;lt;/font&amp;gt;)&amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;sRet&amp;lt;/font&amp;gt; = &amp;lt;font color=&amp;quot;#808080&amp;quot;&amp;gt;&amp;quot;link&amp;quot;&amp;lt;/font&amp;gt;;&lt;br /&gt;
         &amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;&#039;&#039;&#039;return&#039;&#039;&#039;&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;sRet&amp;lt;/font&amp;gt;;&lt;br /&gt;
     }&lt;br /&gt;
 &lt;br /&gt;
     &amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;&#039;&#039;&#039;public void&#039;&#039;&#039; LinkPropertyValue&amp;lt;/font&amp;gt;(&amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;&#039;&#039;&#039;string&#039;&#039;&#039;&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;sPropertyId&amp;lt;/font&amp;gt;)&lt;br /&gt;
     {&lt;br /&gt;
         &amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;&#039;&#039;&#039;if&#039;&#039;&#039;&amp;lt;/font&amp;gt;(&amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;sPropertyId&amp;lt;/font&amp;gt; == &amp;lt;font color=&amp;quot;#808080&amp;quot;&amp;gt;&amp;quot;m_bDoorOpened&amp;quot;&amp;lt;/font&amp;gt;)&lt;br /&gt;
         {&lt;br /&gt;
             &amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;m_bDoorOpened&amp;lt;/font&amp;gt; = !&amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;m_bDoorOpened&amp;lt;/font&amp;gt;;&lt;br /&gt;
         }&lt;br /&gt;
     }&lt;br /&gt;
 };&lt;br /&gt;
&lt;br /&gt;
Hope you enjoyed an learned!&amp;lt;br&amp;gt;&lt;br /&gt;
Full example here: [[Media:TrainzDevIceCreamTruck.zip]] (Thanks to misterairbursh for the permission!)&lt;br /&gt;
&lt;br /&gt;
If you want to contact me, you may use this e-mail: callavsg@gmx.de&lt;br /&gt;
&lt;br /&gt;
callavsg&lt;/div&gt;</summary>
		<author><name>Callavsg</name></author>
	</entry>
	<entry>
		<id>https://wiki.trainzsimulator.com/index.php?title=File:TrainzDevIceCreamTruck.zip&amp;diff=8811</id>
		<title>File:TrainzDevIceCreamTruck.zip</title>
		<link rel="alternate" type="text/html" href="https://wiki.trainzsimulator.com/index.php?title=File:TrainzDevIceCreamTruck.zip&amp;diff=8811"/>
		<updated>2016-04-21T09:04:11Z</updated>

		<summary type="html">&lt;p&gt;Callavsg: Callavsg uploaded a new version of &amp;amp;quot;File:TrainzDevIceCreamTruck.zip&amp;amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Callavsg</name></author>
	</entry>
	<entry>
		<id>https://wiki.trainzsimulator.com/index.php?title=HowTo/Hide-_%26_Unhide_Meshes&amp;diff=8810</id>
		<title>HowTo/Hide- &amp; Unhide Meshes</title>
		<link rel="alternate" type="text/html" href="https://wiki.trainzsimulator.com/index.php?title=HowTo/Hide-_%26_Unhide_Meshes&amp;diff=8810"/>
		<updated>2016-04-21T09:02:05Z</updated>

		<summary type="html">&lt;p&gt;Callavsg: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;In [[HowTo/Your first Trainz Script]] we created the script:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
; myscript.gs&lt;br /&gt;
 &#039;&#039;&#039;&amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;include&amp;lt;/font&amp;gt;&#039;&#039;&#039; &amp;lt;font color=&amp;quot;#808080&amp;quot;&amp;gt;&amp;quot;MapObject.gs&amp;quot;&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &#039;&#039;&#039;&amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;class&amp;lt;/font&amp;gt;&#039;&#039;&#039; &amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;CMyClass&amp;lt;/font&amp;gt; &#039;&#039;&#039;&amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;isclass&amp;lt;/font&amp;gt;&#039;&#039;&#039; &#039;&#039;&#039;&amp;lt;font color=&amp;quot;#800000&amp;quot;&amp;gt;MapObject&amp;lt;/font&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
 {&lt;br /&gt;
     &amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;&#039;&#039;&#039;public void&#039;&#039;&#039; Init&amp;lt;/font&amp;gt;(&amp;lt;font color=&amp;quot;#800000&amp;quot;&amp;gt;&#039;&#039;&#039;Asset&#039;&#039;&#039;&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;pAsset&amp;lt;/font&amp;gt;)&lt;br /&gt;
     {&lt;br /&gt;
         &amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;&#039;&#039;&#039;inherited&#039;&#039;&#039;&amp;lt;/font&amp;gt;(&amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;pAsset&amp;lt;/font&amp;gt;);&lt;br /&gt;
     }&lt;br /&gt;
 };&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Today we&#039;re gonna use this little example for a vehicle. There is an ice cream truck on the DLS by misterairbrush (&amp;lt;kuid:414943:100987&amp;gt;). This ice cream truck has a door that can be set opened or closed.&lt;br /&gt;
It looks like:&lt;br /&gt;
&lt;br /&gt;
[[File:Scripting_02_Truck_1.jpg]] [[File:Scripting_02_Truck_2.jpg]]&lt;br /&gt;
&lt;br /&gt;
We&#039;ll learn today how to hide the &amp;quot;wrong&amp;quot; and show the right mesh. Also we want that the users may select the option in de &amp;quot;?&amp;quot;-Window of the scenery object.&lt;br /&gt;
First we need a member variable to store the information if the door is opened or closed, then we need functions to save and load the information every time the map[the vehicle] loads.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Variables may be described as kind of placeholders. These placeholders offers us the opportunity to save data temporary.&lt;br /&gt;
&lt;br /&gt;
In Trainz Script there are four (well, really there are five, but we will ignore one this time!) data [[Types]] we can use:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;bool&#039;&#039;&#039; - boolean constants true/false&lt;br /&gt;
* &#039;&#039;&#039;int&#039;&#039;&#039; - every number between -2147483647 and 2147483647 (a 32 Bit integer)&lt;br /&gt;
* &#039;&#039;&#039;string&#039;&#039;&#039; - characters&lt;br /&gt;
* &#039;&#039;&#039;float&#039;&#039;&#039; - floating numbers (32 Bit)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Today we&#039;ll have a closer look on the &#039;&#039;&#039;bool&#039;&#039;&#039; type. The others will be explained another time :)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In our case, we only need a true/false value.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;True&#039;&#039;&#039;: The user wants the door to be opened&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;False&#039;&#039;&#039;: The user wants the door to be closed&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
How do we declare a member variable? This is pretty easy:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
; icecreamtruck.gs&lt;br /&gt;
 &#039;&#039;&#039;&amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;include&amp;lt;/font&amp;gt;&#039;&#039;&#039; &amp;lt;font color=&amp;quot;#808080&amp;quot;&amp;gt;&amp;quot;MapObject.gs&amp;quot;&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &#039;&#039;&#039;&amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;class&amp;lt;/font&amp;gt;&#039;&#039;&#039; &amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;CIceCreamTruck&amp;lt;/font&amp;gt; &#039;&#039;&#039;&amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;isclass&amp;lt;/font&amp;gt;&#039;&#039;&#039; &#039;&#039;&#039;&amp;lt;font color=&amp;quot;#800000&amp;quot;&amp;gt;MapObject&amp;lt;/font&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
 {&lt;br /&gt;
     &amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;&#039;&#039;&#039;bool&#039;&#039;&#039;&amp;lt;/font&amp;gt;        &amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;m_bDoorOpened&amp;lt;/font&amp;gt;;&lt;br /&gt;
 &lt;br /&gt;
     &amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;&#039;&#039;&#039;public void&#039;&#039;&#039; Init&amp;lt;/font&amp;gt;(&amp;lt;font color=&amp;quot;#800000&amp;quot;&amp;gt;&#039;&#039;&#039;Asset&#039;&#039;&#039;&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;pAsset&amp;lt;/font&amp;gt;)&lt;br /&gt;
     {&lt;br /&gt;
         &amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;&#039;&#039;&#039;inherited&#039;&#039;&#039;&amp;lt;/font&amp;gt;(&amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;pAsset&amp;lt;/font&amp;gt;);&lt;br /&gt;
     }&lt;br /&gt;
 };&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
As you can see, we just have to begin with the type of our variable and then giving it a name. This is it. Now we can use it.&lt;br /&gt;
This variable now is available in the whole CIceCreamTruck-Class, because we declared it as member, so we may say it&#039;s a global variable (that isn&#039;t true, but it&#039;s easier to explain).&lt;br /&gt;
We also may declare variables within methods/functions. These then will only be accessable inside the function or method and not on other places in the script.&lt;br /&gt;
In Trainz Script there are now real global variables (that&#039;s why I think we may call the members global, even if it&#039;s not true). We only may declare variables inside classes.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Next, we will have a look an two new methods:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;[[Class_PropertyObject#GetProperties]] (GetProperties)&#039;&#039;&#039; - Save data to a soup&lt;br /&gt;
* &#039;&#039;&#039;[[Class_PropertyObject#SetProperties]] (SetProperties)&#039;&#039;&#039; - Fetch data from a Soup&lt;br /&gt;
&lt;br /&gt;
These methods are implemented in native code. That means we don&#039;t have to care about when they are called. We just have to override them. Trainz will call it every time it is needed.&lt;br /&gt;
Let&#039;s override them:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
; icecreamtruck.gs&lt;br /&gt;
 &#039;&#039;&#039;&amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;include&amp;lt;/font&amp;gt;&#039;&#039;&#039; &amp;lt;font color=&amp;quot;#808080&amp;quot;&amp;gt;&amp;quot;MapObject.gs&amp;quot;&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &#039;&#039;&#039;&amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;class&amp;lt;/font&amp;gt;&#039;&#039;&#039; &amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;CIceCreamTruck&amp;lt;/font&amp;gt; &#039;&#039;&#039;&amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;isclass&amp;lt;/font&amp;gt;&#039;&#039;&#039; &#039;&#039;&#039;&amp;lt;font color=&amp;quot;#800000&amp;quot;&amp;gt;MapObject&amp;lt;/font&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
 {&lt;br /&gt;
     &amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;&#039;&#039;&#039;bool&#039;&#039;&#039;&amp;lt;/font&amp;gt;        &amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;m_bDoorOpened&amp;lt;/font&amp;gt;;&lt;br /&gt;
 &lt;br /&gt;
     &amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;&#039;&#039;&#039;public void&#039;&#039;&#039; Init&amp;lt;/font&amp;gt;(&amp;lt;font color=&amp;quot;#800000&amp;quot;&amp;gt;&#039;&#039;&#039;Asset&#039;&#039;&#039;&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;pAsset&amp;lt;/font&amp;gt;)&lt;br /&gt;
     {&lt;br /&gt;
         &amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;&#039;&#039;&#039;inherited&#039;&#039;&#039;&amp;lt;/font&amp;gt;(&amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;pAsset&amp;lt;/font&amp;gt;);&lt;br /&gt;
     }&lt;br /&gt;
 &lt;br /&gt;
     &amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;&#039;&#039;&#039;public&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;#800000&amp;quot;&amp;gt;Soup&amp;lt;/font&amp;gt;&#039;&#039;&#039; &amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;GetProperties&amp;lt;/font&amp;gt;(&amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;&#039;&#039;&#039;void&#039;&#039;&#039;&amp;lt;/font&amp;gt;)&lt;br /&gt;
     {&lt;br /&gt;
         &#039;&#039;&#039;&amp;lt;font color=&amp;quot;#800000&amp;quot;&amp;gt;Soup&amp;lt;/font&amp;gt;&#039;&#039;&#039; &amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;pSoup&amp;lt;/font&amp;gt; = &amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;&#039;&#039;&#039;inherited&#039;&#039;&#039;&amp;lt;/font&amp;gt;();&lt;br /&gt;
         &amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;&#039;&#039;&#039;return&#039;&#039;&#039;&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;pSoup&amp;lt;/font&amp;gt;;&lt;br /&gt;
     }&lt;br /&gt;
 &lt;br /&gt;
     &amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;&#039;&#039;&#039;public void&#039;&#039;&#039; SetProperties&amp;lt;/font&amp;gt;(&amp;lt;font color=&amp;quot;#800000&amp;quot;&amp;gt;&#039;&#039;&#039;Soup&#039;&#039;&#039;&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;pSoup&amp;lt;/font&amp;gt;)&lt;br /&gt;
     {&lt;br /&gt;
         &amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;&#039;&#039;&#039;inherited&#039;&#039;&#039;&amp;lt;/font&amp;gt;(&amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;pSoup&amp;lt;/font&amp;gt;);&lt;br /&gt;
     }&lt;br /&gt;
 };&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
; GetProperties:&lt;br /&gt;
As I said above, this functions task is to save data into a Soup. It expects a Soup-Object to be returend. You&#039;ll see, that Soup is a class, not a data type,&lt;br /&gt;
&lt;br /&gt;
But we&#039;re able to declare class instances as variables too. (Look at: &#039;&#039;&#039;&amp;lt;font color=&amp;quot;#800000&amp;quot;&amp;gt;Soup&amp;lt;/font&amp;gt;&#039;&#039;&#039; &amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;pSoup&amp;lt;/font&amp;gt; = &amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;&#039;&#039;&#039;inherited&#039;&#039;&#039;&amp;lt;/font&amp;gt;();)&lt;br /&gt;
&lt;br /&gt;
And again: The inherited is in here!&lt;br /&gt;
Every function/method we override has in most cases to inherit the parent classes method. The inherited in here calls GetProperties of Class MapObject. This makes sure, that every operation inside a method of the parent class is called too. Remember: We overrided the method. If we don&#039;t inherit it here again, the parent classes GetProperties-Method will never be called!&lt;br /&gt;
Only miss the call to inherited if you want to disable functionallity for a class, if not, don&#039;t forget it.&lt;br /&gt;
&lt;br /&gt;
In the script above, we return the Soup directly, without any operation. What exactly return types are will be explained another time :) (it will be too much for us now!)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
; SetProperties:&lt;br /&gt;
In this method we get a paramter of type soup. We inherit the MapObject-Setproprties. This time we don&#039;t have to return any value. Here we will load the data from the Soup we got as paramter.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
; &#039;&#039;&#039;Saving data&#039;&#039;&#039;&lt;br /&gt;
I already explained that Soup is a class. So it may has members, and in fact, it has. Look at: [[Class_Soup]]&lt;br /&gt;
&lt;br /&gt;
A Soup is like a small database. We can set values by a name and a value. I use the variable name as name, because I don&#039;t have to look it up every time, and not to think, what name&lt;br /&gt;
the value inside the soup has. The method &amp;quot;SetNamedTag&amp;quot; in class Soup is the right here for us to save a value. We can access all public methods inside a class with the dereference operator, that&lt;br /&gt;
is a single dot (&#039;&#039;&#039;.&#039;&#039;&#039;). So, we call the function like this:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;pSoup&amp;lt;/font&amp;gt;.&amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;SetNamedTag&amp;lt;/font&amp;gt;(&amp;lt;font color=&amp;quot;#808080&amp;quot;&amp;gt;&amp;quot;NAME&amp;quot;&amp;lt;/font&amp;gt;, [VALUE]);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now in script, it looks like:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
; icecreamtruck.gs&lt;br /&gt;
 &#039;&#039;&#039;&amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;include&amp;lt;/font&amp;gt;&#039;&#039;&#039; &amp;lt;font color=&amp;quot;#808080&amp;quot;&amp;gt;&amp;quot;MapObject.gs&amp;quot;&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &#039;&#039;&#039;&amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;class&amp;lt;/font&amp;gt;&#039;&#039;&#039; &amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;CIceCreamTruck&amp;lt;/font&amp;gt; &#039;&#039;&#039;&amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;isclass&amp;lt;/font&amp;gt;&#039;&#039;&#039; &#039;&#039;&#039;&amp;lt;font color=&amp;quot;#800000&amp;quot;&amp;gt;MapObject&amp;lt;/font&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
 {&lt;br /&gt;
     &amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;&#039;&#039;&#039;bool&#039;&#039;&#039;&amp;lt;/font&amp;gt;        &amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;m_bDoorOpened&amp;lt;/font&amp;gt;;&lt;br /&gt;
 &lt;br /&gt;
     &amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;&#039;&#039;&#039;public void&#039;&#039;&#039; Init&amp;lt;/font&amp;gt;(&amp;lt;font color=&amp;quot;#800000&amp;quot;&amp;gt;&#039;&#039;&#039;Asset&#039;&#039;&#039;&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;pAsset&amp;lt;/font&amp;gt;)&lt;br /&gt;
     {&lt;br /&gt;
         &amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;&#039;&#039;&#039;inherited&#039;&#039;&#039;&amp;lt;/font&amp;gt;(&amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;pAsset&amp;lt;/font&amp;gt;);&lt;br /&gt;
     }&lt;br /&gt;
 &lt;br /&gt;
     &amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;&#039;&#039;&#039;public&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;#800000&amp;quot;&amp;gt;Soup&amp;lt;/font&amp;gt;&#039;&#039;&#039; &amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;GetProperties&amp;lt;/font&amp;gt;(&amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;&#039;&#039;&#039;void&#039;&#039;&#039;&amp;lt;/font&amp;gt;)&lt;br /&gt;
     {&lt;br /&gt;
         &#039;&#039;&#039;&amp;lt;font color=&amp;quot;#800000&amp;quot;&amp;gt;Soup&amp;lt;/font&amp;gt;&#039;&#039;&#039; &amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;pSoup&amp;lt;/font&amp;gt; = &amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;&#039;&#039;&#039;inherited&#039;&#039;&#039;&amp;lt;/font&amp;gt;();&lt;br /&gt;
         &amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;pSoup&amp;lt;/font&amp;gt;.&amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;SetNamedTag&amp;lt;/font&amp;gt;(&amp;lt;font color=&amp;quot;#808080&amp;quot;&amp;gt;&amp;quot;m_bDoorOpened&amp;quot;&amp;lt;/font&amp;gt;, &amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;m_bDoorOpened&amp;lt;/font&amp;gt;);&lt;br /&gt;
         &amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;&#039;&#039;&#039;return&#039;&#039;&#039;&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;pSoup&amp;lt;/font&amp;gt;;&lt;br /&gt;
     }&lt;br /&gt;
 &lt;br /&gt;
     &amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;&#039;&#039;&#039;public void&#039;&#039;&#039; SetProperties&amp;lt;/font&amp;gt;(&amp;lt;font color=&amp;quot;#800000&amp;quot;&amp;gt;&#039;&#039;&#039;Soup&#039;&#039;&#039;&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;pSoup&amp;lt;/font&amp;gt;)&lt;br /&gt;
     {&lt;br /&gt;
         &amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;&#039;&#039;&#039;inherited&#039;&#039;&#039;&amp;lt;/font&amp;gt;(&amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;pSoup&amp;lt;/font&amp;gt;);&lt;br /&gt;
     }&lt;br /&gt;
 };&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now you&#039;ll understand, why we have to return the Soup back to Trainz. We manipulate the values inside the Soup and Trainz has to know it, if Trainz should save the Soup for us.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
; &#039;&#039;&#039;Loading data&#039;&#039;&#039;&lt;br /&gt;
The oppisite of &amp;quot;Setting data&amp;quot; (SetNamedTag) is &amp;quot;Getting data&amp;quot; (GetNamedTag). And, yes, Soup has a method called &amp;quot;GetNamedTag&amp;quot;, but it&#039;ll return the value as a string. We need a boolean value.&lt;br /&gt;
So, we will use the method &amp;quot;GetNamedTagAsBool&amp;quot;. It expects only one paramter, the name of our value inside the Soup. We can directly assign the value of &amp;quot;GetNamedTagAsBool&amp;quot; to our variable.&lt;br /&gt;
But this is a oveerloaded function. There are some variants. Another variant expects two parameters. The first one is the name of our value, and the other one is a standard value, if the selected&lt;br /&gt;
value is not set in the Soup. We&#039;ll need that one! Because if we place an object in surveyor, there are no values inside the Soup. So, we can set an initial value for the door state. In our case we will set the initial door state to closed (so: m_bDoorOpened has to be false).&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;m_bDoorOpened&amp;lt;/font&amp;gt; = &amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;pSoup&amp;lt;/font&amp;gt;.&amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;GetNamedTagAsBool&amp;lt;/font&amp;gt;(&amp;lt;font color=&amp;quot;#808080&amp;quot;&amp;gt;&amp;quot;m_bDoorOpened&amp;quot;&amp;lt;/font&amp;gt;, &amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;&#039;&#039;&#039;false&#039;&#039;&#039;&amp;lt;/font&amp;gt;);&lt;br /&gt;
&lt;br /&gt;
If we put that part into our script it&#039;ll look like:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
; icecreamtruck.gs&lt;br /&gt;
 &#039;&#039;&#039;&amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;include&amp;lt;/font&amp;gt;&#039;&#039;&#039; &amp;lt;font color=&amp;quot;#808080&amp;quot;&amp;gt;&amp;quot;MapObject.gs&amp;quot;&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &#039;&#039;&#039;&amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;class&amp;lt;/font&amp;gt;&#039;&#039;&#039; &amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;CIceCreamTruck&amp;lt;/font&amp;gt; &#039;&#039;&#039;&amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;isclass&amp;lt;/font&amp;gt;&#039;&#039;&#039; &#039;&#039;&#039;&amp;lt;font color=&amp;quot;#800000&amp;quot;&amp;gt;MapObject&amp;lt;/font&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
 {&lt;br /&gt;
     &amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;&#039;&#039;&#039;bool&#039;&#039;&#039;&amp;lt;/font&amp;gt;        &amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;m_bDoorOpened&amp;lt;/font&amp;gt;;&lt;br /&gt;
 &lt;br /&gt;
     &amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;&#039;&#039;&#039;public void&#039;&#039;&#039; Init&amp;lt;/font&amp;gt;(&amp;lt;font color=&amp;quot;#800000&amp;quot;&amp;gt;&#039;&#039;&#039;Asset&#039;&#039;&#039;&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;pAsset&amp;lt;/font&amp;gt;)&lt;br /&gt;
     {&lt;br /&gt;
         &amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;&#039;&#039;&#039;inherited&#039;&#039;&#039;&amp;lt;/font&amp;gt;(&amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;pAsset&amp;lt;/font&amp;gt;);&lt;br /&gt;
     }&lt;br /&gt;
 &lt;br /&gt;
     &amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;&#039;&#039;&#039;public&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;#800000&amp;quot;&amp;gt;Soup&amp;lt;/font&amp;gt;&#039;&#039;&#039; &amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;GetProperties&amp;lt;/font&amp;gt;(&amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;&#039;&#039;&#039;void&#039;&#039;&#039;&amp;lt;/font&amp;gt;)&lt;br /&gt;
     {&lt;br /&gt;
         &#039;&#039;&#039;&amp;lt;font color=&amp;quot;#800000&amp;quot;&amp;gt;Soup&amp;lt;/font&amp;gt;&#039;&#039;&#039; &amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;pSoup&amp;lt;/font&amp;gt; = &amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;&#039;&#039;&#039;inherited&#039;&#039;&#039;&amp;lt;/font&amp;gt;();&lt;br /&gt;
         &amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;pSoup&amp;lt;/font&amp;gt;.&amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;SetNamedTag&amp;lt;/font&amp;gt;(&amp;lt;font color=&amp;quot;#808080&amp;quot;&amp;gt;&amp;quot;m_bDoorOpened&amp;quot;&amp;lt;/font&amp;gt;, &amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;m_bDoorOpened&amp;lt;/font&amp;gt;);&lt;br /&gt;
         &amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;&#039;&#039;&#039;return&#039;&#039;&#039;&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;pSoup&amp;lt;/font&amp;gt;;&lt;br /&gt;
     }&lt;br /&gt;
 &lt;br /&gt;
     &amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;&#039;&#039;&#039;public void&#039;&#039;&#039; SetProperties&amp;lt;/font&amp;gt;(&amp;lt;font color=&amp;quot;#800000&amp;quot;&amp;gt;&#039;&#039;&#039;Soup&#039;&#039;&#039;&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;pSoup&amp;lt;/font&amp;gt;)&lt;br /&gt;
     {&lt;br /&gt;
         &amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;&#039;&#039;&#039;inherited&#039;&#039;&#039;&amp;lt;/font&amp;gt;(&amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;pSoup&amp;lt;/font&amp;gt;);&lt;br /&gt;
         &amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;m_bDoorOpened&amp;lt;/font&amp;gt; = &amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;pSoup&amp;lt;/font&amp;gt;.&amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;GetNamedTagAsBool&amp;lt;/font&amp;gt;(&amp;lt;font color=&amp;quot;#808080&amp;quot;&amp;gt;&amp;quot;m_bDoorOpened&amp;quot;&amp;lt;/font&amp;gt;, &amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;&#039;&#039;&#039;false&#039;&#039;&#039;&amp;lt;/font&amp;gt;);&lt;br /&gt;
     }&lt;br /&gt;
 };&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now we can display and hide the meshes. But the object itself has to be prepared for it. The Ice cream truck has three meshes. The truck with a whole where the door is, a door in opened state and a door in closed state. You also may achieve this by using animations, but this way is pretty easier.&lt;br /&gt;
&lt;br /&gt;
[[File:Scripting_2_Truck_whole.jpg]]&amp;lt;br&amp;gt;&lt;br /&gt;
Truck with whole, where the door is&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Scripting_2_Doors_open.jpg]]&amp;lt;br&amp;gt;&lt;br /&gt;
Door in opened state&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Scripting_2_Doors_closed.jpg]]&amp;lt;br&amp;gt;&lt;br /&gt;
Door in closed state&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In script we reference the mesh-table entries of config.txt.&lt;br /&gt;
It may look like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[...]&lt;br /&gt;
&lt;br /&gt;
mesh-table&lt;br /&gt;
{  &lt;br /&gt;
   default&lt;br /&gt;
   {&lt;br /&gt;
     mesh                                &amp;quot;truck.im&amp;quot;&lt;br /&gt;
     auto-create                         1&lt;br /&gt;
   }&lt;br /&gt;
  &lt;br /&gt;
   door-opened&lt;br /&gt;
   {&lt;br /&gt;
     mesh                                &amp;quot;door_opened.im&amp;quot;&lt;br /&gt;
     auto-create                         0&lt;br /&gt;
   }&lt;br /&gt;
  &lt;br /&gt;
   door-closed&lt;br /&gt;
   {&lt;br /&gt;
     mesh                                &amp;quot;door_closed.im&amp;quot;&lt;br /&gt;
     auto-create                         0&lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
   [...]&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
[...]&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
All meshes we want to control by script may never have an auto-create value of 1! It has to be 0, otherwise we can&#039;t take the control over the meshes.&lt;br /&gt;
&lt;br /&gt;
Our CIceCreamTruck&#039;s parent class is MapObject. And MapObject&#039;s parent class is MeshObject, and there we will find a method that is called &amp;quot;SetMeshVisible&amp;quot;.&lt;br /&gt;
We can use it directly, because we automatically inherit from MeshObject, too.&lt;br /&gt;
SetMeshVsible expects three parameters. The name of our mesh-table entry, a state (true, false - [visible, invisible]) and a floating number that sets a fading time in seconds.&lt;br /&gt;
We&#039;ll leave the last parameter 0.0f.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;SetMeshVisible&amp;lt;/font&amp;gt;(&amp;lt;font color=&amp;quot;#808080&amp;quot;&amp;gt;&amp;quot;NAME&amp;quot;&amp;lt;/font&amp;gt;, &amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;&#039;&#039;&#039;true&#039;&#039;&#039;&amp;lt;/font&amp;gt;/&amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;&#039;&#039;&#039;false&#039;&#039;&#039;&amp;lt;/font&amp;gt;, &amp;lt;font color=&amp;quot;#FF8000&amp;quot;&amp;gt;0.0f&amp;lt;/font&amp;gt;);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We have two meshes, that has to be set. In script we&#039;ll hide/show them like this:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
; icecreamtruck.gs&lt;br /&gt;
 &#039;&#039;&#039;&amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;include&amp;lt;/font&amp;gt;&#039;&#039;&#039; &amp;lt;font color=&amp;quot;#808080&amp;quot;&amp;gt;&amp;quot;MapObject.gs&amp;quot;&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &#039;&#039;&#039;&amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;class&amp;lt;/font&amp;gt;&#039;&#039;&#039; &amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;CIceCreamTruck&amp;lt;/font&amp;gt; &#039;&#039;&#039;&amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;isclass&amp;lt;/font&amp;gt;&#039;&#039;&#039; &#039;&#039;&#039;&amp;lt;font color=&amp;quot;#800000&amp;quot;&amp;gt;MapObject&amp;lt;/font&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
 {&lt;br /&gt;
     &amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;&#039;&#039;&#039;bool&#039;&#039;&#039;&amp;lt;/font&amp;gt;        &amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;m_bDoorOpened&amp;lt;/font&amp;gt;;&lt;br /&gt;
 &lt;br /&gt;
     &amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;&#039;&#039;&#039;public void&#039;&#039;&#039; Init&amp;lt;/font&amp;gt;(&amp;lt;font color=&amp;quot;#800000&amp;quot;&amp;gt;&#039;&#039;&#039;Asset&#039;&#039;&#039;&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;pAsset&amp;lt;/font&amp;gt;)&lt;br /&gt;
     {&lt;br /&gt;
         &amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;&#039;&#039;&#039;inherited&#039;&#039;&#039;&amp;lt;/font&amp;gt;(&amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;pAsset&amp;lt;/font&amp;gt;);&lt;br /&gt;
     }&lt;br /&gt;
 &lt;br /&gt;
     &amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;&#039;&#039;&#039;public&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;#800000&amp;quot;&amp;gt;Soup&amp;lt;/font&amp;gt;&#039;&#039;&#039; &amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;GetProperties&amp;lt;/font&amp;gt;(&amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;&#039;&#039;&#039;void&#039;&#039;&#039;&amp;lt;/font&amp;gt;)&lt;br /&gt;
     {&lt;br /&gt;
         &#039;&#039;&#039;&amp;lt;font color=&amp;quot;#800000&amp;quot;&amp;gt;Soup&amp;lt;/font&amp;gt;&#039;&#039;&#039; &amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;pSoup&amp;lt;/font&amp;gt; = &amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;&#039;&#039;&#039;inherited&#039;&#039;&#039;&amp;lt;/font&amp;gt;();&lt;br /&gt;
         &amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;pSoup&amp;lt;/font&amp;gt;.&amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;SetNamedTag&amp;lt;/font&amp;gt;(&amp;lt;font color=&amp;quot;#808080&amp;quot;&amp;gt;&amp;quot;m_bDoorOpened&amp;quot;&amp;lt;/font&amp;gt;, &amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;m_bDoorOpened&amp;lt;/font&amp;gt;);&lt;br /&gt;
         &amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;&#039;&#039;&#039;return&#039;&#039;&#039;&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;pSoup&amp;lt;/font&amp;gt;;&lt;br /&gt;
     }&lt;br /&gt;
 &lt;br /&gt;
     &amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;&#039;&#039;&#039;public void&#039;&#039;&#039; SetProperties&amp;lt;/font&amp;gt;(&amp;lt;font color=&amp;quot;#800000&amp;quot;&amp;gt;&#039;&#039;&#039;Soup&#039;&#039;&#039;&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;pSoup&amp;lt;/font&amp;gt;)&lt;br /&gt;
     {&lt;br /&gt;
         &amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;&#039;&#039;&#039;inherited&#039;&#039;&#039;&amp;lt;/font&amp;gt;(&amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;pSoup&amp;lt;/font&amp;gt;);&lt;br /&gt;
         &amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;m_bDoorOpened&amp;lt;/font&amp;gt; = &amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;pSoup&amp;lt;/font&amp;gt;.&amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;GetNamedTagAsBool&amp;lt;/font&amp;gt;(&amp;lt;font color=&amp;quot;#808080&amp;quot;&amp;gt;&amp;quot;m_bDoorOpened&amp;quot;&amp;lt;/font&amp;gt;, &amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;&#039;&#039;&#039;false&#039;&#039;&#039;&amp;lt;/font&amp;gt;);&lt;br /&gt;
 &lt;br /&gt;
         &amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;SetMeshVisible&amp;lt;/font&amp;gt;(&amp;lt;font color=&amp;quot;#808080&amp;quot;&amp;gt;&amp;quot;door-opened&amp;quot;&amp;lt;/font&amp;gt;, &amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;m_bDoorOpened&amp;lt;/font&amp;gt;, &amp;lt;font color=&amp;quot;#FF8000&amp;quot;&amp;gt;0.0f&amp;lt;/font&amp;gt;);&lt;br /&gt;
         &amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;SetMeshVisible&amp;lt;/font&amp;gt;(&amp;lt;font color=&amp;quot;#808080&amp;quot;&amp;gt;&amp;quot;door-closed&amp;quot;&amp;lt;/font&amp;gt;, !&amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;m_bDoorOpened&amp;lt;/font&amp;gt;, &amp;lt;font color=&amp;quot;#FF8000&amp;quot;&amp;gt;0.0f&amp;lt;/font&amp;gt;);&lt;br /&gt;
     }&lt;br /&gt;
 };&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We can use our bool variable for indicating the mesh state. The opened mesh is set with the value of m_bDoorOpened. If m_bDoorOpened is true, the mesh will display, otherwise it&#039;ll hide.&lt;br /&gt;
The closed state mesh is set with the oppsite value of m_bDoorOpened. This can be easily done by using the &amp;quot;!&amp;quot;-operator. Just place it in front of a boolean variable, to use the opposite value.&lt;br /&gt;
&lt;br /&gt;
Now you know how to control meshes. Because it will be too much for now, I&#039;ll give the last part of the script without explanation and move it to another time :)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
; icecreamtruck.gs&lt;br /&gt;
 &#039;&#039;&#039;&amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;include&amp;lt;/font&amp;gt;&#039;&#039;&#039; &amp;lt;font color=&amp;quot;#808080&amp;quot;&amp;gt;&amp;quot;MapObject.gs&amp;quot;&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &#039;&#039;&#039;&amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;class&amp;lt;/font&amp;gt;&#039;&#039;&#039; &amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;CIceCreamTruck&amp;lt;/font&amp;gt; &#039;&#039;&#039;&amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;isclass&amp;lt;/font&amp;gt;&#039;&#039;&#039; &#039;&#039;&#039;&amp;lt;font color=&amp;quot;#800000&amp;quot;&amp;gt;MapObject&amp;lt;/font&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
 {&lt;br /&gt;
     &amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;&#039;&#039;&#039;bool&#039;&#039;&#039;&amp;lt;/font&amp;gt;        &amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;m_bDoorOpened&amp;lt;/font&amp;gt;;&lt;br /&gt;
 &lt;br /&gt;
     &amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;&#039;&#039;&#039;public void&#039;&#039;&#039; Init&amp;lt;/font&amp;gt;(&amp;lt;font color=&amp;quot;#800000&amp;quot;&amp;gt;&#039;&#039;&#039;Asset&#039;&#039;&#039;&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;pAsset&amp;lt;/font&amp;gt;)&lt;br /&gt;
     {&lt;br /&gt;
         &amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;&#039;&#039;&#039;inherited&#039;&#039;&#039;&amp;lt;/font&amp;gt;(&amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;pAsset&amp;lt;/font&amp;gt;);&lt;br /&gt;
     }&lt;br /&gt;
 &lt;br /&gt;
     &amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;&#039;&#039;&#039;public&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;#800000&amp;quot;&amp;gt;Soup&amp;lt;/font&amp;gt;&#039;&#039;&#039; &amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;GetProperties&amp;lt;/font&amp;gt;(&amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;&#039;&#039;&#039;void&#039;&#039;&#039;&amp;lt;/font&amp;gt;)&lt;br /&gt;
     {&lt;br /&gt;
         &#039;&#039;&#039;&amp;lt;font color=&amp;quot;#800000&amp;quot;&amp;gt;Soup&amp;lt;/font&amp;gt;&#039;&#039;&#039; &amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;pSoup&amp;lt;/font&amp;gt; = &amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;&#039;&#039;&#039;inherited&#039;&#039;&#039;&amp;lt;/font&amp;gt;();&lt;br /&gt;
         &amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;pSoup&amp;lt;/font&amp;gt;.&amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;SetNamedTag&amp;lt;/font&amp;gt;(&amp;lt;font color=&amp;quot;#808080&amp;quot;&amp;gt;&amp;quot;m_bDoorOpened&amp;quot;&amp;lt;/font&amp;gt;, &amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;m_bDoorOpened&amp;lt;/font&amp;gt;);&lt;br /&gt;
         &amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;&#039;&#039;&#039;return&#039;&#039;&#039;&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;pSoup&amp;lt;/font&amp;gt;;&lt;br /&gt;
     }&lt;br /&gt;
 &lt;br /&gt;
     &amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;&#039;&#039;&#039;public void&#039;&#039;&#039; SetProperties&amp;lt;/font&amp;gt;(&amp;lt;font color=&amp;quot;#800000&amp;quot;&amp;gt;&#039;&#039;&#039;Soup&#039;&#039;&#039;&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;pSoup&amp;lt;/font&amp;gt;)&lt;br /&gt;
     {&lt;br /&gt;
         &amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;&#039;&#039;&#039;inherited&#039;&#039;&#039;&amp;lt;/font&amp;gt;(&amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;pSoup&amp;lt;/font&amp;gt;);&lt;br /&gt;
         &amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;m_bDoorOpened&amp;lt;/font&amp;gt; = &amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;pSoup&amp;lt;/font&amp;gt;.&amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;GetNamedTagAsBool&amp;lt;/font&amp;gt;(&amp;lt;font color=&amp;quot;#808080&amp;quot;&amp;gt;&amp;quot;m_bDoorOpened&amp;quot;&amp;lt;/font&amp;gt;, &amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;&#039;&#039;&#039;false&#039;&#039;&#039;&amp;lt;/font&amp;gt;);&lt;br /&gt;
 &lt;br /&gt;
         &amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;SetMeshVisible&amp;lt;/font&amp;gt;(&amp;lt;font color=&amp;quot;#808080&amp;quot;&amp;gt;&amp;quot;door-opened&amp;quot;&amp;lt;/font&amp;gt;, &amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;m_bDoorOpened&amp;lt;/font&amp;gt;, &amp;lt;font color=&amp;quot;#FF8000&amp;quot;&amp;gt;0.0f&amp;lt;/font&amp;gt;);&lt;br /&gt;
         &amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;SetMeshVisible&amp;lt;/font&amp;gt;(&amp;lt;font color=&amp;quot;#808080&amp;quot;&amp;gt;&amp;quot;door-closed&amp;quot;&amp;lt;/font&amp;gt;, !&amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;m_bDoorOpened&amp;lt;/font&amp;gt;, &amp;lt;font color=&amp;quot;#FF8000&amp;quot;&amp;gt;0.0f&amp;lt;/font&amp;gt;);&lt;br /&gt;
     }&lt;br /&gt;
 &lt;br /&gt;
     &amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;//////////////////////////////////////////////////////////////////////////////////////////////////////////////&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
     &amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;&#039;&#039;&#039;public string&#039;&#039;&#039; GetDescriptionHTML&amp;lt;/font&amp;gt;(&amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;&#039;&#039;&#039;void&#039;&#039;&#039;&amp;lt;/font&amp;gt;)&lt;br /&gt;
     {&lt;br /&gt;
         &amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;&#039;&#039;&#039;string&#039;&#039;&#039;&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;sHtml&amp;lt;/font&amp;gt; = &amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;&#039;&#039;&#039;inherited&#039;&#039;&#039;&amp;lt;/font&amp;gt;();&lt;br /&gt;
         &amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;sHtml&amp;lt;/font&amp;gt; = &amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;sHtml&amp;lt;/font&amp;gt; + &amp;lt;font color=&amp;quot;#800000&amp;quot;&amp;gt;&#039;&#039;&#039;HTMLWindow&#039;&#039;&#039;&amp;lt;/font&amp;gt;.&amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;CheckBox&amp;lt;/font&amp;gt;(&amp;lt;font color=&amp;quot;#808080&amp;quot;&amp;gt;&amp;quot;live://property/m_bDoorOpened&amp;quot;&amp;lt;/font&amp;gt;, &amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;m_bDoorOpened&amp;lt;/font&amp;gt;) + &amp;lt;font color=&amp;quot;#808080&amp;quot;&amp;gt;&amp;quot;&amp;amp;amp;nbsp;Open door&amp;quot;&amp;lt;/font&amp;gt;;&lt;br /&gt;
         &amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;&#039;&#039;&#039;return&#039;&#039;&#039;&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;sHtml&amp;lt;/font&amp;gt;;&lt;br /&gt;
     }&lt;br /&gt;
 &lt;br /&gt;
     &amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;&#039;&#039;&#039;public string&#039;&#039;&#039; GetPropertyType&amp;lt;/font&amp;gt;(&amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;&#039;&#039;&#039;string&#039;&#039;&#039;&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;sPropertyId&amp;lt;/font&amp;gt;)&lt;br /&gt;
     {&lt;br /&gt;
         &amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;&#039;&#039;&#039;string&#039;&#039;&#039;&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;sRet&amp;lt;/font&amp;gt; = &amp;lt;font color=&amp;quot;#808080&amp;quot;&amp;gt;&amp;quot;link&amp;quot;&amp;lt;/font&amp;gt;;&lt;br /&gt;
         &amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;&#039;&#039;&#039;if&#039;&#039;&#039;&amp;lt;/font&amp;gt;(&amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;sPropertyId&amp;lt;/font&amp;gt; == &amp;lt;font color=&amp;quot;#808080&amp;quot;&amp;gt;&amp;quot;m_bDoorOpened&amp;quot;&amp;lt;/font&amp;gt;)&amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;sRet&amp;lt;/font&amp;gt; = &amp;lt;font color=&amp;quot;#808080&amp;quot;&amp;gt;&amp;quot;link&amp;quot;&amp;lt;/font&amp;gt;;&lt;br /&gt;
         &amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;&#039;&#039;&#039;return&#039;&#039;&#039;&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;sRet&amp;lt;/font&amp;gt;;&lt;br /&gt;
     }&lt;br /&gt;
 &lt;br /&gt;
     &amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;&#039;&#039;&#039;public void&#039;&#039;&#039; LinkPropertyValue&amp;lt;/font&amp;gt;(&amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;&#039;&#039;&#039;string&#039;&#039;&#039;&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;sPropertyId&amp;lt;/font&amp;gt;)&lt;br /&gt;
     {&lt;br /&gt;
         &amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;&#039;&#039;&#039;if&#039;&#039;&#039;&amp;lt;/font&amp;gt;(&amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;sPropertyId&amp;lt;/font&amp;gt; == &amp;lt;font color=&amp;quot;#808080&amp;quot;&amp;gt;&amp;quot;m_bDoorOpened&amp;quot;&amp;lt;/font&amp;gt;)&lt;br /&gt;
         {&lt;br /&gt;
             &amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;m_bDoorOpened&amp;lt;/font&amp;gt; = !&amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;m_bDoorOpened&amp;lt;/font&amp;gt;;&lt;br /&gt;
         }&lt;br /&gt;
     }&lt;br /&gt;
 };&lt;br /&gt;
&lt;br /&gt;
Hope you enjoyed an learned!&amp;lt;br&amp;gt;&lt;br /&gt;
Full example here: [[Media:TrainzDevIceCreamTruck.zip]]&lt;br /&gt;
&lt;br /&gt;
If you want to contact me, you may use this e-mail: callavsg@gmx.de&lt;br /&gt;
&lt;br /&gt;
callavsg&lt;/div&gt;</summary>
		<author><name>Callavsg</name></author>
	</entry>
	<entry>
		<id>https://wiki.trainzsimulator.com/index.php?title=File:TrainzDevIceCreamTruck.zip&amp;diff=8809</id>
		<title>File:TrainzDevIceCreamTruck.zip</title>
		<link rel="alternate" type="text/html" href="https://wiki.trainzsimulator.com/index.php?title=File:TrainzDevIceCreamTruck.zip&amp;diff=8809"/>
		<updated>2016-04-21T08:57:08Z</updated>

		<summary type="html">&lt;p&gt;Callavsg: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Callavsg</name></author>
	</entry>
	<entry>
		<id>https://wiki.trainzsimulator.com/index.php?title=HowTo/Hide-_%26_Unhide_Meshes&amp;diff=8808</id>
		<title>HowTo/Hide- &amp; Unhide Meshes</title>
		<link rel="alternate" type="text/html" href="https://wiki.trainzsimulator.com/index.php?title=HowTo/Hide-_%26_Unhide_Meshes&amp;diff=8808"/>
		<updated>2016-04-21T08:32:14Z</updated>

		<summary type="html">&lt;p&gt;Callavsg: Created page with &amp;quot;In HowTo/Your first Trainz Script we created the script:   ; myscript.gs  &amp;#039;&amp;#039;&amp;#039;&amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;include&amp;lt;/font&amp;gt;&amp;#039;&amp;#039;&amp;#039; &amp;lt;font color=&amp;quot;#808080&amp;quot;&amp;gt;&amp;quot;MapObject.gs&amp;quot;&amp;lt;/font&amp;gt;    &amp;#039;&amp;#039;&amp;#039;&amp;lt;fon...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;In [[HowTo/Your first Trainz Script]] we created the script:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
; myscript.gs&lt;br /&gt;
 &#039;&#039;&#039;&amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;include&amp;lt;/font&amp;gt;&#039;&#039;&#039; &amp;lt;font color=&amp;quot;#808080&amp;quot;&amp;gt;&amp;quot;MapObject.gs&amp;quot;&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &#039;&#039;&#039;&amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;class&amp;lt;/font&amp;gt;&#039;&#039;&#039; &amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;CMyClass&amp;lt;/font&amp;gt; &#039;&#039;&#039;&amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;isclass&amp;lt;/font&amp;gt;&#039;&#039;&#039; &#039;&#039;&#039;&amp;lt;font color=&amp;quot;#800000&amp;quot;&amp;gt;MapObject&amp;lt;/font&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
 {&lt;br /&gt;
     &amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;&#039;&#039;&#039;public void&#039;&#039;&#039; Init&amp;lt;/font&amp;gt;(&amp;lt;font color=&amp;quot;#800000&amp;quot;&amp;gt;&#039;&#039;&#039;Asset&#039;&#039;&#039;&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;pAsset&amp;lt;/font&amp;gt;)&lt;br /&gt;
     {&lt;br /&gt;
         &amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;&#039;&#039;&#039;inherited&#039;&#039;&#039;&amp;lt;/font&amp;gt;(&amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;pAsset&amp;lt;/font&amp;gt;);&lt;br /&gt;
     }&lt;br /&gt;
 };&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Today we&#039;re gonna use this little example for a vehicle. There is an ice cream truck on the DLS by misterairbrush (&amp;lt;kuid:414943:100987&amp;gt;). This ice cream truck has a door that can be set opened or closed.&lt;br /&gt;
It looks like:&lt;br /&gt;
&lt;br /&gt;
[[File:Scripting_02_Truck_1.jpg]] [[File:Scripting_02_Truck_2.jpg]]&lt;br /&gt;
&lt;br /&gt;
We&#039;ll learn today how to hide the &amp;quot;wrong&amp;quot; and show the right mesh. Also we want that the users may select the option in de &amp;quot;?&amp;quot;-Window of the scenery object.&lt;br /&gt;
First we need a member variable to store the information if the door is opened or closed, then we need functions to save and load the information every time the map[the vehicle] loads.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Variables may be described as kind of placeholders. These placeholders offers us the opportunity to save data temporary.&lt;br /&gt;
&lt;br /&gt;
In Trainz Script there are four (well, really there are five, but we will ignore one this time!) data [[Types]] we can use:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;bool&#039;&#039;&#039; - boolean constants true/false&lt;br /&gt;
* &#039;&#039;&#039;int&#039;&#039;&#039; - every number between -2147483647 and 2147483647 (a 32 Bit integer)&lt;br /&gt;
* &#039;&#039;&#039;string&#039;&#039;&#039; - characters&lt;br /&gt;
* &#039;&#039;&#039;float&#039;&#039;&#039; - floating numbers (32 Bit)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Today we&#039;ll have a closer look on the &#039;&#039;&#039;bool&#039;&#039;&#039; type. The others will be explained another time :)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In our case, we only need a true/false value.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;True&#039;&#039;&#039;: The user wants the door to be opened&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;False&#039;&#039;&#039;: The user wants the door to be closed&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
How do we declare a member variable? This is pretty easy:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
; icecreamtruck.gs&lt;br /&gt;
 &#039;&#039;&#039;&amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;include&amp;lt;/font&amp;gt;&#039;&#039;&#039; &amp;lt;font color=&amp;quot;#808080&amp;quot;&amp;gt;&amp;quot;MapObject.gs&amp;quot;&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &#039;&#039;&#039;&amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;class&amp;lt;/font&amp;gt;&#039;&#039;&#039; &amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;CIceCreamTruck&amp;lt;/font&amp;gt; &#039;&#039;&#039;&amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;isclass&amp;lt;/font&amp;gt;&#039;&#039;&#039; &#039;&#039;&#039;&amp;lt;font color=&amp;quot;#800000&amp;quot;&amp;gt;MapObject&amp;lt;/font&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
 {&lt;br /&gt;
     &amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;&#039;&#039;&#039;bool&#039;&#039;&#039;&amp;lt;/font&amp;gt;        &amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;m_bDoorOpened&amp;lt;/font&amp;gt;;&lt;br /&gt;
 &lt;br /&gt;
     &amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;&#039;&#039;&#039;public void&#039;&#039;&#039; Init&amp;lt;/font&amp;gt;(&amp;lt;font color=&amp;quot;#800000&amp;quot;&amp;gt;&#039;&#039;&#039;Asset&#039;&#039;&#039;&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;pAsset&amp;lt;/font&amp;gt;)&lt;br /&gt;
     {&lt;br /&gt;
         &amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;&#039;&#039;&#039;inherited&#039;&#039;&#039;&amp;lt;/font&amp;gt;(&amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;pAsset&amp;lt;/font&amp;gt;);&lt;br /&gt;
     }&lt;br /&gt;
 };&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
As you can see, we just have to begin with the type of our variable and then giving it a name. This is it. Now we can use it.&lt;br /&gt;
This variable now is available in the whole CIceCreamTruck-Class, because we declared it as member, so we may say it&#039;s a global variable (that isn&#039;t true, but it&#039;s easier to explain).&lt;br /&gt;
We also may declare variables within methods/functions. These then will only be accessable inside the function or method and not on other places in the script.&lt;br /&gt;
In Trainz Script there are now real global variables (that&#039;s why I think we may call the members global, even if it&#039;s not true). We only may declare variables inside classes.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Next, we will have a look an two new methods:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;[[Class_PropertyObject#GetProperties]] (GetProperties)&#039;&#039;&#039; - Save data to a soup&lt;br /&gt;
* &#039;&#039;&#039;[[Class_PropertyObject#SetProperties]] (SetProperties)&#039;&#039;&#039; - Fetch data from a Soup&lt;br /&gt;
&lt;br /&gt;
These methods are implemented in native code. That means we don&#039;t have to care about when they are called. We just have to override them. Trainz will call it every time it is needed.&lt;br /&gt;
Let&#039;s override them:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
; icecreamtruck.gs&lt;br /&gt;
 &#039;&#039;&#039;&amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;include&amp;lt;/font&amp;gt;&#039;&#039;&#039; &amp;lt;font color=&amp;quot;#808080&amp;quot;&amp;gt;&amp;quot;MapObject.gs&amp;quot;&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &#039;&#039;&#039;&amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;class&amp;lt;/font&amp;gt;&#039;&#039;&#039; &amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;CIceCreamTruck&amp;lt;/font&amp;gt; &#039;&#039;&#039;&amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;isclass&amp;lt;/font&amp;gt;&#039;&#039;&#039; &#039;&#039;&#039;&amp;lt;font color=&amp;quot;#800000&amp;quot;&amp;gt;MapObject&amp;lt;/font&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
 {&lt;br /&gt;
     &amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;&#039;&#039;&#039;bool&#039;&#039;&#039;&amp;lt;/font&amp;gt;        &amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;m_bDoorOpened&amp;lt;/font&amp;gt;;&lt;br /&gt;
 &lt;br /&gt;
     &amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;&#039;&#039;&#039;public void&#039;&#039;&#039; Init&amp;lt;/font&amp;gt;(&amp;lt;font color=&amp;quot;#800000&amp;quot;&amp;gt;&#039;&#039;&#039;Asset&#039;&#039;&#039;&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;pAsset&amp;lt;/font&amp;gt;)&lt;br /&gt;
     {&lt;br /&gt;
         &amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;&#039;&#039;&#039;inherited&#039;&#039;&#039;&amp;lt;/font&amp;gt;(&amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;pAsset&amp;lt;/font&amp;gt;);&lt;br /&gt;
     }&lt;br /&gt;
 &lt;br /&gt;
     &amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;&#039;&#039;&#039;public&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;#800000&amp;quot;&amp;gt;Soup&amp;lt;/font&amp;gt;&#039;&#039;&#039; &amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;GetProperties&amp;lt;/font&amp;gt;(&amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;&#039;&#039;&#039;void&#039;&#039;&#039;&amp;lt;/font&amp;gt;)&lt;br /&gt;
     {&lt;br /&gt;
         &#039;&#039;&#039;&amp;lt;font color=&amp;quot;#800000&amp;quot;&amp;gt;Soup&amp;lt;/font&amp;gt;&#039;&#039;&#039; &amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;pSoup&amp;lt;/font&amp;gt; = &amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;&#039;&#039;&#039;inherited&#039;&#039;&#039;&amp;lt;/font&amp;gt;();&lt;br /&gt;
         &amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;&#039;&#039;&#039;return&#039;&#039;&#039;&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;pSoup&amp;lt;/font&amp;gt;;&lt;br /&gt;
     }&lt;br /&gt;
 &lt;br /&gt;
     &amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;&#039;&#039;&#039;public void&#039;&#039;&#039; SetProperties&amp;lt;/font&amp;gt;(&amp;lt;font color=&amp;quot;#800000&amp;quot;&amp;gt;&#039;&#039;&#039;Soup&#039;&#039;&#039;&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;pSoup&amp;lt;/font&amp;gt;)&lt;br /&gt;
     {&lt;br /&gt;
         &amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;&#039;&#039;&#039;inherited&#039;&#039;&#039;&amp;lt;/font&amp;gt;(&amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;pSoup&amp;lt;/font&amp;gt;);&lt;br /&gt;
     }&lt;br /&gt;
 };&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
; GetProperties:&lt;br /&gt;
As I said above, this functions task is to save data into a Soup. It expects a Soup-Object to be returend. You&#039;ll see, that Soup is a class, not a data type,&lt;br /&gt;
&lt;br /&gt;
But we&#039;re able to declare class instances as variables too. (Look at: &#039;&#039;&#039;&amp;lt;font color=&amp;quot;#800000&amp;quot;&amp;gt;Soup&amp;lt;/font&amp;gt;&#039;&#039;&#039; &amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;pSoup&amp;lt;/font&amp;gt; = &amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;&#039;&#039;&#039;inherited&#039;&#039;&#039;&amp;lt;/font&amp;gt;();)&lt;br /&gt;
&lt;br /&gt;
And again: The inherited is in here!&lt;br /&gt;
Every function/method we override has in most cases to inherit the parent classes method. The inherited in here calls GetProperties of Class MapObject. This makes sure, that every operation inside a method of the parent class is called too. Remember: We overrided the method. If we don&#039;t inherit it here again, the parent classes GetProperties-Method will never be called!&lt;br /&gt;
Only miss the call to inherited if you want to disable functionallity for a class, if not, don&#039;t forget it.&lt;br /&gt;
&lt;br /&gt;
In the script above, we return the Soup directly, without any operation. What exactly return types are will be explained another time :) (it will be too much for us now!)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
; SetProperties:&lt;br /&gt;
In this method we get a paramter of type soup. We inherit the MapObject-Setproprties. This time we don&#039;t have to return any value. Here we will load the data from the Soup we got as paramter.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
; &#039;&#039;&#039;Saving data&#039;&#039;&#039;&lt;br /&gt;
I already explained that Soup is a class. So it may has members, and in fact, it has. Look at: [[Class_Soup]]&lt;br /&gt;
&lt;br /&gt;
A Soup is like a small database. We can set values by a name and a value. I use the variable name as name, because I don&#039;t have to look it up every time, and not to think, what name&lt;br /&gt;
the value inside the soup has. The method &amp;quot;SetNamedTag&amp;quot; in class Soup is the right here for us to save a value. We can access all public methods inside a class with the dereference operator, that&lt;br /&gt;
is a single dot (&#039;&#039;&#039;.&#039;&#039;&#039;). So, we call the function like this:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;pSoup&amp;lt;/font&amp;gt;.&amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;SetNamedTag&amp;lt;/font&amp;gt;(&amp;lt;font color=&amp;quot;#808080&amp;quot;&amp;gt;&amp;quot;NAME&amp;quot;&amp;lt;/font&amp;gt;, [VALUE]);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now in script, it looks like:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
; icecreamtruck.gs&lt;br /&gt;
 &#039;&#039;&#039;&amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;include&amp;lt;/font&amp;gt;&#039;&#039;&#039; &amp;lt;font color=&amp;quot;#808080&amp;quot;&amp;gt;&amp;quot;MapObject.gs&amp;quot;&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &#039;&#039;&#039;&amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;class&amp;lt;/font&amp;gt;&#039;&#039;&#039; &amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;CIceCreamTruck&amp;lt;/font&amp;gt; &#039;&#039;&#039;&amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;isclass&amp;lt;/font&amp;gt;&#039;&#039;&#039; &#039;&#039;&#039;&amp;lt;font color=&amp;quot;#800000&amp;quot;&amp;gt;MapObject&amp;lt;/font&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
 {&lt;br /&gt;
     &amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;&#039;&#039;&#039;bool&#039;&#039;&#039;&amp;lt;/font&amp;gt;        &amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;m_bDoorOpened&amp;lt;/font&amp;gt;;&lt;br /&gt;
 &lt;br /&gt;
     &amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;&#039;&#039;&#039;public void&#039;&#039;&#039; Init&amp;lt;/font&amp;gt;(&amp;lt;font color=&amp;quot;#800000&amp;quot;&amp;gt;&#039;&#039;&#039;Asset&#039;&#039;&#039;&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;pAsset&amp;lt;/font&amp;gt;)&lt;br /&gt;
     {&lt;br /&gt;
         &amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;&#039;&#039;&#039;inherited&#039;&#039;&#039;&amp;lt;/font&amp;gt;(&amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;pAsset&amp;lt;/font&amp;gt;);&lt;br /&gt;
     }&lt;br /&gt;
 &lt;br /&gt;
     &amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;&#039;&#039;&#039;public&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;#800000&amp;quot;&amp;gt;Soup&amp;lt;/font&amp;gt;&#039;&#039;&#039; &amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;GetProperties&amp;lt;/font&amp;gt;(&amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;&#039;&#039;&#039;void&#039;&#039;&#039;&amp;lt;/font&amp;gt;)&lt;br /&gt;
     {&lt;br /&gt;
         &#039;&#039;&#039;&amp;lt;font color=&amp;quot;#800000&amp;quot;&amp;gt;Soup&amp;lt;/font&amp;gt;&#039;&#039;&#039; &amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;pSoup&amp;lt;/font&amp;gt; = &amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;&#039;&#039;&#039;inherited&#039;&#039;&#039;&amp;lt;/font&amp;gt;();&lt;br /&gt;
         &amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;pSoup&amp;lt;/font&amp;gt;.&amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;SetNamedTag&amp;lt;/font&amp;gt;(&amp;lt;font color=&amp;quot;#808080&amp;quot;&amp;gt;&amp;quot;bDoorOpened&amp;quot;&amp;lt;/font&amp;gt;, &amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;m_bDoorOpened&amp;lt;/font&amp;gt;);&lt;br /&gt;
         &amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;&#039;&#039;&#039;return&#039;&#039;&#039;&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;pSoup&amp;lt;/font&amp;gt;;&lt;br /&gt;
     }&lt;br /&gt;
 &lt;br /&gt;
     &amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;&#039;&#039;&#039;public void&#039;&#039;&#039; SetProperties&amp;lt;/font&amp;gt;(&amp;lt;font color=&amp;quot;#800000&amp;quot;&amp;gt;&#039;&#039;&#039;Soup&#039;&#039;&#039;&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;pSoup&amp;lt;/font&amp;gt;)&lt;br /&gt;
     {&lt;br /&gt;
         &amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;&#039;&#039;&#039;inherited&#039;&#039;&#039;&amp;lt;/font&amp;gt;(&amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;pSoup&amp;lt;/font&amp;gt;);&lt;br /&gt;
     }&lt;br /&gt;
 };&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now you&#039;ll understand, why we have to return the Soup back to Trainz. We manipulate the values inside the Soup and Trainz has to know it, if Trainz should save the Soup for us.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
; &#039;&#039;&#039;Loading data&#039;&#039;&#039;&lt;br /&gt;
The oppisite of &amp;quot;Setting data&amp;quot; (SetNamedTag) is &amp;quot;Getting data&amp;quot; (GetNamedTag). And, yes, Soup has a method called &amp;quot;GetNamedTag&amp;quot;, but it&#039;ll return the value as a string. We need a boolean value.&lt;br /&gt;
So, we will use the method &amp;quot;GetNamedTagAsBool&amp;quot;. It expects only one paramter, the name of our value inside the Soup. We can directly assign the value of &amp;quot;GetNamedTagAsBool&amp;quot; to our variable.&lt;br /&gt;
But this is a oveerloaded function. There are some variants. Another variant expects two parameters. The first one is the name of our value, and the other one is a standard value, if the selected&lt;br /&gt;
value is not set in the Soup. We&#039;ll need that one! Because if we place an object in surveyor, there are no values inside the Soup. So, we can set an initial value for the door state. In our case we will set the initial door state to closed (so: m_bDoorOpened has to be false).&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;m_bDoorOpened&amp;lt;/font&amp;gt; = &amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;pSoup&amp;lt;/font&amp;gt;.&amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;GetNamedTagAsBool&amp;lt;/font&amp;gt;(&amp;lt;font color=&amp;quot;#808080&amp;quot;&amp;gt;&amp;quot;m_bDoorOpened&amp;quot;&amp;lt;/font&amp;gt;, &amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;&#039;&#039;&#039;false&#039;&#039;&#039;&amp;lt;/font&amp;gt;);&lt;br /&gt;
&lt;br /&gt;
If we put that part into our script it&#039;ll look like:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
; icecreamtruck.gs&lt;br /&gt;
 &#039;&#039;&#039;&amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;include&amp;lt;/font&amp;gt;&#039;&#039;&#039; &amp;lt;font color=&amp;quot;#808080&amp;quot;&amp;gt;&amp;quot;MapObject.gs&amp;quot;&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &#039;&#039;&#039;&amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;class&amp;lt;/font&amp;gt;&#039;&#039;&#039; &amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;CIceCreamTruck&amp;lt;/font&amp;gt; &#039;&#039;&#039;&amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;isclass&amp;lt;/font&amp;gt;&#039;&#039;&#039; &#039;&#039;&#039;&amp;lt;font color=&amp;quot;#800000&amp;quot;&amp;gt;MapObject&amp;lt;/font&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
 {&lt;br /&gt;
     &amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;&#039;&#039;&#039;bool&#039;&#039;&#039;&amp;lt;/font&amp;gt;        &amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;m_bDoorOpened&amp;lt;/font&amp;gt;;&lt;br /&gt;
 &lt;br /&gt;
     &amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;&#039;&#039;&#039;public void&#039;&#039;&#039; Init&amp;lt;/font&amp;gt;(&amp;lt;font color=&amp;quot;#800000&amp;quot;&amp;gt;&#039;&#039;&#039;Asset&#039;&#039;&#039;&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;pAsset&amp;lt;/font&amp;gt;)&lt;br /&gt;
     {&lt;br /&gt;
         &amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;&#039;&#039;&#039;inherited&#039;&#039;&#039;&amp;lt;/font&amp;gt;(&amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;pAsset&amp;lt;/font&amp;gt;);&lt;br /&gt;
     }&lt;br /&gt;
 &lt;br /&gt;
     &amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;&#039;&#039;&#039;public&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;#800000&amp;quot;&amp;gt;Soup&amp;lt;/font&amp;gt;&#039;&#039;&#039; &amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;GetProperties&amp;lt;/font&amp;gt;(&amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;&#039;&#039;&#039;void&#039;&#039;&#039;&amp;lt;/font&amp;gt;)&lt;br /&gt;
     {&lt;br /&gt;
         &#039;&#039;&#039;&amp;lt;font color=&amp;quot;#800000&amp;quot;&amp;gt;Soup&amp;lt;/font&amp;gt;&#039;&#039;&#039; &amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;pSoup&amp;lt;/font&amp;gt; = &amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;&#039;&#039;&#039;inherited&#039;&#039;&#039;&amp;lt;/font&amp;gt;();&lt;br /&gt;
         &amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;pSoup&amp;lt;/font&amp;gt;.&amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;SetNamedTag&amp;lt;/font&amp;gt;(&amp;lt;font color=&amp;quot;#808080&amp;quot;&amp;gt;&amp;quot;bDoorOpened&amp;quot;&amp;lt;/font&amp;gt;, &amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;m_bDoorOpened&amp;lt;/font&amp;gt;);&lt;br /&gt;
         &amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;&#039;&#039;&#039;return&#039;&#039;&#039;&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;pSoup&amp;lt;/font&amp;gt;;&lt;br /&gt;
     }&lt;br /&gt;
 &lt;br /&gt;
     &amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;&#039;&#039;&#039;public void&#039;&#039;&#039; SetProperties&amp;lt;/font&amp;gt;(&amp;lt;font color=&amp;quot;#800000&amp;quot;&amp;gt;&#039;&#039;&#039;Soup&#039;&#039;&#039;&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;pSoup&amp;lt;/font&amp;gt;)&lt;br /&gt;
     {&lt;br /&gt;
         &amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;&#039;&#039;&#039;inherited&#039;&#039;&#039;&amp;lt;/font&amp;gt;(&amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;pSoup&amp;lt;/font&amp;gt;);&lt;br /&gt;
         &amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;m_bDoorOpened&amp;lt;/font&amp;gt; = &amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;pSoup&amp;lt;/font&amp;gt;.&amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;GetNamedTagAsBool&amp;lt;/font&amp;gt;(&amp;lt;font color=&amp;quot;#808080&amp;quot;&amp;gt;&amp;quot;m_bDoorOpened&amp;quot;&amp;lt;/font&amp;gt;, &amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;&#039;&#039;&#039;false&#039;&#039;&#039;&amp;lt;/font&amp;gt;);&lt;br /&gt;
     }&lt;br /&gt;
 };&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now we can display and hide the meshes. But the object itself has to be prepared for it. The Ice cream truck has three meshes. The truck with a whole where the door is, a door in opened state and a door in closed state. You also may achieve this by using animations, but this way is pretty easier.&lt;br /&gt;
&lt;br /&gt;
[[File:Scripting_2_Truck_whole.jpg]]&amp;lt;br&amp;gt;&lt;br /&gt;
Truck with whole, where the door is&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Scripting_2_Doors_open.jpg]]&amp;lt;br&amp;gt;&lt;br /&gt;
Door in opened state&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Scripting_2_Doors_closed.jpg]]&amp;lt;br&amp;gt;&lt;br /&gt;
Door in closed state&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In script we reference the mesh-table entries of config.txt.&lt;br /&gt;
It may look like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[...]&lt;br /&gt;
&lt;br /&gt;
mesh-table&lt;br /&gt;
{  &lt;br /&gt;
   default&lt;br /&gt;
   {&lt;br /&gt;
     mesh                                &amp;quot;truck.im&amp;quot;&lt;br /&gt;
     auto-create                         1&lt;br /&gt;
   }&lt;br /&gt;
  &lt;br /&gt;
   door-opened&lt;br /&gt;
   {&lt;br /&gt;
     mesh                                &amp;quot;door_opened.im&amp;quot;&lt;br /&gt;
     auto-create                         0&lt;br /&gt;
   }&lt;br /&gt;
  &lt;br /&gt;
   door-closed&lt;br /&gt;
   {&lt;br /&gt;
     mesh                                &amp;quot;door_closed.im&amp;quot;&lt;br /&gt;
     auto-create                         0&lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
   [...]&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
[...]&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
All meshes we want to control by script may never have an auto-create value of 1! It has to be 0, otherwise we can&#039;t take the control over the meshes.&lt;br /&gt;
&lt;br /&gt;
Our CIceCreamTruck&#039;s parent class is MapObject. And MapObject&#039;s parent class is MeshObject, and there we will find a method that is called &amp;quot;SetMeshVisible&amp;quot;.&lt;br /&gt;
We can use it directly, because we automatically inherit from MeshObject, too.&lt;br /&gt;
SetMeshVsible expects three parameters. The name of our mesh-table entry, a state (true, false - [visible, invisible]) and a floating number that sets a fading time in seconds.&lt;br /&gt;
We&#039;ll leave the last parameter 0.0f.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;SetMeshVisible&amp;lt;/font&amp;gt;(&amp;lt;font color=&amp;quot;#808080&amp;quot;&amp;gt;&amp;quot;NAME&amp;quot;&amp;lt;/font&amp;gt;, &amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;&#039;&#039;&#039;true&#039;&#039;&#039;&amp;lt;/font&amp;gt;/&amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;&#039;&#039;&#039;false&#039;&#039;&#039;&amp;lt;/font&amp;gt;, &amp;lt;font color=&amp;quot;#FF8000&amp;quot;&amp;gt;0.0f&amp;lt;/font&amp;gt;);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We have two meshes, that has to be set. In script we&#039;ll hide/show them like this:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
; icecreamtruck.gs&lt;br /&gt;
 &#039;&#039;&#039;&amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;include&amp;lt;/font&amp;gt;&#039;&#039;&#039; &amp;lt;font color=&amp;quot;#808080&amp;quot;&amp;gt;&amp;quot;MapObject.gs&amp;quot;&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &#039;&#039;&#039;&amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;class&amp;lt;/font&amp;gt;&#039;&#039;&#039; &amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;CIceCreamTruck&amp;lt;/font&amp;gt; &#039;&#039;&#039;&amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;isclass&amp;lt;/font&amp;gt;&#039;&#039;&#039; &#039;&#039;&#039;&amp;lt;font color=&amp;quot;#800000&amp;quot;&amp;gt;MapObject&amp;lt;/font&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
 {&lt;br /&gt;
     &amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;&#039;&#039;&#039;bool&#039;&#039;&#039;&amp;lt;/font&amp;gt;        &amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;m_bDoorOpened&amp;lt;/font&amp;gt;;&lt;br /&gt;
 &lt;br /&gt;
     &amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;&#039;&#039;&#039;public void&#039;&#039;&#039; Init&amp;lt;/font&amp;gt;(&amp;lt;font color=&amp;quot;#800000&amp;quot;&amp;gt;&#039;&#039;&#039;Asset&#039;&#039;&#039;&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;pAsset&amp;lt;/font&amp;gt;)&lt;br /&gt;
     {&lt;br /&gt;
         &amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;&#039;&#039;&#039;inherited&#039;&#039;&#039;&amp;lt;/font&amp;gt;(&amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;pAsset&amp;lt;/font&amp;gt;);&lt;br /&gt;
     }&lt;br /&gt;
 &lt;br /&gt;
     &amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;&#039;&#039;&#039;public&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;#800000&amp;quot;&amp;gt;Soup&amp;lt;/font&amp;gt;&#039;&#039;&#039; &amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;GetProperties&amp;lt;/font&amp;gt;(&amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;&#039;&#039;&#039;void&#039;&#039;&#039;&amp;lt;/font&amp;gt;)&lt;br /&gt;
     {&lt;br /&gt;
         &#039;&#039;&#039;&amp;lt;font color=&amp;quot;#800000&amp;quot;&amp;gt;Soup&amp;lt;/font&amp;gt;&#039;&#039;&#039; &amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;pSoup&amp;lt;/font&amp;gt; = &amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;&#039;&#039;&#039;inherited&#039;&#039;&#039;&amp;lt;/font&amp;gt;();&lt;br /&gt;
         &amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;pSoup&amp;lt;/font&amp;gt;.&amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;SetNamedTag&amp;lt;/font&amp;gt;(&amp;lt;font color=&amp;quot;#808080&amp;quot;&amp;gt;&amp;quot;bDoorOpened&amp;quot;&amp;lt;/font&amp;gt;, &amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;m_bDoorOpened&amp;lt;/font&amp;gt;);&lt;br /&gt;
         &amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;&#039;&#039;&#039;return&#039;&#039;&#039;&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;pSoup&amp;lt;/font&amp;gt;;&lt;br /&gt;
     }&lt;br /&gt;
 &lt;br /&gt;
     &amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;&#039;&#039;&#039;public void&#039;&#039;&#039; SetProperties&amp;lt;/font&amp;gt;(&amp;lt;font color=&amp;quot;#800000&amp;quot;&amp;gt;&#039;&#039;&#039;Soup&#039;&#039;&#039;&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;pSoup&amp;lt;/font&amp;gt;)&lt;br /&gt;
     {&lt;br /&gt;
         &amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;&#039;&#039;&#039;inherited&#039;&#039;&#039;&amp;lt;/font&amp;gt;(&amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;pSoup&amp;lt;/font&amp;gt;);&lt;br /&gt;
         &amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;m_bDoorOpened&amp;lt;/font&amp;gt; = &amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;pSoup&amp;lt;/font&amp;gt;.&amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;GetNamedTagAsBool&amp;lt;/font&amp;gt;(&amp;lt;font color=&amp;quot;#808080&amp;quot;&amp;gt;&amp;quot;m_bDoorOpened&amp;quot;&amp;lt;/font&amp;gt;, &amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;&#039;&#039;&#039;false&#039;&#039;&#039;&amp;lt;/font&amp;gt;);&lt;br /&gt;
 &lt;br /&gt;
         &amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;SetMeshVisible&amp;lt;/font&amp;gt;(&amp;lt;font color=&amp;quot;#808080&amp;quot;&amp;gt;&amp;quot;door-opened&amp;quot;&amp;lt;/font&amp;gt;, &amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;m_bDoorOpened&amp;lt;/font&amp;gt;, &amp;lt;font color=&amp;quot;#FF8000&amp;quot;&amp;gt;0.0f&amp;lt;/font&amp;gt;);&lt;br /&gt;
         &amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;SetMeshVisible&amp;lt;/font&amp;gt;(&amp;lt;font color=&amp;quot;#808080&amp;quot;&amp;gt;&amp;quot;door-closed&amp;quot;&amp;lt;/font&amp;gt;, !&amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;m_bDoorOpened&amp;lt;/font&amp;gt;, &amp;lt;font color=&amp;quot;#FF8000&amp;quot;&amp;gt;0.0f&amp;lt;/font&amp;gt;);&lt;br /&gt;
     }&lt;br /&gt;
 };&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We can use our bool variable for indicating the mesh state. The opened mesh is set with the value of m_bDoorOpened. If m_bDoorOpened is true, the mesh will display, otherwise it&#039;ll hide.&lt;br /&gt;
The closed state mesh is set with the oppsite value of m_bDoorOpened. This can be easily done by using the &amp;quot;!&amp;quot;-operator. Just place it in front of a boolean variable, to use the opposite value.&lt;br /&gt;
&lt;br /&gt;
Now you know how to control meshes. Because it will be too much for now, I&#039;ll give the last part of the script without explanation and move it to another time :)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
; icecreamtruck.gs&lt;br /&gt;
 &#039;&#039;&#039;&amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;include&amp;lt;/font&amp;gt;&#039;&#039;&#039; &amp;lt;font color=&amp;quot;#808080&amp;quot;&amp;gt;&amp;quot;MapObject.gs&amp;quot;&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &#039;&#039;&#039;&amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;class&amp;lt;/font&amp;gt;&#039;&#039;&#039; &amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;CIceCreamTruck&amp;lt;/font&amp;gt; &#039;&#039;&#039;&amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;isclass&amp;lt;/font&amp;gt;&#039;&#039;&#039; &#039;&#039;&#039;&amp;lt;font color=&amp;quot;#800000&amp;quot;&amp;gt;MapObject&amp;lt;/font&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
 {&lt;br /&gt;
     &amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;&#039;&#039;&#039;bool&#039;&#039;&#039;&amp;lt;/font&amp;gt;        &amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;m_bDoorOpened&amp;lt;/font&amp;gt;;&lt;br /&gt;
 &lt;br /&gt;
     &amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;&#039;&#039;&#039;public void&#039;&#039;&#039; Init&amp;lt;/font&amp;gt;(&amp;lt;font color=&amp;quot;#800000&amp;quot;&amp;gt;&#039;&#039;&#039;Asset&#039;&#039;&#039;&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;pAsset&amp;lt;/font&amp;gt;)&lt;br /&gt;
     {&lt;br /&gt;
         &amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;&#039;&#039;&#039;inherited&#039;&#039;&#039;&amp;lt;/font&amp;gt;(&amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;pAsset&amp;lt;/font&amp;gt;);&lt;br /&gt;
     }&lt;br /&gt;
 &lt;br /&gt;
     &amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;&#039;&#039;&#039;public&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;#800000&amp;quot;&amp;gt;Soup&amp;lt;/font&amp;gt;&#039;&#039;&#039; &amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;GetProperties&amp;lt;/font&amp;gt;(&amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;&#039;&#039;&#039;void&#039;&#039;&#039;&amp;lt;/font&amp;gt;)&lt;br /&gt;
     {&lt;br /&gt;
         &#039;&#039;&#039;&amp;lt;font color=&amp;quot;#800000&amp;quot;&amp;gt;Soup&amp;lt;/font&amp;gt;&#039;&#039;&#039; &amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;pSoup&amp;lt;/font&amp;gt; = &amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;&#039;&#039;&#039;inherited&#039;&#039;&#039;&amp;lt;/font&amp;gt;();&lt;br /&gt;
         &amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;pSoup&amp;lt;/font&amp;gt;.&amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;SetNamedTag&amp;lt;/font&amp;gt;(&amp;lt;font color=&amp;quot;#808080&amp;quot;&amp;gt;&amp;quot;bDoorOpened&amp;quot;&amp;lt;/font&amp;gt;, &amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;m_bDoorOpened&amp;lt;/font&amp;gt;);&lt;br /&gt;
         &amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;&#039;&#039;&#039;return&#039;&#039;&#039;&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;pSoup&amp;lt;/font&amp;gt;;&lt;br /&gt;
     }&lt;br /&gt;
 &lt;br /&gt;
     &amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;&#039;&#039;&#039;public void&#039;&#039;&#039; SetProperties&amp;lt;/font&amp;gt;(&amp;lt;font color=&amp;quot;#800000&amp;quot;&amp;gt;&#039;&#039;&#039;Soup&#039;&#039;&#039;&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;pSoup&amp;lt;/font&amp;gt;)&lt;br /&gt;
     {&lt;br /&gt;
         &amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;&#039;&#039;&#039;inherited&#039;&#039;&#039;&amp;lt;/font&amp;gt;(&amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;pSoup&amp;lt;/font&amp;gt;);&lt;br /&gt;
         &amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;m_bDoorOpened&amp;lt;/font&amp;gt; = &amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;pSoup&amp;lt;/font&amp;gt;.&amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;GetNamedTagAsBool&amp;lt;/font&amp;gt;(&amp;lt;font color=&amp;quot;#808080&amp;quot;&amp;gt;&amp;quot;m_bDoorOpened&amp;quot;&amp;lt;/font&amp;gt;, &amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;&#039;&#039;&#039;false&#039;&#039;&#039;&amp;lt;/font&amp;gt;);&lt;br /&gt;
 &lt;br /&gt;
         &amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;SetMeshVisible&amp;lt;/font&amp;gt;(&amp;lt;font color=&amp;quot;#808080&amp;quot;&amp;gt;&amp;quot;door-opened&amp;quot;&amp;lt;/font&amp;gt;, &amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;m_bDoorOpened&amp;lt;/font&amp;gt;, &amp;lt;font color=&amp;quot;#FF8000&amp;quot;&amp;gt;0.0f&amp;lt;/font&amp;gt;);&lt;br /&gt;
         &amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;SetMeshVisible&amp;lt;/font&amp;gt;(&amp;lt;font color=&amp;quot;#808080&amp;quot;&amp;gt;&amp;quot;door-closed&amp;quot;&amp;lt;/font&amp;gt;, !&amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;m_bDoorOpened&amp;lt;/font&amp;gt;, &amp;lt;font color=&amp;quot;#FF8000&amp;quot;&amp;gt;0.0f&amp;lt;/font&amp;gt;);&lt;br /&gt;
     }&lt;br /&gt;
 &lt;br /&gt;
     &amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;//////////////////////////////////////////////////////////////////////////////////////////////////////////////&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
     &amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;&#039;&#039;&#039;public string&#039;&#039;&#039; GetDescriptionHTML&amp;lt;/font&amp;gt;(&amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;&#039;&#039;&#039;void&#039;&#039;&#039;&amp;lt;/font&amp;gt;)&lt;br /&gt;
     {&lt;br /&gt;
         &amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;&#039;&#039;&#039;string&#039;&#039;&#039;&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;sHtml&amp;lt;/font&amp;gt; = &amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;&#039;&#039;&#039;inherited&#039;&#039;&#039;&amp;lt;/font&amp;gt;();&lt;br /&gt;
         &amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;sHtml&amp;lt;/font&amp;gt; = &amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;sHtml&amp;lt;/font&amp;gt; + &amp;lt;font color=&amp;quot;#800000&amp;quot;&amp;gt;&#039;&#039;&#039;HTMLWindow&#039;&#039;&#039;&amp;lt;/font&amp;gt;.&amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;CheckBox&amp;lt;/font&amp;gt;(&amp;lt;font color=&amp;quot;#808080&amp;quot;&amp;gt;&amp;quot;live://property/m_bDoorOpened&amp;quot;&amp;lt;/font&amp;gt;, &amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;m_bDoorOpened&amp;lt;/font&amp;gt;) + &amp;lt;font color=&amp;quot;#808080&amp;quot;&amp;gt;&amp;quot;&amp;amp;amp;nbsp;Open door&amp;quot;&amp;lt;/font&amp;gt;;&lt;br /&gt;
         &amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;&#039;&#039;&#039;return&#039;&#039;&#039;&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;sHtml&amp;lt;/font&amp;gt;;&lt;br /&gt;
     }&lt;br /&gt;
 &lt;br /&gt;
     &amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;&#039;&#039;&#039;public string&#039;&#039;&#039; GetPropertyType&amp;lt;/font&amp;gt;(&amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;&#039;&#039;&#039;string&#039;&#039;&#039;&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;sPropertyId&amp;lt;/font&amp;gt;)&lt;br /&gt;
     {&lt;br /&gt;
         &amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;&#039;&#039;&#039;string&#039;&#039;&#039;&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;sRet&amp;lt;/font&amp;gt; = &amp;lt;font color=&amp;quot;#808080&amp;quot;&amp;gt;&amp;quot;link&amp;quot;&amp;lt;/font&amp;gt;;&lt;br /&gt;
         &amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;&#039;&#039;&#039;if&#039;&#039;&#039;&amp;lt;/font&amp;gt;(&amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;sPropertyId&amp;lt;/font&amp;gt; == &amp;lt;font color=&amp;quot;#808080&amp;quot;&amp;gt;&amp;quot;m_bDoorOpened&amp;quot;&amp;lt;/font&amp;gt;)&amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;sRet&amp;lt;/font&amp;gt; = &amp;lt;font color=&amp;quot;#808080&amp;quot;&amp;gt;&amp;quot;link&amp;quot;&amp;lt;/font&amp;gt;;&lt;br /&gt;
         &amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;&#039;&#039;&#039;return&#039;&#039;&#039;&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;sRet&amp;lt;/font&amp;gt;;&lt;br /&gt;
     }&lt;br /&gt;
 &lt;br /&gt;
     &amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;&#039;&#039;&#039;public void&#039;&#039;&#039; LinkPropertyValue&amp;lt;/font&amp;gt;(&amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;&#039;&#039;&#039;string&#039;&#039;&#039;&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;sPropertyId&amp;lt;/font&amp;gt;)&lt;br /&gt;
     {&lt;br /&gt;
         &amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;&#039;&#039;&#039;if&#039;&#039;&#039;&amp;lt;/font&amp;gt;(&amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;sPropertyId&amp;lt;/font&amp;gt; == &amp;lt;font color=&amp;quot;#808080&amp;quot;&amp;gt;&amp;quot;m_bDoorOpened&amp;quot;&amp;lt;/font&amp;gt;)&lt;br /&gt;
         {&lt;br /&gt;
             &amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;m_bDoorOpened&amp;lt;/font&amp;gt; = !&amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;m_bDoorOpened&amp;lt;/font&amp;gt;;&lt;br /&gt;
         }&lt;br /&gt;
     }&lt;br /&gt;
 };&lt;br /&gt;
&lt;br /&gt;
Hope you enjoyed an learned!&lt;br /&gt;
&lt;br /&gt;
If you want to contact me, you may use this e-mail: callavsg@gmx.de&lt;br /&gt;
&lt;br /&gt;
callavsg&lt;/div&gt;</summary>
		<author><name>Callavsg</name></author>
	</entry>
	<entry>
		<id>https://wiki.trainzsimulator.com/index.php?title=File:Scripting_2_Doors_closed.jpg&amp;diff=8807</id>
		<title>File:Scripting 2 Doors closed.jpg</title>
		<link rel="alternate" type="text/html" href="https://wiki.trainzsimulator.com/index.php?title=File:Scripting_2_Doors_closed.jpg&amp;diff=8807"/>
		<updated>2016-04-21T07:56:27Z</updated>

		<summary type="html">&lt;p&gt;Callavsg: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Callavsg</name></author>
	</entry>
	<entry>
		<id>https://wiki.trainzsimulator.com/index.php?title=File:Scripting_2_Doors_open.jpg&amp;diff=8806</id>
		<title>File:Scripting 2 Doors open.jpg</title>
		<link rel="alternate" type="text/html" href="https://wiki.trainzsimulator.com/index.php?title=File:Scripting_2_Doors_open.jpg&amp;diff=8806"/>
		<updated>2016-04-21T07:55:51Z</updated>

		<summary type="html">&lt;p&gt;Callavsg: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Callavsg</name></author>
	</entry>
	<entry>
		<id>https://wiki.trainzsimulator.com/index.php?title=File:Scripting_2_Truck_whole.jpg&amp;diff=8805</id>
		<title>File:Scripting 2 Truck whole.jpg</title>
		<link rel="alternate" type="text/html" href="https://wiki.trainzsimulator.com/index.php?title=File:Scripting_2_Truck_whole.jpg&amp;diff=8805"/>
		<updated>2016-04-21T07:55:01Z</updated>

		<summary type="html">&lt;p&gt;Callavsg: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Callavsg</name></author>
	</entry>
	<entry>
		<id>https://wiki.trainzsimulator.com/index.php?title=File:Scripting_02_Truck_2.jpg&amp;diff=8804</id>
		<title>File:Scripting 02 Truck 2.jpg</title>
		<link rel="alternate" type="text/html" href="https://wiki.trainzsimulator.com/index.php?title=File:Scripting_02_Truck_2.jpg&amp;diff=8804"/>
		<updated>2016-04-21T06:48:17Z</updated>

		<summary type="html">&lt;p&gt;Callavsg: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Callavsg</name></author>
	</entry>
	<entry>
		<id>https://wiki.trainzsimulator.com/index.php?title=File:Scripting_02_Truck_1.jpg&amp;diff=8803</id>
		<title>File:Scripting 02 Truck 1.jpg</title>
		<link rel="alternate" type="text/html" href="https://wiki.trainzsimulator.com/index.php?title=File:Scripting_02_Truck_1.jpg&amp;diff=8803"/>
		<updated>2016-04-21T06:47:15Z</updated>

		<summary type="html">&lt;p&gt;Callavsg: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Callavsg</name></author>
	</entry>
	<entry>
		<id>https://wiki.trainzsimulator.com/index.php?title=HowTo&amp;diff=8802</id>
		<title>HowTo</title>
		<link rel="alternate" type="text/html" href="https://wiki.trainzsimulator.com/index.php?title=HowTo&amp;diff=8802"/>
		<updated>2016-04-21T06:29:40Z</updated>

		<summary type="html">&lt;p&gt;Callavsg: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page lists available &amp;quot;How To&amp;quot; Guides which describe how to achieve certain tasks related to Trainz. &lt;br /&gt;
&lt;br /&gt;
Users are encouraged to add their own guides to this page in a similar fashion, or expand on existing guides. Please keep in mind that this site is dedicated to the current version of Trainz and that techniques used should relate to this version. Editors note: all pages here should fit the pattern &amp;quot;How to X&amp;quot;, as in &amp;quot;How to place signals&amp;quot;. Pages and topics which cannot be phrased in this manner do not belong on this page.&lt;br /&gt;
&lt;br /&gt;
==Using &amp;quot;Manage Content&amp;quot; in TANE==&lt;br /&gt;
* [[/Download an Asset from the Download Station/]]&lt;br /&gt;
* [[/Configure and use Columns in content windows/]]&lt;br /&gt;
* [[/Use the &amp;quot;Status&amp;quot; column in content windows/]]&lt;br /&gt;
* [[/Edit and Submit content/]]&lt;br /&gt;
* [[/View by thumbnail images/]]&lt;br /&gt;
* [[/Fix Errors and Warnings/]]&lt;br /&gt;
* [[/Use Search Filters/]]&lt;br /&gt;
&lt;br /&gt;
==Content Creation: Routes==&lt;br /&gt;
* [[/Create a Route in 10 Minutes/]]&lt;br /&gt;
* [[/Add Bumpy Track/]]&lt;br /&gt;
* [[/Make a Track Cutting/]]&lt;br /&gt;
* [[/Place Signals/]]&lt;br /&gt;
* [[/Build a Bridge/]]&lt;br /&gt;
* [[/Build a Tunnel/]]&lt;br /&gt;
* [[/Build a Crossing/]]&lt;br /&gt;
* [[/Build Catenary/]]&lt;br /&gt;
* [[/Use Superelevation/]]&lt;br /&gt;
* [[/Use Trig Stations/]]&lt;br /&gt;
* [[/Configure an iPortal/]]&lt;br /&gt;
* [[/Configure An Interlocking Tower/]]&lt;br /&gt;
&lt;br /&gt;
==Content Creation: Assets==&lt;br /&gt;
* [[/Make your first Trainz Asset/]]&lt;br /&gt;
* [[/Export from Max/]]&lt;br /&gt;
* [[/Export from Blender/]]&lt;br /&gt;
* [[/Export from Blender using FBX/]]&lt;br /&gt;
* [[/Solve Blender Modelling Problems/]]&lt;br /&gt;
* [[/Scaling setup in Blender/]] &lt;br /&gt;
* [[/Build normal maps in Max/]]&lt;br /&gt;
* [[/Localize an Asset/]]&lt;br /&gt;
* [[/Build a scripted asset/]]&lt;br /&gt;
* [[/Reskin an Asset/]]&lt;br /&gt;
* [[/Reskin an Asset using an alias/]]&lt;br /&gt;
* [[/Build a Car for Traffic (stand-alone version)/]]&lt;br /&gt;
* [[/Build a Car for Traffic (mesh library version)/]]&lt;br /&gt;
* [[/Build a cab interior/]]&lt;br /&gt;
* [[/Build a drivable car/]]&lt;br /&gt;
* [[/Render to Texture/]]&lt;br /&gt;
* [[/Build a simple animated scenery asset in Blender/]]&lt;br /&gt;
* [[/Build Passenger Enabled Assets/]]&lt;br /&gt;
* [[/Create a High Voltage Power Line Spline/]]&lt;br /&gt;
* [[/Create transparent windows in Blender/]]&lt;br /&gt;
* [[/Create a Fence Spline Featuring LOD and Random Meshes/]]&lt;br /&gt;
* [[/Create a Neon Font Effect with PhotoShop C4/]]&lt;br /&gt;
* [[/Build an animated Neon Sign/]]&lt;br /&gt;
* [[/Configure a spline for collisions/]]&lt;br /&gt;
* [[/Build Procedural Track for T:ANE/]]&lt;br /&gt;
* [[/Update your auto-generated next KUID/]]&lt;br /&gt;
&lt;br /&gt;
==Content Creation: Scripting==&lt;br /&gt;
* [[/Your first Trainz Script/]]&lt;br /&gt;
* [[/Hide- &amp;amp; Unhide Meshes/]]&lt;br /&gt;
&lt;br /&gt;
==Creating and Configuring Content In-game==&lt;br /&gt;
* [[/Create an Interactive Session/]]&lt;br /&gt;
* [[/Add Carz Traffic to a Route/]]&lt;br /&gt;
* [[/Tune a Steam Locomotive Enginespec/]]&lt;br /&gt;
* [[/Configure an Interactive Industry/]]&lt;br /&gt;
* [[/Implement a Destination Sign System/]]&lt;br /&gt;
* [[/Upload a new asset to the DownloadStation/]]&lt;br /&gt;
* [[/Update an existing asset on the DownloadStation/]]&lt;br /&gt;
&lt;br /&gt;
==Documentation Suggestions==&lt;br /&gt;
&lt;br /&gt;
* [[/Build normal maps in Blender/]]&lt;br /&gt;
* [[/Build a house/]]&lt;br /&gt;
* [[/Build a tree/]]&lt;br /&gt;
* [[/Build a track/]]&lt;br /&gt;
* [[/Build a tunnel/]]&lt;br /&gt;
* [[/Build a hedge/]]&lt;br /&gt;
* [[/Build a fence/]]&lt;br /&gt;
* [[/Build a road/]]&lt;br /&gt;
* [[/Build a road crossing/]]&lt;br /&gt;
* [[/Build a train car/]]&lt;br /&gt;
* [[/Build a bogey/]]&lt;br /&gt;
* [[/Build a ground texture/]]&lt;br /&gt;
* [[/Build an interactive industry/]]&lt;br /&gt;
* [[/Add attached track/]]&lt;br /&gt;
* [[/Add an intro page to a session/]]&lt;br /&gt;
* [[/Register with Planet Auran/]]&lt;br /&gt;
* [[/Create an Achievement/]]&lt;br /&gt;
* [[/Use a map to create a baseboard/]]&lt;br /&gt;
* [[/Create a displacement map/]]&lt;br /&gt;
&lt;br /&gt;
== See Also==&lt;br /&gt;
&lt;br /&gt;
* [[Content Configuration]] - &#039;&#039;A reference manual covering all content types.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[Category:How-to guides| ]]&lt;/div&gt;</summary>
		<author><name>Callavsg</name></author>
	</entry>
	<entry>
		<id>https://wiki.trainzsimulator.com/index.php?title=HowTo/Your_first_Trainz_Script&amp;diff=8791</id>
		<title>HowTo/Your first Trainz Script</title>
		<link rel="alternate" type="text/html" href="https://wiki.trainzsimulator.com/index.php?title=HowTo/Your_first_Trainz_Script&amp;diff=8791"/>
		<updated>2016-04-18T20:54:42Z</updated>

		<summary type="html">&lt;p&gt;Callavsg: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Scripting is one of most powerful tools when creating trainz assets.&lt;br /&gt;
More and more content creators are using scripts to extend the funciontallity of their contents,&lt;br /&gt;
so scripters, like me, get a lot of request for script work.&lt;br /&gt;
Finally, I thought, even for small functionallity, it&#039;ll be a good idea, if more people know how to script.&lt;br /&gt;
&lt;br /&gt;
I&#039;m from germany and this is my first article here, so feel free to send corrections or if you have the permission,&lt;br /&gt;
feel free to correct this article on your own!&lt;br /&gt;
&lt;br /&gt;
First, let us take a theoretical approach:&lt;br /&gt;
&lt;br /&gt;
Trainz Script is a small programming language and has many similar aspects to Java or C++. I&#039;ll say it&#039;s a kind of a Framework,&lt;br /&gt;
that allows us to implement new features based on built-in classes and their members.&lt;br /&gt;
That means we have to assign our assets to a script class. Without a custom script, we do it by selecting the kind of our asset&lt;br /&gt;
in config.txt. A kind of &amp;quot;scenery&amp;quot; (not &amp;quot;screnery-trackside&amp;quot;!) will assign the class &amp;quot;MapObject&amp;quot; to our asset.&lt;br /&gt;
So, if we want to extend our asset of [[Class MapObject]], we&#039;ll have to extend the class itself.&lt;br /&gt;
Extending a class means to create a custom script file with a custom class declaration inside of it that inherits from the [[Class MapObject]].&lt;br /&gt;
&amp;quot;MapObject&amp;quot; then becomes our parent class and we have all functionallity of this class within our custom implemented class.&lt;br /&gt;
&lt;br /&gt;
A basic script may look like this:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
; myscript.gs&lt;br /&gt;
 &#039;&#039;&#039;&amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;include&amp;lt;/font&amp;gt;&#039;&#039;&#039; &amp;lt;font color=&amp;quot;#808080&amp;quot;&amp;gt;&amp;quot;MapObject.gs&amp;quot;&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &#039;&#039;&#039;&amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;class&amp;lt;/font&amp;gt;&#039;&#039;&#039; &amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;CMyClass&amp;lt;/font&amp;gt; &#039;&#039;&#039;&amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;isclass&amp;lt;/font&amp;gt;&#039;&#039;&#039; &#039;&#039;&#039;&amp;lt;font color=&amp;quot;#800000&amp;quot;&amp;gt;MapObject&amp;lt;/font&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
 {&lt;br /&gt;
     &amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;&#039;&#039;&#039;public void&#039;&#039;&#039; Init&amp;lt;/font&amp;gt;(&amp;lt;font color=&amp;quot;#800000&amp;quot;&amp;gt;&#039;&#039;&#039;Asset&#039;&#039;&#039;&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;pAsset&amp;lt;/font&amp;gt;)&lt;br /&gt;
     {&lt;br /&gt;
         &amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;&#039;&#039;&#039;inherited&#039;&#039;&#039;&amp;lt;/font&amp;gt;(&amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;pAsset&amp;lt;/font&amp;gt;);&lt;br /&gt;
     }&lt;br /&gt;
 };&lt;br /&gt;
&lt;br /&gt;
As you see in the little script above, our class already got a member function. This member function (Init) is the most important member we have to implement.&lt;br /&gt;
This little function initializies our class and inherits all initializations of our parent class (see: &amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;&#039;&#039;&#039;inherited&#039;&#039;&#039;&amp;lt;/font&amp;gt;(&amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;pAsset&amp;lt;/font&amp;gt;);).&lt;br /&gt;
Without that function with it&#039;s call to &amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;&#039;&#039;&#039;inherited&#039;&#039;&#039;&amp;lt;/font&amp;gt;, functionallity of our asset is not granted, because in this case our parent class won&#039;t be initialized.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Notice:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
1. Never forget the &amp;quot;Init&amp;quot;-Method (method = function within class)!&lt;br /&gt;
&lt;br /&gt;
2. Never forget to call &amp;quot;inherited&amp;quot;!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In the config.txt of our asset, we need to set two new tags!&lt;br /&gt;
The first tag is the &amp;quot;script&amp;quot;-tag and the second one is the &amp;quot;class&amp;quot;-tag. We have to fill these tags with our script information.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;script&#039;&#039;&#039;: The filename of our script&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;class&#039;&#039;&#039;: The class we created for our &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In our case the config.txt may look like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
trainz-build                            3.7&lt;br /&gt;
kuid                                    [...]&lt;br /&gt;
category-class                          &amp;quot;[...]&amp;quot;&lt;br /&gt;
category-region                         &amp;quot;[...]&amp;quot;&lt;br /&gt;
category-era                            &amp;quot;[...]&amp;quot;&lt;br /&gt;
kind                                    &amp;quot;scenery&amp;quot;&lt;br /&gt;
description                             &amp;quot;[...]&amp;quot;&lt;br /&gt;
username                                &amp;quot;[...]&amp;quot;&lt;br /&gt;
script                                  &amp;quot;myscript.gs&amp;quot;&lt;br /&gt;
class                                   &amp;quot;CMyClass&amp;quot;&lt;br /&gt;
&lt;br /&gt;
thumbnails&lt;br /&gt;
{&lt;br /&gt;
    [...]&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
mesh-table&lt;br /&gt;
{&lt;br /&gt;
    [...]&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
kuid-table&lt;br /&gt;
{&lt;br /&gt;
    [...]&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
; What we&#039;ve learned today:&lt;br /&gt;
- If we want to extend the functionallity of an asset, we have to extend the Trainz-Script-Class that belongs to our asset (here [[Class MapObject]])&lt;br /&gt;
&lt;br /&gt;
- We extend our class by implementing a custom class that inherits from our parent class (CMyClass inherits from [[Class MapObject]])&lt;br /&gt;
&lt;br /&gt;
- All Trainz-Classes that assets can inherit from have the Init-Method and custom classes has to implement the Init-Method, too!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If you want to contact me, you may use this e-mail: callavsg@gmx.de&lt;br /&gt;
&lt;br /&gt;
Until next time!&lt;br /&gt;
&lt;br /&gt;
callavsg&lt;/div&gt;</summary>
		<author><name>Callavsg</name></author>
	</entry>
	<entry>
		<id>https://wiki.trainzsimulator.com/index.php?title=HowTo/Your_first_Trainz_Script&amp;diff=8790</id>
		<title>HowTo/Your first Trainz Script</title>
		<link rel="alternate" type="text/html" href="https://wiki.trainzsimulator.com/index.php?title=HowTo/Your_first_Trainz_Script&amp;diff=8790"/>
		<updated>2016-04-18T20:54:26Z</updated>

		<summary type="html">&lt;p&gt;Callavsg: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Scripting is one of most powerful tools when creating trainz assets.&lt;br /&gt;
More and more content creators are using scripts to extend the funciontallity of their contents,&lt;br /&gt;
so scripters, like me, get a lot of request for script work.&lt;br /&gt;
Finally, I thought, even for small functionallity, it&#039;ll be a good idea, if more people know how to script.&lt;br /&gt;
&lt;br /&gt;
I&#039;m from germany and this is my first article here, so feel free to send corrections or if you have the permission,&lt;br /&gt;
feel free to correct this article on your own!&lt;br /&gt;
&lt;br /&gt;
First, let us take a theoretical approach:&lt;br /&gt;
&lt;br /&gt;
Trainz Script is a small programming language and has many similar aspects to Java or C++. I&#039;ll say it&#039;s a kind of a Framework,&lt;br /&gt;
that allows us to implement new features based on built-in classes and their members.&lt;br /&gt;
That means we have to assign our assets to a script class. Without a custom script, we do it by selecting the kind of our asset&lt;br /&gt;
in config.txt. A kind of &amp;quot;scenery&amp;quot; (not &amp;quot;screnery-trackside&amp;quot;!) will assign the class &amp;quot;MapObject&amp;quot; to our asset.&lt;br /&gt;
So, if we want to extend our asset of [[Class MapObject]], we&#039;ll have to extend the class itself.&lt;br /&gt;
Extending a class means to create a custom script file with a custom class declaration inside of it that inherits from the [[Class MapObject]].&lt;br /&gt;
&amp;quot;MapObject&amp;quot; then becomes our parent class and we have all functionallity of this class within our custom implemented class.&lt;br /&gt;
&lt;br /&gt;
A basic script may look like this:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
; myscript.gs&lt;br /&gt;
 &#039;&#039;&#039;&amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;include&amp;lt;/font&amp;gt;&#039;&#039;&#039; &amp;lt;font color=&amp;quot;#808080&amp;quot;&amp;gt;&amp;quot;MapObject.gs&amp;quot;&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &#039;&#039;&#039;&amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;class&amp;lt;/font&amp;gt;&#039;&#039;&#039; &amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;CMyClass&amp;lt;/font&amp;gt; &#039;&#039;&#039;&amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;isclass&amp;lt;/font&amp;gt;&#039;&#039;&#039; &#039;&#039;&#039;&amp;lt;font color=&amp;quot;#800000&amp;quot;&amp;gt;MapObject&amp;lt;/font&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
 {&lt;br /&gt;
     &amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;&#039;&#039;&#039;public void&#039;&#039;&#039; Init&amp;lt;/font&amp;gt;(&amp;lt;font color=&amp;quot;#800000&amp;quot;&amp;gt;&#039;&#039;&#039;Asset&#039;&#039;&#039;&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;pAsset&amp;lt;/font&amp;gt;)&lt;br /&gt;
     {&lt;br /&gt;
         &amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;&#039;&#039;&#039;inherited&#039;&#039;&#039;&amp;lt;/font&amp;gt;(&amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;pAsset&amp;lt;/font&amp;gt;);&lt;br /&gt;
     }&lt;br /&gt;
 };&lt;br /&gt;
&lt;br /&gt;
As you see in the little script above, our class already got a member function. This member function (Init) is the most important member we have to implement.&lt;br /&gt;
This little function initializies our class and inherits all initializations of our parent class (see: &amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;&#039;&#039;&#039;inherited&#039;&#039;&#039;&amp;lt;/font&amp;gt;(&amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;pAsset&amp;lt;/font&amp;gt;);).&lt;br /&gt;
Without that function with it&#039;s call to &amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;&#039;&#039;&#039;inherited&#039;&#039;&#039;&amp;lt;/font&amp;gt;, functionallity of our asset is not granted, because in this case our parent class won&#039;t be initialized.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Notice:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
1. Never forget the &amp;quot;Init&amp;quot;-Method (method = function within class)!&lt;br /&gt;
&lt;br /&gt;
2. Never forget to call &amp;quot;inherited&amp;quot;!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In the config.txt of our asset, we need to set two new tags!&lt;br /&gt;
The first tag is the &amp;quot;script&amp;quot;-tag and the second one is the &amp;quot;class&amp;quot;-tag. We have to fill these tags with our script information.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;script&#039;&#039;&#039;: The filename of our script&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;class&#039;&#039;&#039;: The class we created for our &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In our case the config.txt may look like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
trainz-build                            3.7&lt;br /&gt;
kuid                                    [...]&lt;br /&gt;
category-class                          &amp;quot;[...]&amp;quot;&lt;br /&gt;
category-region                         &amp;quot;[...]&amp;quot;&lt;br /&gt;
category-era                            &amp;quot;[...]&amp;quot;&lt;br /&gt;
kind                                    &amp;quot;scenery&amp;quot;&lt;br /&gt;
description                             &amp;quot;[...]&amp;quot;&lt;br /&gt;
username                                &amp;quot;[...]&amp;quot;&lt;br /&gt;
script                                  &amp;quot;myscript.gs&amp;quot;&lt;br /&gt;
class                                   &amp;quot;CMyClass&amp;quot;&lt;br /&gt;
&lt;br /&gt;
thumbnails&lt;br /&gt;
{&lt;br /&gt;
    [...]&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
mesh-table&lt;br /&gt;
{&lt;br /&gt;
    [...]&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
kuid-table&lt;br /&gt;
{&lt;br /&gt;
    [...]&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
; What we&#039;ve learned today:&lt;br /&gt;
- If we want to extend the functionallity of an asset, we have to extend the Trainz-Script-Class that belongs to our asset (here [[Class MapObject]])&lt;br /&gt;
&lt;br /&gt;
- We extend our class by implementing a custom class that inherits from our parent class (CMyClass inherits from [[Class MapObject]])&lt;br /&gt;
&lt;br /&gt;
- All Trainz-Classes that assets can inherit from have the Init-Method and custom classes has to implement the Init-Method, too!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If you wnt to contact me, you may use this e-mail: callavsg@gmx.de&lt;br /&gt;
&lt;br /&gt;
Until next time!&lt;br /&gt;
&lt;br /&gt;
callavsg&lt;/div&gt;</summary>
		<author><name>Callavsg</name></author>
	</entry>
	<entry>
		<id>https://wiki.trainzsimulator.com/index.php?title=HowTo/Your_first_Trainz_Script&amp;diff=8789</id>
		<title>HowTo/Your first Trainz Script</title>
		<link rel="alternate" type="text/html" href="https://wiki.trainzsimulator.com/index.php?title=HowTo/Your_first_Trainz_Script&amp;diff=8789"/>
		<updated>2016-04-18T20:47:03Z</updated>

		<summary type="html">&lt;p&gt;Callavsg: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Scripting is one of most powerful tools when creating trainz assets.&lt;br /&gt;
More and more content creators are using scripts to extend the funciontallity of their contents,&lt;br /&gt;
so scripters, like me, get a lot of request for script work.&lt;br /&gt;
Finally, I thought, even for small functionallity, it&#039;ll be a good idea, if more people know how to script.&lt;br /&gt;
&lt;br /&gt;
I&#039;m from germany and this is my first article here, so feel free to send corrections or if you have the permission,&lt;br /&gt;
feel free to correct this article on your own!&lt;br /&gt;
&lt;br /&gt;
First, let us take a theoretical approach:&lt;br /&gt;
&lt;br /&gt;
Trainz Script is a small programming language and has many similar aspects to Java or C++. I&#039;ll say it&#039;s a kind of a Framework,&lt;br /&gt;
that allows us to implement new features based on built-in classes and their members.&lt;br /&gt;
That means we have to assign our assets to a script class. Without a custom script, we do it by selecting the kind of our asset&lt;br /&gt;
in config.txt. A kind of &amp;quot;scenery&amp;quot; (not &amp;quot;screnery-trackside&amp;quot;!) will assign the class &amp;quot;MapObject&amp;quot; to our asset.&lt;br /&gt;
So, if we want to extend our asset of [[Class MapObject]], we&#039;ll have to extend the class itself.&lt;br /&gt;
Extending a class means to create a custom script file with a custom class declaration inside of it that inherits from the [[Class MapObject]].&lt;br /&gt;
&amp;quot;MapObject&amp;quot; then becomes our parent class and we have all functionallity of this class within our custom implemented class.&lt;br /&gt;
&lt;br /&gt;
A basic script may look like this:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
; myscript.gs&lt;br /&gt;
 &#039;&#039;&#039;&amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;include&amp;lt;/font&amp;gt;&#039;&#039;&#039; &amp;lt;font color=&amp;quot;#808080&amp;quot;&amp;gt;&amp;quot;MapObject.gs&amp;quot;&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &#039;&#039;&#039;&amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;class&amp;lt;/font&amp;gt;&#039;&#039;&#039; &amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;CMyClass&amp;lt;/font&amp;gt; &#039;&#039;&#039;&amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;isclass&amp;lt;/font&amp;gt;&#039;&#039;&#039; &#039;&#039;&#039;&amp;lt;font color=&amp;quot;#800000&amp;quot;&amp;gt;MapObject&amp;lt;/font&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
 {&lt;br /&gt;
     &amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;&#039;&#039;&#039;public void&#039;&#039;&#039; Init&amp;lt;/font&amp;gt;(&amp;lt;font color=&amp;quot;#800000&amp;quot;&amp;gt;&#039;&#039;&#039;Asset&#039;&#039;&#039;&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;pAsset&amp;lt;/font&amp;gt;)&lt;br /&gt;
     {&lt;br /&gt;
         &amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;&#039;&#039;&#039;inherited&#039;&#039;&#039;&amp;lt;/font&amp;gt;(&amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;pAsset&amp;lt;/font&amp;gt;);&lt;br /&gt;
     }&lt;br /&gt;
 };&lt;br /&gt;
&lt;br /&gt;
As you see in the little script above, our class already got a member function. This member function (Init) is the most important member we have to implement.&lt;br /&gt;
This little function initializies our class and inherits all initializations of our parent class (see: &amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;&#039;&#039;&#039;inherited&#039;&#039;&#039;&amp;lt;/font&amp;gt;(&amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;pAsset&amp;lt;/font&amp;gt;);).&lt;br /&gt;
Without that function with it&#039;s call to &amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;&#039;&#039;&#039;inherited&#039;&#039;&#039;&amp;lt;/font&amp;gt;, functionallity of our asset is not granted, because in this case our parent class won&#039;t be initialized.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Notice:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
1. Never forget the &amp;quot;Init&amp;quot;-Method (method = function within class)!&lt;br /&gt;
&lt;br /&gt;
2. Never forget to call &amp;quot;inherited&amp;quot;!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In the config.txt of our asset, we need to set two new tags!&lt;br /&gt;
The first tag is the &amp;quot;script&amp;quot;-tag and the second one is the &amp;quot;class&amp;quot;-tag. We have to fill these tags with our script information.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;script&#039;&#039;&#039;: The filename of our script&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;class&#039;&#039;&#039;: The class we created for our &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In our case the config.txt may look like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
trainz-build                            3.7&lt;br /&gt;
kuid                                    [...]&lt;br /&gt;
category-class                          &amp;quot;[...]&amp;quot;&lt;br /&gt;
category-region                         &amp;quot;[...]&amp;quot;&lt;br /&gt;
category-era                            &amp;quot;[...]&amp;quot;&lt;br /&gt;
kind                                    &amp;quot;scenery&amp;quot;&lt;br /&gt;
description                             &amp;quot;[...]&amp;quot;&lt;br /&gt;
username                                &amp;quot;[...]&amp;quot;&lt;br /&gt;
script                                  &amp;quot;myscript.gs&amp;quot;&lt;br /&gt;
class                                   &amp;quot;CMyClass&amp;quot;&lt;br /&gt;
&lt;br /&gt;
thumbnails&lt;br /&gt;
{&lt;br /&gt;
    [...]&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
mesh-table&lt;br /&gt;
{&lt;br /&gt;
    [...]&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
kuid-table&lt;br /&gt;
{&lt;br /&gt;
    [...]&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Callavsg</name></author>
	</entry>
	<entry>
		<id>https://wiki.trainzsimulator.com/index.php?title=HowTo/Your_first_Trainz_Script&amp;diff=8788</id>
		<title>HowTo/Your first Trainz Script</title>
		<link rel="alternate" type="text/html" href="https://wiki.trainzsimulator.com/index.php?title=HowTo/Your_first_Trainz_Script&amp;diff=8788"/>
		<updated>2016-04-18T20:28:39Z</updated>

		<summary type="html">&lt;p&gt;Callavsg: Created page with &amp;quot;Scripting is one of most powerful tools when creating trainz assets. More and more content creators are using scripts to extend the funciontallity of their contents, so script...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Scripting is one of most powerful tools when creating trainz assets.&lt;br /&gt;
More and more content creators are using scripts to extend the funciontallity of their contents,&lt;br /&gt;
so scripters, like me, get a lot of request for script work.&lt;br /&gt;
Finally, I thought, even for small functionallity, it&#039;ll be a good idea, if more people know how to script.&lt;br /&gt;
&lt;br /&gt;
I&#039;m from germany and this is my first article here, so feel free to send corrections or if you have the permission,&lt;br /&gt;
feel free to correct this article on your own!&lt;br /&gt;
&lt;br /&gt;
First, let us take a theoretical approach:&lt;br /&gt;
&lt;br /&gt;
Trainz Script is a small programming language and has many similar aspects to Java or C++. I&#039;ll say it&#039;s a kind of a Framework,&lt;br /&gt;
that allows us to implement new features based on built-in classes and their members.&lt;br /&gt;
That means we have to assign our assets to a script class. Without a custom script, we do it by selecting the kind of our asset&lt;br /&gt;
in config.txt. A kind of &amp;quot;scenery&amp;quot; (not &amp;quot;screnery-trackside&amp;quot;!) will assign the class &amp;quot;MapObject&amp;quot; to our asset.&lt;br /&gt;
So, if we want to extend our asset of [[Class MapObject]], we&#039;ll have to extend the class itself.&lt;br /&gt;
Extending a class means to create a custom script file with a custom class declaration inside of it that inherits from the [[Class MapObject]].&lt;br /&gt;
&amp;quot;MapObject&amp;quot; then becomes our parent class and we have all functionallity of this class within our custom implemented class.&lt;br /&gt;
&lt;br /&gt;
A basic script may look like this:&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;&amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;include&amp;lt;/font&amp;gt;&#039;&#039;&#039; &amp;lt;font color=&amp;quot;#808080&amp;quot;&amp;gt;&amp;quot;MapObject.gs&amp;quot;&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &#039;&#039;&#039;&amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;class&amp;lt;/font&amp;gt;&#039;&#039;&#039; &amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;CMyClass&amp;lt;/font&amp;gt; &#039;&#039;&#039;&amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;isclass&amp;lt;/font&amp;gt;&#039;&#039;&#039; &#039;&#039;&#039;&amp;lt;font color=&amp;quot;#800000&amp;quot;&amp;gt;MapObject&amp;lt;/font&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
 {&lt;br /&gt;
     &amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;&#039;&#039;&#039;public void&#039;&#039;&#039; Init&amp;lt;/font&amp;gt;(&amp;lt;font color=&amp;quot;#800000&amp;quot;&amp;gt;&#039;&#039;&#039;Asset&#039;&#039;&#039;&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;pAsset&amp;lt;/font&amp;gt;)&lt;br /&gt;
     {&lt;br /&gt;
         &amp;lt;font color=&amp;quot;#0000C0&amp;quot;&amp;gt;inherited&amp;lt;/font&amp;gt;(&amp;lt;font color=&amp;quot;#008000&amp;quot;&amp;gt;pAsset&amp;lt;/font&amp;gt;);&lt;br /&gt;
     }&lt;br /&gt;
 };&lt;/div&gt;</summary>
		<author><name>Callavsg</name></author>
	</entry>
	<entry>
		<id>https://wiki.trainzsimulator.com/index.php?title=HowTo&amp;diff=8787</id>
		<title>HowTo</title>
		<link rel="alternate" type="text/html" href="https://wiki.trainzsimulator.com/index.php?title=HowTo&amp;diff=8787"/>
		<updated>2016-04-18T19:45:56Z</updated>

		<summary type="html">&lt;p&gt;Callavsg: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page lists available &amp;quot;How To&amp;quot; Guides which describe how to achieve certain tasks related to Trainz. &lt;br /&gt;
&lt;br /&gt;
Users are encouraged to add their own guides to this page in a similar fashion, or expand on existing guides. Please keep in mind that this site is dedicated to the current version of Trainz and that techniques used should relate to this version. Editors note: all pages here should fit the pattern &amp;quot;How to X&amp;quot;, as in &amp;quot;How to place signals&amp;quot;. Pages and topics which cannot be phrased in this manner do not belong on this page.&lt;br /&gt;
&lt;br /&gt;
==Using &amp;quot;Manage Content&amp;quot; in TANE==&lt;br /&gt;
* [[/Download an Asset from the Download Station/]]&lt;br /&gt;
* [[/Configure and use Columns in content windows/]]&lt;br /&gt;
* [[/Use the &amp;quot;Status&amp;quot; column in content windows/]]&lt;br /&gt;
* [[/Edit and Submit content/]]&lt;br /&gt;
* [[/View by thumbnail images/]]&lt;br /&gt;
* [[/Fix Errors and Warnings/]]&lt;br /&gt;
* [[/Use Search Filters/]]&lt;br /&gt;
&lt;br /&gt;
==Content Creation: Routes==&lt;br /&gt;
* [[/Create a Route in 10 Minutes/]]&lt;br /&gt;
* [[/Add Bumpy Track/]]&lt;br /&gt;
* [[/Make a Track Cutting/]]&lt;br /&gt;
* [[/Place Signals/]]&lt;br /&gt;
* [[/Build a Bridge/]]&lt;br /&gt;
* [[/Build a Tunnel/]]&lt;br /&gt;
* [[/Build a Crossing/]]&lt;br /&gt;
* [[/Build Catenary/]]&lt;br /&gt;
* [[/Use Superelevation/]]&lt;br /&gt;
* [[/Use Trig Stations/]]&lt;br /&gt;
* [[/Configure an iPortal/]]&lt;br /&gt;
* [[/Configure An Interlocking Tower/]]&lt;br /&gt;
&lt;br /&gt;
==Content Creation: Assets==&lt;br /&gt;
* [[/Make your first Trainz Asset/]]&lt;br /&gt;
* [[/Export from Max/]]&lt;br /&gt;
* [[/Export from Blender/]]&lt;br /&gt;
* [[/Export from Blender using FBX/]]&lt;br /&gt;
* [[/Solve Blender Modelling Problems/]]&lt;br /&gt;
* [[/Scaling setup in Blender/]] &lt;br /&gt;
* [[/Build normal maps in Max/]]&lt;br /&gt;
* [[/Localize an Asset/]]&lt;br /&gt;
* [[/Build a scripted asset/]]&lt;br /&gt;
* [[/Reskin an Asset/]]&lt;br /&gt;
* [[/Reskin an Asset using an alias/]]&lt;br /&gt;
* [[/Build a Car for Traffic (stand-alone version)/]]&lt;br /&gt;
* [[/Build a Car for Traffic (mesh library version)/]]&lt;br /&gt;
* [[/Build a cab interior/]]&lt;br /&gt;
* [[/Build a drivable car/]]&lt;br /&gt;
* [[/Render to Texture/]]&lt;br /&gt;
* [[/Build a simple animated scenery asset in Blender/]]&lt;br /&gt;
* [[/Build Passenger Enabled Assets/]]&lt;br /&gt;
* [[/Create a High Voltage Power Line Spline/]]&lt;br /&gt;
* [[/Create transparent windows in Blender/]]&lt;br /&gt;
* [[/Create a Fence Spline Featuring LOD and Random Meshes/]]&lt;br /&gt;
* [[/Create a Neon Font Effect with PhotoShop C4/]]&lt;br /&gt;
* [[/Build an animated Neon Sign/]]&lt;br /&gt;
* [[/Configure a spline for collisions/]]&lt;br /&gt;
* [[/Build Procedural Track for T:ANE/]]&lt;br /&gt;
* [[/Update your auto-generated next KUID/]]&lt;br /&gt;
&lt;br /&gt;
==Content Creation: Scripting==&lt;br /&gt;
* [[/Your first Trainz Script/]]&lt;br /&gt;
&lt;br /&gt;
==Creating and Configuring Content In-game==&lt;br /&gt;
* [[/Create an Interactive Session/]]&lt;br /&gt;
* [[/Add Carz Traffic to a Route/]]&lt;br /&gt;
* [[/Tune a Steam Locomotive Enginespec/]]&lt;br /&gt;
* [[/Configure an Interactive Industry/]]&lt;br /&gt;
* [[/Implement a Destination Sign System/]]&lt;br /&gt;
* [[/Upload a new asset to the DownloadStation/]]&lt;br /&gt;
* [[/Update an existing asset on the DownloadStation/]]&lt;br /&gt;
&lt;br /&gt;
==Documentation Suggestions==&lt;br /&gt;
&lt;br /&gt;
* [[/Build normal maps in Blender/]]&lt;br /&gt;
* [[/Build a house/]]&lt;br /&gt;
* [[/Build a tree/]]&lt;br /&gt;
* [[/Build a track/]]&lt;br /&gt;
* [[/Build a tunnel/]]&lt;br /&gt;
* [[/Build a hedge/]]&lt;br /&gt;
* [[/Build a fence/]]&lt;br /&gt;
* [[/Build a road/]]&lt;br /&gt;
* [[/Build a road crossing/]]&lt;br /&gt;
* [[/Build a train car/]]&lt;br /&gt;
* [[/Build a bogey/]]&lt;br /&gt;
* [[/Build a ground texture/]]&lt;br /&gt;
* [[/Build an interactive industry/]]&lt;br /&gt;
* [[/Add attached track/]]&lt;br /&gt;
* [[/Add an intro page to a session/]]&lt;br /&gt;
* [[/Register with Planet Auran/]]&lt;br /&gt;
* [[/Create an Achievement/]]&lt;br /&gt;
* [[/Use a map to create a baseboard/]]&lt;br /&gt;
* [[/Create a displacement map/]]&lt;br /&gt;
&lt;br /&gt;
== See Also==&lt;br /&gt;
&lt;br /&gt;
* [[Content Configuration]] - &#039;&#039;A reference manual covering all content types.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[Category:How-to guides| ]]&lt;/div&gt;</summary>
		<author><name>Callavsg</name></author>
	</entry>
</feed>