The Ravanholm Traps

Tutorial collection, comprehensive listings on main site.

The Ravanholm Traps

Postby Tutorial on Tue Mar 08, 2005 12:47 am

category
General Half-Life 2/Entities

description
All of the Ravenholm traps explained.

keywords
ravenholm, traps, trap.

Tutorial: Traps of ravenholm

In order of difficulty I will discuss three of them, first the propellor trap, then the firetrap and last the crushtrap (cartrap).

THE PROPELLER TRAP

the simplest of traps. We’ll begin with the models
first make a prop_static, and give it the engine model (models/props_c17/TrapPropeller_Engine.mdl)
make a prop_dynamic with the lever model
(models/props_c17/TrapPropeller_Lever.mdl)place it where the lever should be.

Make it non-solid, and parent it to “swits” (youll make it later)
Lastly, make a prop_physics with the propellor model (models/props_c17/TrapPropeller_Lever.mdl)
Name it “prop1”, and uncheck all flags, set damagetype to sharp

Next make a brush the same size as the lever and place it over it. Tie it to a func_rot_button-entity. Make sure it rotates where the lever would (either by using the helpers or a small brush with the origin texture on all sides.) give the brush a nodraw texture to make in invisible. Name it “swits”. Select it with the levermodel and rotate it a bit downwards, say 30 degrees

Image

You should have something like this now.
The “swits” should get a speed of about 100 (degrees/sec), a distance of 60 degrees, and for flags you should check: “one-way”, “non-solid to player”, “toggle” and “use opens”
What will happen is the player will try to use the lever (model) but instead uses an invisible lever (the brush) that is going to trigger the trap. The lever will rotate just like the brush because it is parented to it.

Now, lets make the engine. Create a phys_motor where the engine model and the prop model touch (try to be as precise as possible). Make sure the little circle (which resembles the axle of the motor) is exactly on the same x and y as the centre of the propellor, the height doesn’t matter. Name the phys_motor “motor1”, and give it the following properties: “rotation speed”: around 1200 will do nicely.

“Spin up time” (time to get to max speed) should be about 1 or 2 (seconds) “inertia scale” (the power of the engine) about 5, and the attached object is our “prop1”.
Make a phys_hinge to hinge the propeller to. Make sure its helper is at the same place as the helper of the phys_motor, so both axis match. Entity 1 should be the propellor (“prop1”)
Give it some friction too.

About 10 should be enough for realism (that’s why we cant use the built-in hinge of the phys_motor; it doesn’t have realistic (not enough) friction.)
Only now we are able to pull off the propellor while we shouldn’t. we need to fix this. Valve uses a point_angularvelocitysensor, but I see no reason for it. Just make some trigger before the player can reach the prop_trap (like a trigger_once earlier in the map, or a logic_auto set to trigger at the moment of mapstart)

Whatever you choose, you must go to the output-tab and add (example is for a trigger_once, the “my input named” value may be different for other entities)
“my imput named”: OnStartTouch
“Targets Entities Named”: prop1 (the propellor)
“Input” “SetBodyGroup”
“parameter” 0

and check that it gets triggered only once (before the player can get to the trap!)setbodygroup 0 makes the prop non-pickupable until it is set to 1 again. The player is able to move it along the axle of the hinge though)


Next make an ambient_generic, name it “sound1”. The sound (ambient/machines/spin_loop.wav) should begin silent (check that flag) and the rest of the options can be changed at will. I recommend setting the fade in time to about 1-2 seconds, so it matches the spin-up time of the phys_motor. Place “sound1” where you want the sound to come from or select the phys_motor as “SourceEntityName”.

Make sure the audible area isnt too big (for realism)
instead of fading out this sound, you can use this sound: (Town.d1_town_03_spindown). make an ambient_generic just like the previous, only dont change the fade and check teh "is not looped" flag.

The only thing left is to make it all start. Select your leverbrush (“swits”) and go to the outputs tab. Add five outputs, like in the picture:

Image

