<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.trainzsimulator.com/index.php?action=history&amp;feed=atom&amp;title=Handling_Name_Effects.</id>
	<title>Handling Name Effects. - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.trainzsimulator.com/index.php?action=history&amp;feed=atom&amp;title=Handling_Name_Effects."/>
	<link rel="alternate" type="text/html" href="https://wiki.trainzsimulator.com/index.php?title=Handling_Name_Effects.&amp;action=history"/>
	<updated>2026-11-05T12:14:57Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.46.2</generator>
	<entry>
		<id>https://wiki.trainzsimulator.com/index.php?title=Handling_Name_Effects.&amp;diff=38097&amp;oldid=prev</id>
		<title>Ek.skirl at 19:08, 4 August 2023</title>
		<link rel="alternate" type="text/html" href="https://wiki.trainzsimulator.com/index.php?title=Handling_Name_Effects.&amp;diff=38097&amp;oldid=prev"/>
		<updated>2023-08-04T19:08:59Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw-interface=&quot;&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 19:08, 4 August 2023&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l1&quot;&gt;Line 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&#039;&#039;&#039;&#039;&#039;Some issues with the property browser leading here to errors. For hints to slove this see the forum thread  [https://forums.auran.com/trainz/showthread.php?172571-Some-trouble-with-string-property-editing&amp;amp;p=1976756#post1976756|Some trouble with string property editing].&#039;&#039;&#039;&#039;&#039;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&#039;&#039;&#039;&#039;&#039;Some issues with the property browser leading here to errors. For hints to slove this see the forum thread  [https://forums.auran.com/trainz/showthread.php?172571-Some-trouble-with-string-property-editing&amp;amp;p=1976756#post1976756|Some trouble with string property editing]. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;(ek.skirl)&lt;/ins&gt;&#039;&#039;&#039;&#039;&#039;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Ek.skirl</name></author>
	</entry>
	<entry>
		<id>https://wiki.trainzsimulator.com/index.php?title=Handling_Name_Effects.&amp;diff=38096&amp;oldid=prev</id>
		<title>Ek.skirl: Hint for solving some error issues</title>
		<link rel="alternate" type="text/html" href="https://wiki.trainzsimulator.com/index.php?title=Handling_Name_Effects.&amp;diff=38096&amp;oldid=prev"/>
		<updated>2023-08-04T19:08:36Z</updated>

		<summary type="html">&lt;p&gt;Hint for solving some error issues&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw-interface=&quot;&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 19:08, 4 August 2023&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l1&quot;&gt;Line 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&#039;&#039;&#039;&#039;&#039;Some issues with the property browser leading here to errors. For hints to slove this see the forum thread  [https://forums.auran.com/trainz/showthread.php?172571-Some-trouble-with-string-property-editing&amp;amp;p=1976756#post1976756|Some trouble with string property editing].&#039;&#039;&#039;&#039;&#039;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Dealing with &amp;#039;&amp;#039;name&amp;#039;&amp;#039; effects in the Property Editor is similar in principle to dealing with submeshes except:&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Dealing with &amp;#039;&amp;#039;name&amp;#039;&amp;#039; effects in the Property Editor is similar in principle to dealing with submeshes except:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* &amp;#039;&amp;#039;Name&amp;#039;&amp;#039; effects can&amp;#039;t be edited simply by clicking on a link, we need to supply a string editor.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* &amp;#039;&amp;#039;Name&amp;#039;&amp;#039; effects can&amp;#039;t be edited simply by clicking on a link, we need to supply a string editor.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Ek.skirl</name></author>
	</entry>
	<entry>
		<id>https://wiki.trainzsimulator.com/index.php?title=Handling_Name_Effects.&amp;diff=11444&amp;oldid=prev</id>
		<title>Tonyhilliam at 02:05, 17 January 2018</title>
		<link rel="alternate" type="text/html" href="https://wiki.trainzsimulator.com/index.php?title=Handling_Name_Effects.&amp;diff=11444&amp;oldid=prev"/>
		<updated>2018-01-17T02:05:34Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw-interface=&quot;&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 02:05, 17 January 2018&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l162&quot;&gt;Line 162:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 162:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;You can test the code in the usual way.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;You can test the code in the usual way.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Next Tutorial: [[Texture Replacement.]]&amp;lt;br&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Next Tutorial: [[Texture Replacement.]]&amp;lt;br&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[[Getting_Started_in_TrainzScript|Back to Getting Started]]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Tonyhilliam</name></author>
	</entry>
	<entry>
		<id>https://wiki.trainzsimulator.com/index.php?title=Handling_Name_Effects.&amp;diff=408&amp;oldid=prev</id>
		<title>Windwalkr: 1 revision</title>
		<link rel="alternate" type="text/html" href="https://wiki.trainzsimulator.com/index.php?title=Handling_Name_Effects.&amp;diff=408&amp;oldid=prev"/>
		<updated>2010-02-03T13:59:01Z</updated>

		<summary type="html">&lt;p&gt;1 revision&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw-interface=&quot;&quot;&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 13:59, 3 February 2010&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-notice&quot; lang=&quot;en&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(No difference)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
		<author><name>Windwalkr</name></author>
	</entry>
	<entry>
		<id>https://wiki.trainzsimulator.com/index.php?title=Handling_Name_Effects.&amp;diff=407&amp;oldid=prev</id>
		<title>Andi06 at 21:20, 13 July 2008</title>
		<link rel="alternate" type="text/html" href="https://wiki.trainzsimulator.com/index.php?title=Handling_Name_Effects.&amp;diff=407&amp;oldid=prev"/>
		<updated>2008-07-13T21:20:26Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;Dealing with &amp;#039;&amp;#039;name&amp;#039;&amp;#039; effects in the Property Editor is similar in principle to dealing with submeshes except:&lt;br /&gt;
