On/Off Lights

If you're looking for mapping help or you reckon you're a mapping guru, post your questions / solutions here

Moderator: Moderators

Post Reply
*GCC*Nigel
Second Lieutenant
Posts: 169
Joined: Sun Dec 04, 2005 5:13 am

On/Off Lights

Post 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.
Stein Auf
Green Beret
Major General
Posts: 746
Joined: Mon Apr 19, 2004 12:21 pm
Contact:

Post 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
Image
User avatar
ViPER
General
Posts: 1058
Joined: Fri Jan 14, 2005 5:48 pm
Location: California
Contact:

Post 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
User avatar
hogleg
General
Posts: 1577
Joined: Tue Sep 09, 2003 5:23 pm
Location: Down South Hillbilly Country

Post by hogleg »

"all the governments in the world are corrupt and in the hands of the Illuminati"
Post Reply