when the lever is pressed up, it will start the motor and the sound. When pressed down, it will stop both of them, and start the stoppingsound of the motor

The last step is to compile the lot and troubleshoot it. If the propellor wont start check if it isnt stuck in the engine-model. If the lever rotates downwards, check the “reverse dir”-flag of “swits”. if you find that the zombies (or other AI enemies) seem to avoid the trap and you dont want that, you must add a logic_navigation. the target entity is the "prop1", and check teh "start on" flag. the entity makes the prop invisible to enemies, so they cant avoid it.

As an extra you can make it so the player stays ducked under the propellor once its rotating, so the player doesn’t have to keep pressing duck all the time. You do that by creating a brush where you want this to happen (under the propellor, the xy size should be about the same as the propellor is) and tie it to a trigger_playermovement.

This entity, when enabled, makes sure the player stays ducked once inside its volume untill the entity is disabled or the player is out of the volume. You don’t need to name it if you don’t want to, in the game they are enabled all the time.. you can however make a point_angulairvelocitysensor which triggers this entity when the propellor isnt rotating.

That’s all, happy cutting.

Example map: see below

THE BROKEN PROPTRAP

Remember in the game, there was one propellortrap that got broken, and tossed the propellor into the air? Its not that hard to make, heres how you do it.

First make a normal proptrap like above. Add a point_angularvelocitysensor, “target entity name” should be “prop1”, and “tresholdvalue” about 1100 (so the propellor will break as soon as it hits this speed). The sensor will trigger the breaking scene, so go make a logic_relay, name it “breaktrap_rly” and go back to the sensor’s output tab. Add the following:

Image

remember to rename your sensors to something you trigger here as wel as your phys_hinge.
the “breaksound” is an ambient_generic with the breaksound of the propellor(Town.d1_town_03_blade_out) and should be used with the “is not looped flag” and “start silent”
as you can see the lever is disabled as wel, so you cant restart the engine.
Another sound to use, “sputter”(Town.d1_town_03_sputter1) can be triggered just as “breaksound”

Also we must give back the ability for the player to pick up the propellor, hence the “setbody group” with a parameter of 1. (that’s the botton one in the pic if you couldn’t read it)

To thrust the propellor into the air we need a phys_thruster, named “thruster”. Place it under the propellor, somewhat in the middle. Set its direction upwards, but not straight up or it will fall down on the engine itself. Give it a bit of an angle. The attached object is the “prop1” offcourse, and the force to thrust should be about 1300. the time to force should be about 0.5 seconds. check the “apply force” and “ignore mass”.

Check it out, and if you’ve done this right, itll work.

THE FIRETRAP

The second trap I’ll discuss is the firetrap

Image

start off by placing the model entities. You’ll need 5 of them:
-the valve, a prop_dynamic (models/props_pipes/valvewheel002.mdl) parent it to “gasvalve” and make it non-solud under collisions
-the red button, again a prop_dynamic (models/props_citizen_tech/Firetrap_button01a.mdl)
parent it to “shockbutton” and make it non-solid (under collision)
-the wallthingy for the red button
-the cannister
-the gaspipe
all three prop_static(models/props_citizen_tech/…)
place them as you wish and your done for step two.

In step two we will make the button and the valve rotating. It goes the same as with the propellortrap, by enclosing the model with a brush, making it a func_rot_button, naming it accordingly (“gasvalve” for the valve and “shockbutton” for the button). Make sure they rotate at the same place as the models should using either the helpers of the func_rot_buttons or an origin brush. Make sure you select the right axes for them to rotate around, and make them non-solid if you wish. Both should have the “use opens” flags checked and only the gasvalve should have the “toggle”-flag checked. Give it a sound if you wish. The red button gets it sound later.

The red button (the func_rot_button) should have a distance of about 90, and a speed twice as high. Make it reset after 1 second. The valve’s button should have a higher amount, more like 360 degrees @ 200 degrees/second. But that’s for you to decide.
Once you got that working, its time to make the flaming thing.
First the sparks. Place them (env_spark) at those pin-like things along the gaspipe, name them “firetrap_spark”, and make sure their sparks are medium size and have a long trail-length.

