Dynamic Light/Rope Problem

BigWalnutZ

Newbie
Joined
May 14, 2004
Messages
385
Reaction score
0
I will attach all of my working files so some of you skilled mappers can help me out. The problem is:

I followed the video tutorial that is stickied in this forum for dynamic lighting. Nearly everything went perfect except for one aspect, the rope connecting the light to the ceiling. The rope point on the ceiling is a "move_rope" called "Dynamic_Rope01" and the part attached to the lamp is a "keyframe_rope" named Dynamic_RopeKey01". I set the "Next KeyFrame" in the Dynamic_Rope01 to be the Dynamic_RopeKey01. This worked fine. The rope was drawn between the two points. Just to test I compiled and ran the map in game. Note: I already did the phys_lengthconstrain and parenting the light sources to the lamp model. In game everything worked perfectly. When the lamp was shot it swung around spraying light all over. Obviously the rope didn't move, since I didn't "Parent" it to the lamp yet. I tabbed out of the game, went back into Hammer, and Parented the Dynamic_RopeKey01 to the Dynamic_Lamp01. Saved compiled and ran ingame, and I saw what you can find in the screenshots below. The rope no longer connected from Rope01 (for short) for RopeKey01. It now went from Rope01 to some miscellaneous point in my floor. Try as I may I can't fix this. I unparented it and it worked fine again without swinging with the lamp of course.

Any and all help is greatly appreciated. I have attached screenshots and I will try to upload the actual VMF file in my next post. Thanks
 
Well, when I try creating this, it always work so I hope I'll be able to help you. Move_rope and Keyframe_rope are just visual components. I usually put move_rope to a point that is stationary (in your case, its ceiling) and keyframe_rope to a movable point (lamp). Then I select keyframe_rope as next keyframe in move_rope properties. I then select my lamp as a parent in keyframe_rope properties. If I didn't forget anything, you should now have rope attached to ceiling and lamp at all times. But as you can see, rope doesn't act as it should. To fix that, we add lengthconstraint in the same place where you have keyframe_rope, parent it to the lamp, and then drag a little blue ball (dont know what its called) in the place where you have your move_rope. If I didn't forget any steps, this should work just fine. Hope this helped!
 
Thanks for your reply. Unfortunately that is what I did exactly, except for adding the light_dynamic and point_spotlight. Does anyone know how to solve what is happening in the screenshots? As soon as I make the dynamic_lamp01 parent of then keyframe_rope everything goes to hell.

Oh Note: I am doing this in Counter-strike source, not HL2DM. Does that make a difference?

Edit: Thought maybe it was something to do with all the extra light features, so I added another light with nothing but the ropes, lamp itself, and the lengthcontraint. Now both lamp ropes are pointing to the same spot...I am lost
 
Wow great find, thanks much. not really happy adding all the extra stuff. seems kinda over board. just thought it would be neat to have a map like the old bugs bunny and mugsy cartoons where there we spotlights and u couldn't see anything except for what was under those lights. the added coolness of being able to shoot the lights to shed light on the enemy was a cool added flare.

what are some of the drawbacks?
 
I've found that the rope goes to the origin (0,0,0) of your map. I copied mine from a HL2 map where it worked fine. So yes, it's a CSS bug.
 
I feel there is a better way to do it anyway. Do it like its done in prodigy. In the prodigy folder there is a model called hanging_light or swinging_light. Use that as a prop_phys and the use a ball socket. Looks good, works fine. Give it a try.
 
In the prodigy folder there is a model called hanging_light or swinging_light. Use that as a prop_phys and the use a ball socket. Looks good, works fine. Give it a try.

Ive been having the same problems, i thought it was me.. i guess not.
Im goin to try the prodigy solution, also would it be possible to use a giant chandilier and make it prop_phys for the dynamic lighting??

I wish they would get cs:s upto speed in the editor, all these minor bugs are extremely annoying especially when most of the tut's etc are for hl2dm(*ehem crap*).. :p

Thanks for the tip treb
 
