<?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_Corona_Effects.</id>
	<title>Handling Corona 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_Corona_Effects."/>
	<link rel="alternate" type="text/html" href="https://wiki.trainzsimulator.com/index.php?title=Handling_Corona_Effects.&amp;action=history"/>
	<updated>2026-11-05T17:23:10Z</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_Corona_Effects.&amp;diff=11450&amp;oldid=prev</id>
		<title>Tonyhilliam at 02:07, 17 January 2018</title>
		<link rel="alternate" type="text/html" href="https://wiki.trainzsimulator.com/index.php?title=Handling_Corona_Effects.&amp;diff=11450&amp;oldid=prev"/>
		<updated>2018-01-17T02:07:10Z</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:07, 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-l53&quot;&gt;Line 53:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 53:&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;Turning them on and off and, if you wish, changing the texture that they use is just about all that you can do with coronas. Size and frequency are preset in &amp;#039;&amp;#039;config.txt&amp;#039;&amp;#039; and can&amp;#039;t be altered by script.&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;Turning them on and off and, if you wish, changing the texture that they use is just about all that you can do with coronas. Size and frequency are preset in &amp;#039;&amp;#039;config.txt&amp;#039;&amp;#039; and can&amp;#039;t be altered by script.&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: [[Playing Sounds.]]&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: [[Playing Sounds.]]&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_Corona_Effects.&amp;diff=406&amp;oldid=prev</id>
		<title>Windwalkr: 1 revision</title>
		<link rel="alternate" type="text/html" href="https://wiki.trainzsimulator.com/index.php?title=Handling_Corona_Effects.&amp;diff=406&amp;oldid=prev"/>
		<updated>2010-02-03T13:59:00Z</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_Corona_Effects.&amp;diff=405&amp;oldid=prev</id>
		<title>Andi06: /* Handling Corona Effects */</title>
		<link rel="alternate" type="text/html" href="https://wiki.trainzsimulator.com/index.php?title=Handling_Corona_Effects.&amp;diff=405&amp;oldid=prev"/>
		<updated>2008-07-11T22:56:15Z</updated>

		<summary type="html">&lt;p&gt;&lt;span class=&quot;autocomment&quot;&gt;Handling Corona Effects&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;You will have noticed the call &amp;#039;&amp;#039;SetFXCoronaTexture(&amp;quot;corona&amp;quot;,null);&amp;#039;&amp;#039; in the previous code examples. Corona effects specified in config.txt will be turned on when the object is loaded.  This call turns the corona off to begin with since it won&amp;#039;t be needed until the doors start to open.  To deal with coronas we need to add some code, new sections are in blue.&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;
 &lt;br /&gt;
    public void Init(void) {&lt;br /&gt;
       inherited();&lt;br /&gt;
       SetFXCoronaTexture(&amp;quot;corona&amp;quot;,null);&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;
 &amp;lt;font color=#808080&amp;gt;/* GetCorona is a utility method that will read the &amp;#039;&amp;#039;texture-kuid&amp;#039;&amp;#039; tag from the &lt;br /&gt;
    &amp;#039;&amp;#039;config.txt&amp;#039;&amp;#039; of our shed.  When we turned the corona off in Init() the reference &lt;br /&gt;
    to the KUID of the corona was lost and there is no easy way to reset it. This &lt;br /&gt;
    method retrieves the value and returns it as a corona asset. Code which reads data &lt;br /&gt;
    from a Soup, which is the Trainz word for database, is often very convoluted and &lt;br /&gt;
    difficult to follow.  I have split the code into different calls here, and made &lt;br /&gt;
    it a separate method in order to keep it readable, but it could have been written&lt;br /&gt;
    as one long statement.*/ &amp;lt;/font&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
    &amp;lt;font color=blue&amp;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;
    }&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;font color=#808080&amp;gt;/* We can use the same mechanism to control the coronas that we are using to open &lt;br /&gt;
       and close the shed doors, we just need to add the appropriate statements. */&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;
          &amp;lt;font color=blue&amp;gt;SetFXCoronaTexture(&amp;quot;corona&amp;quot;,GetCorona(&amp;quot;default&amp;quot;,&amp;quot;corona&amp;quot;));&amp;lt;/font&amp;gt;&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;
          &amp;lt;font color=blue&amp;gt;SetFXCoronaTexture(&amp;quot;corona&amp;quot;,null);&amp;lt;/font&amp;gt;&lt;br /&gt;
       }&lt;br /&gt;
    }&lt;br /&gt;
 &lt;br /&gt;
 };&lt;br /&gt;
&lt;br /&gt;
Accessing &amp;#039;&amp;#039;texture-kuid&amp;#039;&amp;#039; requires a lot of words but you should not be misled by this. Soups are very powerful and flexible and you will come across them quite frequently.  If you look at the &amp;#039;&amp;#039;config.txt&amp;#039;&amp;#039; structure you will see that the method GetCorona() needed to access a value in a database which is nested four levels deep!&lt;br /&gt;
&lt;br /&gt;
Turning them on and off and, if you wish, changing the texture that they use is just about all that you can do with coronas. Size and frequency are preset in &amp;#039;&amp;#039;config.txt&amp;#039;&amp;#039; and can&amp;#039;t be altered by script.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Next Tutorial: [[Playing Sounds.]]&amp;lt;br&amp;gt;&lt;/div&gt;</summary>
		<author><name>Andi06</name></author>
	</entry>
</feed>