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 20:13] – [Using Triggers] hnegled_examples [2022/03/05 13:15] (current) hneg
Line 112: Line 112:
  
 Next, a bit more complex trigger controlled situation. 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.+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: 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|}} {{:led_xmpl_007_001.png|}}
Line 118: Line 118:
 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. 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. 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|}} {{:led_xmpl_007_002.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 translation widget. Fine-tune the emitter position so that it lights up the outside roof instead of the insides of the vehicle. +Of course setting **//Use Flare//** and adjusting it’s size would make them look more real.
-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. Sync it with the blue emitter (SHIFT + ALT + S). +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/deactivationOn activation the emitter is "on" and on deactivation emitter is "off".
-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+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.
  
-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 it’s condition field write missionNamespace getVariable ["do_lightctrl", false] +===== Directional ===== 
-In it’s On Activation field write do_mainctrl false and in it’s On Deactivation field write do_mainctrl true +<WRAP todo>TODO</WRAP>
-Set the three Timer Values (min – mid - max) to 0.05.+
led_examples.1638130387.txt.gz · Last modified: 2021/11/28 20:13 by hneg