Difference between revisions of "Grid - atom description"

From Nebuchadnezzar Modding Wiki
Jump to navigation Jump to search
 
(18 intermediate revisions by the same user not shown)
Line 1: Line 1:
 +
[[Atom types|<- back to all classes]]
 
=== General description ===
 
=== General description ===
 
[[File:grid_surface2.png]]
 
[[File:grid_surface2.png]]
Line 5: Line 6:
 
**[[Surface - atom description|Surface]] atoms hold the graphical representation, but used Surface atom is determined by '''Grid atoms in its four vertices'''.
 
**[[Surface - atom description|Surface]] atoms hold the graphical representation, but used Surface atom is determined by '''Grid atoms in its four vertices'''.
 
*Grid type can be '''set/changed''' in map editor by appropriate '''editor tool'''.
 
*Grid type can be '''set/changed''' in map editor by appropriate '''editor tool'''.
*In the image above they are the '''red rects'''.
+
*In the image above you can see single Surface in the '''cyan rhombus''' and its four Grid in the '''red rects'''.
**Left and bottom Grit atoms are of type ''soil'' and top and right are of type ''desert'', so the result Surface atom is transition from ''soil'' to ''desert''.
+
**Left and bottom Grid atoms are of type ''soil'' and top and right are of type ''desert'', so the result Surface atom is transition from ''soil'' to ''desert''.
  
 
=== Properties description ===
 
=== Properties description ===
Line 13: Line 14:
 
|-
 
|-
 
|name || locale string || obligatory || Name of the grid type. Shown only in map editor.
 
|name || locale string || obligatory || Name of the grid type. Shown only in map editor.
|-
 
|is_water || bool || false || Determines if this Grid is accessible by ships.
 
 
|-
 
|-
 
|water_power || int || 0 || Determines how big is the surroundings in which this tile can irrigate other tiles.
 
|water_power || int || 0 || Determines how big is the surroundings in which this tile can irrigate other tiles.
Line 20: Line 19:
 
|water_repellent || bool || false || Water repelent tiles cannot be irrigated by no means.
 
|water_repellent || bool || false || Water repelent tiles cannot be irrigated by no means.
 
|-
 
|-
|supported_subsoils || string || obligatory || Sequence of characters which describes all subsoils which represents this Grid.
+
|features || vec_1D'''['''atom'''['''[[Grid Feature - atom description|Grid Feature]]''']]''' || obligatory || List of grid features.
 
|-
 
|-
|surface_representant || atom<Grid> || null || Grid atom which is used, instead of this atom, for determination of Surface type.
+
|surface_representant || atom'''['''Grid''']''' || null || Grid atom which is used, instead of this atom, for determination of Surface type.
 
|}
 
|}
  
 
=== Properties in detail ===
 
=== Properties in detail ===
==== supported_subsoils ====
+
==== features ====
*Each Grid can support multiple "subsoils".
+
*Each Grid can support multiple "features".
*Each subsoil is determined by single letter.
+
*These features then describe additional properties.
*These subsoils are then used to determine is specififc buildings is allowed to be built on a specific place.
 
*For example ''soil'' and ''desert'' have both type <code>G</code> (as a ''ground'') and that means that standart buildings can be built on them.
 
  
 
==== surface_representant ====
 
==== surface_representant ====
 
*Sometimes you can have multiple Grid atoms which are different is some properties, but which do not influence which Surface should be used with them. For example ''soil'' without water power and ''soil'' with water power in base mod.
 
*Sometimes you can have multiple Grid atoms which are different is some properties, but which do not influence which Surface should be used with them. For example ''soil'' without water power and ''soil'' with water power in base mod.
 
*In such cases is best to choose one of them as a representant because it reduces number of required surface atoms.
 
*In such cases is best to choose one of them as a representant because it reduces number of required surface atoms.
 +
 +
=== Example ===
 +
<pre>
 +
atom ('grid.stone',
 +
{
 +
    name = "@grid.stone",
 +
    features = {'gf.A', 'gf.G', 'gf.Si'},
 +
    water_repellent = true,
 +
})
 +
 +
atom ('grid.river',
 +
{
 +
    name = "@grid.river",
 +
    features = {'gf.A', 'gf.W'},
 +
    water_power = 4,
 +
})
 +
</pre>

Latest revision as of 15:56, 16 April 2021

<- back to all classes

General description[edit]

Grid surface2.png

  • Grid atoms represent type of terrain on a vertex of any tiles.
  • They do not hold graphical representation.
    • Surface atoms hold the graphical representation, but used Surface atom is determined by Grid atoms in its four vertices.
  • Grid type can be set/changed in map editor by appropriate editor tool.
  • In the image above you can see single Surface in the cyan rhombus and its four Grid in the red rects.
    • Left and bottom Grid atoms are of type soil and top and right are of type desert, so the result Surface atom is transition from soil to desert.

Properties description[edit]

Name Type Default value /
Obligatory
Description
name locale string obligatory Name of the grid type. Shown only in map editor.
water_power int 0 Determines how big is the surroundings in which this tile can irrigate other tiles.
water_repellent bool false Water repelent tiles cannot be irrigated by no means.
features vec_1D[atom[Grid Feature]] obligatory List of grid features.
surface_representant atom[Grid] null Grid atom which is used, instead of this atom, for determination of Surface type.

Properties in detail[edit]

features[edit]

  • Each Grid can support multiple "features".
  • These features then describe additional properties.

surface_representant[edit]

  • Sometimes you can have multiple Grid atoms which are different is some properties, but which do not influence which Surface should be used with them. For example soil without water power and soil with water power in base mod.
  • In such cases is best to choose one of them as a representant because it reduces number of required surface atoms.

Example[edit]

atom ('grid.stone',
{
    name = "@grid.stone",
    features = {'gf.A', 'gf.G', 'gf.Si'},
    water_repellent = true,
})

atom ('grid.river',
{
    name = "@grid.river",
    features = {'gf.A', 'gf.W'},
    water_power = 4,
})