Dynamic_lights

Dynamic_lights

Re: Dynamic_lights Posted by Baddog on Tue Dec 14th 2004 at 6:39am
Baddog
79 posts
Posted 2004-12-14 6:39am
Baddog
member
79 posts 8 snarkmarks Registered: Dec 6th 2004 Location: Portland,Oregon USA
I have a dynamic light set to my lightfixture and the dynamic light doesnt work no matter what I do any help at all please.
Re: Dynamic_lights Posted by snazz on Tue Dec 14th 2004 at 11:54am
snazz
2 posts
Posted 2004-12-14 11:54am
snazz
member
2 posts 0 snarkmarks Registered: Dec 14th 2004
I've read through a few tutorials, and they didn't do exactly what I wanted them to do, so I came up with this:

What I did is I tied a prop light model to a physics system.

What I used:
My prop: models/props_interiors/LightBulb03a.mdl used as a prop_dynamic
Physics_ballsocket
Function_physbox

extras:
env_sprite set to sprite_glow03
light_dynamic

Assembly:
Create an entity using prop_dynamic, give it the model you want, I used models/props_interiors/LightBulb03a.mdl with a skin of 1 so it appears on. Give the prop a name of "mylight".

Above the model, I placed a physics_ballsocket where I wanted the model to swing from. Give that a name of "constant".

Then make a brush (cube) around the long stem of the prop model, this is going to be the area that you would interact with. Try to keep it formed to the model, and make it a func_physbox, and you can texture it with Block Bullets. No draw also works, but I had a hard time with the sprites later on. Give the func_physbox a name of "mybox" We are using block bullet texture so it will remain invisible, but react with whatever we shoot at it.

Putting it all together:

Select the physics_ballsocket, alt+enter, and in entity1 assign it to "mybox".
Select the light prop ( prop_physics) and assign the parent to MyBox.

And that's it.

Putting in the extras:
I added a dynamic light to the base of the light, there is already a tutorial on setting that up, just remember to assign the parent of the dynamic light to "mybox". Do the same with the sprite; but line the sprite up to the bulb of the prop, make the sprite glowsprite03, with a scale of 1, rendermode is "world space glow", assign the parent field to "myxox".

Now they are all linked, so compile and smack the heck out of the light model and watch it swing. With the light and sprite attached to mybox, they will also swing as one entity.

I don't have anywhere to upload the vtf, but if you want the vtf to see it, let me know and I'll get it out to you.

I should note that the model that I used looks a little funny because it has the arm for the wires. I'm sure as models are created a better model will be available.

If this was already covered, sorry I didn't see it anywhere. Hope someone gets something out of this.

Found this out there. Wish i could give credit to whom ever wrote it works geat. But guns have little effect on the light the phys gun makes it swing good.

Good luck.