Then, at the same places as the env_sparks, place a few env_steams. (they simulate the gas flowing out of the pipe). Name them “firetrap_steam” and give them the following properties:
“Initial state” off, “particle type” heatwave, “spread speed” 15, “speed” 120, “particle start size” 10, “particle end size” 20, “emission rate” 26, “color” 239 194 61, “length of steam” 80, “translucency” 255 if they arent already. No flags need to be checked.

Near every env_spark place a env_firesource (this in an entity that starts a fire) and name them “firetrap”. “radius” should be about 60, “damage” about 10
Now the flames can be placed. We use env_fires. They can be set on fire by an env_firesource or other env_fires. You use firesources to make sure theres a wave of fire, making it look like the gas/sparks made the fire. If we’d just trigger the flames they would all come up at the same time, losing this effect.

The env_fires, name them all “fires”, should have the default properties eccept: height, which should vary from 110 near the gaspipe to about 60 further away from the pipe. The “attack” (time to grow to full strength) should be around 0.05, “ignition point” (how much damage to take from other env_fires or env_firesources)1, and “damage scale” around 10 or even higher. make them start disabled

Make sure to check the “infinite duration” and “smokeless”-flags. Place as many env_fires as you like, but the more the laggier so don’t overdo it. Valve used 5 env_fires per gasstream, so that’s a good hold-on.
Env_fires are silent, so we have to give them some sound. There are three to give: a start sound “whooossshhh” , a looping burning sound and a stopsound “Sshhhhhhhhh….”

Place a ambient_generic for each of them, and:
Name one “firetrap_firestart” and give it the startsound (d1_town.FlameTrapIgnite)

(note: this is a real sound, I couldn’t be arsed to find my own so I just copied the names straight from valves map)
check the “start silent” and “is not looped”-flags, and place them somewhere in the middle of the flames.

Make sure its audible distance is not too big, like always. You can make more, but one is sufficient for the effect.

Copy this one and rename it to “firetrap_firestop”, make it sound (d1_town.FlameTrapExtinguish) and leave the rest the same
Comy this one and rename it to “firetrap_firesound” make it this sound (d1_town.LargeFireLoop) and uncheck the “is not looped” flag. Place all at the same place, about in the middle of the flames, about 30 units from the ground

We need two more sounds, which is the one for the steam, and one for the red button. So lets do that. It’s the same as the “firetrap_firestart” setup, only different names (“steam_sound” and “buttonwav” (ill leav you to guess which one is which)), and the sounds should be (ambient/gas/steam_loop1.wav) and (Town.d1_town_01_lightswitch2).

Place them near they respective targets (the button and the env_steams). The “steam_sound” should have its “is not looped”-flag unchecked and be placed near the env_steams, again only one should be enough for the effect. Make sure they have a small radius.

About in the middle of the flames add a light. (for the cool effect). Name it “firetrap_light”, give it a brightness of 254 174 10 500 and select the “start off”-flag. Leave the rest at default

Your setup should be like this now:

Image

so now we begin the last step, the triggering. First well start with the looping firesound

make an env_firesensor (which does exactly like it sounds)name it “firetrap_sensor”, give it a radius of about 40, and a heat-level of 1, and check the “start on”-flag.
Go to the outputs tab and make it trigger the looping firesound, so that sound will start as soon as the flames start, and stop when they stop, like in the picture below:

Image

the rest is going to be complicated so ill try to explain everything as good as i can:
first create one logic_relay. Name it “firestarter”, make it start disabled.
Add these outputs:

Image

the firestarter starts the fire, the light, the starting sound and it makes sure that you can’t trigger it again untill the fire is out by diabling itself and enabling “firestopper”, which is the next logic_relay we will make. So do that, give it the same properties as “firestarter”, only add the next outputs instead:

Image

“firestopper” does the exact opposite as “firestarter”, only it disables itself to make sure it isnt triggered more than it should. Note the parameter of 1 at the extinguish command, you need it to specify the time it takes to stop the flames, or else it wont work.

