How to create a crane in Teardown?

Create a custom crane in Teardown

This is a guide how to create a crane in the game called Teardown. This guide was initially written for Teardown version 0.6.2. Things may have changed. Please let me know in the comments and I’ll update the guide.

This is part II of III in which I explain predefined tags which can be used for vehicles. We’ve a look at the „crane“ tag. Part I covered the basics of creating a custom car and in part III I’ll explain how to handle custom input and custom sounds for a car.

Prerequisites

Please visit Part I for the Prerequisites.

Custom tags explained

Teardown supports tags for vehicles which make them behave in a certain manner. The following tags exist:
boat: The vehicle behaves like a boat
nodrive: The vehicle can’t be driven by the player
reversebeep: The vehicle makes a beep sound when driving backwards
dumptruck: All hinge joints are controlled by the Left and right Mouse Button
crane: All hinge joints are controlled by the Left and right Mouse Button further a vox tagged with „hook“ which has a body as parent can be used as hook by using the Space key
forklift: All prismatic joints are controlled by the Left and right Mouse Button

Those tags can be combined when separated with a space. For example use the two tags „dumptruck reversebeep“ which results in a vehicle which moves all the hinge joints by using the left and right mouse buttons and when driven backwards it is beeping.

Crane in Teardown – modelling

Now let’s make a crane by using the crane tag and a hook to „hook-up“ things ;-). Based what we learned on Part I we build a vehicle with a body, a back and a front wheel, an arm and a hook. This could look like like that:

Pickup Crane in MagicaVoxel
Pickup Crane MagicaVoxel

Crane in Teardown – tag set-up

Once we’ve modeled the crane you can use the Editor to set it up or use the below XML template to add in your maps XML:


