Breakable Window Bars

Breakable Window Bars

Re: Breakable Window Bars Posted by mazemaster on Sun Jan 2nd 2005 at 12:35pm
mazemaster
890 posts
Posted 2005-01-02 12:35pm
890 posts 438 snarkmarks Registered: Feb 12th 2002
How did Valve do the breakable window bars from the coast/wasteland levels?
From observation, the following happens:
Before:
(1) There are windowbars, which are a model.
(2) There is a glass windowpane.

After:
(1) The windowbars are now "broken" with shards of the origional bars
remaining.
(2) The glass windowpane shatters.

I can get the glass windowpane to break just fine by making it a brush-based
func_breakable, but I can't get the windowbars to break. I put them in as a
prop_detail and had the glass func_breakable "on break" trigger the bars to
"break", but nothing happened to the windowbars when the glass broke!

I also noticed that the windowbars model
(models/props_wasteland/woodwall030b_window01a_bars.mdl) has no "broken"
animation that I can see, so my current thinking is that the windowbars
model gets disabled and either another "broken" model gets simultaneously
enabled, or some brush-based "broken bars" get enabled. However, I can't
find any broken window bars models, and I doubt that the bars seen in game
are brushes since they look smaller than 1 unit.
Re: Breakable Window Bars Posted by Leperous on Sun Jan 2nd 2005 at 12:53pm
Leperous
3382 posts
Posted 2005-01-02 12:53pm
Leperous
Creator of SnarkPit!
member
3382 posts 1635 snarkmarks Registered: Aug 21st 2001 Occupation: Lazy student Location: UK
First of all, "being broken" is now actually a submodel (you can view it in the model viewer), NOT an animation.

If you want to break the window bars, try placing them with a prop_physics (or prop_dynamic) entity instead, and tick the "start asleep" flag.
Re: Breakable Window Bars Posted by mazemaster on Sun Jan 2nd 2005 at 1:21pm
mazemaster
890 posts
Posted 2005-01-02 1:21pm
890 posts 438 snarkmarks Registered: Feb 12th 2002
That was it. Thanks. Bodygroup 0 is normal and 1 is broken, and by enabling/disabling 2 prop_dynamics at the same times it works. Unfortunately I couldn't get the model to show up with a prop_physics (so im using prop_dynamic), but that could just be due to my ineptitude with prop entities.