Page 1 of 1
On/Off Lights
Posted: Tue Oct 03, 2006 10:03 pm
by *GCC*Nigel
Is there a way you can turn off all the lights on a map then after 10 seconds or so, they turn back on automatically, maybe flicker once or twice? In the map, you're turning off a generator in a bunker, then the Idea is the auxilery starts up afterwards. Then you go turn that off and your doused in pitch black except for red emergency lights which need to turn on after the second generator is turned off/destroyed.
Posted: Tue Oct 03, 2006 10:31 pm
by Green Beret
Well, I dont know how much scripting you know, But give the lights targetnames like bunker_light.
//script
$bunker_light turnon
//
//script
//
$bunker_light turnoff
//script
Posted: Tue Oct 03, 2006 10:54 pm
by ViPER
you may want to script the light completely.
This puts a light in the dark basement of the center house in banhoff. there are two switches - one above and one below. they turn the light on revealing anyone that may be hiding in the dark.
They stay on for a short while then switch off.
Code: Select all
shedlight:
local.lite = spawn script_model model "fx/dummy.tik" "targetname" "hello"
local.lite.origin = ( -2785 1900 -170 ) // coordinates
local.lite light 1 1 1 300 // last number is how big it is, ( 1 1 1 is white light).
$hello hide
local.ltsw1 = spawn trigger_use
local.ltsw1.origin = ( -2644 1502 -333 )
local.ltsw1 setsize ( -10 -10 -20 ) ( 10 10 20 )
local.ltsw1 targetname litsw
local.static1 = spawn script_model
local.static1 model "static/switch1.tik"
local.static1.origin = ( -2644 1502 -333 )
local.static1.angles = ( 0 -90 0 )
local.ltsw2 = spawn trigger_use
local.ltsw2.origin = ( -3135 1972 -61 )
local.ltsw2 setsize ( -10 -10 -20 ) ( 10 10 20 )
local.ltsw2 targetname litsw2
local.static2 = spawn script_model
local.static2 model "static/switch1.tik"
local.static2.origin = ( -3135 1972 -61 )
local.static2.angles = ( 0 0 0 )
thread togglelights
thread togglelights2
end
///////////////////////////////////////////
togglelights:
while(1)
{
$litsw waittill trigger
thread lighton
}
end
togglelights2:
while(1)
{
$litsw2 waittill trigger
thread lighton
}
end
///////////////////////////////////////////
lighton:
$hello show
wait 15
$hello hide
end
Posted: Wed Oct 04, 2006 1:04 am
by hogleg