Need for a machine gun

In this recipe, we will do something fun with the car and attach a machine gun to the vehicle and have it be fired from the driver's seat.

Getting ready

Complete the Creating a new car XML recipe. Then open MyVehicle.xml in Notepad or an equivalent editor. Delete the following cells from MyVehicle.xml:

<Weapons>
<Primary/>
</Weapons>
<ActionParts/>

How to do it...

In the cells that were just deleted (as they were obsolete), copy the following lines:

<SeatActions>
<SeatAction class="Weapons">
<Weapons isSecondary="0">
<Weapons>
<Weapon class="AsianCoaxialGun" part="body">
<Helpers>
<Helper value="mgun_out"/>
</Helpers>
</Weapon>
</Weapons>
</Weapons>
</SeatAction>
</SeatActions>

How it works...

The newly added <SeatAction> tag is used for any weapons that are made for the vehicles. The weapon itself can use a helper to fire from and if the weapon is set up on a part, then the weapon will rotate with that part as well (such as a turret).

The flag of isSecondary handles whether the weapon is fired from the primary fire button or if it uses the secondary fire button.

See also

  • Creating a new car XML
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.14.144.216