firestopper and firestarter also disable/enable the fires, to make sure any burning zombies cant restart the env_fires again

Now we only need to trigger the steam and steamsounds, the sparks and the sound for the red button. Well do that at the buttons
So select your output-field of the red button (“shockbutton”, the func_rot_button) and make this:

Image

the func_rot_button of the valve should have these outputs:

Image

explanation: as you open the valve (onIn) it starts the steam, enables the firestarter (but doesnt trigger it), and starts the steam sound. The red button starts the sparks and its own sound, and triggers the firestarter. "firestarter" wil also disable itself to make sure it doens trigger it when the flames are already up.

When you close the gasvalve it will stop the steam and the steam-sound, and it will disable the firestarter (to make sure you can’t trigger it without the gas) and it will active the firestopper (which will start if it isnt disabled). The firestopper is disabled when the fire is out, its disabled by itself…see, I told you it was complicated.

If you get this, good. If you don’t, who cares, just follow the tutorial and the firetrap should work. Only troubleshooting would be more difficult.

You will notice when you run the game, the gas doesn’t stop when the fire starts as it does in the game. I did that deliberately, because its more logical. If you want it to stop, youd have to copy the 4th and 7th line in the output tab of the gasvalve, and put them in the firestarter entity. Also, instead of toggle youd have to use STOP and START steam/sound, so START for the 1st and 3rd line of the gasvalve and STOP for the firestarter and the 4th and 7th line in the gasvalve’s outputlist.

We are done now, so take a look at the result. Be proud of yourself if you managed all that.
Example map see below

THE CRUSH/CARTRAP
The last one. Not difficult, but I had no idea how valve did it. Luckily, I have x-ray eyes and can take a look at entities inside bsp-files, so I had some clues. And I think this is how tthey did it:

Image

don’t try this with your fathers’ car kids!

Anyhow, lets just start. This tutorial is getting way too long
Start off by placing the car, a prop_physics, (models/props_vehicles/car004a_physics.mdl) for instance somewhere on the ground (or in its lowest position). Create a few prop_dynamics, (models/props_c17/utilityconnecter005.mdl) and place them like below. Also, add four move_rope’s, one at each connector and one in the middle:

Image

make sure the three move_ropes at the connectors connect to the middle one. Name the middle one “crushtrap_02_rope_start” (yea, that’s a real valve name for an entity) and parent all four move_rope, including the three prop_dynamics to the car (name the car “crushtrap_02_weight_car”) (god I love those valve-names) you’ll want to make the prop_dynamics non-solid, and give the ropes the standard properites.
As for the car: set the mass scale to 4 and check the “don’t take physics damage”-flag.

