Materials

From Data Realms Wiki

(Difference between revisions)
Jump to: navigation, search
m (How they are defined)
(Replaced hybrid Concrete/Air example mashup with Shelled Flesh, described more definition types. Removed bloody British spelling since obviously CC expects American (no offense, chaps). New sections.)
Line 3: Line 3:
material, which will deflect low caliber bullets from guns like the SMG.
material, which will deflect low caliber bullets from guns like the SMG.
-
=== How they are defined ===
+
== Material Definitions ==
-
For this, we'll use the Concrete material:
+
 
 +
Shelled Flesh of the local [[Wildlife#Crab | crabs]] is a good example because it uses almost all the Material definition types.
 +
 
<pre>
<pre>
AddMaterial = Material
AddMaterial = Material
-
Index = 0
+
Index = 146
-
InstanceName = Air
+
PresetName = Shelled Flesh
-
Bounce = 0.8
+
Bounce = 0.6
-
Friction = 0
+
Friction = 0.6
-
StructuralIntegrity = 0
+
StructuralIntegrity = 40
-
DensityKGPerVolumeL = 1.0
+
DensityKGPerVolumeL = 1.4
-
GibImpulseLimitPerVolumeL = 15
+
GibImpulseLimitPerVolumeL = 18
-
GibWoundLimitPerVolumeL = 0.1
+
GibWoundLimitPerVolumeL = 0.2
-
Priority = 0
+
Priority = 15
 +
SettleMaterial = 149
 +
TransformsInto = 161
Color = Color
Color = Color
-
R = 255
+
R = 210
-
G = 0
+
G = 120
-
B = 255
+
B = 85
-
UseOwnColor = 0
+
UseOwnColor = 1
</pre>
</pre>
-
This doesn't look too bad, does it? But now for a deeper explanation:
+
This doesn't look too bad, does it? Now for an explanation of what each definition type is and does.
<pre>
<pre>
-
AddMaterial = Material // The instance call, defines the next text as parts of a material.
+
AddMaterial = Material // The instance call, defines the next text as parts of a Material.
-
Index = 0 // Indexing system, must not be one that is already used.
+
Index = 146 // Index in the Material palette - must not be one that is already used or the game will crash.
-
InstanceName = Air // The name used to refer to the instance later.
+
PresetName = Shelled Flesh // The name used with CopyOf to define what Material things are made of.
-
Bounce = 0.6 // How bouncy the material is (0-1). 1 means no energy lost on collisions.
+
Bounce = 0.6 // Kinetic energy reflected or absorbed from collisions. 1.0 = reflects all, 0.0 = absorbs all. (Rubber, oddly enough, has 0.01 Bounce; Military Stuff has 0.85)
-
Friction = 0.9 // The friction of the material. 0 is like ice, while 1 snags on to everything.
+
Friction = 0.6 // The friction of the material. 0 is like ice, while 1 snags on to everything.
-
StructuralIntegrity = 75 // How big an impulse is required to knock off a particle of this material. Mass * Velocity = Impulse
+
StructuralIntegrity = 40 // How big an impulse is required to knock off a particle of this material. Mass * Velocity = Impulse
-
DensityKGPerVolumeL = 2.3 // mass per volume (litres). A Litre is 10^3cm.
+
DensityKGPerVolumeL = 1.4 // Mass in Kilograms per Liter. Water is 1KG per Liter, metals around 8.
-
GibImpulseLimitPerVolumeL = 15 // The impulse required per volume in litres to gib.
+
GibImpulseLimitPerVolumeL = 18 // Mass*Velocity per Liter an Actor or Device can take before limbs are torn or parts gibbed.  
-
GibWoundLimitPerVolumeL = 0.1 // How many wounds is required per volume in litres to gib.
+
GibWoundLimitPerVolumeL = 0.2 // Number of wounds per Liter an Actor or Device can take before gibbing.
-
Priority = 0 // The priority that a pixel of this material has to be displayed. The higher the number, the higher the priority.
+
Priority = 15 // The priority that a pixel of this material has to be displayed; lower numbers are lower priority. 15 is typical.
-
Color = Color // The colour to use in scenes to represent this material, also natural colour when knocked loose from terrain.
+
SettleMaterial = 149 // Index of the Material to create instead of this one for special effects when knocked loose, etc. (In this case, Flesh Scraps.)
 +
 
 +
TransformsInto = 161 // Index of the Material to create in addition to the SettleMaterial when gibbed. (In this case, Blood.)
 +
 
 +
Color = Color // In image files defining Materials of Bunker, Terrain, or Scene objects, pixels this color are this Material.
R = 165 // Red value
R = 165 // Red value
Line 52: Line 60:
B = 165 // Blue value
B = 165 // Blue value
-
UseOwnColor = 0 // Whether to use the own colour when a pixel of terrain of this material is knocked loose (1), or not (0)
+
UseOwnColor = 1 // Whether to use natural color above when a pixel of terrain of this material is knocked loose [1], or not [0].
</pre>
</pre>
-
A good idea is to just grab an existing material, and then tweak it to your liking. The GibWound and GibImpulse limits are used for actors.
+
The GibWound and GibImpulse limits are used for [[Actors]] but do not figure into anything else (thus the default 15 and 0.1 values on everything from Bullet Metal to Water).
 +
=== Material Textures ===
As shown below you can also set the texture of a material for use in maps. Put the texture just after UseOwnColor, or, if omitted, the RGB values.
As shown below you can also set the texture of a material for use in maps. Put the texture just after UseOwnColor, or, if omitted, the RGB values.
<pre>
<pre>
...
...
-
R = 165
+
Color = Color
-
G = 165
+
R = 230
-
B = 165
+
G = 240
-
UseOwnColor = 0
+
B = 240
TextureFile = ContentFile
TextureFile = ContentFile
-
Path = Base.rte/Scenes/Textures/Soil.bmp
+
Path = Base.rte/Scenes/Textures/Snow.bmp
</pre>
</pre>
 +
 +
=== Custom Materials ===
 +
 +
You can create your own Materials using one of the undefined indexes, but this can complicate your use of other people's mods which might have gone ahead and used some index numbers and create a game-crashing index collision.
 +
 +
For anything with its own .ini file, such as Actors or Devices (but not Bunker pieces), it is safer to add your own custom Material definitions as in the example below:
 +
<pre>
 +
Atom = Atom
 +
Material = Material
 +
CopyOf = Bullet Metal
 +
PresetName = Incendiary Shotgun Flames
 +
Bounce = 0.0
 +
Friction = 1.0
 +
 +
</pre>
 +
This will locally override the values for the Material without affecting its use by anything else. Thus you can define them however you want without messing up your install of Cortex Command and enjoy other people's mods.
 +
 +
For Bunker pieces or Scenes you want to use custom materials, look at major mods like [http://forums.datarealms.com/viewtopic.php?f=24&t=12224 Map Pack 3] to see how they've done it without much alteration to the core Base.rte files.
 +
[[Category:Modding]]
[[Category:Modding]]
[[Category:Tutorials]]
[[Category:Tutorials]]

Revision as of 23:31, 6 July 2012

Materials are simply what different objects are made of, be it concrete, metal, flesh...
Some materials are naturally harder than others. Mega metal, for one, is a very tough
material, which will deflect low caliber bullets from guns like the SMG.

Material Definitions

Shelled Flesh of the local crabs is a good example because it uses almost all the Material definition types.

AddMaterial = Material
	Index = 146
	PresetName = Shelled Flesh
	Bounce = 0.6
	Friction = 0.6
	StructuralIntegrity = 40
	DensityKGPerVolumeL = 1.4
	GibImpulseLimitPerVolumeL = 18
	GibWoundLimitPerVolumeL = 0.2
	Priority = 15
	SettleMaterial = 149
	TransformsInto = 161
	Color = Color
		R = 210
		G = 120
		B = 85
	UseOwnColor = 1

This doesn't look too bad, does it? Now for an explanation of what each definition type is and does.

AddMaterial = Material // The instance call, defines the next text as parts of a Material.

	Index = 146 // Index in the Material palette - must not be one that is already used or the game will crash.

	PresetName = Shelled Flesh // The name used with CopyOf to define what Material things are made of.

	Bounce = 0.6 // Kinetic energy reflected or absorbed from collisions. 1.0 = reflects all, 0.0 = absorbs all. (Rubber, oddly enough, has 0.01 Bounce; Military Stuff has 0.85)

	Friction = 0.6 // The friction of the material. 0 is like ice, while 1 snags on to everything.

	StructuralIntegrity = 40 // How big an impulse is required to knock off a particle of this material. Mass * Velocity = Impulse

	DensityKGPerVolumeL = 1.4 // Mass in Kilograms per Liter. Water is 1KG per Liter, metals around 8.

	GibImpulseLimitPerVolumeL = 18 // Mass*Velocity per Liter an Actor or Device can take before limbs are torn or parts gibbed. 

	GibWoundLimitPerVolumeL = 0.2 // Number of wounds per Liter an Actor or Device can take before gibbing.

	Priority = 15 // The priority that a pixel of this material has to be displayed; lower numbers are lower priority. 15 is typical.

	SettleMaterial = 149 // Index of the Material to create instead of this one for special effects when knocked loose, etc. (In this case, Flesh Scraps.)

	TransformsInto = 161 // Index of the Material to create in addition to the SettleMaterial when gibbed. (In this case, Blood.)

	Color = Color // In image files defining Materials of Bunker, Terrain, or Scene objects, pixels this color are this Material.

		R = 165 // Red value

		G = 165 // Green value

		B = 165 // Blue value

	UseOwnColor = 1 // Whether to use natural color above when a pixel of terrain of this material is knocked loose [1], or not [0].

The GibWound and GibImpulse limits are used for Actors but do not figure into anything else (thus the default 15 and 0.1 values on everything from Bullet Metal to Water).

Material Textures

As shown below you can also set the texture of a material for use in maps. Put the texture just after UseOwnColor, or, if omitted, the RGB values.

...
	Color = Color
		R = 230
		G = 240
		B = 240
	TextureFile = ContentFile
		Path = Base.rte/Scenes/Textures/Snow.bmp

Custom Materials

You can create your own Materials using one of the undefined indexes, but this can complicate your use of other people's mods which might have gone ahead and used some index numbers and create a game-crashing index collision.

For anything with its own .ini file, such as Actors or Devices (but not Bunker pieces), it is safer to add your own custom Material definitions as in the example below:

	Atom = Atom
		Material = Material
			CopyOf = Bullet Metal
			PresetName = Incendiary Shotgun Flames
			Bounce = 0.0
			Friction = 1.0

This will locally override the values for the Material without affecting its use by anything else. Thus you can define them however you want without messing up your install of Cortex Command and enjoy other people's mods.

For Bunker pieces or Scenes you want to use custom materials, look at major mods like Map Pack 3 to see how they've done it without much alteration to the core Base.rte files.

Personal tools