Professional Documents
Culture Documents
How To Make New Ships
How To Make New Ships
# Ship basics #
###############
Ships consist of three basic components:
ship_size #common/ship_sizes.txt
section_template #common/section_templates/*
component_template #common/component_templates/*
These three things are then used by a ship_design to formulate a complete ship.
#common/global_ship_designs.txt
A ship_size has a list of slots that can have sections attached to them.
Each slot has a name and specifies a locator where the section will be attached
graphically
Example:
section_slots = {
"north" = { locator = "part1" }
"west" = { locator = "part2" }
"east" = { locator = "part3" }
"south" = { locator = "part4" }
}
A section_template then specifies what ship_sizes they are compatible with and
which slots they fit on
Example:
ship_size = name_of_a_shipsize
ship_size = name_of_another_shipsize
fits_on_slot = "north"
fits_on_slot = "a_slot_in_some_other_shipsize"
Components are placed by the ship_design in a way that sizes match and weapon
components go on "slot_type = weapon" and vice versa.
If you add a new ship_size, you will need to add that size to every valid component
in component_templates
############
# Graphics #
############
For ships with multiple sections, this entity is usually invisible (an exception is
military stations) but holds the skeleton.
Animations are usually done on the core entity.
This core entity should have the "part1", "part2" etc locators referenced by the
ship_size slots.
Each section_template specifies a name for their entity directly in their script
files ( common/section_templates/* ).
The game then prepends the name of the gfx_culture to that name when getting an
actual entity.
example: in common/component_templates/some_section.txt
section_template = {
...
entity = "some_entity"
}
game will look for "mammalian_01_some_entity" if the current
gfx_culture is mammalian_01
the section entity is then attached to a locator on the core entity specified by
the slot ( like "part1" ).
Weapon entities are similar to section entities with the differences being that
they attach to the locator specified in the section_template component_slot
scripts.
the name would be "<gfx_culture>_<entity found in compnent_template>_entity"
Weapon component entities should also have a locator named "turret_muzzle_01"
(this is specified in defines.lua as
"NGraphics::SHIP_TURRET_PROJECTILE_SPAWN_LOCATOR")
#########################
# Create a special ship #
#########################
Sometimes you want ships that can't be designed by players or be compatible with
all graphical cultures.
To create a ship like the space cloud you need to do the following:
You need to have entities for both the ship_size and you section_templates. Only
one of them has to be visible though
For single-section ships it is recommended to make the entity that belongs to the
section the visible part since that will make the ship_size reusable
If your ship has weapons then each weapon_component_template also needs to have an
entity, and that entity needs to have a locator called "turret_muzzle_01".