Falling Utility Pole

Tutorial collection, comprehensive listings on main site.

Falling Utility Pole

Postby Tutorial on Sun Jun 11, 2006 3:36 pm

category
General Half-Life 2/Scripting

description
Make a pole fall to the ground.

keywords
fall, falling, pole, post, utility.

This tutorial will teach you how to make a utility pole fall to the ground. Everything will be triggerd with a trigger_once entity and it’s very simple. I’ve devided this tutorial into 3 steps, so just follow them, and everything will work out fine.

Step:1

Start off by selecting the Entity Tool (Shift + E) and place a prop_physics_override somewhere in your map, (you can adjust the location afterwards).

In the Object Properties dialog box, select the keyvalue named: World Model and copy and paste this into that keyvalue: models/props_c17/utilitypole01a.mdl
Now, give the object a name, anything you want. I would suggest: Pole01. You don’t have to change any other keyvalues! Now it’s time to hit the Apply button.

Image


These are the Flags for the utility pole:

Image

Motion Disabled: Checked

Prevent Pickup: Checked

All the other flags are: Unchecked

Image

Make sure the utility pole DOESN’T touch the ground! Not even the purple overlay!

Step: 2

Select the Block Tool (Shift + B) and make a brush with the texture: tools/toolstrigger

Image

Now select the brush you’ve just made with the Selection Tool (Shift + S) and press Ctrl + T. An Object Properties dialog box will appear and as class, select trigger_push and klick on the Apply button.
The trigger_push entity will push our utility pole in the direction we want.
Adjust the location of the trigger_push entity and place it like the picture is showing:

Image

These are the settings for the trigger_push:

Name: Trigger_push01
Start Disabled: Yes
Push Direction: Depends on which direction you want the utility pole to fall in
Speed of Push: 50

These are the Flags for the trigger_push:

Once Only: Checked

Physics Objects: Checked

All the other flags are: Unchecked


Step: 3

Select the Block Tool (Shift + B) and make a brush with the texture: tools/toolstrigger
Now select the brush you’ve just made with the Selection Tool (Shift + S) and press Ctrl + T. An Object Properties dialog box will appear and as class, select trigger_once. You don’t have to change any keyvalues or Flags!

Image

Place the trigger_once entity where you want it to be and select the Outputs tab. Klick the Add button and make these settings:

Image

You now have a falling utility pole which will only fall, when the player triggers the trigger_once entity.


Step: 4 (Optional)

Select the Entity Tool (Shift + E) and place a env_explosion, behind and at the top of the utility pole.

These are the settings for the env_explosion:

Name: Exp01

These are the Flags for the env_explosion:

No Damage: Checked

Select the env_explosion and hold down Shift and drag the env_explosion to a new place with the left mouse button. Release the mouse button, still holding down Shift, and you have a clone of your explosion. Do this a couple of times and place the explosions around and at the top of the utility pole.

Image

Select the trigger_once entity and select the Outputs tab. Press the Add button and make this new setting:


OnStartTouch - - - > Exp01 - - - > Explode - - - > Delay: 0.00 - - -> Once Only: Yes

Image

When the player triggers the trigger_once entity, there will be explosions. It will look like it was the explosions that made the utility pole to fall!

There’s a lot more you can do, I hope I’ve stimulated your imagination!

- Tranced_Psycho
- Don't send PM's to this user -
Tutorial
Not A Real User
 
Joined: Sun Mar 06, 2005 11:00 pm

Possible with multiple Func_physbox

Postby Spliter on Tue Jan 23, 2007 10:41 pm

Hi! Can the trigger_push be used also for multiple physboxes?
for example, I have a wall, that's made out of physboxes, and then I want it to explode, I trigger it, activating the trigger_push and all the physboxes fly at once.
how can I do this?
Spliter
Member
Member
 
Joined: Thu Jan 18, 2007 8:21 pm
Location: Portugal

Postby Mr. Happy on Wed Jan 24, 2007 7:04 am

Yep!
Image
-You've just been happified!?
User avatar
Mr. Happy
Forum Goer Elite™
Forum Goer Elite™
 
Joined: Sat Dec 30, 2006 9:20 am
Location: Flyin' thru "da cloud" in the MotherShip

not working

Postby Spliter on Wed Jan 24, 2007 5:18 pm

Mr Happy wrote:Yep!

Okay, I tried that and it's no use.
the physboxes won't fly away even if everything else does.
I made a little expreiment, I made the trigger_push premanent and I put in a physbox, it flew up, but then when I landed on the land he wouldn't trigger it anymore. The npcs trigger it multiple times (and multiple times they fly waaaay up, but a physbox would just fly up once and then not fly anymore (unless I grab it with the physgun and place there again), it won't fly even if I disable the pusher and then enable it.
BTW, If I use a physexplosion instead, what magnitude should I set for a 200 KG (I think) piece of wall?
Spliter
Member
Member
 
Joined: Thu Jan 18, 2007 8:21 pm
Location: Portugal

Postby Mr. Happy on Thu Jan 25, 2007 6:46 am

Hmm, try making two trigger pushes that are the same except have one of them start disabled. Then have the enabled one disable itself and enable the one that started disabled after it pushes the thingy. Same thing for the one that started disabled, so that they alternate pushing the physbox

As for the env_explosion, I havent used it but I think it only causes damage rather than pushing force. So, if the physbox wall is set so that movement damages it and you fiddle with the numbers a bit it might work, but I dont think it does.

You might want to post these questions in the level design forums if these workarounds dont work, youll probably get a better response.
Image
-You've just been happified!?
User avatar
Mr. Happy
Forum Goer Elite™
Forum Goer Elite™
 
Joined: Sat Dec 30, 2006 9:20 am
Location: Flyin' thru "da cloud" in the MotherShip

Return to Tutorials

Who is online

Users browsing this forum: No registered users