Conditional display (ASM tweak): Difference between revisions

From FSDeveloper Wiki
Jump to navigationJump to search
No edit summary
No edit summary
Line 1: Line 1:
With MakeMDL it is not possible to specify conditions for the display of your objects (or parts of them). But how about the lights that should only be shown at night or the Christmas tree that should be displayed only in December?
With MakeMDL it is not possible to specify conditions for the display of your objects (or parts of them). But how about the lights that should only be shown at night or that Christmas tree that you want to be displayed only in December?


With a relatively simple modification to the source code it is possible to display the object only when you want it. The structure of the code is as follows:
With a relatively simple modification to the source code it is possible to display the object only when you want it. The structure of the code is as follows:


<pre>IFIN1 labelname, var, con1, con2
<pre>IFIN1 labelname, var, con1, con2
; the code you want only to display in the certain condition
; the code you want only to display at the certain condition
labelname label word</pre>
labelname label word</pre>


So you must first find the code of the object(s) you want to apply the condition to. After that you place the IFIN1 command in front of it. This command has four parameters. The first one is the label that is jumped to if the condition is not met. This is the label you need to place behind the object you want to apply the condition to. All names of labels must be unique, so if you add conditions to different objects in one source, make sure you give all the labels a different name. The next parameter is the variable you want to check for. The next two parameters are the minimum and the maximum value the variable can have to fullfill the condition. If you for example want something to display at dusk/dawn and night then the commands looks like:
So you must first find the code of the object(s) you want to apply the condition to. After that you place the IFIN1 command in front of it. This command has four parameters. The first one is the label that is jumped to if the condition is not met. This is the label you need to place behind the object you want to apply the condition to. All names of labels must be unique, so if you add conditions to different objects in one source, make sure you give all the labels a different name. The next parameter is the variable you want to check for. The next two parameters are the minimum and the maximum value, between which the variable must be for the condition to be fulfilled.


<pre>IFIN1 labelname, tod, 2, 4 </pre>
== Example: Lights at night ==
 
An example of a condition that is often applied is to make lights only display at night and at dusk/dawn. To do so you need to place a simple condition check around the lights in the source code. First look for the line that defines your light, it should look something like this:
 
<pre>BGL_LIGHT LIGHT_NAV, 0.0, 0.0, 0.0, 20, 0.60, 0.40, 0FF09132dh, 0.0, 0.0, 1.0</pre>
 
Then place the check around it, so that your code looks like this:
 
<pre>IFIN1 nolight, tod, 2, 4
BGL_LIGHT LIGHT_NAV, 0.0, 0.0, 0.0, 20, 0.60, 0.40, 0FF09132dh, 0.0, 0.0, 1.0
nolight label word</pre>
 
== Example: Entire object at ==
 
Bla


[[category:Scenery design]]
[[category:Scenery design]]
[[category:FS8_(FS2002)]]
[[category:FS8_(FS2002)]]
[[category:FS9_(FS2004)]]
[[category:FS9_(FS2004)]]
{{Template:Navbox-SceneryDesign-Navigation}}

Revision as of 15:40, 24 March 2008

With MakeMDL it is not possible to specify conditions for the display of your objects (or parts of them). But how about the lights that should only be shown at night or that Christmas tree that you want to be displayed only in December?

With a relatively simple modification to the source code it is possible to display the object only when you want it. The structure of the code is as follows:

IFIN1 labelname, var, con1, con2
; the code you want only to display at the certain condition
labelname label word

So you must first find the code of the object(s) you want to apply the condition to. After that you place the IFIN1 command in front of it. This command has four parameters. The first one is the label that is jumped to if the condition is not met. This is the label you need to place behind the object you want to apply the condition to. All names of labels must be unique, so if you add conditions to different objects in one source, make sure you give all the labels a different name. The next parameter is the variable you want to check for. The next two parameters are the minimum and the maximum value, between which the variable must be for the condition to be fulfilled.

Example: Lights at night

An example of a condition that is often applied is to make lights only display at night and at dusk/dawn. To do so you need to place a simple condition check around the lights in the source code. First look for the line that defines your light, it should look something like this:

BGL_LIGHT LIGHT_NAV, 0.0, 0.0, 0.0, 20, 0.60, 0.40, 0FF09132dh, 0.0, 0.0, 1.0

Then place the check around it, so that your code looks like this:

IFIN1 nolight, tod, 2, 4
BGL_LIGHT LIGHT_NAV, 0.0, 0.0, 0.0, 20, 0.60, 0.40, 0FF09132dh, 0.0, 0.0, 1.0
nolight label word

Example: Entire object at

Bla

Template:Navbox-SceneryDesign-Navigation