trebhome said:
I feel there is a better way to do it anyway. Do it like its done in prodigy. In the prodigy folder there is a model called hanging_light or swinging_light. Use that as a prop_phys and the use a ball socket. Looks good, works fine. Give it a try.
more description on how to find this swinginlamp would be appreciated...i am not seeing a prodigy folder
 
BigWalnutZ said:
more description on how to find this swinginlamp would be appreciated...i am not seeing a prodigy folder

props/de_prodigy/TheHangingLamp'sName.mdl
 
excellent thanks, works like a champ and gets exactly what i wanted done with out all the extra ropes, length contraints etc. thanks
 
A keyframe_rope's parent can be set with a logic_auto.

output OnMapSpawn target somekeyframe input SetParent override parententity
 
Does that actually work, Raeven0? I mean, you've tried it in CS:S and you don't get the rope-to-map-origin bug?

If it does, that's so much easier than the workaround.
 
Rof said:
Does that actually work, Raeven0? I mean, you've tried it in CS:S and you don't get the rope-to-map-origin bug?

If it does, that's so much easier than the workaround.

I wouldn't tell you a solution if it didn't work, would I? ;)
 
Indeed it does work. There's some slight issues with where the attachment point goes, but that might be caused by the object moving slightly before the logic_auto fires. It could probably be worked around.

Strange bug. The fact that SetParent works while standard parenting doesn't is actually more mysterious than if neither worked.

Great find, anyway.
 
Reading through all this is kind of confusing, seeing how a few people have different ways of making it work, my heads all boggled. Could somebody write up a shorthand tutorial for this?
 
OK, here's the most versatile way, courtesy of Raeven0's good idea. To reiterate, you only need to do it this way for CS:S.

Make the thing you want to hang. This could be a func_physbox (for a brush-based object), or a prop_physics or prop_physics_override, etc. for a model-based object. Give the object a name - say "hang1"

Now make your rope. You need a move_rope (name it "r1"), and a keyframe_rope (named "r2"). Set the "next keyframe" of the move_rope to be "r2". Make sure the "parent" field of both of these entities is blank. (Don't parent them to anything).

The move_rope will be the top of the rope, so place it under the ceiling or whatever. The keyframe_rope will be the bottom of the rope, the part that the hanging object will attach to. So place it overlapping the hanging object at the point where you want it to attach.

Now make a logic_auto. Add an output:
Output: OnMapSpawn
Target: r2
Input: SetParent
Parameter: hang1

That parents the keyframe_rope (r2) to the hanging object (hang1) when the map is loaded.

That will give you a rope attached to the object. However, there is no constraint yet, so it will flop to the ground, and the rope will stretch indefinitely.

To actually make it hang, add a phys_lengthconstraint. Place it overlapping the top end of the rope (the move_rope). Drag the phys_lengthconstraint's helper (the white circle in the middle) until it touches the other end of the rope (where you put the keyframe_rope). Set the phys_lengthconstraint's "Entity 2" field to "hang1".

That should be it.
 
Rof said:
Indeed it does work. There's some slight issues with where the attachment point goes, but that might be caused by the object moving slightly before the logic_auto fires. It could probably be worked around.

And now I add this: if you're using the logic_auto to SetParent the keyframe_rope, and you don't want your object to move before the keyframe can be parented to it, then set the object's "Motion Disabled" flag, then use the logic_auto to enable its motion (input EnableMotion) a second or two after the keyframe is parented to it. :)
 
Hello,

I've got this kind of problem with my CS: S map.

I've tried many things but I can't manage to make my hanging lamp works. :(

I've tried many things with logic_auto but I always get the same result:
it works on the first round, but the ropes are not bound to the lamps on the next round.

If needed, I can post a sample o my .vmf file.
 
Just to reiterate: ROF'S SOLUTION DOES NOT WORK!

I have added a note about the cause (and solution) to the problem in the valve developer wiki, and pointed to it from a number of different pages so others won't have to deal with this shit in the future.
 
Back
Top