Next you can place the crane-like thing (models/props_c17/Trap_Crush01a.mdl), put a keyframe_rope at the first wheel (the one that is supposed to lift the car). Make sure “crushtrap_02_rope_start” connects to it, leave slack at 0, and make the “type” rigid (check the autoresize flag so the rope resizes in length

The car is lifted by the use of a func_physbox. This physbox moves along a phys_slidecontraint, and a phys_lengthconstraint makes sure the distance between the car and the physbox stays the same. The phys_lengthconstraint can give motion to whatever is attached to it, so that entity delivers the actual lifting power

To make that, simply start with a physbox above the car (about 128 units above the middle move_rope), name it “counterweight”. Give it the nodraw texture to make it invisible and make it non-solid (we don’t want to spoil our trick do we)

Make a phys_lengthconstraint, and use it to attach the “counterweight” as entity 1 and “crushtrap_02_weight_car” as entity 2. the constraint system manager should be named “manager” (well make it later). The “attached object 2 point” is the point where the 2nd entity should be connected with. You can specify it with the helper of the phys_lengthconstraint. Place this helper at teh same xy axis, but higher that the phys_lengthconstraint. Check all flags, apart from “start inactive”

Next well make the phys_constraintsystem, name it “manager”, but leave it alone. Its existence is enough.

The phys_lengthconstraint should be placed at the centre of the “counterweight”. Its helper should be placed at the same place as the keyframe_rope (top of the cranethingy). Its properties should be: name “slider”, entity 1 = “counterweight”, constraint system manager “manager” and load scale should be five
the car is pulled upwards untill the physbox hits something and cant go up anymore, so you'll have to make a roof for it. skybrushes, nodraw brushes, they all should work.

Image

this should be our setup for now
next well make the machine and triggers

Image

this is the total setup. Not very hard compared to the firetrap. Lets begin.
Start by finding all the models(models/props_canal/winch02d.mdl, models/props_canal/winch02b.mdl, models/props_canal/winch02.mdl). Place them as you wish. I hope you know by now how to make models rotate. The lever should be a func_rot_button, whick works exaclt like the one from the propellortrap.

Make sure “use activates” is flagged, as well as the right axis, and name it “lever” (that’s also where you have to parent the lever-entity (prop_dynamic) to)

The rotating thing is made using a func_rotating, but the essence is the same. Parent the wheel model (func_dynamic) to “wheel”, name the func_rotating “wheel”,and give “wheel” the following properties: “max rotation speed” 1500, and check the “not solid” if you wish. Check the right axis too.

Now create the three sounds (ambient_generic):
“startmotor”, (Town.d1_town_01_spinup) flags: start silent, is not looped
“motorloop”, (d1_town.CarTrapMotorLoop) flags: start silent
“release”, (d1_town.CarRelease), flags: start silent, is not looped
make sure their radius is not too big and that the origin of their sound is IN the machine.

Make a keyframe_rope and move_rope and put one at the wheel and the other at the top of the crane, so it looks like the rope from the car goes over the top of the crane to the winch. (you can make this as complicated as you want, you can even add more wheels (just copy the func_rotating and use another model), and they will look like they are actually working because they rotate at the same time as the car moves.

Now the hardest bit. Again, the logic_relays arive. I love them, and so should you.
Make two of them:
“lift” (not start disabled):

Image

“drop” (not start disabled):

Image

“lift” starts the sound and makes “wheel” rotate at a normal (350) speed forward, itll also disable the release-lever so you cant release the car while its lifting (you can make it so it can, but its quite complicated so I wont go throught that).

The car is lifted using the SetVelocity input for the phys_slideconstraint which gives the physbox an upward motion that lifts the car. When the car is at its top (youll have to calculate or test the value to find out when that is) the wheel is stopped, and the releaselever enabled. “drop” makes the car fall (by taking away the upwards force on the physbox from the slideconstraint), and rotate the wheel backwards at high (1500) speed so its like the damn thing is unrolling the rope. It will also trigger “lift” again so the car wont stay down. That’s how I like my cars, up in the air

We are not ready yet, we forgot one thing: the release-lever (“lever”):

Image

it will trigger “drop” offcoures.
The only thing left is a trigger that triggers the engine to lift the car before the player uses the release-handle. We do that by placing a simple trigger around the players starting place, or some other way to trigger it.

Extra: add athmosphere by adding a ambient_generic, with the (crushtrap_01_ropestrain_wav_1)-sound, and a logic_times that fires it at random (between about 3 and 7 seconds was used in the game)

Now we are done and can playtest it. If the wheel rotates in the wrong direction, check the “reverse direction”flag of the func_rotating.

Be sure to check out the example map if you dont understand something or want to have a great time fighting a few zombies using these traps and unlimited ammo (only works in hl2, no deathmatch, no cs:s, simply because of the zombies, the traps themselves should work)
I really mean it, this is the funnest example map ever!!!

Related:
Example map

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

jst dusnt work

Postby iambadsim on Thu Mar 31, 2005 9:47 am

i followed the tutorial thurely bt wen i tried to load the map it jst exited be4 the map had loaded ????? :(
iambadsim
Member
Member
 
Joined: Wed Mar 30, 2005 2:28 pm

Re: jst dusnt work

Postby Murkrow on Thu Mar 31, 2005 12:54 pm

iambadsim wrote:i followed the tutorial thurely bt wen i tried to load the map it jst exited be4 the map had loaded ????? :(


leak. or sumthin
Jest@ wrote:Sure, not everything looks like it was built by God, optimised by Jesus and playtested by the holy spirit, ...
User avatar
Murkrow
1337 p0st3r
1337 p0st3r
 
Joined: Tue Feb 01, 2005 5:59 pm
Location: Slovenia

Postby iambadsim on Thu Mar 31, 2005 3:21 pm

it worked fine until i added the spining trap
iambadsim
Member
Member
 
Joined: Wed Mar 30, 2005 2:28 pm

Postby Spas12 on Wed Apr 13, 2005 12:54 am

UHHH..... Hello?! for the firetrap theres no such thing as a logic_trigger??!?!? help?! :cry:
Past Treyarch Level Designer

Portfolio
Spas12
Veteran
Veteran
 
Joined: Thu Mar 31, 2005 3:21 pm
Location: trapped in level-design factory, send help

Postby zombie@computer on Wed Apr 13, 2005 12:39 pm

use logic_relay, sorry about that
When you are up to your neck in shit, keep your head up high
zombie@computer
Forum Goer Elite™
Forum Goer Elite™
 
Joined: Fri Dec 31, 2004 5:58 pm
Location: Lent, Netherlands

Postby huntersnip3r on Tue Apr 19, 2005 7:46 pm

i need some help on the firetrap. i can make every thing work besides the fire it self. every thing will start all but the fires. someone plz help
huntersnip3r
Member
Member
 
Joined: Thu Apr 14, 2005 9:57 pm

Postby Spas12 on Tue Apr 19, 2005 7:49 pm

yes i had that same problem, help?
Past Treyarch Level Designer

Portfolio
Spas12
Veteran
Veteran
 
Joined: Thu Mar 31, 2005 3:21 pm
Location: trapped in level-design factory, send help

Postby huntersnip3r on Tue Apr 19, 2005 8:22 pm

what do u mean u "had" did u get it to work
huntersnip3r
Member
Member
 
Joined: Thu Apr 14, 2005 9:57 pm

Postby huntersnip3r on Tue Apr 19, 2005 8:35 pm

i even did ur example map but it say the same way u do it! are u missing something in this tutorial or some thing plz pm me if u can fix this :cry:
huntersnip3r
Member
Member
 
Joined: Thu Apr 14, 2005 9:57 pm

Postby zombie@computer on Wed Apr 20, 2005 9:19 am

the example map works fine for me for hl2 and hl2dm, but it might not work on css. are you guys mapping for css?
When you are up to your neck in shit, keep your head up high
zombie@computer
Forum Goer Elite™
Forum Goer Elite™
 
Joined: Fri Dec 31, 2004 5:58 pm
Location: Lent, Netherlands

help

Postby huntersnip3r on Thu Apr 21, 2005 7:12 pm

hey ur car trap dont work it just messes up my game someone plz pm me if u have a solution.
huntersnip3r
Member
Member
 
Joined: Thu Apr 14, 2005 9:57 pm

Postby zombie@computer on Thu Apr 21, 2005 7:18 pm

with that info i can really help you :roll:
When you are up to your neck in shit, keep your head up high
zombie@computer
Forum Goer Elite™
Forum Goer Elite™
 
Joined: Fri Dec 31, 2004 5:58 pm
Location: Lent, Netherlands

Postby huntersnip3r on Thu Apr 21, 2005 7:19 pm

well it just gives a bad error and the car seems to want to float insted of haveing ragdolls. help
huntersnip3r
Member
Member
 
Joined: Thu Apr 14, 2005 9:57 pm

Postby huntersnip3r on Thu Apr 21, 2005 7:49 pm

so how u help me :?
huntersnip3r
Member
Member
 
Joined: Thu Apr 14, 2005 9:57 pm
Next

Return to Tutorials

Who is online

Users browsing this forum: No registered users