Events are triggered by the game engine and can play animations accordingly, for example drive and door animation of vehicles.
Event names are predefined, while animation names can be freely chosen.
Events are listed in model files, which are triggered depending on the state of model.
The following vehicle events are available:
*animation is looped
Note that the wheel rotation and steering as weel as additional animations for aircraft and boats (elevator, aileron, flaps, rudder, paddles, flags) are calculated by the game engine. The mesh files used for these animations can be defined in the metadata section of the model file.
The following building and person events are available:
*animation is looped
Example code:
events = { open_doors_right = { [2] = { name = "opend1", forward = true }, [5] = { name = "opend2", forward = true }, }, close_doors_right = { [2] = { name = "opend1", forward = false }, [5] = { name = "opend2", forward = false }, }, open_doors_left= { [3] = { name = "opend2", forward = true }, [4] = { name = "opend1", forward = true }, }, close_doors_left = { [3] = { name = "opend2", forward = false }, [4] = { name = "opend1", forward = false }, }, },
The number in the square bracket refers to the position of the mesh file listed in the model file starting with 1. 0 is used to reference the model file itself.
Animations are defined in model or mesh files. They can be keyframe or file based.
Example code for a keyframe based vehicle door animation:
animations = { opend1 = { type = "KEYFRAME", params = { origin = { 0, 0, 0, }, keyframes = { { time = 0, rot = { 0, 0, 0 }, transl = { 0, 0, 0 } }, { time = 1100, rot = { 92, 0, 0 }, transl = { 0, 0, 0 } } } } }, },
Example code for a file based person animation:
animations = { idle = { params = { id = "man01_idle_lod_0/_root.ani", }, type = "FILE_REF", }, sitting = { params = { id = "man01_sitting_lod_0/_root.ani", }, type = "FILE_REF", }, walk = { params = { id = "man01_walk_lod_0/_root.ani", }, type = "FILE_REF", }, },
Animation files are stored in the .ani
format in the res\models\animation\
folder.