Adding a weakspot

Overview

Everybody knows that vehicles blow up from a single shot, if you know where to aim. In order to get our vehicle as realistic as possible, we should add a weakspot, to imitate that behavior.

Adding a weakspot is fairly simple, we only need to add a new component, give it very few hitpoints and position it somewhere on the car. For this example, the whole front of the car is going to be a weakspot, that is going to cause the whole car to blow up when hit.

If you have the "_simple_4_wheel_destroyable.XML" from the last section at hand, all you need to do is adding this component.

<Component name="cWeakspot" damageMax="1" major="1" position="0,2.2,0.5" size="1.75,0.5,1"  hullAffection="0">
  <DamageBehaviors>
    <DamageBehavior class="Destroy" damageRatioMin="1"/>
    <DamageBehavior class="Effect">
      <Effect effect="VehicleDestroyed"/>
    </DamageBehavior>
  </DamageBehaviors>
</Component>

Since this component is not assigned to any part, we can't use any parts bounding box and have to define the position and size of the bounding box ourselves. You can have the bounding boxes of your vehicle displayed to you by setting the CVar v_draw_components 1.

You can see the bounding box for each component and their names, the one that interests us right now is the bounding box for the component "cWeakspot" we just created.

The damageBehaviours for the "cWeakspot" component are copied straight from the "cBody" component, since we want to achieve the same result when shooting it.

You can check out the Crysis 1 LTV for fancier ways to create weakspots, like burning fuel cans that blow up after a slight delay.

||