Swinging Lights

Tutorial collection, comprehensive listings on main site.

Swinging Lights

Postby Tutorial on Mon Jul 11, 2005 7:15 pm

category
General Half-Life 2/Lighting

description
Attach a light prop to a swinging wire.

keywords
swing, swinging, light, lights, wire, rope.

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

Image

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?

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.

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.

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.

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 :

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
- Don't send PM's to this user -
Tutorial
Not A Real User
 
Joined: Sun Mar 06, 2005 11:00 pm

Postby ferret on Mon Jul 11, 2005 7:21 pm

Nice tut. I like this method way better than the length constraint method.

Glad to see another light junkie/expert on interlopers
*** May the Source Be With You ***
User avatar
ferret
Senior Member
Senior Member
 
Joined: Fri Jun 10, 2005 10:03 pm
Location: oHIo

Postby Rustvaar on Mon Jul 11, 2005 7:42 pm

I greatly appreciate the use of the word 'expert'. But I'll be honest, I'm no expert on the topic.


Lighting can make or break a map and it's something we take for granted. With a bit of effort a map can go from bland and tired; which is how it usually ends up - to atmospheric and exciting.

A little touch of fog can really work well for atmosphere too.


Look out for my next tutorial which will involve 'Playable Flashback sequences'.

Again, thank you for the kind comments ferret!
User avatar
Rustvaar
Sir Post-a-lot
Sir Post-a-lot
 
Joined: Sat Jul 02, 2005 9:34 pm
Location: The Land of Fail and Procrastination

Postby ferret on Mon Jul 11, 2005 8:16 pm

Rustvaar wrote:Lighting can make or break a map and it's something we take for granted. With a bit of effort a map can go from bland and tired; which is how it usually ends up - to atmospheric and exciting.

Amen to that :-D

Rustvaar wrote:Again, thank you for the kind comments ferret!

:wink:
*** May the Source Be With You ***
User avatar
ferret
Senior Member
Senior Member
 
Joined: Fri Jun 10, 2005 10:03 pm
Location: oHIo

Postby skier55d on Fri Jul 15, 2005 5:51 pm

Rustvaar,

You have written a great tutorial but, there are a few flaws:

1. You have left out a few, including setting the move_rope's next keyframe to KeyFrame01 so the rope is actually created.

2. When I followed your steps exactly, I did not get a successful result; had a hanging/swinging lamp, but no rope. When I connected the keyframe and move_rope entity with next keyframe property, a rope appeared, but one end started at the move_rope's position and the other end zoomed off towards the origin (0,0,0) through the wall? I don't know how that worked, but thats what happened. Anyways, some insight as to exactly how you have the rope appearing and moving as would be predicted with the lamp would be much appreciated.

Other than that, you have written an excellent tutorial. Thank you.
skier55d
Dumpling
Dumpling
 
Joined: Fri Jul 15, 2005 5:43 pm

Postby skier55d on Sat Jul 16, 2005 2:17 am

Hmmmm.... I suspect it may have something to do with CS Source and parenting rope_keyframes to props (namely prop_physics). I tried out a video tutorial that covered the same subject that included a VMF that worked in Half Life 2, but soon as I loaded it into CS Source, the rope_keyframe seems to relocate itself to the origin and not move. That or the rope_keyframe is ignored and the move_rope automatically draws its next keyframe to the origin. Is this a bug or lack of support on Valve's part?
skier55d
Dumpling
Dumpling
 
Joined: Fri Jul 15, 2005 5:43 pm

Postby jerm on Sat Jul 16, 2005 6:55 am

is there any way to make the light not give off any light apart from the beam? because the model tends to give off a light entity and the beam is created by point_spotlight?

or altenativly is there any way to tie a light_spot to the prop_physics lamp?
jerm
Member
Member
 
Joined: Sun Jun 26, 2005 1:15 am

Postby Rustvaar on Sat Jul 16, 2005 11:07 am

skier55d wrote:Rustvaar,

You have written a great tutorial but, there are a few flaws:

1. You have left out a few, including setting the move_rope's next keyframe to KeyFrame01 so the rope is actually created.

2. When I followed your steps exactly, I did not get a successful result; had a hanging/swinging lamp, but no rope. When I connected the keyframe and move_rope entity with next keyframe property, a rope appeared, but one end started at the move_rope's position and the other end zoomed off towards the origin (0,0,0) through the wall? I don't know how that worked, but thats what happened. Anyways, some insight as to exactly how you have the rope appearing and moving as would be predicted with the lamp would be much appreciated.

Other than that, you have written an excellent tutorial. Thank you.


OK - Blink informed me of this the day I handed it to him; I checked over it and it seemed fine - He checked over it and it seemed fine. It appeared I hadn't missed anything.

I spent a good while writing this, lots of coffee consumed and I was up til about 2am - So omissions are probable, however setting the move_rope's next keyframe to KeyFrame01 is exactly right - I may have missed this out - But I added this stuff after I had created my light, so that's further chance for error.

Thanks for bringing it to my attention. However I do have one question, are you following the tutorial for HL2 or CSS?

The sole purpose for this tutorial was for HL2 - I know for a fact that for online play it's a different story, but sadly I don't actually know that story.

jerm wrote:is there any way to make the light not give off any light apart from the beam? because the model tends to give off a light entity and the beam is created by point_spotlight?

or altenativly is there any way to tie a light_spot to the prop_physics lamp?


I'm not aware of any methods in which this can be acheived but I wouldn't recommend giving up hope; Check the Forums via the Search tool, search Google to see if you find anything and ask on the Forums; Ferret [As far as I recall] is the Big Chief for lighting and he may have a better understanding and a more helpful answer for you.

On the topic of the light_spot, I am unsure but if you can wait I shall check just now and post back in about 10 minutes time.


Edit : 12:18 - Jerm : No this cannot be acheived as the light_spot is unable to be part on heirarchial system, basically : It cannot be parented, therfore cannot connect to the lamp model and thus will not move with the lamp.

Skier55d : I believe this may be caused by CounterStrike Source's method of handling physics properties - They require to be multiplayer specific; I don't know much about this area so I won't make any false assumptions on the matter. As I said to Jerm you may wish to check around the forums and see if anyone is able to help you with this specific matter, although I do believe [if you are attemtping this tutorial in CS:S] that the problem is related to prop_physics_multiplayer.
User avatar
Rustvaar
Sir Post-a-lot
Sir Post-a-lot
 
Joined: Sat Jul 02, 2005 9:34 pm
Location: The Land of Fail and Procrastination

Postby jerm on Sat Jul 16, 2005 12:09 pm

Thanks. I figuered out my problem here and thanks for that other info :>
jerm
Member
Member
 
Joined: Sun Jun 26, 2005 1:15 am

Postby Megadude on Tue Oct 18, 2005 12:23 am

I've tried doing this, but when I test my map, the lamp and all the entities for it are not there :?
User avatar
Megadude
Veteran
Veteran
 
Joined: Tue Sep 20, 2005 6:20 pm
Location: UK

Postby Mikey on Tue Oct 18, 2005 2:03 pm

have you compiled the map before? U may have forgotten to delete the old bsp... Hammer doesnt overwrite for some odd reason, atleast not for me :?
Shr3d wrote:Ninjas don't have guns. American rednecks that live in Kmart do.
User avatar
Mikey
1337 p0st3r
1337 p0st3r
 
Joined: Wed Jul 20, 2005 7:43 am
Location: Southampton

Postby Megadude on Tue Oct 18, 2005 5:52 pm

I have compiled it before, but my Hammer overwrites my old BSP for me. All my other map changes were shown when i tested, just not the light.
User avatar
Megadude
Veteran
Veteran
 
Joined: Tue Sep 20, 2005 6:20 pm
Location: UK

Postby mike-o on Fri Nov 04, 2005 11:41 pm

how can i parent a regular point light entity (light) to the lamp / rope
User avatar
mike-o
Sir Post-a-lot
Sir Post-a-lot
 
Joined: Tue Feb 01, 2005 12:18 am

Postby Rustvaar on Sat Nov 05, 2005 1:07 am

You can't - It's simply impossible; as far as I'm aware it must be the 'point_spotlight' entity and no other.


Sorry, it's either 'light_dynamic' or 'point_spotlight' but 'light' doesn't work.
User avatar
Rustvaar
Sir Post-a-lot
Sir Post-a-lot
 
Joined: Sat Jul 02, 2005 9:34 pm
Location: The Land of Fail and Procrastination

Postby Mikey on Sat Nov 05, 2005 11:49 am

yep...

My swinging lights got royally f-cked yesterday, for some reason the ropes go in to a wall somewhere... i know i have 2 lights like htis in my map, but i fixed the names and parenting and everything so that cant be the issue...

ne idea of whats gone wrong?
Shr3d wrote:Ninjas don't have guns. American rednecks that live in Kmart do.
User avatar
Mikey
1337 p0st3r
1337 p0st3r
 
Joined: Wed Jul 20, 2005 7:43 am
Location: Southampton
Next

Return to Tutorials

Who is online

Users browsing this forum: No registered users