2016-03-12

‎Ship Design: update for file structure

← Older revision

Revision as of 18:24, 12 March 2016

(3 intermediate revisions by the same user not shown)

Line 5:

Line 5:

FreeOrion content is described in content files located in the /default subdirectory of the main FreeOrion game directory (typically 'C:\Freeorion').

FreeOrion content is described in content files located in the /default subdirectory of the main FreeOrion game directory (typically 'C:\Freeorion').



File
| Contents

+

Directory
| Contents

--------------------+--------------------------------------

--------------------+--------------------------------------



techs
.txt
| Tech Categories and Technologies

+

techs

| Tech Categories and Technologies



buildings
.txt
| Buildings

+

buildings

| Buildings



specials
.txt
| Specials
(general)

+

specials

| Specials



planet_specials.txt | Specials (randomly placed on planets)

+

ship_hulls

| Ship Hulls



ship_hulls
.txt
| Ship Hulls

+

ship_parts

| Ship Parts



ship_parts
.txt
| Ship Parts

+

species

| Species



species
.txt
| Species

+

ship_designs        | Ship Designs



space_monsters.txt
| ShipDesigns to use as space monsters

+

monster_designs
| ShipDesigns to use as space monsters



These
files
are structured as a list of
descriptions of individual entries of their respective contents.  buildings
.txt is a list of
"BuildingType" descriptions (see below).  specials
.txt is a list of
"Special" descriptions.  techs
.txt
contains tech category and tech descriptions.
The
ordering of entries in the files do not matter,
except
for
techs.txt, which requires that
a
particular tech category
entries
appear before any techs are listed as part of that category
.

+

The
files
in these directories contain
descriptions of individual entries of their respective contents.  buildings
/ contains files with
"BuildingType" descriptions (see below).  specials
/ contains
"Special" descriptions.  techs
/
contains tech category and tech descriptions.
When there are multiple entries in a single file, the
ordering of entries in the files do not matter
.  Files can be organized into sub-directories as needed
, for
example ship_parts might contain
a
directory for weapon
entries.

The primary building blocks used to specify the above types of FreeOrion content are ValueRefs (value references), Conditions, and EffectsGroups (which contain Effects and Conditions).  Effects change the game state and thereby give buildings, techs and specials their in-game purpose.  Conditions act to filter a starting set of objects to a smaller set (which might sometimes wind up being one or none).  In EffectsGroups Conditions determine if (the activation condition) and on what (the scope condition) effects act.  Conditions also have a few other uses, such as determining where buildings or ship parts or hulls can be produced, and where species focus settings can be used; they are also used within some of the more advanced ValueRefs.  ValueRefs provide values used by the other portions of the script.  Sometimes that might be a simple constant, like three, which the scripter would simply write as "3".  Other times that might be a dynamic value such as the current game turn number, scripted as "CurrentTurn".  In other cases that might be something much more complex, such as the number of monsters within two starlane jumps of a given system; the syntax for such value references is described farther below.

The primary building blocks used to specify the above types of FreeOrion content are ValueRefs (value references), Conditions, and EffectsGroups (which contain Effects and Conditions).  Effects change the game state and thereby give buildings, techs and specials their in-game purpose.  Conditions act to filter a starting set of objects to a smaller set (which might sometimes wind up being one or none).  In EffectsGroups Conditions determine if (the activation condition) and on what (the scope condition) effects act.  Conditions also have a few other uses, such as determining where buildings or ship parts or hulls can be produced, and where species focus settings can be used; they are also used within some of the more advanced ValueRefs.  ValueRefs provide values used by the other portions of the script.  Sometimes that might be a simple constant, like three, which the scripter would simply write as "3".  Other times that might be a dynamic value such as the current game turn number, scripted as "CurrentTurn".  In other cases that might be something much more complex, such as the number of monsters within two starlane jumps of a given system; the syntax for such value references is described farther below.

Line 126:

Line 126:

A specification for a Special, which is a definition of a predefined set of EffectsGroups with a unique name, which may be attached to an object in-game.

A specification for a Special, which is a definition of a predefined set of EffectsGroups with a unique name, which may be attached to an object in-game.



* Specials used in the game are stored
in
[https://github.com/freeorion/freeorion/blob/master/default/specials
.txt
specials
.txt
].

+

* Specials used in the game are stored
within
[https://github.com/freeorion/freeorion/blob/master/default
/scripting
/specials
/
specials].



** specials
.txt
contains general specials that may be applied to objects using the AddSpecial effect
.

+

** specials contains general specials that may be applied to objects using the AddSpecial effect.



** planet_specials.txt contains specials that may be randomly applied to planets during universe generation
.

+

===BuildingType Specification===

===BuildingType Specification===

Line 158:

