Difference between revisions of "Surface - atom description"

From Nebuchadnezzar Modding Wiki
Jump to navigation Jump to search
 
(10 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.
 
|-
 
|-
|transition_grid || atom<Grid> || null || Transition Grid of this Surface
+
|transition_grid || atom'''['''[[Grid - atom description|Grid]]''']''' || null || Transition Grid of this Surface
 
|-
 
|-
 
|transition_type || int || obligatory if<br>transition_grid set || Transition type between ''grid'' and ''transition_grid''
 
|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.
 
|}
 
|}
  
Line 43: Line 43:
 
*Addition graphics when the tile is irrigated.
 
*Addition graphics when the tile is irrigated.
 
==== grass_ending ====
 
==== 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.
+
*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
})