<vehicle name="pick_up_truck" tags="crane reversebeep" pos="-1.1 0.3 1.2" rot="0 135 0" acceleration="1.2" strength="2">
  <body name="carBody" pos="0.0 0.0 0.0" rot="0 0 0" dynamic="true">
    <vox pos="0.0 0.0 0.0" rot="0 90 0" density="1.2" strength="2" file="LEVEL/pickupCrane.vox" object="body">
      <location name="exhaustRight" tags="exhaust" pos="0.35 1.9 -0.45" rot="0.0 0.0 0.0"/>
      <location name="exhaustLeft" tags="exhaust" pos="0.35 1.9 0.45" rot="0.0 0.0 0.0"/>
      <light name="backLightLeft" pos="-2.3 0.35 -0.45" rot="90.0 0.0 -90.0" type="area" size="0.1 0.1" unshadowed="0.3"/>
      <light name="backLightRight" pos="-2.3 0.35 0.45" rot="90.0 0.0 -90.0" type="area" size="0.1 0.1" unshadowed="0.3"/>
      <light name="frontLightRight" pos="2.2 0.5 0.8" rot="0.0 90.0 0.0" type="cone" color="1 .9 .8" scale="10" angle="90" penumbra="30" size="0.1" unshadowed="0.3" glare="0.3"/>
      <light name="frontLightLeft" pos="2.2 0.5 -0.8" rot="0.0 90.0 0.0" type="cone" color="1 .9 .8" scale="10" angle="90" penumbra="30" size="0.1" unshadowed="0.3" glare="0.3"/>
      <location name="vital" tags="vital" pos="1.75 0.35 0.0"/>
      <location name="playerPosition" tags="player" pos="0.5 1.3 -0.3" rot="0.0 -90.0 0.0"/>
    </vox>
    <wheel name="bl_1" pos="-1.05 0.05 2.05" drive="1" travel="-0.1 0.2">
      <vox pos="0.05 -0.35 0.05" rot="0.0 90.0 0.0" file="LEVEL/pickupCrane.vox" object="wheel_back"/>
    </wheel>
    <wheel name="br_1" pos="1.05 0.05 2.05" drive="1" travel="-0.1 0.2">
      <vox pos="0.05 -0.35 0.05" rot="0.0 90.0 0.0" file="LEVEL/pickupCrane.vox" object="wheel_back"/>
    </wheel>
    <wheel name="bl_2" pos="-0.75 0.05 2.05" drive="1" travel="-0.1 0.2">
      <vox pos="0.05 -0.35 0.05" rot="0.0 90.0 0.0" file="LEVEL/pickupCrane.vox" object="wheel_back"/>
    </wheel>
    <wheel name="br_2" pos="0.75 0.05 2.05" drive="1" travel="-0.1 0.2">
      <vox pos="0.05 -0.35 0.05" rot="0.0 90.0 0.0" file="LEVEL/pickupCrane.vox" object="wheel_back"/>
    </wheel>
    <wheel name="fl" pos="-0.9 0.05 -1.75" drive="1" steer="1" travel="-0.1 0.2">
      <vox pos="0.0 -0.35 0.05" rot="0.0 90.0 0.0" file="LEVEL/pickupCrane.vox" object="wheel_front"/>
    </wheel>
    <wheel name="fr" pos="0.9 0.05 -1.75" drive="1" steer="1" travel="-0.1 0.2">
      <vox pos="0.0 -0.35 0.05" rot="0.0 90.0 0.0" file="LEVEL/pickupCrane.vox" object="wheel_front"/>
    </wheel>
  </body>
  <body dynamic="true">
    <vox name="hook" tags="hook unbreakable" pos="0.1 0.0 5.7" rot="0 90" density="4" prop="false" file="LEVEL/pickupCrane.vox" object="hook"/>
    <rope pos="0.1 3.1 5.7">
      <location pos="0.05 0.7 -0.3" rot="0.0 0.0 0.0"/>
      <location pos="-0.05 -2.45 -0.05" rot="0.0 0.0 0.0"/>
    </rope>
    <rope pos="-0.1 3 5.6">
      <location pos="-0.05 0.8 -0.2" rot="0.0 0.0 0.0"/>
      <location pos="0.15 -2.35 0.05" rot="0.0 0.0 0.0"/>
    </rope>
  </body>
  <body pos="-0.0 2.3 1.0" rot="50.0 0.0 0.0" dynamic="true">
    <vox pos="0.0 1.9 1.8" rot="0.0 90.0 -90.0" density="1.2" strength="3.0" prop="false" file="LEVEL/pickupCrane.vox" object="arm">
      <joint pos="2.45 0.2 -0.2" rot="0.0 0.0 0.0" type="hinge" size="0.1" rotstrength="0.1" rotspring="0" limits="-60 45"/>
      <joint pos="2.45 0.2 0.2" rot="0.0 0.0 0.0" type="hinge" size="0.1" rotstrength="0.1" rotspring="0" limits="-60 45"/>
      <rope name="holderRope1" pos="-2.0 0.5 0.0" rot="0 90" slack="-0.5">
        <location pos="-0.15 0.0 0.0" rot="0.0 0.0 0.0"/>
        <location pos="-0.35 1.7 5.0" rot="0.0 0.0 0.0"/>
      </rope>
      <rope name="holderRope2" pos="-2.0 0.3 0.0" rot="0 90" slack="-0.5">
        <location id_="1234249216" pos="0.15 0.2 -0.0" rot="0.0 0.0 0.0"/>
        <location id_="1907017344" pos="0.35 1.8 5" rot="0.0 0.0 0.0"/>
      </rope>
    </vox>
  </body>
</vehicle>

Note that the hook vox needs to be a stand alone dynamic body within the vehicle in order to work properly. Also be aware that using the „crane“ tag makes ALL hinge joints moving when pressing the left or right mouse button. So if you plan to have for example doors on your crane and use hinge joints they would also move.

Crane in Teardown – Finished result

The result could look something like that:

Pickup crane in Teardown game
Pickup crane in game

If you missed Part I which covered the basics of creating a custom car you can read it up here. In the part III I’ll explain how to handle custom input and custom sounds for a car.


More interesting details about Teardown:
Teardown FAQ

print

2 Kommentare

Schreibe einen Kommentar

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert