Difference between revisions of "Surface - atom description"

From Nebuchadnezzar Modding Wiki
Jump to navigation Jump to search
 
(18 intermediate revisions by the same user not shown)
Line 5: Line 5:
 
*Type of Surface on specific tile is '''determined by set [[Grid - atom description|Grid]] atoms''' of its four vertices.
 
*Type of Surface on specific tile is '''determined by set [[Grid - atom description|Grid]] atoms''' of its four vertices.
 
*In the image above you can see single Surface in the '''cyan rhombus''' and its four Grid in 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 - atom description|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 11: Line 11:
 
! Name || Type || Default value /<br>Obligatory || Description
 
! Name || Type || Default value /<br>Obligatory || Description
 
|-
 
|-
|grid || atom<Grid> || obligatory || Main Grid of this Surface
+
|grid || atom'''['''[[Grid - atom description|Grid]]''']''' || obligatory || Main Grid of this Surface
 
|-
 
|-
 
|masque || masque || obligatory || Surface masque.
 
|masque || masque || obligatory || Surface masque.
 
|-
 
|-
|neighbor_grid || atom<Grid> || null || Transition Grid of this Surface
+
|transition_grid || atom'''['''[[Grid - atom description|Grid]]''']''' || null || Transition Grid of this Surface
 
|-
 
|-
|neighbor_transition || int || obligatory if<br>neighbor_grid set || Transition type
+
|transition_type || int || obligatory if<br>transition_grid set || Transition type between ''grid'' and ''transition_grid''
 
|-
 
|-
|grass || atom<Grass> || null || Grass representation atom.
+
|grass || vec_1D'''['''atom'''['''[[Grass - atom description|Grass]]''']]''' || empty vec || Grass representation atom.
 
|-
 
|-
|grass_ending || atom<Grass> || null || Grass ending representation atom.
+
|grass_ending || vec_1D'''['''atom'''['''[[Grass - atom description|Grass]]''']]''' || empty vec || Grass ending representation atom.
 
|}
 
|}
  
 
=== Properties in detail ===
 
=== Properties in detail ===
==== supported_subsoils ====
+
==== grid ====
*Each Grid can support multiple "subsoils".
+
*Grid atom for which this Surface is representant.
*Each subsoil is determined by single letter.
+
*When all vertices of a tile has this Grid type, then this Surface is used.
*These subsoils are then used to determine is specififc buildings is allowed to be built on a specific place.
+
*It also serves as on of two transition Grids for transition tiles.
*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 ====
+
==== transition_grid ====
*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.
+
*Second Grid if this Surface serves as transition tile.
*In such cases is best to choose one of them as a representant because it reduces number of required surface atoms.
+
 
 +
==== transition_type ====
 +
*Type of transition between ''grid'' and ''transition_grid''.
 +
*It's a number which describe which vertices have ''grid'' and which have ''transtion_grid'' by it's binary format.
 +
**Vertices are counted in clockwise order starting with the top vertex.
 +
**It means that meaningful values here are numbers between 1 and 14.
 +
*For example value ''3'', in binary ''0011'' means that top and right vertices must have ''grid'' type and bottom and left vertices must have ''transition_grid''.
 +
**As in the image above.
 +
==== grass ====
 +
*Addition graphics when the tile is irrigated.
 +
==== grass_ending ====
 +
*Addition graphics when the tile is irrigated but at the same time it's on the border of area which do not show grass.
 +
*For example tile under some buildings or grid type which does not allow irrigation.
 +
 
 +
=== Example ===
 +
<pre>
 +
atom ('surface.soil',
 +
{
 +
    grid = 'grid.soil';
 +
    masque = {
 +
        {"images/surface/soil/soil_a.png"},
 +
        {"images/surface/soil/soil_b.png"},
 +
        {"images/surface/soil/soil_c.png"},
 +
        {"images/surface/soil/soil_d.png"},
 +
    },
 +
    grass = grass,
 +
    grass_ending = grass_ending
 +
})
 +
 
 +
atom ('surface.desert.soil.1',
 +
{
 +
    grid = 'grid.desert',
 +
    transition_grid = 'grid.soil',
 +
    transition_type = 1,
 +
 
 +
    masque = {{"images/surface/desert_soil/desert_soil_1.png"}},
 +
    grass = grass,
 +
    grass_ending = grass_ending
 +
})
 +
</pre>

Latest revision as of 14:58, 16 April 2021

<- back to all classes

General description[edit]

Grid surface2.png

  • Surface atoms represent graphical representation of each tile.
  • Type of Surface on specific tile is determined by set Grid atoms of its four vertices.
  • 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
grid atom[Grid] obligatory Main Grid of this Surface
masque masque obligatory Surface masque.
transition_grid atom[Grid] null Transition Grid of this Surface
transition_type int obligatory if
transition_grid set
Transition type between grid and transition_grid
grass vec_1D[atom[Grass]] empty vec Grass representation atom.
grass_ending vec_1D[atom[Grass]] empty vec Grass ending representation atom.

Properties in detail[edit]

grid[edit]

  • Grid atom for which this Surface is representant.
  • When all vertices of a tile has this Grid type, then this Surface is used.
  • It also serves as on of two transition Grids for transition tiles.

transition_grid[edit]

  • Second Grid if this Surface serves as transition tile.

transition_type[edit]

  • Type of transition between grid and transition_grid.
  • It's a number which describe which vertices have grid and which have transtion_grid by it's binary format.
    • Vertices are counted in clockwise order starting with the top vertex.
    • It means that meaningful values here are numbers between 1 and 14.
  • For example value 3, in binary 0011 means that top and right vertices must have grid type and bottom and left vertices must have transition_grid.
    • As in the image above.

grass[edit]

  • Addition graphics when the tile is irrigated.

grass_ending[edit]

  • Addition graphics when the tile is irrigated but at the same time it's on the border of area which do not show grass.
  • For example tile under some buildings or grid type which does not allow irrigation.

Example[edit]

atom ('surface.soil',
{
    grid = 'grid.soil';
    masque = {
        {"images/surface/soil/soil_a.png"},
        {"images/surface/soil/soil_b.png"},
        {"images/surface/soil/soil_c.png"},
        {"images/surface/soil/soil_d.png"},
    },
    grass = grass,
    grass_ending = grass_ending
})

atom ('surface.desert.soil.1',
{
    grid = 'grid.desert',
    transition_grid = 'grid.soil',
    transition_type = 1,

    masque = {{"images/surface/desert_soil/desert_soil_1.png"}},
    grass = grass,
    grass_ending = grass_ending
})