User Tools

Site Tools


led_examples

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
led_examples [2021/11/28 19:56] hnegled_examples [2022/03/05 13:15] (current) hneg
Line 71: Line 71:
 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. 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.
 {{:led_xmpl_004_001.png|}} {{:led_xmpl_004_001.png|}}
 +{{:led_xmpl_004_002.png|}}
 +
 +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:
 +{{:led_xmpl_004_003.png|}}
 +
 +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:
 +{{:led_xmpl_004_004.png|}}
 +
 +===== 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 ({{:attach_btn_sel.png?20|}}) and press ``ALT + A``.
 +
 +This opens a sub-leaf on the tool UI showing the possible selections on the building to choose from.
 +{{:led_xmpl_005_001.png|}}
 +
 +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.
 +{{:led_xmpl_005_002.png|}}
 +
 +===== 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//.
 +
 +<WRAP important>NOTE that the regular Eden Sync does not work with this, you have to use the method specific to this tool.</WRAP>
 +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":
 +{{:led_xmpl_006_001.png|}}
 +
 +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:
 +{{:led_xmpl_006_002.png|}}
 +
 +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:
 +{{:led_xmpl_007_001.png|}}
 +
 +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.
 +{{:led_xmpl_007_003.png|}}
 +
 +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 [[led_examples#ufo|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:
 +<code>triggerActivated light_ctrl</code>
 +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:
 +<code>!(triggerActivated light_ctrl) && !(missionNamespace getVariable ["do_lightctrl", false])</code>
 +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
 +<code>true</code>
 +In it’s **//On Activation//** field write:
 +<code>do_mainctrl = true</code>
 +
 +Then name the next trigger to //main_ctrl//.
 +Set it //Repeatable// and in it’s **//Condition field//** write
 +<code>missionNamespace getVariable ["do_mainctrl", false]</code>
 +In it’s **//On Activation//** field write
 +<code>do_lightctrl = true</code>
 +and in it’s **//On Deactivation//** field
 +<code>do_lightctrl = false</code>
 +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
 +<code>missionNamespace getVariable ["do_lightctrl", false]</code>
 +In its **//On Activation//** field write
 +<code>do_mainctrl = false</code>
 +and in it’s **//On Deactivation//** field write
 +<code>do_mainctrl = true</code>
 +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:
 +{{:led_xmpl_007_002.png|}}
 +
 +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 [[todo|In-Game Functions –> Examples]], but it is quite crude and not really meant top be used, especially not tested in MP.
 +
 +
 +===== Directional =====
 +<WRAP todo>TODO</WRAP>
led_examples.1638129394.txt.gz · Last modified: 2021/11/28 19:56 by hneg