CREATING TURRETS

This tutorial is for those of you who aren't happy with using existing turret models and are eager to introduce your own designs. Knowledge of the assembly and material editor is assumed.

Let's begin with the fundamentals...

Each turret in the game is assembled into an *.asb file from three individual parts. These parts are connected in a parent-child relationship which is important for the turret to work properly in-game.

Individual segments are first imported as *.mdl files through the Material editor and then assembled into an *.asb file.

Here’s an example of an assembled turret (Spg2/Models/Turrets/Tesla/tesla.asb)

	txt
	StaticMesh:
	{
		MeshName:	Spg2\Models\Turrets\Tesla\tesla1.mdl
		Position:	0.0	0.0	0.0
		Rotation:	0.0	0.0	0.0
	}
	StaticMesh:
	{
		MeshName:	Spg2\Models\Turrets\Tesla\tesla2.mdl
		Position:	0.0	0.0	0.0
		Rotation:	0.0	0.0	0.0
	}
	StaticMesh:
	{
		MeshName:	Spg2\Models\Turrets\Tesla\tesla3.mdl
		Position:	0.0	0.0	0.0
		Rotation:	0.0	0.0	0.0
	}
	Dummy:
	{
		Position:	0.0	0.043	0.119
	}
	

The order of segments in the assembly file is important and MUST be adhered to. 1.Base | 2.Neck | 3.Head | 4.Dummy(s)

The txt tag refers to the file being a textual file. Before using in the game, save the assembly as a Compressed assembly file via the editor. This will convert the file into binary form and greatly speed up load times.

Important notes on each segment are outlined below. The order in which they are presented here is the mandatory order in the assembly file.

  • Base
  • *turret foundation
  • *its position must be set as 0.0 0.0 0.0 (in the *.asb file)
  • Neck
  • *allows the turret to rotate around its vertical axis
  • *its position is linked to the base as its parent (since the base is right smack in the center, positioning the neck accurately shouldn't be a problem)
  • Head
  • *allows the turret to tilt up/down
  • *its position is linked to the neck as its parent. Adjust the position to represent the offset from the neck, NOT from the base of the turret
  • Dummy
  • *although the name suggests otherwise, this is a very important segment
  • *its position is linked to the head as its parent. Adjust the position to represent the offset from the head, NOT from the base or the neck of the turret
  • *dummies are not visible in the game, they only serve to mark the position where the effect of the weapon will be fired from (usually placed at the tip of each turret barrel)

Total number of dummies (barrels if you wish) MUST NOT exceed 4

Linking a turret model to a weapon is done through two database tables:

Spg2/Base/Turrets.wdt – either edit an existing entry to change the path to the *.asb file, or add a new entry.

Pay attention to the Unique ID each entry has (First column)
For more information on database tables browse the Modding databases section

Spg2/Base/LightWeapons.wdt – each light weapon has a unique entry in this database. Column 13 holds the turret model ID from Turrets.wdt

Heavy weapons DO NOT have a visible turret!