Material Definitions (ocm)
Material definitions determine looks and behaviour of landscape materials.
Value | Data type | Description |
---|---|---|
Name | String (max. 15) | Name of material. |
ColorAnimation | Integer | 0 or 1. Color animation. |
Shape | Integer | Shape of surface: Flat (0), Octagon, FlatTop (1), Smoother, Smooth (2) or Rough (3). |
Density | Integer | A density of 25 and above is liquid. 50 and above is solid. BlastFree offers a parameter to only blast solid materials of a given density or lower. |
Friction | Integer | 0-100. Friction. |
DigFree | Integer | 0 or 1. Determines wether the material can be dug into. |
BlastFree | Integer | 0 or 1. Determines whether the material can be blasted away. |
Blast2Object | definition id | Type of objects created by blasting this material. |
Dig2Object | definition id | Type of objects dug out from this material. |
Dig2ObjectRatio | Integer | ca. 100-500. Mass ratio when digging out objects. |
Dig2ObjectRequest | Integer | 0 or 1. If 1, objects are only dug out on request. |
Blast2ObjectRatio | Integer | ca. 100-500. Mass ratio when blasting free objects. |
Blast2PXSRatio | Integer | Mass ratio when material pixels are blasted free. |
Instable | Integer | 0 or 1. Stability. |
MaxAirSpeed | Integer | ca. 10-100. Maximum falling speed. |
MaxSlide | Integer | Maximum side offset when sliding. |
WindDrift | Integer | Horizontal drift by wind. |
Inflammable | Integer | Inflammability. |
Incendiary | Integer | This material incinerates objects. Note: For compatibility reasons, the misspelling "Incindiary" is also accepted if (and only if) no value with the correct spelling is set. |
Corrode | Integer | This material corrodes other materials. |
Corrosive | Integer | This material can be corroded. |
Extinguisher | Integer | This material will extinguish burning objects. |
Soil | Integer | Plants grow on this material. |
Light | Integer | 0 or 1. If greater than zero, ambient light is emitted from this material even if drawn unterground. |
TempConvStrength | Integer | Strength of temperature conversion. |
BlastShiftTo | String (max. 15) | Material changes into another material when blasted. |
InMatConvert | String (max. 15) | Entering this material the material will change into... |
InMatConvertTo | String (max. 15) | ...this material... |
InMatConvertDepth | Integer | ...when at the given depth. |
AboveTempConvert | Integer | Above this temperature the material will change into... |
AboveTempConvertTo | String (max. 15) | ...this material. |
AboveTempConvertDir | Integer | Direction of temperature conversion: 0 bottom up, 1 top down |
BelowTempConvert | Integer | Below this temperature the material will change into... |
BelowTempConvertTo | String (max. 15) | ...this material. |
BelowTempConvertDir | Integer | Direction of temperature conversion: 0 bottom up, 1 top down |
Placement | Integer | 0-100. This Value is used for lighting of the landscape and is usually determined automatically from the other material values. |
TextureOverlay | String (max. 15) | Standard texture for this material used by the landscape generator. |
OverlayType | Integer | Bit mask for texture calculation on this material. Bit 0 (1): exact (no zoom), bit 1 (2): no texture, bit 2 (4): extra large zoom |
PXSGfx | String (max. 30 chars) | Graphics used for loose material pixels. This graphic should be available as material texture. |
PXSGfxRt | 4 integers | Target rectangle for the graphics of loose material pixels. Additional phases on the right and below the specified rectangle will be used. The rectangle should always start in the top left corner and use the complete texture size. |
MinShapeOverlap | Integer | Used during map-to-landscape zooming when drawn with a texture with shape definitions: Minimum overlap of map pixels to corresponding shapes to cause a full shape expansion. See Shape textures. |
User defined reaction
In addition to default reactions, every material can define custom reactions which are executed when the material passes another material as a free pixel (e.g. precipitation or particles after explosios) or by material movement (e.g. when a lake floods a tunnel).
Value | Data type | Description |
---|---|---|
Type | String | Type of reaction that should happen. See Table. |
TargetSpec | String | Target material, with which the loose material reacts. See material specifications. |
ScriptFunc | String | Reaction type script only: Name of the script function, which determines the behaviour. |
ExecMask | Integer | Bitmask, determining in which situation the reaction is to be executed. Bit indices are the reaction events. Default value -1 for all events. |
Reverse | Boolean | Usually, the reaction defines what happens when loose material of the definition, in which the reaction is defined, hits solid material of the type specified in TargetSpec. If Reverse is set, this definition is swapped. |
InverseSpec | Boolean | If true, the reaction will be defined for all other materials (including "Sky"), which do not fulfill the condition in TargetSpec. |
CheckSlide | Boolean | If true, the standard behaviour (Bouncing off the ground and sliding according to MaxSlide) will be executed before the call is done. |
Depth | Integer | Reaction type Convert only: Depth in target material required for conversion. |
ConvertMat | String | Reaction type Convert only: Material, into which the loose material is converted. If sky is specified, the material will vanish. |
CorrosionRate | Integer | Reaction type Corrode only: Chance of corrosion. |
Name | Value | Event |
---|---|---|
MEE_PXSPos | 0 | Check before each movement frame of a loose material pixel against its background material |
MEE_PXSMove | 1 | Check against each pixel that a loose material pixel passes during its movemvent |
MEE_MassMove | 2 | During larger material movements (e.g. when a lake is flooded into a tunnel): Check of the moving material against the material over which it's moving |
Name | Behaviour |
---|---|
Script | For each collision, the script function specified in ScriptFunc is called. |
Convert | The material is converted into another. Comparable to the behaviour of snow in water. |
Poof | Both the loose and the solid material are removed. Additionally, there's a 1:3 chance of creating a small smoke cloud, and a 1:3 chance that the sound "Pshshsh" is played. Comparable to the behaviour of water in lava. |
Corrode | The loose material corrodes the target material at the chance CorrosionRate, and vanishes itself if it does so. If corrosion is performed, a small smoke cloud is created at a chance of 1:5, and the sound "Corrode" is played at a chance of 1:20. Comparable with the behaviour of acid on earth. |
Insert | The loose material is inserted as solid material. Comparable to the behaviour of any material that hits a material of equal or higher density. |
Name | Materials |
---|---|
Material name | If the specification equals the name of an existing material, this material will be used. |
All | All materials, including "Sky" |
Solid | All solid materials |
SemiSolid | All solid and liquid materials |
Background | All background materials, including "Sky" |
Sky | The background material. |
Incendiary | All materials that can incinerate objects. Note: For compatibility reasons, the misspelling "Incindiary" is also accepted. |
Extinguisher | All extinguishing materials. |
Inflammable | All flammable materials. |
Corrosive | All materials which can be corroded. |
Corrode | All corrosive materials. |
Reaction type 'Script'
This resource-intensive method can be used to define the material behaviour freely. The script function should be defined globally and have the following parameters:
The return value of the function should be either 1 for removal or 0 for keeping the loose material.
Parameter number(s) | Name(s) | Data type | Description |
---|---|---|---|
1,2 | x, y | Integer | Position of the loose material. The parameters may be modified in order to move the material pixel. |
3,4 | landscape_x, landscape_y | Integer | Position in the landscape, on which the material hits. |
5,6 | xdir, ydir | Integer | Speed (in 1/100px) of the movement of the material. May be modified in order to change the material speed. Not for MassMover. |
7 | pxs_material | Integer | Material number of the loose material. Useful if the same reaction function is used for multiple materials |
8 | landscape_material | Integer | Material number of the solid material. |
9 | event | Integer | See Reaction events. |