Animation

Animation and files

When designing monster or viking, you will probably make an animation instead of single image (walking cycles etc.). Convention is to save the animation as a series of files with the same name and a number at the end, e.g. olaf_ko1.tga and olaf_ko2.tga are two parts of an animation.

Don't make animated GIFs and similar stuff - the game can't load it properly.

Animation and Model

It is possible to define animation in a model XML file (for many examples see gfx/models/olaf_model.xml). Animation has to be defined in 'load_pre'.

<model>
  <load_pre>
    <image sym="left1">vikings/olaf/olaf_walk2_left.tga</image>

    <image sym="left_breath">vikings/olaf/olaf_breath_left.tga</image>

    <!-- Walking left -->
    <animation sym="move_left">
      <image sym="left1"/>
      <image>vikings/olaf/olaf_walk1_left.tga</image>
    </animation>

    <!-- Standing looking left -->
    <animation sym="stand_left">
      <image sym="left1"/>
      <image sym="left_breath"/>      
    </animation>
  </load_pre>

  <states>
    <state name="onground_standing_left" sym="stand_left"/>

    <state name="onground_moving_left" sym="move_left"/>
  </states>
</model>
	

As you can see, it is possible to use the symbolic names even in 'load_pre'.