Modding ships

Brought to you by PCGamingWiki
From FTL Wiki
(Difference between revisions)
Jump to: navigation, search
(XML File)
m (Added a mention about yet another ship editor)
Line 6: Line 6:
Another editor has [ already been released], but it lacks many key features, such as loading the XML file.
Another editor has [ already been released], but it lacks many key features, such as loading the XML file.
Yet another ship editor - [ Superluminal] - is available and constantly updated. Allows the user to modify pretty much every property of a ship.
=== Graphics ===
=== Graphics ===

Revision as of 23:22, 5 March 2013

Modding guide
Events file structure
Mod manager

Ship data is divided between several files. For example, the Kestrel has a kestral.txt (sic) that details the room/door layout, a kestral.xml file for explosion data and position of weapon slots, and an entry in blueprints.xml defining the game data of the ship.

A ship editor GUI is in development.

Another editor has already been released, but it lacks many key features, such as loading the XML file.

Yet another ship editor - Superluminal - is available and constantly updated. Allows the user to modify pretty much every property of a ship.



Filename Description
(ship) Indicates the ship's name.

Example, Zoltan A is 'energy_cruiser' Thus 'energy_cruiser_base.png', etc.

(ship)_base.png The base image file of the ship, seen when no rooms are displayed.
(ship)_floor.png The gray background image behind rooms. Used only on player ships.
(ship)_gib#.png The pieces that are displayed when a ship breaks apart. '#' is 1-6 for player ships, 1-4 for enemy ships.
(ship)_cloak.png The pale outline when a ship engages its cloaking device.
(ship)_shields1.png The shields displayed for a particular ship. Not all ships require their own shield file.

Note: cloak images are 10 pixels bigger in every direction than base images. For example, a 200x200 ship graphic should have a 220x220 cloak image. Otherwise, the cloak image is stretched in-game to match these dimensions.

TXT File

Code Description
<number> [<number>*35 offsets the entire ship in the X axis]
<number> [<number>*35 offsets the entire ship in the Y axis]
<number> [<number> offsets the entire ship in the Y axis by this many pixels]
ELLIPSE [The shield graphic uses these parameters]
<id> [Unique ID]
<x> [How many tiles from 0 the room is on the X-axis]
<y> [How many tiles from 0 the room is on the Y-axis]
<w> [How wide is the room]
<h> [How tall is the room]
<x> [How many tiles from 0 the door is on the X-axis]
<y> [How many tiles from 0 the door is on the Y-axis]
<room (left/up)> [The room ID to the left (verticle) or above (horizontal) this door] -1 is empty space
<room (right/down)> [The room ID to the right (verticle) or below (horizontal) this door]
<vertical/horizontal> [0 = connects rooms vertically, 1 = connects rooms horizontally: Door snaps to the left or top wall of that tile always]

XML File

Code Description
<img x="#" y="#" w="#" h="#"/> Determines the size and X/Y offeset of (ship)_base.png
X= Slides the base image left (negative value) or right (positive value)
Y= Slides the base image up (negative value) or down (positive value)
W= The width of the (ship)_base.png

Can cause stretching if set higher or lower than actual (ship)_base dimensions

H= The height of the (ship)_base.png

Can cause stretching if set higher or lower than actual (ship)_base dimensions

<mount x="#" y="#" rotate="true" mirror="false" gib="#" slide="down"/> Determines the placement and movement of ship-mounted weaponry.
X= / Y= X,Y Coordinates determine where the weapon appears on the ship.

Origin (0,0) is determined by the top-left corner of (ship)_base.png and is not affected by <img> offset values

Note: All default weapon sprites face upwards with mounting points to the left.
rotate= True - Turns the weapon sprite 90 degrees clockwise. Used on player ships to make weapons face right.

False - Weapon remains vertically aligned. Used on enemy ships to keep weapons facing up.

mirror= True - Flips the weapon horizontally. Used for player weapons on the top of ships / Enemy weapons on left side.

Independent of rotate= tag False - Weapon sprite maintains original orientation.

gib= The chunk of ship the weapon remains attached to when destroyed.

Allows weapon to 'drift' with destroyed wreckage.

slide= Determines which way the weapon moves when powered up.

Accepted values are Up , Down , Left , Right , No

<gib#> Determines alignment of (ship)_gib#.png, and movement during ship destruction
<velocity min="0.6" max="1"/> Determines speed of gib movement. Game randomly selects a value between minimum / maximum values.
<direction min="60" max="120"/> Direction of gib movement. Values between 0-360, rotational. Negative values allowed. Value of 0 is equivalent to facing north.

