What is it? A script allowing you to change value's of lights with a trigger, or with another script. Works with both trigger_use and trigger_multiple. You have controll over stuff like intensity, inner_/outer_fov, color and radius. I've setup a few basic things like switching lights on and off and dimming lights and more ( see the vid ) in the script, you can use those by just adding some KVP's in radiant.
How to use? Download the script's and place them in the corresponding folder in your mods\mapname\ folder. Readme file with explanation of the pre-set lights is included in the download. As well as instalation instructions. After calling the scripts, you can simply use it by adding KVP's in radiant.
An example of the KVP's used in radiant: KVP's trigger: ( example ) trigger_use and trigger_multiple use the same KVP's!
Code Snippet
Plaintext
count - 1 (make's the trigger looping) targetname - light_switch (the same for all switches in your map) script_string - off_on_inv (tell's the script what hintstring to use) script_noteworthy - light_group1 (you make this up yourself, give all light's that belong to this trigger the same script_noteworthy as this one! )
KVP's Light's: ( example )
Code Snippet
Plaintext
You HAVE to check the following box's for the light to work. Also, all lights need to target a info_null to work! -PRIMARY_SCRIPTABLE -PRIMARY_OMNI or PRIMARY_SPOT
targetname - light_controll (the same for all light in your map you want this script to work with) script_noteworthy - light_group1 (you make this up yourself, give the trigger that belong's to these lights the same script_noteworthy!! ) script_string - off_on_inv (tell's the script what type of light this is. read below for explanation and options!) angles - 1 0.31 0.64 ( for lights that switch color, you put the second color as an angles KVP on the light. Use the R G B value just like the actual _color kvp )
(and ofc all the normal light kvps, like: (not going to put all in here) target ( All lights need to target a info_null to work!!!!! ) intensity radius fov_inner fov_outer etc etc
============================
Can i also use this in one of my own scripts? Yes, to switch a light-group from another script, use this:
Simply call it again to switch the lights again. You can switch most light-type's as many time's as you want.
============================ Important! Your lights need to be: -PRIMARY_SCRIPTABLE -PRIMARY_OMNI or PRIMARY_SPOT ( select _spot if you want the light to be directed at the info_null, otherwise select _omni ) And they ALWAYS need to target an info_null, or they will not work!!!
off_on: A trigger allowing you to switch the lights on ( and off again if looping ) off_on_inv: Same as above, but the light starts on this time.
--- off_on_flicker A trigger allowing you to switch the lights on. At startup the lights will flicker.
--- slow_dim: A trigger allowing you to dim the lights slowly ( and back to full-bright again if looping ). Does not get completly switched off slow_dim_inv: Same as above, but the light starts in the dimmed state. ---
switch_fov: A trigger allowing you to focus a spotlight( and back to normal again if looping ). switch_fov_inv: Same as above, but the spotlight starts in a focused state ---
switch_color A trigger allowing you to swtich between two different light colors. ---
dim_and_color A trigger allowing you to dim the lights slowly and also switch the color( and full bright again if looping ). Does not get completly switched off dim_and_color_inv: Same as above, but the light starts in the dimmed state. ---
fast_strobe: No trigger or any special KVP's needed for this one (except the script_string ofc). Just a random fast flickering light. ---
fast_strobe_color: Same as above, but also switching to a random new color every time ---
CREDITS: YaPhil ( showing me where the power-lights where handled, and answering some questions about .csc)
There are 4 different light's you can use stock, without opening a script or even adding a script to your mod. Just a few KVP's.. Again, use the same settings as above. So: -PRIMARY_SCRIPTABLE -PRIMARY_OMNI or PRIMANRY_SPOT
Make every light target an info_null! and give it all normal light kvp's you want.
Then add one of these targetname's: -generic_pulsing -fire_flicker -firecaster -light_electric ( make the intensity KVP 0.001 after the power is turned on, these lights turn on. If you also give it a script_float KVP, that will be the intensity once it's on. Default is to 1.5 )
Also ( and thanks again to codmodd1234 for telling me this!! ), there's 12 stock options for the 'def' KVP for a light. I knew about 3 or 4, so i thought these might be usefull as well. The def changes the appearance of the light, the stock light is 'light_point_linear'. By adding a new light def KVP to your map, also an extra .iwi get's added to your compile. All available def's are in your raw\lights\ folder. You can also use asset-manager to create a new light def, using a custom image ( ie. a batman logo ). I never did this, and all credit to codmodd1234 again for telling me!
Whaaaa? Nice. People been asking for this everywhere. Even seen other tuts but never did it. This tut looks simple enough to use. Will definitely use it. Any limits or things we should be concerned with when using this, not to use too much?
Whaaaa? Nice. People been asking for this everywhere. Even seen other tuts but never did it. This tut looks simple enough to use. Will definitely use it. Any limits or things we should be concerned with when using this, not to use too much?
Because all of these need to be primary lights you dont want to have their radius overlap each other too much, or you will prob end up with light / dark spots and/or glitchy lighting. That should be all..
Thanks for the feedback so far, wasn't sure if people think it would be usefull..
some extra info CodModd1234 sent me regarding Dynamic lights. Thanks m8!
There is a limit for dynamic lights, so you dont want to use too many of these. He thought the limit was 64, so keep around 50 - 60max to be safe. Each dynamic light should ideally only light 1 single brush surface or model. ( so two dynamic lights lighting the same model or brush could cause issue's ) If u split a brush u can sometimes have 2 lights in the same area.
some extra info CodModd1234 sent me regarding Dynamic lights. Thanks m8!
There is a limit for dynamic lights, so you dont want to use too many of these. He thought the limit was 64, so keep around 50 - 60max to be safe. Each dynamic light should ideally only light 1 single brush surface or model. ( so two dynamic lights lighting the same model or brush could cause issue's ) If u split a brush u can sometimes have 2 lights in the same area.
Thanks for sharing! Will start small when I try to do it, closer to the end of the map then.
Yea, you can be pretty creative with these and come up with all sorts of nice additions for a map.
If people have a request for a type of light, and have a hard time scripting it. Just post your request in this topic and i'll try and take a look at it.
Fast_strobe doesnt work for me. I have light connected to info_null, also primary_omni and primary_scriptable checked, radius 250, but it doesnt flicker. Just work like a normal light.
Fast_strobe doesnt work for me. I have light connected to info_null, also primary_omni and primary_scriptable checked, radius 250, but it doesnt flicker. Just work like a normal light.
Did you give both the targetname and the script_string. Also note the targetname has two L's at the end, a typo