Make switches for lights

A Tutorial for Source Engine

Members see zero ads. Signup for free
In this tutorial I will show you how to make a light that you will be able to switch on and off. Despite its simpleness, I'm surprised I've never seen it in any maps. So how simple is it? Well to give you some scale, this is easier than adding dustmotes. So the first thing you will do is make a light or light_spot, and assign it a name, doesn't matter what that will be, just make it something easy to remember like "light\_hall" or "central\_light," as long as it's nothing stupid like "pickle\_jar." You may want to adjust the settings on the light a bit to your liking, but I'm not gonna go into too much detail about that. So now that you've done that, forget about that light. Yeah, you won't be needing to adjust the outputs on it. Now create a brush along the wall that is 1 unit thick, 10 units tall, and 6 units wide. Make it into a solid. This will become your light switch. now press ctrl + T then click where it says func\_detail and start typing in func\_button; most likely around the second u, it'll auto-complete it to be a func\_button, click apply and click out of it for a second. This is when you will be texturing the button, pay careful attention. However it is up to you how you want to texture it. Just make sure all of the textures fit.
First click on the face editor and then select the side touching the wall. Click browse and apply the following texture then apply it: tools/toolsnodraw. Now select the long and skinny sides of the switch while still in face editor. Click browse and find some texture that is white, as long as it isn't cement. Now select the face that is the largest and faces outward (while in face editor). Click on browse and apply this texture: decals/milswitch003. While the large face is still selected where L, R, Fit, T, B, and C are, click on the C, this should center the switch. I know what you're thinking, "But Liko, I could use that switch decal as a decal like it's supposed to be then make the button invisible." You could do that, but for some strange reason the decal didn't show up in game for me. When you're done you should have something that looks like Screenshot B. Now that the texturing is done, exit out of the face editor. Select the switch and press Alt + enter. This will bring you to the properties of the switch. Before proceeding to outputs or flags, do the following:
Sounds should be set to "Lightswitch"
Delay Before Reset should be set to 0 Now go to the output tab and set it like so:
OnPressed | inter\_light | Toggle || 0.00 | No
In the place of "inter\_light" should be the name of your light.
(Screenshot C) And last but not least, the flags on the button. For the flags, make sure only the following are checked:
Don't Move
Use Activates
(Screenshot D) So now this should work! Easy peasy. Just as a little side note, if for your light you use a prop with an illuminated skin, the prop will still stay illuminated. Making it switch skins is possible, but it involves some complex outputs. Also you cannot be using dustmotes or glow sprites for your lights. These will also show up in the dark. So with all that said and done, try it out. It should make your level more interesting and will add some new strategy.
1-10 of 12
1
Pages
  • 1
  • 2
