Realistic Breakable Glass Doors?
Post Reply
Quote
Re: Realistic Breakable Glass Doors?
Posted by Nanodeath on Sat Nov 13th at 11:11pm 2004


Slightly simplified, here's what I'm going for. There's a door, entirely of glass. On each side of the door there is a brass/metal door handle. You shoot the door, destroy the door, and the two door handles fall to the ground while the rest of the door shatters.

Ok, the part that should have been the easiest was making the glass door breakable. Just set a non-zero value in for the Health field, right? Apparently not...I tried setting it to 1 and have emptied a clip into it to no avail. Anyway, I'm not so worried about that really.

For the door handles...I tried both a func_breakable and a func_physbox with their parent fields set to the glass door, so they move together. I would have it (never got this far) so the door's destruction would convert the func_breakable to a func_physbox. These both have non-zero health values, too (though I tried with 0 health values as well).

To get the door to actually break I just changed it to a func_breakable...now what actually happens is when the doors break, both of the handles break as well. Huh? Apparently when the parent is "killed" it kills all the "children" too. I tried setting it so that the destruction of the door caused the two door handles to get their parent fields cleared, but as I believe this happens AFTER the door is destroyed (and not as it's destroyed) the handles still die.

That about sums it up...any ideas?





Quote
Re: Realistic Breakable Glass Doors?
Posted by Zevensoft on Sun Nov 14th at 1:43am 2004


Try making an invisible box which "holds" the door handles in it and is a the child of the door itself, so that you can break it with the door instead, dropping the physical handles.




Quote
Re: Realistic Breakable Glass Doors?
Posted by coldbladed on Sun Nov 14th at 3:03am 2004


I think I remember the glass entity you're looking for being prop_physics, you might try that for glass breaking like cs_office.



Quote
Re: Realistic Breakable Glass Doors?
Posted by Nanodeath on Sun Nov 14th at 6:06am 2004


Zevensoft: when I try putting a func_physbox inside another brush, they don't appear when I start the map. I'm putting them inside the func_breakable brush, if that matters.

coldbladed: this would be helpful except that I don't want the glass to obey physics, and I don't think I'd be able to make it behave like a door anyway. Um, yeah, isn't that glass a func_breakable_surf anyway?





Quote
Re: Realistic Breakable Glass Doors?
Posted by coldbladed on Sun Nov 14th at 9:49am 2004


My exp with func_breakable_surf has been that it looks dumb, really dumb




Quote
Re: Realistic Breakable Glass Doors?
Posted by Leperous on Sun Nov 14th at 11:20am 2004


I think the entity you're after is a phys_constraint; I'm not sure *exactly* how to use it but it will stick entities together. Set up an output on your breakable door so that "OnBreak" it will "break" (or "kill") the constraint.

Good luck getting it to work though, only thing I've been successful with is linking two physboxes!





Quote
Re: Realistic Breakable Glass Doors?
Posted by Nanodeath on Sun Nov 14th at 7:07pm 2004


Thanks, yeah, that worked. Feel sorta dumb because it hadn't occurred to me even though I did a tutorial with phys_constraint (connecting a physical camera with a tripod). At first I was a little worried that the door handles would wobble, but if you set the Force Limit To Break and Torque Limit To Break both at like 100000 then this corrects that ;-) Also, if you use the constraint entity to connect the glass part and the door handle part, you don't need to destroy the constraint because one of the involved entities are destroyed...though it would probably be good form to clean up unused constraints anyway. Now if I could only get those doors to break...might have to do some fancy stuff with a parented invisible func_breakable maybe?

Oh, and Zevensoft, I tried something a little smarter with what you said and actually cut out a little hollow space in the invisible door that held the handles, and this sorta worked okay. The func_physbox jiggled a lot when the door started and stopped, and the func_physbox_multiplayer actually jiggled a lot less (contrary to my expectations). Still, I think Leperous's way is a little easier as well as more realistic-looking.

Thanks everyone for your help!





Quote
Re: Realistic Breakable Glass Doors?
Posted by Nanodeath on Sun Nov 14th at 8:16pm 2004


Ok, I've come to a couple conclusions:

1) Entirely glass door: you'll need a phys_constraint here with the settings turned all the way up and you'll want to set the door handle to Debris so the player can't move it or get stuck on it. That's about it...the handle still might jiggle a little. Experiment with the handle on func_physbox and func_physbox_multiplayer and see which works better.

2) Partly glass door: same as above, but instead of a phys_constraint set the handle's Parent to the non-glass part of the door, and have the glass part of the door clear the Parent of the handle when the glass breaks. You don't have to set it to Debris here, but it's your choice.






Post Reply