Tutorials

Swinging Lights



This tutorial should give you a better understanding on how to create hanging lights which not only produce light, but swing when hit!

news post image

news post image

Now first off you're going to at least have a room built, if you've not done that then I suggest you head over here and get yourself a little room going. If however you've got your map up and running then let's get started, shall we?

news post image

OK, so I have my room and it's pretty basic, this is beside the point. I could add any variety of lights in here, but we want something a little more special. As many of the Interlopers will tell you; Lighting is essential. Depending on how you use light you can have a calm map, a dangerous map, a scary map, a dark map, or a fullbright map [amongst many others].

Now onto the practical part, I will discuss more later on how your light can affect your map.

Step One

First off we want to get ourselves a model for the lamp shade.

Select the Entity Tool [Shift + E] or click on the icon in your GUI and click somewhere on the Front, Side or Top area of your editor screen. Choose 'prop_physics' from the list and then hit the Return Key , you should see a red box, right click it in either of the aforementioned views and select Properties, choose a World Model:

'models/props_c17/lamp_standard_off01.mdl' is what I decided upon, but it is entirely up to yourself what you would like to use.

Next we need a name, it always helps to make relevant names for objects, because if you name your lamp 'chair' you're going to get very confused ... and you don't want that do you?

'Lamp01' should suffice, the reason the name Lamp works is because the model we have created is just that ... a lamp!
It isn't actually a light itself; we have to be very pedantic in our naming structures - Just to be safe.

Also; you may wish to edit Flags to prevent the user picking up the light - you know how silly people can be! Simply check the 'Prevent Pickup' box.

Step Two

It is logical that we would move onto creating the light source itself now, but I thought about it and decided that some users may not wish to actually have light coming from the lamp, so I shall leave it til later.

Right now we will deal with 'Keyframe_Rope' - I will be perfectly honest, I'm not entirely sure what this does; but it works ... Trust me on that! As before with the lamp you want to create an entity, but this time search for 'keyframe_rope' as opposed to prop_physics. Once again we go to Properties, let's name our keyframe ... What should we call it?

KeyFrame01

Now the difference here is that the Keyframe needs to know that it must work alongside the Lamp Model, so click Parent, enter 'Lamp01' they keyframe now works with the Lamp. There are a few variables you can toy with; I suggest you do this once creating a successful hanging lamp.

Once you have created this keyframe you should move it inside the top
point of the model.

news post image

Step Three

Another entity to create, I shall assume you understand how to make
your own entities now - This time you want to create a
phys_ballsocket, attach this too the roof, or wherever you're
connecting the light to. Head to the Properties for this entity and
choose Entity 1; enter 'Lamp01' into this box and Apply.

Step Four

We're almost there now!
ANOTHER entity to be created, this time we are creating 'Move_Rope',
edit the properties for width and texture scale, set them both to 1.

Again there are more bits and bobs for you to fool around with but I
recommend leaving this until later, when you are more familiar with
the various elements.

If you've set about creating a moving light without having it switched
on, perhaps to give an eerie feeling - Well done, you should have a
fully moving light. Give your map a test run and see how it works out.

news post image

If you're after some light, then read on!


Step Five

What we need for light is another,yes, another entity.

This time we're on the hunt for point_spotlight, create this just
within the model - below the bulb - for a more realistic effect.

Change the name to Spotlight01 and set the parent as Lamp01, as ever
there are settings such as colour and brightness for you to mess
around with.

news post image

It has been mentioned that changing the Flag 'No Dynamic Light' to
Checked will mean less processing work for the machine. I personally
didn't notice much of a difference. Change the settings for Pitch Yaw
Roll, to 90 0 0 to create a downward facing light.

Hopefully this has helped you out and you now have some moveable
lights. Check out what you can achieve with other entitys such as
env_wind. It doesn't hurt to try stuff out yourself!

- Rustvaar
___________________________________________________________________

Now to discuss the matter of light affecting your map; first off you have brightness, if you have a very dim light in a basement then the player will probably feel a little more cautious than if it were a bright light where they could see everything around them.

Colour will affect your map too, think about it - If you see a flashing red light it's most likely you'll think danger and won't feel secure - especially if there is no other light apart from the red flashing one, because for every red flash, there is an equal amount of darkness - That means something sneaking up on you could be getting there unnoticed.

If we used the colour green however, without a pulse or flicker then chances are we'll feel secure; because everything's normal, right?

These are the 2 most basic colours you can use, green and red, good and bad, safety and danger - People will take these colours for granted; why not trick them once in a while?

I take my understanding of colour for granted because I've studied 5 years of Art; but a lot of people don't understand how to use colours to their advantage. Here's a colour wheel so you can see what colours are relative and opposite :

news post image

Green through to Red Purple are classed as 'Cool' Colours and Red to Yellow Green are the 'Warm' Colours - If you want to find colour opposites, to create contrasts then look at the origin colour ... Say you picked Green - then the colour opposite would be Red! Yellow to Purple and Blue to Orange - You can use these things to your advantage, so do!

There is also the matter of how much light to use - Using light sparingly works best, too much light can ruin a map - Keeping a mooded lighting by using maybe one light to keep an entire room lit will work better than using 20 lights to light the room.

There are also options to make lights flicker, act in strobe or pulsate - Using these can give the effect of danger, safety or even a disco! Mess around until you find something you like!

Finally there is light placement and source types - Having a ceiling lamp is all fine and well - but what if the ceiling is too low? Striplights! On the walls, on the floor, on the roof - it's up to you.

I recall reading on the forums that there is a human reaction that affects us when we see a light source from the floor; instead of the roof - Use this to your advantage, but like anything - don't overdo it. A lamp on a table may work better than a neon sign - Consider your surroundings and judge sensibly.

Light sources such as windows must be considered too - If it's sunny outside it shouldn't be dark inside unless there's good reason such as boarded up windows, and even then you can create beams of light ripping through to give the room some great atmosphere!

That's all for this Tutorial - Good luck!

_________________________________________________________________

Related Articles :
Spas12's Method
Making a Room

Rustvaar

View comments ( 37 )

Back to top