Materials

From Data Realms Wiki

Jump to: navigation, search

Materials are named, indexed definitions of physical properties possessed by whatever objects are made of, be it concrete, metal, flesh... Some properties apply more to Actors and Devices while others are important for Terrains, Bunker pieces, and Scenes in general. In Base.rte, the file Materials.ini contains the master list which everything uses, though the .ini files for Actors and Devices allow overriding specific definitions for itself. Terrains, Bunkers, and Scenes use an image whose pixels must match the Color of the Material they are meant to be and cannot override what the definition says.


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.

	PresetName = Shelled Flesh // The name used with CopyOf to define what Material things are made of. Also must not be one that is already used.

	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. Must not conflict with any other Material's.

		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