Snarkpit Articles


Many of us saw the Half-Life 2 videos showing off the physics engine- perhaps most notably, barrels being shot off a ledge, and bouncing down through a series of metal bars, pachinko-style. This tutorial will be updated as we learn more, but for now will give a brief outline of how to get physics "working" in your levels.

You can quickly get physical models that you can shoot around- such as barrels- into your level with the prop_physics entity. Simply load up an appropriate model, such as models/props_c17/oildrum001.mdl (they have to be compatible with this entity- if the model you have chosen does not appear in-game then you need to use a different type of prop_ entity with it!)

Now, making solids into objects which obey the laws of physics is achieved using the func_physbox entity- you don't need to use any origin brushes or the like. And that's all you need to know!

For example, we could make a see-saw, simply by placing a func_physbox on top of a solid fulcrum:



Unfortunately, you can't use this method to make a human catapault- it will think you've just been hit by a fast moving block and knock off a bit of health. You can launch prop_ and physbox entities, though!

If you give the entity prop data then you will make it destroyable. Note also that falling heavy items will cause a shudder when they hit the ground!

We could also create a platform, with barrels on top, that sits on top of a func_breakable support beam. However, to do so you must tick the "don't take physics damage" flag, otherwise the sheer weight of what's on top will break them.



Yes, you will get hurt if you stand underneath- though, sadly, the hostages won't- and I expect to see a lot of maps with traps like this in pretty soon!

Note that the prop_physics entity can also be nudged around; however, it seems that this entity is used for breakable items such as computer screens.


Post ReplyView Topic
Discussion
0 starsPosted by SVIN on Mon Jan 10th 2005 at 2:01pm

Leoperous u make the best toturials:D
0 starsPosted by Random on Thu Dec 30th 2004 at 8:07am

Awesome i been wondering about this!
0 starsPosted by kdhunt2000 on Mon Dec 20th 2004 at 9:40pm

I have a question. what makes something able to be picked up?
0 starsPosted by Sparky911 on Thu Dec 9th 2004 at 3:45am

Need more though. Hopefully the next part of the tutorial come soon like on how to place these into your game, what values to set, so on and so on. btw Whats a prop_physics_multiplayer for? Any different then prop physics?
0 starsPosted by Junkyard God on Thu Dec 2nd 2004 at 11:33am

Cool tutorial, verry interesting indeed smiley

gives me a bunch of nice ideas smiley

GREAT smiley
0 starsPosted by Neural Scan on Sun Nov 14th 2004 at 7:23pm

By the way, you CAN make a catapult smiley All you need to do is have the player stand on another Physics object on the catapult.

I found this out by setting phys_pushscale to 1000, standing on a barrel and shooting the other end of the seesaw.

Try it for yourself! It's fun!
Post ReplyView Topic