* &amp;#039;&amp;#039;Name&amp;#039;&amp;#039; effects can&amp;#039;t be edited simply by clicking on a link, we need to supply a string editor.&lt;br /&gt;
* In order to be editable the name, as supplied to the Property Editor, can never be blank. If it were we would not be able to select it for editing.&lt;br /&gt;
* &amp;#039;&amp;#039;Name&amp;#039;&amp;#039; effects are rather troublesome because the script call that we need to use, &amp;#039;&amp;#039;SetFXNameText(&amp;quot;effectname&amp;quot;,value)&amp;#039;&amp;#039;, will not accept an empty string without causing a script exception.&lt;br /&gt;
* To deal with these issues we need to provide additional property handling code and some messing about to avoid seeing our old friend the exception dialogue.&lt;br /&gt;
&lt;br /&gt;
 include &amp;quot;Buildable.gs&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 class Tutorial isclass Buildable {&lt;br /&gt;
 &lt;br /&gt;
    bool doorsOpen = false;&lt;br /&gt;
    bool roofVisible;&lt;br /&gt;
 &amp;lt;font color=#808080&amp;gt;/* It is legitimate to assign an initial value when a variable is declared. &lt;br /&gt;
    The value can be still altered by other code statements. */&amp;lt;/font&amp;gt;&lt;br /&gt;
    &amp;lt;font color=blue&amp;gt;string nameText = &amp;quot;None&amp;quot;;&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;font color=#808080&amp;gt;/* We are going to be calling a new method called &amp;#039;&amp;#039;SetNameText()&amp;#039;&amp;#039; in our &amp;#039;&amp;#039;Init()&amp;#039;&amp;#039;&lt;br /&gt;
    method. The method itself will be defined later on but the script will not &lt;br /&gt;
    compile unless it knows the parameters required by the method when it first &lt;br /&gt;
    finds a reference to it.  To get around this we can predefine it in the body &lt;br /&gt;
    of the class. */&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
    &amp;lt;font color=blue&amp;gt;void SetNameText(void);&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
    public void Init(void) {&lt;br /&gt;
       inherited();&lt;br /&gt;
       SetFXCoronaTexture(&amp;quot;corona&amp;quot;,null);&lt;br /&gt;
       &amp;lt;font color=blue&amp;gt;SetNameText();&amp;lt;/font&amp;gt;&lt;br /&gt;
       AddHandler(me,&amp;quot;Object&amp;quot;,&amp;quot;&amp;quot;,&amp;quot;ObjectHandler&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
 &lt;br /&gt;
    Asset GetCorona(string mesh, string effect) {&lt;br /&gt;
       Soup meshtable = GetAsset().GetConfigSoup().GetNamedSoup(&amp;quot;mesh-table&amp;quot;);&lt;br /&gt;
       Soup effects = meshtable.GetNamedSoup(mesh).GetNamedSoup(&amp;quot;effects&amp;quot;);&lt;br /&gt;
       KUID kuid = effects.GetNamedSoup(effect).GetNamedTagAsKUID(&amp;quot;texture-kuid&amp;quot;);&lt;br /&gt;
       return World.FindAsset(kuid);&lt;br /&gt;
    }&lt;br /&gt;
 &lt;br /&gt;
    thread void RingTheBell(void) {&lt;br /&gt;
       while (doorsOpen) {&lt;br /&gt;
          Sleep(0.35 + World.Play2DSound(GetAsset(),&amp;quot;bell.wav&amp;quot;));&lt;br /&gt;
       }&lt;br /&gt;
    }&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;font color=#808080&amp;gt;/* This is the actual declaration of &amp;#039;&amp;#039;SetNameText().&amp;#039;&amp;#039; We are going to use this&lt;br /&gt;
    method to work around our little problem with null string parameters to the&lt;br /&gt;
    built-in &amp;#039;&amp;#039;SetFXNameText()&amp;#039;&amp;#039; method. Since this hack will be needed several &lt;br /&gt;
    times we have &amp;#039;centralised&amp;#039; it here. */&amp;lt;/font&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
    &amp;lt;font color=blue&amp;gt;void SetNameText(void) {&lt;br /&gt;
       if (nameText == &amp;quot;None&amp;quot; or nameText == &amp;quot;&amp;quot;) {&lt;br /&gt;
          SetFXNameText(&amp;quot;name&amp;quot;,&amp;quot; &amp;quot;);&lt;br /&gt;
       } else {&lt;br /&gt;
          SetFXNameText(&amp;quot;name&amp;quot;,nameText);&lt;br /&gt;
       }&lt;br /&gt;
    }&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
    void ObjectHandler(Message msg) {&lt;br /&gt;
       Vehicle vehicle = cast&amp;lt;Vehicle&amp;gt;msg.src;&lt;br /&gt;
       if (!vehicle) return;&lt;br /&gt;
       if (msg.minor == &amp;quot;InnerEnter&amp;quot;) {&lt;br /&gt;
          doorsOpen = true;&lt;br /&gt;
          SetMeshAnimationState(&amp;quot;default&amp;quot;, true);&lt;br /&gt;
          SetFXCoronaTexture(&amp;quot;corona&amp;quot;,GetCorona(&amp;quot;default&amp;quot;,&amp;quot;corona&amp;quot;));&lt;br /&gt;
          RingTheBell();&lt;br /&gt;
       }&lt;br /&gt;
       else if (msg.minor == &amp;quot;InnerLeave&amp;quot;) {&lt;br /&gt;
          doorsOpen = false;&lt;br /&gt;
          SetMeshAnimationState(&amp;quot;default&amp;quot;, false);&lt;br /&gt;
          SetFXCoronaTexture(&amp;quot;corona&amp;quot;,null);&lt;br /&gt;
       }&lt;br /&gt;
    }&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;font color=#808080&amp;gt;/* Additional code to retrieve saved values of &amp;#039;&amp;#039;nameText&amp;#039;&amp;#039;. */&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
    public void SetProperties(Soup soup) {&lt;br /&gt;
       inherited(soup);&lt;br /&gt;
       roofVisible = soup.GetNamedTagAsBool (&amp;quot;roof&amp;quot;,true);&lt;br /&gt;
       SetMeshVisible(&amp;quot;roof&amp;quot;,roofVisible,1.0);&lt;br /&gt;
       &amp;lt;font color=blue&amp;gt;nameText = soup.GetNamedTag(&amp;quot;name&amp;quot;);&lt;br /&gt;
       SetNameText();&amp;lt;/font&amp;gt;&lt;br /&gt;
    }&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;font color=#808080&amp;gt;/* Additional code to save the present value of &amp;#039;&amp;#039;nameText&amp;#039;&amp;#039;. */&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
    public Soup GetProperties(void) {&lt;br /&gt;
       Soup soup = inherited();&lt;br /&gt;
       soup.SetNamedTag(&amp;quot;roof&amp;quot;,roofVisible);&lt;br /&gt;
       &amp;lt;font color=blue&amp;gt;soup.SetNamedTag(&amp;quot;name&amp;quot;,nameText);&amp;lt;/font&amp;gt;&lt;br /&gt;
       return soup;&lt;br /&gt;
    }&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;font color=#808080&amp;gt;/* Additional code to present &amp;#039;&amp;#039;nameText&amp;#039;&amp;#039; in the Property Editor. */&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
     public string GetDescriptionHTML(void) {&lt;br /&gt;
       string roofStatus = &amp;quot;Show&amp;quot;;&lt;br /&gt;
       if (roofVisible) roofStatus = &amp;quot;Hide&amp;quot;;&lt;br /&gt;
       string html = inherited()&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;         + &amp;quot;&amp;lt;font size=5&amp;gt;&amp;lt;br&amp;gt;&amp;quot;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;         + &amp;quot;Roof: &amp;lt;a href=live://property/roof&amp;gt;&amp;quot; + roofStatus + &amp;quot;&amp;lt;/a&amp;gt;&amp;lt;br&amp;gt;&amp;quot;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
          &amp;lt;font color=blue&amp;gt;&amp;lt;nowiki&amp;gt;+ &amp;quot;Name: &amp;lt;a href=live://property/name&amp;gt;&amp;quot; + nameText + &amp;quot;&amp;lt;/a&amp;gt;&amp;lt;br&amp;gt;&amp;quot;&amp;lt;/nowiki&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
          + &amp;quot;&amp;lt;/font&amp;gt;&amp;quot;;&lt;br /&gt;
       return html;&lt;br /&gt;
    }&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;font color=#808080&amp;gt;/* When we edit &amp;#039;&amp;#039;nameText&amp;#039;&amp;#039; Trainz will provide a separate dialogue box that we can &lt;br /&gt;
    type into. This method requests a caption for that dialogue. */&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
    &amp;lt;font color=blue&amp;gt;public string GetPropertyName(string pID) {&lt;br /&gt;
       string result = inherited(pID);&lt;br /&gt;
       if (pID == &amp;quot;name&amp;quot;) result = &amp;quot;Enter Name Text&amp;quot;;&lt;br /&gt;
       return result;&lt;br /&gt;
    }&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;font color=#808080&amp;gt;/* Advise Trainz that the &amp;#039;&amp;#039;name&amp;#039;&amp;#039; property is of type &amp;quot;string&amp;quot;. */&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
    public string GetPropertyType(string pID) {&lt;br /&gt;
       string result = inherited(pID);&lt;br /&gt;
       if (pID == &amp;quot;roof&amp;quot;) result = &amp;quot;link&amp;quot;;&lt;br /&gt;
       &amp;lt;font color=blue&amp;gt;else if (pID == &amp;quot;name&amp;quot;) result = &amp;quot;string&amp;quot;;&amp;lt;/font&amp;gt;&lt;br /&gt;
       return result;&lt;br /&gt;
    }&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;font color=#808080&amp;gt;/* &amp;#039;&amp;#039;GetPropertyValue()&amp;#039;&amp;#039; enters the current value of &amp;#039;&amp;#039;nameText&amp;#039;&amp;#039; into a dialogue to&lt;br /&gt;
    allow it to be edited. */&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
    &amp;lt;font color=blue&amp;gt;public string GetPropertyValue(string pID) {&lt;br /&gt;
       string result = inherited(pID);&lt;br /&gt;
       if (pID == &amp;quot;name&amp;quot;) result = nameText;&lt;br /&gt;
       return result;&lt;br /&gt;
    }&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;font color=#808080&amp;gt;/* &amp;#039;&amp;#039;SetPropertyValue()&amp;#039;&amp;#039; takes our edited value and assigns it to our &amp;#039;&amp;#039;nameText&amp;#039;&amp;#039;&lt;br /&gt;
    variable. This will only happen if we actually change the value in the TRS&lt;br /&gt;
    dialogue. Otherwise the original value will not be altered. */&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
    &amp;lt;font color=blue&amp;gt;public void SetPropertyValue(string pID, string value) {&lt;br /&gt;
       if (pID == &amp;quot;name&amp;quot;) {&lt;br /&gt;
          if (value == &amp;quot;&amp;quot;) nameText = &amp;quot;None&amp;quot;;&lt;br /&gt;
          else nameText = value;&lt;br /&gt;
          SetNameText();&lt;br /&gt;
       }&lt;br /&gt;
       else inherited(pID, value);&lt;br /&gt;
    }&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
    public void LinkPropertyValue(string pID) {&lt;br /&gt;
       if (pID == &amp;quot;roof&amp;quot;) {&lt;br /&gt;
          roofVisible = !roofVisible;&lt;br /&gt;
          SetMeshVisible(&amp;quot;roof&amp;quot;,roofVisible,1.0);&lt;br /&gt;
       }&lt;br /&gt;
       else inherited(pID);&lt;br /&gt;
    }&lt;br /&gt;
 &lt;br /&gt;
 };&lt;br /&gt;
&lt;br /&gt;
Note that there are no rules about the order in which methods, constants and variables are declared, except that all declarations must be made before they are used by other sections of the code.&lt;br /&gt;
&lt;br /&gt;
Adding new properties to the Property Editor is straightforward enough although because of the way that TRS makes a large number of method calls, each requesting a small piece of information, it can become confusing as your code becomes more complex.&lt;br /&gt;
&lt;br /&gt;
There are further methods for editing lists and numbers and parameters can be added to the specifications returned by &amp;#039;&amp;#039;GetPropertyType()&amp;#039;&amp;#039;, specifying maximum and minimum values and the length of strings.&lt;br /&gt;
&lt;br /&gt;
You can test the code in the usual way.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Next Tutorial: [[Texture Replacement.]]&amp;lt;br&amp;gt;&lt;/div&gt;</summary>
		<author><name>Andi06</name></author>
	</entry>
</feed>