Object Definitions

Object definitions are used for all game objects in clonk: the wooden hut, goal objects and the clonk himself. An object definition is a group file composed from the following components:

Object properties

Object properties.
Table for activities, normally used for objects with animations. The ActMap is defined in the Script.c as a property list.


The object script. See object scripts and localization.

Raster Graphics

Graphics of the object. Base graphics, animation phases and a picture for display in menus are stored in a 32 bit picture with transparency channel (PNG format, 32 bit RGBA color, non interlaced).
The part of the object's graphics which is to be colored in the player color (see ColorByOwner in DefCore.txt) can also be defined using a separate graphics file. In Overlay.png gray scales should be used instead of blue color.
An optional normal map for the object, where the red, green and blue components in the image correspond to the normal vectors to be used for the lighting of the object. If this file is not present, the normal vector at each pixel points straight into Z direction (outside of the screen).
Objects can also contain alternative sets of graphics which can be selected ingame using the script command SetGraphics(). The name corresponds to the file name portion following "Graphics". The matching overlay is automatically selected. For more information see SetGraphics().
Image describing areas in this object that are solid, so vertices of other objects will collide with it. Pixels are made solid if they are 50% or less transparent in this image. Source rectangle within this graphic and target position on the object must be set in DefCore.txt property "SolidMask" or using the script function SetSolidMask.

3D Graphics

A 3D model can be used as an object's graphics instead of a bitmap. It needs to be provided in OGRE format. There are exporters for most 3D modeling tools. All files that are required by the mesh (especially material scripts, textures and skeletons) need also to be present in the object.
Skeleton files contain bones and animations for a 3D model. They are usually created by the exporter if bones and/or animations are used for the mesh.
OGRE material scripts are simple text files which contain information about the material of a 3D model. Each model is assigned a material which specifies how it is rendered. Normally these scripts are being generated by the exporter, but they can also be hand-edited afterwards (using a text editor) to apply additional effects.
Any number of textures defined in the OGRE material scripts.


Object local sounds. As these are always loaded and not dynamically unloaded as are scenario sounds you should use these sparingly and with small sound files only.
Object local sounds within valid definitions are automatically put into a namespace with the ID of the object. They can be played using Sound("id::soundname").

Additional files for crew members

For object definitions defining a clonk type you can specify custom rank names for this clonk type here. The rank names will then also replace rank names of existing crew members of this type. The file should contain a simple text list of names of maximum 30 characters each. By using the approriate language codes you can create language dependent sets of rank names.
You can also define custom rank symbols for clonk types which are then displayed in the game instead of the standard symbols from Graphics.ocg. A rank symbol should always be square and there should be enough many symbols for all ranks. See the global Rank.png in the Graphics.ocg for an example.
Sven2, 2002-04
matthes, 2004-06