UGX-Mods Login

or login with an authentication provider below
Sign In with Google
Sign In with Twitter
Sign In with Discord
Sign In with Steam
Sign In with Facebook
Sign In with Twitch

[Tutorial] Lights controlled by triggers

HOT
broken avatar :(
Created 9 years ago
by BluntStuffy
0 Members and 1 Guest are viewing this topic.
16,577 views
broken avatar :(
×
broken avatar :(
Location: nlApeldoorn
Date Registered: 17 December 2013
Last active: 1 year ago
Posts
1,187
Respect
1,404Add +1
Forum Rank
Zombie Colossus
Primary Group
Community Scripter Elite
My Groups
More
My Contact & Social Links
More
Personal Quote
It aint much, if it aint Dutch
Signature
×
BluntStuffy's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Community Scripter Elite Has shown excellence and experience in the area of custom scripting in the UGX-Mods community.
Oil Rig Beta Access
Oil Rig Beta Access
BluntStuffy's Contact & Social LinksBluntstuffy@BluntZombieBluntStuffyStuffyZombie
http://www.youtube.com/watch?v=h4s-zEpOAxQ#ws

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:

Code Snippet
Plaintext
	for(i=0;i<get_players().size;i++)
{
setclientsysstate( "levelNotify", SCRIPT_NOTEWORTHY, get_players()[i] );
}
   REPLACE: script_noteworthy with the script_noteworthy of the light-group you want to switch. for example:
Code Snippet
Plaintext
	for(i=0;i<get_players().size;i++)
{
setclientsysstate( "levelNotify", "light_group1", get_players()[i] );
}
   
   
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!!!

===========================
How to install:
Code Snippet
Plaintext
In your mapname.gsc under this line:

maps\_zombiemode::main();


Add this line:

maps\_blst_light_control::main();


========================================================

In your mapname.CSC  ( located in \clientscripts\ if it's not in your \mods\mapname\ folder allready copy it from \raw\clientscripts\ )

Under the line:

clientscripts\_zombiemode_tesla::init();


Add this line:

clientscripts\_blst_lights::init();

========================================================


Type's of lights available:
Spoiler: click to open...
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)




UPDATE, Stock lights. no scripting required.

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!

def KVP's
Spoiler: click to open...
-candle
-light_dynamic
-light_no_falloff
-light_point_linear
-light_point_linear_drk_lght_drk
-light_point_linear_fire_fill
-light_point_linear_nocenter
-light_point_quadratic
-light_point_quadratic_glow
-light_point_quadratic_obtuse
-light_point_sharp_fall
-tungsten_lamp
Last Edit: January 15, 2015, 10:40:44 pm by BluntStuffy
broken avatar :(
×
broken avatar :(
[UGX] Documentation Writer & Programmer
Location: usLos Angeles, CA
Date Registered: 23 August 2013
Last active: 6 months ago
Posts
1,322
Respect
Forum Rank
Zombie Colossus
Primary Group
UGX Team Member
My Groups
More
My Contact & Social Links
More
Personal Quote
(ง º ω º )ง u wont sum m8y?
Signature
Do not take life too seriously. You will never get out of it alive.
×
DidUknowiPwn's Groups
UGX Team Member
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Community Scripter Elite Has shown excellence and experience in the area of custom scripting in the UGX-Mods community.
BO3 Modtools Alpha
BO3 Modtools Alpha
This user has access to the Black Ops 3 Modtools Alpha
Looks awesome, good job on this :)
broken avatar :(
×
broken avatar :(
Location: england
Date Registered: 28 March 2013
Last active: 3 years ago
Posts
184
Respect
Forum Rank
Pack-a-Puncher
Primary Group
Member
×
SarcyMoFo's Groups
SarcyMoFo's Contact & Social Links
Tremendous work!  :o

Chuckled a little as opened into new area, even this testing area has more than one room Take that box 'maps'!  :P

Seriously though this looks great, the colour + dim in particular I feel would compliment a boss round, have to make that a reality now!  :D
broken avatar :(
×
broken avatar :(
Location: be
Date Registered: 4 August 2014
Last active: 3 years ago
Posts
224
Respect
Forum Rank
Mr. Elemental
Primary Group
Donator ♥
My Groups
More
Personal Quote
( ͡° ͜ʖ ͡°) ( ͡° ͜ʖ ͡°) ( ͡° ͜ʖ ͡°)
×
MechromancerX's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
MechromancerX's Contact & Social Links
Looks nice :P , incoming maps with a lightswitch in every room :D
broken avatar :(
×
broken avatar :(
Location: usNC
Date Registered: 19 August 2014
Last active: 7 years ago
Posts
104
Respect
Forum Rank
Pack-a-Puncher
Primary Group
Donator ♥
My Groups
More
My Contact & Social Links
More
Personal Quote
OMTGaming
×
OfficialMT22's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
OfficialMT22's Contact & Social LinksOMTGamingOfficialMT22OfficialMT22GamingOMTGaming
YOU ARE AWESOME!
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 14 September 2013
Last active: 4 years ago
Posts
1,895
Respect
Forum Rank
Zombie Destroyer
Primary Group
Community Scripter
My Groups
More
My Contact & Social Links
More
Personal Quote
BE ORIGINAL
Signature
×
MakeCents's Groups
Community Mapper Has released one or more maps to the UGX-Mods community which have been added to the UGX Map Manager.
Community Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
BO3 Modtools Alpha
BO3 Modtools Alpha
This user has access to the Black Ops 3 Modtools Alpha
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?
broken avatar :(
×
broken avatar :(
Location: nlApeldoorn
Date Registered: 17 December 2013
Last active: 1 year ago
Posts
1,187
Respect
1,404Add +1
Forum Rank
Zombie Colossus
Primary Group
Community Scripter Elite
My Groups
More
My Contact & Social Links
More
Personal Quote
It aint much, if it aint Dutch
×
BluntStuffy's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Community Scripter Elite Has shown excellence and experience in the area of custom scripting in the UGX-Mods community.
Oil Rig Beta Access
Oil Rig Beta Access
BluntStuffy's Contact & Social LinksBluntstuffy@BluntZombieBluntStuffyStuffyZombie
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..
broken avatar :(
×
broken avatar :(
Location: england
Date Registered: 26 July 2013
Last active: 7 years ago
Posts
331
Respect
Forum Rank
Perk Hacker
Primary Group
Community Mapper
My Groups
More
My Contact & Social Links
More
Personal Quote
Action is the enemy of thought
Signature
×
tudark's Groups
Community Mapper Has released one or more maps to the UGX-Mods community which have been added to the UGX Map Manager.
tudark's Contact & Social Linkstudark71The Morgue
Awsome stuff Blunty , will be using these in the orbit  map I cant wait.
broken avatar :(
×
broken avatar :(
Location: nlApeldoorn
Date Registered: 17 December 2013
Last active: 1 year ago
Posts
1,187
Respect
1,404Add +1
Forum Rank
Zombie Colossus
Primary Group
Community Scripter Elite
My Groups
More
My Contact & Social Links
More
Personal Quote
It aint much, if it aint Dutch
×
BluntStuffy's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Community Scripter Elite Has shown excellence and experience in the area of custom scripting in the UGX-Mods community.
Oil Rig Beta Access
Oil Rig Beta Access
BluntStuffy's Contact & Social LinksBluntstuffy@BluntZombieBluntStuffyStuffyZombie
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.
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 14 September 2013
Last active: 4 years ago
Posts
1,895
Respect
Forum Rank
Zombie Destroyer
Primary Group
Community Scripter
My Groups
More
My Contact & Social Links
More
Personal Quote
BE ORIGINAL
×
MakeCents's Groups
Community Mapper Has released one or more maps to the UGX-Mods community which have been added to the UGX Map Manager.
Community Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
BO3 Modtools Alpha
BO3 Modtools Alpha
This user has access to the Black Ops 3 Modtools Alpha
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.
broken avatar :(
×
broken avatar :(
Location: usNC
Date Registered: 19 August 2014
Last active: 7 years ago
Posts
104
Respect
Forum Rank
Pack-a-Puncher
Primary Group
Donator ♥
My Groups
More
My Contact & Social Links
More
Personal Quote
OMTGaming
×
OfficialMT22's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
OfficialMT22's Contact & Social LinksOMTGamingOfficialMT22OfficialMT22GamingOMTGaming
i like the way you can make the lights blink, It would be VERY usefull for a construction style map



or even for christmas lights



Thanks for this.
broken avatar :(
×
broken avatar :(
Location: nlApeldoorn
Date Registered: 17 December 2013
Last active: 1 year ago
Posts
1,187
Respect
1,404Add +1
Forum Rank
Zombie Colossus
Primary Group
Community Scripter Elite
My Groups
More
My Contact & Social Links
More
Personal Quote
It aint much, if it aint Dutch
×
BluntStuffy's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Community Scripter Elite Has shown excellence and experience in the area of custom scripting in the UGX-Mods community.
Oil Rig Beta Access
Oil Rig Beta Access
BluntStuffy's Contact & Social LinksBluntstuffy@BluntZombieBluntStuffyStuffyZombie
i like the way you can make the lights blink, It would be VERY usefull for a construction style map

(Image removed from quote.)

or even for christmas lights

(Image removed from quote.)

Thanks for this.

 :) 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.
broken avatar :(
×
broken avatar :(
Location: usNC
Date Registered: 19 August 2014
Last active: 7 years ago
Posts
104
Respect
Forum Rank
Pack-a-Puncher
Primary Group
Donator ♥
My Groups
More
My Contact & Social Links
More
Personal Quote
OMTGaming
×
OfficialMT22's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
OfficialMT22's Contact & Social LinksOMTGamingOfficialMT22OfficialMT22GamingOMTGaming
maybe a rotating light that does a 360 like a lighthouse light?
broken avatar :(
×
broken avatar :(
Location: lt
Date Registered: 8 January 2015
Last active: 5 years ago
Posts
10
Respect
Forum Rank
Legless Crawler
Primary Group
Member
×
Erebuss's Groups
Erebuss's Contact & Social Links
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.
broken avatar :(
×
broken avatar :(
Location: nlApeldoorn
Date Registered: 17 December 2013
Last active: 1 year ago
Posts
1,187
Respect
1,404Add +1
Forum Rank
Zombie Colossus
Primary Group
Community Scripter Elite
My Groups
More
My Contact & Social Links
More
Personal Quote
It aint much, if it aint Dutch
×
BluntStuffy's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Community Scripter Elite Has shown excellence and experience in the area of custom scripting in the UGX-Mods community.
Oil Rig Beta Access
Oil Rig Beta Access
BluntStuffy's Contact & Social LinksBluntstuffy@BluntZombieBluntStuffyStuffyZombie
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  :(

Code Snippet
Plaintext
targetname		-		light_controll

 
Loading ...