Difference between revisions of "Tile"

From wiki
Jump to: navigation, search
(Initial Work on Setting up Configuration Options list.)
(Almost finished set of config options.)
Line 15: Line 15:
 
This option specifies what type of item is being specified by your file. In this case, it tells the game whether to treat the model as if its a material, where it shall construct the look in game based on how it's placed, verses an object which it will not care about the model.
 
This option specifies what type of item is being specified by your file. In this case, it tells the game whether to treat the model as if its a material, where it shall construct the look in game based on how it's placed, verses an object which it will not care about the model.
  
 +
 +
=== "canGrowFlowers" ===
 +
'''Valid options (bool): <code>Either true or false</code>'''
 +
 +
This option specifies if flowers, can grow on top of the block during world generation. Helpful when a block is used in Structures.
 +
 +
 +
=== "compound" ===
 +
Compound is a container for multiple variables. It is written as:
 +
<pre>"compound": {
 +
  "size": {
 +
    "x": 3,
 +
    "y": 1,
 +
    "z": 2
 +
  },
 +
  "specification": "\n\tCC XC CC\n\t"
 +
}</pre>
 +
 +
This option is primarily for objects that don't fit into a 1x1 tile space, such as a lamp post or a table. The size and specification variables are explained below.
 +
 +
 +
=== "pathFindingNoCollision" ===
 +
'''Valid options (bool): <code>Either true or false</code>'''
 +
 +
This option allows the pathfinding system to ignore the tile for pathfinding purposes.
 +
 +
 +
==== "size" ====
 +
Size is another multiple variable container. It is written as:
 +
<pre>"size": {
 +
  "x": 3,
 +
  "y": 1,
 +
  "z": 2
 +
},</pre>
 +
 +
The variables of x, y and z are integer inputs stating how many tiles the object occupies in the x,y and z directions. If the object is not a multiple of 16, you will need to round upwards to the next multiple of 16.
 +
 +
For example: Lets say we have a lamp post that is 4 tiles high, 1 tile in length and 2 tiles in width we would then have a parameter of <code>{"x" : 1, "y" : 4, "z" : 2}</code>
 +
 +
==== "specification" ====
 +
'''Valid options (String): <code>A string comprised of "X", "C" or "E" that has exactly the same number of characters as the number of tiles the object occupies. (Not counting whitespace. E.g. spaces, tabs and newlines.)</code>'''
 +
 +
 +
''You do not need to add a specification, unless you want to allow an empty tile to be built in.''
 +
 +
 +
This option specifies to the game how it should handle each tile in an object. Starting from the top layer, at the x = 0 and z = 0, it will read through each character in the string and apply it to the specific tile in the model. The order goes "Go down x, then increment z, go down x again. Once z is finish decrement y and start again". The different options are;
 +
*<code>"X"</code> specifies the origin of the object. Every object must have 1 <code>"X"</code>. All <code>"X"</code> follow the <code>"C"</code> specification as well. Although multiple can be applied (thus spawning multiple versions of the object) it is not recommended to have more than one <code>"X"</code>.
 +
*<code>"C"</code> specifies that nothing should be placed in this tile. Set this for tiles in which the object actually occupies in the object.
 +
*<code>"E"</code> specifies that an object can be placed in this tile. Set this for any tile that is completely (or almost completely) empty.
 +
 +
