Skip to content
Matthew Walls edited this page Oct 12, 2018 · 1 revision

Gist

Makes animated sprites appear for Pawns (Characters, Animals, etc).

In Action

Bat artwork is courtesy of Draegon1993.

Example Component (Use this!)

Here is an XML example (parts have been removed with <...>s) of the Bats I use in the Rim of Madness - Vampire mod.

<?xml version="1.0" encoding="utf-8" ?>
<Defs>
  <ThingDef ParentName="ROMV_AnimalThingBase">
    <defName>ROMV_BatRace</defName>
    <label>bat</label>
    ...
	<comps>
	  <li Class="CompAnimated.CompProperties_Animated">
	    <movingFrames>
	      <li>
                <texPath>Things/Pawn/Animal/BatVampire/Draegon1993BatVampireA</texPath>
                <color>(110,95,82)</color>
                <drawSize>2.2</drawSize>
                <shaderType>CutoutComplex</shaderType>
		<graphicClass>Graphic_Multi</graphicClass>
              </li>
              <li>
                <texPath>Things/Pawn/Animal/BatVampire/Draegon1993BatVampireB</texPath>
                <color>(110,95,82)</color>
                <drawSize>2.2</drawSize>
                <shaderType>CutoutComplex</shaderType>
		<graphicClass>Graphic_Multi</graphicClass>
	      </li>
	    </movingFrames>
	    <sound/>
	    <secondsBetweenFrames>0.15</secondsBetweenFrames>
	  </li>
	</comps>
    ...
  </ThingDef">
</Defs>

Explained Lightly

::Note:: Characters that use this component do not use the lifestage graphics. Here is the current list of parameters in CompAnimated.CompProperties_Animated and what they do.

  • sound - When set, this will play a sound when the animation cycles.
  • secondsBetweenFrames - The number of seconds between each frame of animation.
  • movingFrames - A list of frames (GraphicData) when the character is moving. Use <li></li> to add in each frame.
  • stillFrames - A list of frames (GraphicData) when the character is at rest.