Académique Documents
Professionnel Documents
Culture Documents
# Ship basics #
###############
Ships consists 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 specify 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 specify 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.
############
# Graphics #
############
Each section_template specify 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".