For example: Lets take the lamp example from [[#size]] Lets say that the lamp follows a pattern like;
 +
<pre> [*]
 +
[*]
 +
[*]
 +
[*] [*]</pre>
 +
An appropriate specification variable for this is <code>"CE CE CE CX"</code>
 +
 +
For more in depth information precede to either [http://forums.playstaxel.com/threads/invalid-tutorial-delete.401/ This Guide] or [http://forums.playstaxel.com/threads/collision-musings.389/ this collection of thoughts].
 +
 +
 +
=== "dockInfo" ===
 +
To be made.
 +
 +
 +
=== "interactEffect" ===
 +
'''Valid options (String): <code>Any valid effect code.</code>'''
 +
 +
This will set the tile that you will receive when breaking or pressing g on the tile. This is avaliable because when you place an object with auto-tile info, it can turn into another item with no info on what original tile was placed. By default, it will give the tile that is being made.
 +
 +
 +
=== "mapping" ===
 +
'''Valid options (Unsigned Int): <code>Any positive number.</code>'''
 +
 +
A fixed ID for the tiles in the world. For example "sky" or blocks of nothing have a set ID of 1. Do not change this value from 0 unless you know what you are doing.
  
  
Line 55: Line 130:
 
For example: Giving "placementDirections" <code>["yn", "yp"]</code> will allow the object to be placed on the top or bottom of any object but not the sides while giving "attachmentDirections" <code>["yn", "yp"]</code> will allow any other object to be placed on the top or bottom of this object.
 
For example: Giving "placementDirections" <code>["yn", "yp"]</code> will allow the object to be placed on the top or bottom of any object but not the sides while giving "attachmentDirections" <code>["yn", "yp"]</code> will allow any other object to be placed on the top or bottom of this object.
  
 +
 +
=== "orientationVariants" ===
 +
'''Valid options (Bool): <code>Either true or false</code>'''
 +
 +
This option specifies if the object should be rotated randomly upon placement. (Right?)
 +
 +
For example: If set to true on a book tile, it will place the book in any of the 4 orientations when placed down, while if false, allows the player to rotate the book themselves.
 +
 +
 +
=== "randomizePosition" / "radomizeVerticalPosition" ===
 +
'''Valid options (Bool): <code>Either true or false</code>'''
 +
 +
This option specifies if the object should be given a random horizontal/vertical displacement when it is placed.
 +
 +
For example: If set to true on a book tile, it will place the book and give it an offset of a few voxels in the x and z direction, while if false, it will always be in the standard position.
 +
 +
 +
=== "variantsRandomizeVerticalPosition" ===
 +
'''Valid options (List of Bools): <code>Either true or false for each model specified in alts. Needs to be the same length as Alts.</code>'''
 +
 +
This option specifies if the object should be given a random vertical displacement when it is placed. The first object in the list affects the first alternative model. The second affects the second. This
 +
 +
For example: If set to true on a book tile, it will place the book and give it an offset of a few voxels in the x and z direction, while if false, it will always be in the standard position.
  
 
=== "representativeTile" ===
 
=== "representativeTile" ===
Line 60: Line 158:
  
 
This will set the tile that you will receive when breaking or pressing g on the tile. This is avaliable because when you place an object with auto-tile info, it can turn into another item with no info on what original tile was placed. By default, it will give the tile that is being made.
 
This will set the tile that you will receive when breaking or pressing g on the tile. This is avaliable because when you place an object with auto-tile info, it can turn into another item with no info on what original tile was placed. By default, it will give the tile that is being made.
 +
  
 
== Physics and Lighting ==
 
== Physics and Lighting ==
Line 106: Line 205:
  
 
Should only be true if the object is completely full, such as a dirt block. Most materials will have this option true while most objects should not have this option.
 
Should only be true if the object is completely full, such as a dirt block. Most materials will have this option true while most objects should not have this option.
 +
 +
 +
=== "smoothRecolorationOnPlace" ===
 +
'''Valid options (Bool): <code>Either true or false</code>'''
 +
 +
This option will make the tile recolour itself to match the tiles nearby it. Used when a palette is defined.
 +
 +
 +
=== "palette" ===
 +
'''Valid options (String): <code>A valid path to a *.colorcorrection file</code>'''
 +
 +
This is an option that specifies to the game that it can overlay colours on top of the model. It points at another file which acts as a collection for images which define colours which will be used to vary colours. Most files don't need this, however if a tile is repeated often, such as the ground, it can be a handy thing to include.
 +
  
 
=== "priority" ===
 
=== "priority" ===
Line 111: Line 223:
  
 
This rendering option specifies this objects order to being rendered. Currently this is only used on objects of the "material" kind. The object with the higher priority will display over the top of the object with lower priority.
 
This rendering option specifies this objects order to being rendered. Currently this is only used on objects of the "material" kind. The object with the higher priority will display over the top of the object with lower priority.
 +
 +
 +
== Shop / Inventory Options ==
 +
These options specify how the shop and inventory will handle this tile.
 +
 +
=== "categories" ===
 +
'''Valid options (String Array): <code>Any valid string, although the following strings are used in the menu sorting, "block", "door", "floor"/"flooring", "flower", "furniture", "light", "plant", "tool", "window", "misc", "red", "orange", "yellow", "green", "blue", "purple", "pink", "white", "black" and "brown"</code>
 +
 +
This options allows for you to specifiy a number of strings that a person can search for, that will turn up the object in question. Several categories are applied when using the buttons in the catalogue or creative mode inventory.
 +
 +
For example: If you give an item the category "road", the player is then able to search for "road" which will return the item in question.
 +
 +
 +
=== "descriptionImage" ===
 +
'''Valid options (String): <code>A valid path to an image</code>'''
 +
 +
This option specifies an image that will be placed at the end of a description in the catalogue and creative inventory.
 +
 +
 +
=== "searchable" ===
 +
'''Valid options (Bool): <code>Either true or false</code>'''
 +
 +
This option specifies if the object whether the object will show up when it is searched for in the shop catalogue or the creative inventory. Useful for objects that have auto tiling info such as fences. (As such only one object appears in the shopping menu)
  
  
Line 140: Line 275:
  
  
 +
== Tile State Options ==
 +
=== "animation" ===
 +
'''Valid options (String): <code>A valid path to a .bvh animation</code>'''
  
DockInfo
+
An option that specifies what animations should be used on the model. This requires that layernames are the same in the model and animations.
InteractEffect
+
Mapping
+
Palette
+
OrientationVariants
+
RandomizePosition
+
RadomizeVerticalPosition
+
CanGrowFlowers
+
CustomRendererVoxels
+
Animation
+
SpawnAction
+
MerchantKind
+
TileStateKind
+
DescriptionImage
+
PrefetchTileState
+
SmoothRecolorationOnPlace
+
PathFindingNoColission
+
StackSizeLimit
+
Categories
+
Searchable
+
InteractActionTrigger
+
  
  
 +
=== "customRendererVoxels" ===
 +
'''Valid options (String): <code>A valid path to a model</code>'''
  
 +
An option to specify the use of a set of voxels while the object is placed?
  
CompoundSize
+
 
CompoundSpecification
+
=== "prefetchTileState" ===
CompoundFiller
+
'''Valid options (Bool): <code>Either true or false</code>'''
CompoundStandinCodes
+
 
 +
This options decides whether or not the TileState of a block is gotten on Server Start.
 +
 
 +
 
 +
=== "spawnAction" ===
 +
'''Valid options (String): <code>Any valid "code" string that points to a Entity Action.</code>'''
 +
 
 +
This option specifies what action is toggled on when the object is spawned into the world, either by loading it up in the world or by placing the object.
 +
 
 +
 
 +
=== "tileStateKind" ===
 +
'''Valid options (String): <code>"object", "material", "nothing"</code>'''
 +
 
 +
This option specifies what type of tilestate that your tile supports. This is mostly used for crafting stations and other interactable objects. This is not to be included on "dumb" objects such as stone.
 +
 
 +
== "Other Options" ==
 +
=== "merchantKind" ===
 +
'''Valid options (String): <code>Any valid "code" string that points to a Merchant File.</code>'''
 +
 
 +
This option specifies when specifies converts the tile Object into a Merchant Vendor block. This essentially makes the tile invisible and spawns the appropriate merchant with their appropriate stall. Do not use this on files that you want to stay in the world.
 +
 
 +
 
 +
StackSizeLimit
 +
InteractActionTrigger

Revision as of 04:09, 18 February 2017


Engine

"code"

Valid options (String): Any valid string. Common to make the string the path to the model but with periods [.] replacing slashes [/]

This option is required to uniquely identify any object or resource. This path must be unique to all other codes, but does not have any other requirements.

For example: Having the code "mods.fountain.fountain" creates an object that has the handle "mods.fountain.fountain"


"kind"

Valid options (String): "object", "material", "nothing"

This option specifies what type of item is being specified by your file. In this case, it tells the game whether to treat the model as if its a material, where it shall construct the look in game based on how it's placed, verses an object which it will not care about the model.


"canGrowFlowers"

Valid options (bool): Either true or false

This option specifies if flowers, can grow on top of the block during world generation. Helpful when a block is used in Structures.


"compound"

Compound is a container for multiple variables. It is written as:

"compound": {
  "size": {
    "x": 3,
    "y": 1,
    "z": 2
  },
  "specification": "\n\tCC XC CC\n\t"
}

This option is primarily for objects that don't fit into a 1x1 tile space, such as a lamp post or a table. The size and specification variables are explained below.


"pathFindingNoCollision"

Valid options (bool): Either true or false

This option allows the pathfinding system to ignore the tile for pathfinding purposes.


"size"

Size is another multiple variable container. It is written as:

"size": {
  "x": 3,
  "y": 1,
  "z": 2
},

The variables of x, y and z are integer inputs stating how many tiles the object occupies in the x,y and z directions. If the object is not a multiple of 16, you will need to round upwards to the next multiple of 16.

For example: Lets say we have a lamp post that is 4 tiles high, 1 tile in length and 2 tiles in width we would then have a parameter of {"x" : 1, "y" : 4, "z" : 2}

"specification"

Valid options (String): A string comprised of "X", "C" or "E" that has exactly the same number of characters as the number of tiles the object occupies. (Not counting whitespace. E.g. spaces, tabs and newlines.)


You do not need to add a specification, unless you want to allow an empty tile to be built in.


This option specifies to the game how it should handle each tile in an object. Starting from the top layer, at the x = 0 and z = 0, it will read through each character in the string and apply it to the specific tile in the model. The order goes "Go down x, then increment z, go down x again. Once z is finish decrement y and start again". The different options are;

  • "X" specifies the origin of the object. Every object must have 1 "X". All "X" follow the "C" specification as well. Although multiple can be applied (thus spawning multiple versions of the object) it is not recommended to have more than one "X".
  • "C" specifies that nothing should be placed in this tile. Set this for tiles in which the object actually occupies in the object.
  • "E" specifies that an object can be placed in this tile. Set this for any tile that is completely (or almost completely) empty.

For example: Lets take the lamp example from #size Lets say that the lamp follows a pattern like;

 [*]
 [*]
 [*]
 [*] [*]

An appropriate specification variable for this is "CE CE CE CX"

For more in depth information precede to either This Guide or this collection of thoughts.


"dockInfo"

To be made.


"interactEffect"

Valid options (String): Any valid effect code.

This will set the tile that you will receive when breaking or pressing g on the tile. This is avaliable because when you place an object with auto-tile info, it can turn into another item with no info on what original tile was placed. By default, it will give the tile that is being made.


"mapping"

Valid options (Unsigned Int): Any positive number.

A fixed ID for the tiles in the world. For example "sky" or blocks of nothing have a set ID of 1. Do not change this value from 0 unless you know what you are doing.


Tile Placement

"alts"

Valid options (String Array): Any path pointing to a *.qb file. Starting at, but not including, the "content" folder

A list of alternative models to use instead of the base model described in "voxels". The game will randomly choose a model from this list and the "voxels" parameter upon placing the object.

For example: If you put [ "staxel/tile/grass/Grass-alt2.qb", "staxel/tile/grass/Grass-alt3.qb", "staxel/tile/grass/Grass-alt4.qb" ], then when you place the tile, it will choose between the one specified in "voxels" and alt 2, 3 or 4 upon placing.


"altsCount"

Valid options (Int): The number of alts + voxel combined

This represents how many different options there are. Should be the number of alternative models plus the base voxel.

For example: If using the example from #"alts", you should place the number 4 here.


"autoTileInfo"

To Be Made.


"attachToAbove" / "attachToBelow" / "attachToSide"

Valid options (bool): Either true or false

These options specifies if the object will try and align itself. Above and Below will attach themselves to the bottom/top of a block so that the object is flush with the other block. Side will attempt to attach to the block behind the object. These affects are recursively done for up to 3 objects?

For example: If you have a lantern, setting to "attachToAbove" true will properly attach to the cieling, while setting to false may leave it floating in mid-air.


"attachmentDirections" / "placementDirections"

Valid options (String Array): A combination of one of (x,y,z) AND (p,n), OR just "all"

"placementDirections" is the list of directions that the tile can be placed onto. For each options, they must have a direction (x, y or z. The three planar directions.) and whether to check in the positive or negative direction. (p or n respectively). Alternatively you can just use "all" to allow the object to be placed in any direction.

The complement of "placementDirections" is the "attachmentDirections" option, which specifies which directions objects can be placed on the specified object.

For example: Giving "placementDirections" ["yn", "yp"] will allow the object to be placed on the top or bottom of any object but not the sides while giving "attachmentDirections" ["yn", "yp"] will allow any other object to be placed on the top or bottom of this object.


"orientationVariants"

Valid options (Bool): Either true or false

This option specifies if the object should be rotated randomly upon placement. (Right?)

For example: If set to true on a book tile, it will place the book in any of the 4 orientations when placed down, while if false, allows the player to rotate the book themselves.


"randomizePosition" / "radomizeVerticalPosition"

Valid options (Bool): Either true or false

This option specifies if the object should be given a random horizontal/vertical displacement when it is placed.

For example: If set to true on a book tile, it will place the book and give it an offset of a few voxels in the x and z direction, while if false, it will always be in the standard position.


"variantsRandomizeVerticalPosition"

Valid options (List of Bools): Either true or false for each model specified in alts. Needs to be the same length as Alts.

This option specifies if the object should be given a random vertical displacement when it is placed. The first object in the list affects the first alternative model. The second affects the second. This

For example: If set to true on a book tile, it will place the book and give it an offset of a few voxels in the x and z direction, while if false, it will always be in the standard position.

"representativeTile"

Valid options (String): Any valid tile code.

This will set the tile that you will receive when breaking or pressing g on the tile. This is avaliable because when you place an object with auto-tile info, it can turn into another item with no info on what original tile was placed. By default, it will give the tile that is being made.


Physics and Lighting

"bouncyness"

Valid options (Float): -1 and below to avoid bouncing, -1 to 0 for lower to normal bouncing, higher then 0 for more extreme bouncing

This option describes how much a tile will bounce you back when colliding with it. The maths behind it is Bounce Vector * (Tile.Bouncyness + 1).


"collision"

Valid options (Bool): Either true or false

This option specifies whether or not a player, or other object, can collide with the tile in question. Commonly flowers don't have collision, while most other objects do.


"emmisiveColor"

Valid options (String): A hexadecimal string that is is in ARGB format. (2 chars for Alpha, Red, Green, Blue)

The color in which an object with the option #"light" higher than 0 will emit when it is placed down.

For example: A light that has an emmisiveColor property of "FFFF0000" will emit a strong red light.


"light"

Valid options (Float): Any positive decimal number.

Specifies how much light is to be emitted from the object. If set to 0, no light will be emitted

For example: Setting this option to 10.0 will let the object emit the same amount of light as an indoor lamp.


"unbreakable"

Valid options (Bool): Either true or false

This option specifies whether a person can break the object after it is placed in the world. Should never be set to true, unless there is some code to remove this object. This option overrides the need to add any components for breaking the tile.


Rendering Options

"open"

Valid options (Bool): Either true or false

A rendering option. Should only be true if the object is completely empty, like an air block. For all other cases, this is false.

"solid"

Valid options (Bool): Either true or false

Should only be true if the object is completely full, such as a dirt block. Most materials will have this option true while most objects should not have this option.


"smoothRecolorationOnPlace"

Valid options (Bool): Either true or false

This option will make the tile recolour itself to match the tiles nearby it. Used when a palette is defined.


"palette"

Valid options (String): A valid path to a *.colorcorrection file

This is an option that specifies to the game that it can overlay colours on top of the model. It points at another file which acts as a collection for images which define colours which will be used to vary colours. Most files don't need this, however if a tile is repeated often, such as the ground, it can be a handy thing to include.


"priority"

Valid options (int): Any valid integer.

This rendering option specifies this objects order to being rendered. Currently this is only used on objects of the "material" kind. The object with the higher priority will display over the top of the object with lower priority.


Shop / Inventory Options

These options specify how the shop and inventory will handle this tile.

"categories"

Valid options (String Array): Any valid string, although the following strings are used in the menu sorting, "block", "door", "floor"/"flooring", "flower", "furniture", "light", "plant", "tool", "window", "misc", "red", "orange", "yellow", "green", "blue", "purple", "pink", "white", "black" and "brown"

This options allows for you to specifiy a number of strings that a person can search for, that will turn up the object in question. Several categories are applied when using the buttons in the catalogue or creative mode inventory.

For example: If you give an item the category "road", the player is then able to search for "road" which will return the item in question.


"descriptionImage"

Valid options (String): A valid path to an image

This option specifies an image that will be placed at the end of a description in the catalogue and creative inventory.


"searchable"

Valid options (Bool): Either true or false

This option specifies if the object whether the object will show up when it is searched for in the shop catalogue or the creative inventory. Useful for objects that have auto tiling info such as fences. (As such only one object appears in the shopping menu)


Sound Options

These options include all ways of adding sound to a tile. Look at Sound for finding out what a Sound/Sound Group is and how it is defined.

"damageSoundGroup"

Valid options (String): Any valid "code" string that points to a Sound Group.

This option specifies what group of sounds to play when the object is destroyed.

For example: Setting this to "staxel.sounds.damage.Grass" will make the block play grass sounds when destroyed.


"placeSoundGroup"

Valid options (String): Any valid "code" string that points to a Sound Group.

This option specifies what group of sounds to play when the object is placed.

For example: Setting this to "staxel.sounds.damage.Grass" will make the block play destroying grass sounds when the tile is placed.


"stepSoundGroup"

Valid options (String): Any valid "code" string that points to a Sound Group.

This option specifies what group of sounds to play when the object is stepped on.

For example: Setting this to "staxel.sounds.damage.Grass" will make the block play destroying grass sounds when a person is walking over the object.


Tile State Options

"animation"

Valid options (String): A valid path to a .bvh animation

An option that specifies what animations should be used on the model. This requires that layernames are the same in the model and animations.


"customRendererVoxels"

Valid options (String): A valid path to a model

An option to specify the use of a set of voxels while the object is placed?


"prefetchTileState"

Valid options (Bool): Either true or false

This options decides whether or not the TileState of a block is gotten on Server Start.


"spawnAction"

Valid options (String): Any valid "code" string that points to a Entity Action.

This option specifies what action is toggled on when the object is spawned into the world, either by loading it up in the world or by placing the object.


"tileStateKind"

Valid options (String): "object", "material", "nothing"

This option specifies what type of tilestate that your tile supports. This is mostly used for crafting stations and other interactable objects. This is not to be included on "dumb" objects such as stone.

"Other Options"

"merchantKind"

Valid options (String): Any valid "code" string that points to a Merchant File.

This option specifies when specifies converts the tile Object into a Merchant Vendor block. This essentially makes the tile invisible and spawns the appropriate merchant with their appropriate stall. Do not use this on files that you want to stay in the world.


StackSizeLimit InteractActionTrigger