So far, we've only been looking at properties that affect the ship as a whole. Much of the customization possible for a ship design comes in the form of the dozen or more systems that give the ship its specialized abilities. Each ship system is defined by a structure in the ship definition file. All of the system structures have a few properties in common, but they each have custom attributes as well.

COMMON SYSTEM PROPERTIES

name The name of the system, used in the engineering screen.
abrv The abbreviation of the system, used in the master caution panel.
design The name of the system design for this system. Starshatter includes a catalog of standard system designs that are made up of damageable/repairable components.
loc A vector providing the location of the system in model units. This is used for system-specific damage modeling to determine if the system was hit by incoming weapons fire.
size The radius of the system in model units. This is used for system-specific damage modeling to determine if the system was in range of the damage from incoming weapons fire.
hull_factor A number from 0.0 to 1.0 that identifies well protected this system is by the ship's hull armor. 0 means the system is completely exposed, 1 means that all damage will be absorbed by the hull plating.

Each system structure is introduced by a specific attribute name that identifies the type of system being declared. For example, reactors are declared with the name "power", like this: power: { /* reactor attributes */ }. The following system types are supported.

SYSTEM TYPES: Click each name for more info

 Name Description
 power Power supplies, reactors, and batteries.
 drive Main fusion or plasma conventional (slower-than-light) drive.
 thruster Small turning and translation thrusters.
 quantum Faster-than-light quantum jump drive. (Starships Only!)
 shield Gravitational bias deflector shield. (Starships Only!)
 weapon Primary (energy beam) or secondary (missile) weapons.
 flightdeck Launch or recover deck for fighters (Carriers Only!)
 sensor Combined passive/active sensor arrays.
 probe Sensor probe launcher.
 decoy Missile countermeasure decoy.
 gear Fighter or shuttle landing gear.
 nav Auto navigation system.
 navlight Flashing navigation lights.
 computer Various avionics and computer systems.

The order that systems are listed in the ship definition file is significant. Each system must draw power from a reactor in order to operate (except for power sources themselves!). Each system is automatically attached to the power source that was most recently declared in the definition file. For example:

power: {
   type:    Fusion,
   design:  "Fusion Reactor",
   // ...
}

drive: {
   type:    Plasma,
   name:    "Plasma Drive",
   // ...
}

power: {
   type:    "Auxilliary Reactor",
   design:  "Auxilliary Reactor",
   // ...
}

shield: {
   type:    2,
   design:  "Grav Shield",
   // ...
}

In the above listing, the plasma drive will draw power from the main reactor, and the shield will be attached to the auxilliary reactor. Starship captains can adjust power distribution and connection during the game through the engineering screen. For example, a starship captain could easily move the shield system from the aux reactor to the main fusion reactor to help balance the load. However, fighter pilots do not have access to the engineering screen, so fighter power routing is fixed at design time.


Weapons Hardpoints and Loadouts

Starships are generally designed with fixed weapons systems. If the ship definition file declares that a particular type of destroyer has two x-ray laser mounts, and one torpedo launcher, all ships of that type will always have those weapons.

Fighters, on the other hand, usually have underwing weapons hardpoints that can carry a variety of different weapon types. You can configure each fighter to carry an appropriate set of weapons each time one takes off during the game. In order to do this, fighter ship designs use two additional structures:

 Name Description
 hardpoint A system that can mount several different weapon types.
 loadout A pre-defined list of weapons to be mounted.


Death Spiral Properties

All good things must come to an end, preferably in a suitably noisy and colorful series of fireballs!

death_spiral: {
   time:             5,

   explosion_type:   10,   // SMALL_EXPLOSION
   explosion_time:   2,
   explosion_loc:    (-50, 50, 0),

   explosion_type:   10,   // SMALL_EXPLOSION
   explosion_time:   1,
   explosion_loc:    (60, 40, 190),

   explosion_type:   10,   // SMALL_EXPLOSION
   explosion_time:   0.5,
   explosion_loc:    (0, -48, -180),

   explosion_type:   20,   // LARGE_BURST (custom)
   explosion_time:   0.1,
   explosion_loc:    (0, -48, -180),

   explosion_type:   10,   // SMALL_EXPLOSION
   explosion_time:   0.3,
   explosion_loc:    (20, 80, -190),

   explosion_type:   20,   // LARGE_BURST (custom)
   explosion_time:   0.1,
   explosion_loc:    (20, 80, -190),

   final_type:       13,   // LARGE_EXPLOSION
   final_loc:        (0, 0, 120),

   final_type:       13,   // NUKE_EXPLOSION
   final_loc:        (0, 0, -120),

   final_type:       12,   // LARGE_BURST
   final_loc:        (0, 0, 0),

   debris:           "Debris1.mag",
   debris_loc:       (0,0,350),
   debris_mass:      100e3,
   debris_count:     1,
   debris_life:      600,
   debris_fire:      (-100,0,0),
   debris_fire:      (-35,20,-80),

   debris:           "Debris2.mag",
   debris_loc:       (-200,20,-300),
   debris_mass:      100e3,
   debris_count:     1,
   debris_life:      500,
   debris_fire:      (64,0,120),
   debris_fire:      (85,20,0),
   debris_fire:      (65,-10,-60),

   debris:           "Debris3.mag",
   debris_loc:       (300,0,-320),
   debris_mass:      100e3,
   debris_count:     1,
   debris_life:      400,

   debris:           "Debris5.mag",
   debris_loc:       (0,20,0),
   debris_mass:      1,
   debris_count:     12,
   debris_life:      25,

   debris:           "Debris7.mag",
   debris_loc:       (10,0,0),
   debris_mass:      1,
   debris_count:     7,
   debris_life:      15,
}

Samples

Here are links to two sample ship design def files. The first one is a fighter design, similar to the Stormhawk fighter from the game. The second one is a fleet carrier design, based on the Orion class carrier:

      Fighter.def            Carrier.def

You can use these samples as the basis for your own designs. Be sure to rename them to match your mod design names. And remember to save the files using a .def extension.