Go to page:
  • ThePatriot55 avatar
    ThePatriot55 Joined 11y ago
    Offline
    100 points Ranked 71117th
    11y
    Very helpfull thanks alot
    Bananite
    URL to post:
  • Nappy_ avatar
    Nappy_ Joined 11y ago
    Offline
    364 points Ranked 47855th
    11y
    Pros: In-Depth, Helpful
    Get old, or die trying
    URL to post:
  • SGT_kick_ur_ass avatar
    SGT_kick_ur_ass Joined 14y ago
    Offline
    11y
    Posted by TwistedPUNK Great tut, well written. Just a question: Does anyone know how to turn on a light using a trigger brush? Eg a room, no lights, You enter trigger a light, when u leave u trigger it off?
    Use a trigger_multiple brush, add 2 outputs: one to turn on the lights, and one to turn off. The output to turn on should have My output named set to OnStartTouchAll and the one to turn off should have it to OnEndTouchAll.
    Turbosmooth dat shit. avatar
    Mantra
    Turbosmooth dat shit.
    URL to post:
  • Liko avatar
    Liko username pic Joined 12y ago
    Offline
    13,499 points Ranked 404th
    16 medals 1 legendary 2 rare
    • 10 years a member Medal icon
    • 6 years a member Medal icon
    • Submitted 100 Threads Medal icon
    • Became a Club Leader Medal icon
    • Reached 1,000 Points Medal icon
    • Reached 2,500 Points Medal icon
    11y
    Posted by TwistedPUNK Great tut, well written. Just a question: Does anyone know how to turn on a light using a trigger brush? Eg a room, no lights, You enter trigger a light, when u leave u trigger it off?
    fill the room with a trigger brush assigned to trigger_multiple. Go to outputs: OnStartTouch | inter_light | On || 0.00 | No OnEndTouch | inter_light | Off || 0.00 | No
    Sort of exists avatar
    Mantra
    Sort of exists
    URL to post:
  • TwistedPUNK avatar
    TwistedPUNK Joined 11y ago
    Offline
    222 points Ranked 53612th
    6 medals 1 rare
    • 6 years a member Medal icon
    • One month a member Medal icon
    • 6 months a member Medal icon
    • 1 year a member Medal icon
    • 2 years a member Medal icon
    • 4 years a member Medal icon
    11y
    Great tut, well written. Just a question: Does anyone know how to turn on a light using a trigger brush? Eg a room, no lights, You enter trigger a light, when u leave u trigger it off?
    Bananite
    URL to post:
  • Juz13 avatar
    Juz13 Joined 12y ago
    Offline
    1,031 points Ranked 24418th
    11y
    Thanks dude really helpful!
    Will do Requests for points -  avatar
    Mantra
    Will do Requests for points -
    URL to post:
  • Button. avatar
    Button. Joined 13y ago
    Offline
    423 points Ranked 46407th
    12y
    Thanks for putting this up, I was looking for something like this.
    :3 avatar
    Mantra
    :3
    URL to post:
  • akMan avatar
    akMan Joined 12y ago
    Offline
    2,489 points Ranked 20050th
    12y
    Thanks for the nice tutorial. It is easy to understand, neat, good grammar and useful.
    Real men use Scouts. avatar
    Mantra
    Real men use Scouts.
    URL to post:
  • Liko avatar
    Liko username pic Joined 12y ago
    Offline
    13,499 points Ranked 404th
    16 medals 1 legendary 2 rare
    • 10 years a member Medal icon
    • 6 years a member Medal icon
    • Submitted 100 Threads Medal icon
    • Became a Club Leader Medal icon
    • Reached 1,000 Points Medal icon
    • Reached 2,500 Points Medal icon
    12y
    Posted by TDDKami Making it switch skins is possible, but it involves some complex outputs. Can you please post them to :)
    When I get back home on Friday, I'll look into it. I wasn't very sure at the time. The lights use a toggle variable whereas skins use a multiple variable and thus cannot be toggled without some sort of external entity.
    Sort of exists avatar
    Mantra
    Sort of exists
    URL to post:
  • Bojero avatar
    Bojero Joined 12y ago
    Offline
    3,715 points Ranked 2056th
    12y
    Useful tutorial.
     avatar
    URL to post:

Embed

Share banner
Image URL
HTML embed code
BB embed code
Markdown embed code

Credits

Key Authors
Liko

Submitter

Liko avatar
Liko username pic Joined 12y ago
Offline
13,499 points Ranked 404th
16 medals 1 legendary 2 rare
  • 10 years a member Medal icon
  • 6 years a member Medal icon
  • Submitted 100 Threads Medal icon
  • Became a Club Leader Medal icon
  • Reached 1,000 Points Medal icon
  • Reached 2,500 Points Medal icon
Liko avatar
Liko

Creator
Sign up to access this!
Sign up to access this!
Sign up to access this!

Game

Sign up to access this!

Category

Details

Difficulty Level
Intermediate

Attributes

Share

  • Share on Reddit
  • Share on Twitter
  • Share on Facebook
  • Share on Google+
  • 3
  • 5.8k
  • 13
  • 12y
  • 5y

More from Submitter

WiPs by Submitter

More Mapping Tutorials

bcp.crwdcntrl.net tracking pixel