User Tools

Site Tools


led_examples

Examples

So, as with the particles, let’s doodle up some examples to get you going.

The biggest difference when it comes to placing light emitters is that there is no default emitter set for lights, because it simply makes no sense to have one. So you can only insert single emitters with INSERT.
All the attach stuff etc is exactly the same though.
But, in case you are not interested in particles and jump straight to the lights I’ll make the examples as if you had not read any of the particle examples.

Simple

Let’s start from blank slate, press New Scenario.
Place down a light emitter and adjust the time of day to be darker so you can actually see the light shinning.

Set the Intensity parameter to 10000. You need to use quite high values in this.
It’s not stated anywhere but the value probably is in candelas.

Set some color for the light. You can see that light color has no alpha so it’s just plain old RGB. You can also see the color change in real time when you move the sliders. And that’s it, you have a light emitter in your scenario.

Light Classes

You can also select a light class from the Emitter class list.

The classes are read from CfgLights so if you’re using a mod that has it’s own lights it is possible those are listed in the list as well. The classes in the list include only the lights that have params that can be set with the setLightXXX scripting commands, refer to the Technical issues/limitations/other notes article for details.

So, anyway, let’s select the class ExploLight.
Now your emitter is emitting a very bright light, which assuming from the name is flashed when something explodes.

Or you can select something like Chemlight_Red, which is of course the light from the red colored Chemlight.

UFO

Clear the scenario, place down a big drone plane (I’m using the Sentinel in this example). Change the daytime so that it becomes dark.

Place down a light emitter and select the class Chemlight_Red, change the Intensity from 4000 to 400000 (add two zeros at the end) and Attenuation Start to 2.

IMPORTANT NOTE:
When you change the intensity param you can see how shortly after the parameter field changes color to yellow. This means the input is being validated and only after the field turns back to white is the input validated successfully and applied to the emitter. In case of faulty input you get a red Eden notification, the field turns red for about 3 seconds and then the field gets applied with either the default datatype for that field or the last known validated input.
You have to wait for the validation to finish until you can change a value in any other param field.

This makes things a bit slow but if there wasn’t such a validation faulty data could be “injected” into the emitter causing errors which in turn would cause tool’s database corruption which would mean the scenario would most likely be FUBAR…

You can also change parameter data with the mouse scroll wheel, see details in Inserting data into data fields.

Select Global attach from the attach mode selector, the button on the top menu with the “box” image on it.
Either click the button or tap SHIFT + A until it changes from to

Select the emitter you placed, move the mouse cursor to an empty area and press ALT + A to activate the Global attach mode. The mode is indicated by a globe symbol above the navigation widget. You will also hear a sound play and see the emitter move to the camera view center.

Do NOT press left mouse button, instead press and hold down the right mouse button and move the mouse around. You will notice how the emitter follows the camera view center. This is how you can position the emitter anywhere on the drone model.

Note that when the emitter is above an object surface a green reticule icon will appear over it:

Press left mouse button to confirm attach.

Global Attach can be a tad annoying to use because the object surface detection is checked from many directions so which ever, the cursor or the emitter itself, collides with the surface there’s the surface position so the emitters may behave “oddly” and jump of to surfaces not even near the cursor. That is a feature, not a bug.
So, move the emitter to either wing, about half way and press left mouse button. You will hear a sound play and the globe symbol disappear from the screen. The attach mode selector button also turns back to the “box” image.

Then you can fine tune the emitter position by selecting the emitter, activating the Eden Translation widget and holding down CTRL on the keyboard. A green reticule will appear to indicate the emitter is movable and you can then move it with the translation widget so that the light appear under the wing/drone (keep CTRL down while “translating”).

You can also, instead of Global attach, just drag the emitter onto the entity and press SHIFT + ALT + A, this will attach the emitter to the spot it is at on the model. Requires the Eden Surface snapping switched on. The same green reticule icon will show up if the emitter is on the object surface.

Place down another light emitter, or clone the previous one with the clone button or the SHIFT + CTRL + C kb shortcut. Select the class Chemlight_Red, change the Intensity from 4000 to 40000 and Attenuation Start to 2. Select Global attach mode and move the emitter to the opposite wing from the previous emitter. Fine tune the positioning as described earlier.

Place down a third light emitter (or clone previous) and select the class Chemlight_Blue, change the Intensity from 4000 to 40000 and Attenuation Start to 2. Select Global attach mode and move the emitter somewhere to the rear of the drone and fine tune the positioning as described earlier.
Place down a fourth light emitter (or clone previous) and select the class Chemlight_Green, change the Intensity from 4000 to 40000 and Attenuation Start to 2. Select Global attach mode and move the emitter to the nose of the drone and fine tune the positioning as described earlier.
So now your drone should look like something like this:

Change the drone altitude to 100. Place down some player entity and Play Scenario. The drone starts to circle around in the air and looking kinda UFO-like when it flies over.

Someone left the lights on

Simple way to make it look like someone has lights on in a building: place down a light emitter and give it the class ExploLightMed and set intensity to 800. Place the light close to a ceiling to simulate a light bulb or whatever and adjust the main Color to some warmer color.

In this case Ambient color should be set to [0,0,0] is that despite it’s name it doesn’t act as you might assume it does. If you check the box Link ambient with color the Ambient color gets the same slider settings as Color and the building looks like this:

