Light Switches

Tutorial collection, comprehensive listings on main site.

Light Switches

Postby Tutorial on Mon Mar 07, 2005 1:02 am

category
General Half-Life 2/Lighting

description
Flick a light on or off at the touch of a button.

keywords
lights, light, switch, switches, button, func_button.

You first need a location for the light and it must obviously contain a light entity in it. Select the light entity and press ALT+ENTER. This will open a dialog box. Set the name as "light1".

Next create a small square brush that is against a wall (This will be the button). After placing the brush, select it and press CTRL+T and choose func_button.

Image

Set these Properties:
Delay before reset: 0

Now go to the Outputs tab, click Add, and fill in the fields as shown below

My output named: OnPressed
Targets entities named: light
Via this input: Toggle

Image


Extra Features:

In the button properties, you can go to flags, and check of Damage Activates or Touch Activates, and this will allow you to shoot or just walk into the button to make it work.

And voila! That’s it.

Contributed by SiLenTDeaTH
Tutorial
Not A Real User
 
Joined: Sun Mar 06, 2005 11:00 pm

Postby Annon Kaies Zi on Sat Apr 09, 2005 4:16 pm

Is there a way to turn off a spotlight with the same switch?
-Annon Kaies Zi
AnnonZi@gmail.com

Visit Aqwaqwa and its forums to help it grow!
Annon Kaies Zi
Member
Member
 
Joined: Sat Apr 02, 2005 3:53 pm
Location: United States

Postby Spas12 on Sat Apr 09, 2005 6:29 pm

Of coarse. just make the spotlight the name of the light to be turned off or on and make it so it has an input of the button
Past Treyarch Level Designer

Portfolio
Spas12
Veteran
Veteran
 
Joined: Thu Mar 31, 2005 3:21 pm
Location: trapped in level-design factory, send help

Postby Annon Kaies Zi on Sat Apr 09, 2005 6:49 pm

When I do that it doesn't work, and in the properties menu it has a symbol with a red line or something.

Note that by spotlight, I mean a point_spotlight entity.
-Annon Kaies Zi
AnnonZi@gmail.com

Visit Aqwaqwa and its forums to help it grow!
Annon Kaies Zi
Member
Member
 
Joined: Sat Apr 02, 2005 3:53 pm
Location: United States

Postby Spas12 on Sat Apr 09, 2005 7:25 pm

hm... dunno. red line means invalid output so maybe u didnt name the enities or something else wrong..
Past Treyarch Level Designer

Portfolio
Spas12
Veteran
Veteran
 
Joined: Thu Mar 31, 2005 3:21 pm
Location: trapped in level-design factory, send help

Postby Annon Kaies Zi on Sat Apr 09, 2005 7:29 pm

I did everything according to this tutorial. The other lights turn off, just not the point_spotlight.
-Annon Kaies Zi
AnnonZi@gmail.com

Visit Aqwaqwa and its forums to help it grow!
Annon Kaies Zi
Member
Member
 
Joined: Sat Apr 02, 2005 3:53 pm
Location: United States

Postby th1alb on Fri Jul 08, 2005 1:34 am

yes, i have the exact same problem
th1alb
Just Joined
Just Joined
 
Joined: Fri Jul 08, 2005 1:34 am

Postby HallWack on Fri Aug 26, 2005 5:29 pm

I got the same too problem, cant shut down spotlights!
I also got little funny issue that the button moves little when I press the button...
S0rry 4 b4d 3ngl15h. 1 h0p3 u 4ll und3r574nd
HallWack
Dumpling
Dumpling
 
Joined: Sun Aug 21, 2005 8:45 am
Location: 60.1667 Northern Latitude; 24.7 Eastern Longitude.

Postby AquilaPhamas on Mon Aug 29, 2005 2:31 am

Do you have No Dynamic Light flagged? If so turn it off, I beleive that will help.
Image
AquilaPhamas
Dumpling
Dumpling
 
Joined: Mon Aug 29, 2005 2:08 am
Location: CT

Postby -=[Mayhem]=- on Tue Sep 06, 2005 5:45 pm

When i pres the buttom it turns off... but does it turn on when i press it again?
-=[Mayhem]=-
1337 p0st3r
1337 p0st3r
 
Joined: Mon Aug 01, 2005 7:09 pm

Postby Rick_D on Sat Nov 05, 2005 3:40 pm

If you set the 'toggle' flag.

Also, set the 'don't move' flag to make the button stationary.
Rick_D
May Contain Skills
May Contain Skills
 
Joined: Wed Jul 13, 2005 1:41 pm
Location: stockholm

Postby Sauce on Fri Dec 02, 2005 6:05 am

Thanks for the tut! One problem though. I have a button that is supposed to spawn blocks for a HL2 mod called sourceforts. Anyway, I can get it to spawn blocks, I just can't get it to move the button in the right direction. I've tried everything to get it to go into the brush (Which rests at 45 degrees) but I just can't do it. What settings should I use for the "Move Direction (Pitch, Yaw, Role)" property? Here is an associated image:

Image
Image
Blink wrote:Do you watch porn and decide you don't need to have sex because you've seen the ending? :-D

zombie@computer wrote:what retarded countries measure in stones anyway?
or feet? or inches? Your dick is a lot longer in cms
User avatar
Sauce
Senior Member
Senior Member
 
Joined: Sat Nov 26, 2005 4:36 am
Location: Australia

Postby Lugz on Mon Feb 20, 2006 4:34 am

Sauce wrote:Thanks for the tut! One problem though. I have a button that is supposed to spawn blocks for a HL2 mod called sourceforts. Anyway, I can get it to spawn blocks, I just can't get it to move the button in the right direction. I've tried everything to get it to go into the brush (Which rests at 45 degrees) but I just can't do it. What settings should I use for the "Move Direction (Pitch, Yaw, Role)" property? Here is an associated image:

Image


For Move Direction, click the "Point At" button, and then click the direction that u want the button to move, so in your situation once you click the point at button click right behind the func_button on the brush.

-Lugz
Lugz
Member
Member
 
Joined: Mon Feb 20, 2006 12:19 am

dynamic lights?

Postby KewlAzMe on Sat Mar 25, 2006 4:39 am

Hi!

Great tips.. it worked great. BUT... I can't seem to get this to work with Light_Dynamic. Is it not possible?
~Thieves' Highway~
Multiplayer mod based on
the 'Thief' Game Series
(Switched to Unreal Engine)
KewlAzMe
Dumpling
Dumpling
 
Joined: Sat Mar 25, 2006 4:37 am

Postby dead7iest-weap0n on Sun Apr 02, 2006 7:59 pm

ok, how would I do this with a model, instead of a brush? Because I want to use the combine switch model.
dead7iest-weap0n
Member
Member
 
Joined: Sun Apr 02, 2006 4:47 am
Next

Return to Tutorials

Who is online

Users browsing this forum: No registered users