Apron lighting using effects and XML
Another way than placing apron lightning with GMAX is by placing the effect (that is to say the controller of the effect) with XML, with Object Placer XML for example.
The way of doing it, is pretty much the same as described in the article Using GMAX to Create Apron Lighting using Effects, but for better reading, I copy the important parts (Nick, please forgive me ;-) ), so the "Creating an Effect"-Section is from Nick.
- Knowledge of creating effect files
- Knowledge of placing an object via Object Placer XML
Creating an Effect
Before creating an effect, you have to undertand a problem that happens with effects. When you start Flight Simulator outside of the spawn area, you get to the airport and you have no effects. What's happening is that the model is spawning outside of the radius that the effects work, which means that the model spawns, the effects say "Oh I'm nowhere near the plane, I'm not going to draw" and then the effects don't respawn because they were a one-time effect with infinite lifetime.
You have two options.
The first option is to set the lifetime of the emitter to 0 in your effect file. Look for:
[Emitter.0] Lifetime=0.00, 0.00
However, it should be noted that when you use this method if your framerate drops the lights will get brighter if the effect overlaps.
Controller Workaround (Georg: The way I prefer)
The second option is to use a controller file. There was a lot of discussion on this top on this thread. I am now certain that the following instructions work, I have tested them a few times now.
What you want to do is create a static effect much like the plane navlights, use fx_navwhi.fx as a template. (This will eliminate the brightness problem with frame rate fluctuations) and then create a proximity controller that triggers the effect within the radius of the model instantiation.
So what happens is the controller tests proximity and creates the effect right after the model is created. In the sample below, I spawn the navwhih effect 10km out. I tested this by placing the effect in Westport (on the Washington coast) and then started my flight in Olympia (about 60 miles away). The effect was there when I got there. You could probably adjust the distance out even further as well. Here's the controller snippet to use:
[Library Effect] Lifetime=5 Version=1.00 Radius=200 Priority=0 [controller.0] lifetime=0.0, 0.0 type=3 distance=10000.00, 10000.00 delay=10000000.00, 10000000.00 x offset=0.00, 0.00 y offset=0.00, 0.00 z offset=0.00, 0.00 effect.0=fx_navwhih, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00
As you can see, type 3 controller is proximity, which means the effect will trigger when you are within [distance] of the effect. In this case, 10,000 meters. The delay set to 10000000.00 means that the controller will not trigger the effect again until 10000000 seconds have passed (and who's going to fly that long really). Therefore it triggers a single instance of the effect when you are within 10,000 meters of the effect. The only possible problem with this solution is that if you go outside of the radius of the effect and unload it, you might not get it back again. But, if do that, the model will also unload, and then reload when you get within range.
Placing the effect and effect parameters
The placing is done via Object Placer XML and pretty much straight forward.
But ... I'm pretty sure that you want your light shining brightly in dusk, dawn and night, so you think: "No problem here, I put the parameters to
but unfortunately there is a bug in the engine and you have to do the following. Place the controller twice on the same location, one with
and one with
With this, you will have the desired lighting periods.