Helps create image of ship blowing apart, rather than collapsing in on itself. Direction of gibs should face outwards from center.

<angular min="-0.4" max="-0.1"/> Creates 'spin' on gib chunks, causing rotation as pieces move away. Value of 10 is equivalent to a full revolution.
<x>0</x> Horizontal offset, determined from origin of (ship)_base
<y>0</y> Vertical offset, determined from origin of (ship)_base

Blueprint XML File

Code Description
<shipBlueprint name="PLAYER_SHIP_HARD" layout="kestral" img="kestral">
<class>Kestrel Cruiser</class> Name of spaceship in selection screen.
<name>The Kestrel</name> Default name for spaceship.
<desc>This class of ship was decommissioned .../desc> Description of ship in selection screen.
<systemList> List of systems that are installed or could be installed in the ship.
<pilot power="1" room="0" start="true" img="room_pilot"> room: Room ID as described in TXT file.
power: Initial power of associated system.
start: Ship starts with this system installed.
img: Image for room.


Slot for the position of the system operator. 0 - upper left, 1 - upper right, 2 - lower left, 3 - lower right.
<doors power="1" room="2" start="true" img="room_doors"/>
<sensors power="1" room="3" start="true" img="room_sensors"/>
<medbay power="1" room="4" start="true" img="room_medbay">


slot for medbay defines which slot is blocked - "-2" means no blocked slot.
<oxygen power="1" room="13" start="true" img="room_oxygen"/>
<shields power="2" room="5" start="true" img="room_shields"/>
<engines power="2" room="14" start="true" img="room_engines"/>
<weapons power="3" room="10" start="true" img="room_weapons"/>
<drones power="2" room="1" start="false"/>
<teleporter power="1" room="15" start="false"/>
<cloaking power="1" room="8" start="false"/>
<weaponSlots>4</weaponSlots> Max weapon slots for ship. Requires weapon system to be installed.
<droneSlots>2</droneSlots> Max drone slots for ship. Requires drones system to be installed.
<weaponList count="2" missiles="8"> Weapons this ship starts with.
missiles: Number of initial missiles.
<weapon name="MISSILES_2_PLAYER"/>
<weapon name="LASER_BURST_3"/>
<droneList count="3" drones="6"> Drones this ship starts with.
drones: Number of initial drone parts.
<drone name="BATTLE"/>
<drone name="REPAIR"/>
<drone name="REPAIR"/>
<health amount="30"/> Initial ship health.
<maxPower amount ="8"/> Initial max power.
<crewCount amount = "3" class="human"/> Start with <amount> number of <class>. This may be listed more than once for mixed-race ships.


  • Slots are numbered progressively in rows, beggining at the top left corner, and ending at bottom right corner. For example, in a 2x2 room, slots in top row would be numbered 0 and 1, while in a 3x2 room 0, 1 and 2, with bottom row having numbers 3, 4 and 5.
  • Man-able systems and medbay have default slots, for when they're not explicitly defined in the blueprints file.
System Default slot and direction
Pilot 0, right
Weapons 1, up
Shields 0, left
Engines 2, down
Medbay 1, N/A
Because of this, systems that are assigned to small enough rooms without an explicitly defined slot will bug, making the station inaccessible.
  • If a ship has artillery system, but doesn't have a weapon mount assigned to it, the artillery beam will shoot from beyond the screen, left-hand side. For the graphic to show up properly, the ship's xml file has to have one additional weapon mount declared, the last mount on the list being considered the artillery mount. For example, a ship with 4 weapon slots and artillery system should have 5 weapon mounts declared.
  • If a ship has no crew declared in blueprint file, it is considered an automated ship, with all systems appearing manned by non-experienced crew.
  • For player ships, all systems except artillery have to be declared. If a system declaration is not present, it will bug - it won't be available at the start, but it will be purchaseable, and once the player buys the system at a store, it won't show up on the ship, systems interface nor in the upgrade tab.
  • Shield graphic uses the ellipse properties in ship's .txt file; offset applies for both player and enemy ships, but the graphic's dimensions only affect enemy ships' shields.
  • Shield mechanic is collision based; the ellipse property in .txt file is used to determine the collision perimeter. If a ship's room is not inside this ellipse, it will be possible to hit it even if the shields are raised (as long as the missile comes at such an angle that it won't collide with ellipse prior to reaching its target).
Personal tools

Technical help