Conditional display (ASM tweak)
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