Line 157:

A specification for a building of a certain type.

A specification for a building of a certain type.

* BuildingTypes must each have a unique name.

* BuildingTypes must each have a unique name.



* BuildingTypes used in the game are stored
in
[https://github.com/freeorion/freeorion/blob/master/default/buildings
.txt
buildings
.txt
].

+

* BuildingTypes used in the game are stored
within
[https://github.com/freeorion/freeorion/blob/master/default/buildings
/
buildings].

* The note about Special name and description text also applies to BuildingTypes.

* The note about Special name and description text also applies to BuildingTypes.

* GRAPHICFILENAME should be relative to the art directory.  So it should appear in the form "foo/bar.png" instead of "default/data/art/foo/bar.png".

* GRAPHICFILENAME should be relative to the art directory.  So it should appear in the form "foo/bar.png" instead of "default/data/art/foo/bar.png".

Line 187:

Line 186:

Specifies a technology category.

Specifies a technology category.

* Techs are displayed by category in the UI

* Techs are displayed by category in the UI



* A category must be defined in [https://github.com/freeorion/freeorion/blob/master/default/techs.
txt techs
.
txt
] before a tech in that category may be defined
(later in the same file)

+

* A category must be defined in [https://github.com/freeorion/freeorion/blob/master/default
/scripting
/techs
/Categories
.
inf Categories
.
inf
] before a tech in that category may be defined
.

===Colour Specification===

===Colour Specification===

Line 267:

Line 266:

* The note about Special and BuildingType name and description text also applies to Tech names, descriptions, and category names.

* The note about Special and BuildingType name and description text also applies to Tech names, descriptions, and category names.

* GRAPHICFILENAME should be relative to the art directory.  So it should appear in the form "foo/bar.png" instead of "default/data/art/foo/bar.png".

* GRAPHICFILENAME should be relative to the art directory.  So it should appear in the form "foo/bar.png" instead of "default/data/art/foo/bar.png".



* Techs used in the game are stored
in
[https://github.com/freeorion/freeorion/blob/master/default/techs
.txt
techs
.txt
].
That file includes
examples of theory techs with no effects or unlocked items, as well as applications that unlock buildings or which have effects of their own.

+

* Techs used in the game are stored
within
[https://github.com/freeorion/freeorion/blob/master/default
/scripting
/techs
/
techs].
These files include
examples of theory techs with no effects or unlocked items, as well as applications that unlock buildings or which have effects of their own.

===Ship Hull Specification===

===Ship Hull Specification===

Line 309:

Line 308:

* The note about Special and BuildingType name and description text also applies to Hull names and descriptions.

* The note about Special and BuildingType name and description text also applies to Hull names and descriptions.

* GRAPHICFILENAME should be relative to the art directory.  So it should appear in the form "foo/bar.png" instead of "default/data/art/foo/bar.png".

* GRAPHICFILENAME should be relative to the art directory.  So it should appear in the form "foo/bar.png" instead of "default/data/art/foo/bar.png".



* Hulls used in the game are stored in [
[ship_hulls
.
txt]
].

+

* Hulls used in the game are stored in [
https://github
.
com/freeorion/freeorion/blob/master/default/scripting/ship_hulls ship_hulls
].

===Ship Part Specification===

===Ship Part Specification===

Line 351:

Line 350:

* The note about Special and BuildingType name and description text also applies to Part names and descriptions.

* The note about Special and BuildingType name and description text also applies to Part names and descriptions.

* GRAPHICFILENAME should be relative to the art directory.  So it should appear in the form "foo/bar.png" instead of "default/data/art/foo/bar.png".

* GRAPHICFILENAME should be relative to the art directory.  So it should appear in the form "foo/bar.png" instead of "default/data/art/foo/bar.png".



*
Hulls
used in the game are stored in [
[ship_parts
.
txt
]].

+

*
Parts
used in the game are stored in [
https://github
.
com/freeorion/freeorion/blob/master/default/scripting/ship_parts/ ship_parts
]].

===Species Specification===

===Species Specification===

Line 765:

Line 764:

Matches planets that are homeworlds to playable species.  If no species are specified, the homeworld of any species will be matched.

Matches planets that are homeworlds to playable species.  If no species are specified, the homeworld of any species will be matched.



SPECIES the name of a species in the game, as defined in species
.txt

+

SPECIES the name of a species in the game, as defined in
a
species
definition file

Line 861:

Line 860:

Design name = "NAME"

Design name = "NAME"



Matches ships that have a design generated from the predefined designs in
predefined_ship_designs.txt
or
space_monsters
.
txt

+

Matches ships that have a design generated from the predefined designs in
ship_designs/
or
monster_designs/
.

Design design = DESIGNID

Design design = DESIGNID

Show more