Creating a working Crane in Half-Life 2

From Valve Developer Community
(Redirected from Crane)
Jump to navigation Jump to search
English (en)Translate (Translate)

This tutorial will teach you how to create a Half-Life 2 crane.

The player operated crane as it appears in the "Highway 17" chapter of Half-Life 2.

Overview

In the chapter Highway 17, the player has to use a crane to knock down a bridge and move their car to continue. Other metal objects like cargo containers and barrels can also be picked up with the magnet and moved.

Requirements

The crane is simple, but for beginning mappers, making one can be a challenge:

Tutorial

The wheels should be touching the top part of the frame.

First, we create a map, then add a prop_static and set the world model to models/crane/crane_frame.mdl, duplicate the part and set the world model to models/crane/crane_frame_interior.mdl.

Next, create a prop_vehicle_crane, set the world model to models/crane/crane_docks.mdl and the name to crane1, place it above the frame, the wheels should be touching the top part of the frame (See image on the right). Change the vehicle script file to scripts/vehicles/crane.txt, this will now sound as a crane and not a jeep.

Now, create a phys_magnet and and set the world model to models/props_wasteland/cranemagnet01a.mdl, set the name to magnet1. Set the mass scale to 1000, this stops it from swinging or flying in the air.

Set the override parameters to damping,0.2,rotdamping,0.2,inertia,0.3, then position it under the crane, in front of the cockpit and a bit above just like in the first image.

And lastly, set the prop_vehicle_cranes magnet entity to magnet1.

Now you have successfuly created a crane! To finish it up, add a platform below the cranes ladder.


Here are the properties to prop_vehicle_crane and phys_magnet:

Download the tutorial map

  • GitHub GitHub version, with .vmf file and .bsp file.

See also