That is because Ambient color defines the color the surfaces around the light source, including surfaces that face away from the light are illuminated with. The regular Color illuminates it’s surroundings as well (which one might also call ambient :P ) but it only illuminates surfaces that face the light source.

Ambient color allows you to do some quite X-Files domes for example:

More Attach

Lights can be attached, just like particle emitters, to object model selections. Including terrain objects.
So, go to an enterable building, place down a light emitter and give it some reasonably bright class.
Press and hold down T on your keyboard and move the mouse cursor over that building. It gets highlighted green. Press left mouse button to select the building, the highlight turns to blue (a sound also plays).

Select selection attach mode by pressing the attach mode selection button (or SHIFT + A) until the button has a grid-like image on it () and press ALT + A.

This opens a sub-leaf on the tool UI showing the possible selections on the building to choose from.

When you select a selection from the list the light will move to that selection on the building model. Press OK to confirm your selection.

Using Triggers

Like with the particles light emitters can be controlled with simple triggers if you wish them not to shine at the start of the scenario.

Simple way to demo this, place an “avenue” (two rows) of a few light emitters, set the other row to use for example Chemlight_red and set the Attenuation start to 2.
Set the other row use for example Chemlight_blue and set it’s Attenuation start to 2.

Then, place down a trigger and place it slightly before the first two emitters, then place as many triggers as you need to have one for each emitter pair. Set each trigger owner to player and activation type owner only – present.

NOTE that the regular Eden Sync does not work with this, you have to use the method specific to this tool.

Sync the triggers with the emitter “pairs” by selecting an emitter and hovering over the trigger (so that it gets highlighted) and press SHIFT + ALT + S. Do the same for the other emitter. Then do this for each of the emitter “pairs”:

What this “special” sync does it makes the emitters wait until the synced trigger gets activated. Unfortunately this requires a looping script per each emitter since there is no eventhandler for this, so can’t be helped.

Play Scenario, switch to 3rd person and run towards the triggers. You will notice the lights light up only when you activate the trigger:

Next, a bit more complex trigger controlled situation.
If you own for example the Laws of War DLC it comes with an ambulance that has the emergency lights on it.
Well, they look absolutely ridiculous compared to the real thing because in the dark you can see those things light up blocks away. Just Google some emergency vehicle images/videos at night and compare to this:

So, let’s put a couple of light emitters and triggers to emulate what they should kinda look like. I say “should kinda” because this is very crude and ugly looking still.
Start a new scenario, put down some car, doesn’t have to be the previously mentioned ambulance, this is just an example.

Place down a light emitter, set the class Chemlight_red for it, change the intensity to 40000 (add one 0 to it) and the Attenuation start to 2. Select the Global attach mode and move the emitter to the roof of the vehicle (or drag and SHIFT + ALT + A). You can fine-tune the attach position either by inputting data into the position field or with the Eden Translation widget (as explained in the UFO example).
Fine-tune the emitter position so that it lights up the outside roof instead of the insides of the vehicle.
Place down another light emitter with class Chemlight_blue, intensity to 40000 and attenuation start to 2. Global attach the emitter to the other side of the roof of the vehicle, fine-tune like the previous one.

Place five 0x0 triggers.
One next to each emitter, name the two to blue and red according to the color of the emitter. In the Condition field of the blue trigger write:

triggerActivated light_ctrl

and set it Repeatable. Use the tools “special sync” to sync it with the blue emitter (SHIFT + ALT + S).
In the Condition field of the red trigger write:

!(triggerActivated light_ctrl) && !(missionNamespace getVariable ["do_lightctrl", false])

and set it Repeatable. Sync it with the red emitter (SHIFT + ALT + S).

Then name one trigger to start (just to keep things easier to follow), in it’s Condition field write

true

In it’s On Activation field write:

do_mainctrl = true

Then name the next trigger to main_ctrl.
Set it Repeatable and in it’s Condition field write

missionNamespace getVariable ["do_mainctrl", false]

In it’s On Activation field write

do_lightctrl = true

and in it’s On Deactivation field

do_lightctrl = false

Set the three Timer Values (min – mid - max) to 0.1.

Name the last trigger to light_ctrl. Set it Repeatable and in its Condition field write

missionNamespace getVariable ["do_lightctrl", false]

In its On Activation field write

do_mainctrl = false

and in it’s On Deactivation field write

do_mainctrl = true

Set the three Timer Values (min – mid - max) to 0.05.

Place down a player entity to observe and Play Scenario.
You should see the lights blinking (badly) on the vehicle roof, looking more like the real thing than the vanilla blinking textures:

Of course setting Use Flare and adjusting it’s size would make them look more real.

This example points out that the when synced with a trigger using the tool’s sync (SHIFT + ALT + S) the emitter follows the triggers activation/deactivation. On activation the emitter is “on” and on deactivation emitter is “off”.

Obviously making these lights look better it would require some scripting in-scenario.
Such a script is included in an example at the end of this manual in the section In-Game Functions –> Examples, but it is quite crude and not really meant top be used, especially not tested in MP.

Directional

TODO

led_examples.txt · Last modified: 2022/03/05 13:15 by hneg