Actors

Actors are models with a skeleton. The skeleton can be animated giving the appearance of a living thing such as a human or dog. Below is an animation of an actor doing star jumps:

The mud client can load numerous types of actor such as Milkshape actors (ms3d), 3D studio actors (3ds) and half life actors (smd).

An actor can perform an animation such as a kick when the mud asks it to do an action (or it could be its idle animation).

Actors are defined in the config file actor element. It has many properties similar to freeforms but also has an 'animations', 'animationmode' and 'interval' property that indicate how it is animated.

Animations
An actor is linked to a certain set of animations that match the actors skeleton. This is specified by 'animations' attribute of actor that links to a 'ActoranimationsItem' element in actoranimations. In this way a dog can have different set of animations to a human. If 'animations' is blank it will link to a 'ActoranimationsItem' that is blank. In an actor 'actoranimation' it is possible to specify the filename of the animation (eg jump.smd), the number of ms between each frame and also a random interval value. For example if you have 3 actors doing star jumps you might not want them to do the star jump exactly in sync. Therefore if the interval is 70 and 'randomizeinterval' is 20 then random value between 0 and 20 is added to 20 minus 10.

It is also possible to allow an animation to use other animations. For example if you wanted to animation a person standing to praying you could use an animation to make the actor kneel and then once it finishes it then does a pray animation. For example in actoranimations:


<ACTORANIMATION animation="pray" filename="kneel.smd" becomes="prayidle" animatiomode="playonce" />
<ACTORANIMATION animation="prayidle" filename="pray.smd" />

The 'becomes' prayidle signifies that once the pray animation is finished then will do the 'prayidle' animimation.

Copying animations
If you have a default set of human animations you may want to override some of the animations for different types of actors. For example a woman walks different from a knight but other than that a woman shares all the other animations. To do this there is the 'copyof' attribute of 'ActoranimationsItem' . This will copy a set of animations of the name specified in 'copyof' and then news animations can be added to the new set or existing ones can be overridden. For example:

<ACTORANIMATIONSITEM name="human">

<ACTORANIMATION name="awalk" filename="actors\animations\walk.smd" interval="50" />
<ACTORANIMATION name="aslash" filename="actors\animations\slash.smd" interval="50" randomizeinterval="10" animationmode="playonce"/>
<ACTORANIMATION name="aslash" filename="actors\animations\slashthrust.smd" interval="50" randomizeinterval="10" animationmode="playonce"/>
<ACTORANIMATION name="akick" filename="actors\animations\kick.smd" interval="50" animationmode="playonce"/>
<ACTORANIMATION name="apush" filename="actors\animations\push.smd" interval="50" animationmode="playonce"/>

</ACTORANIMATIONSITEM>

<ACTORANIMATIONSITEM name="woman" copyof="human">

<ACTORANIMATION name="awalk" filename="actors\animations\femalewalk.smd" interval="50" />

</ACTORANIMATIONSITEM>

Here set of animations called 'woman' is the same as 'human' except it has override 'awalk' with a female walking animation.

Actors Sharing One body
In the picture below the two actors standing up share the same body but have different heads:

files/actorsharebody.jpg

Sharing actor bodies is achieved using the 'filename2' attribute of actor. You can use the 'filename' to load the body and use filename2 to load the head. Both head and body must share the same skeleton. For example:

<OBJECT name="citizen3">

<ACTOR animations="citizen" filename="actors\citizen3\body.ms3d" filename2="actors\citizen3\head.ms3d" />

</OBJECT>

By sharing bodies you create large number of knights (or anything else) by creating many heads for one body. If you improve the body all the knights will share the improvement.

Wielded Items

In the screenshot below the actor is using a shovel:

files/actor.jpg

Actors can carry items as specified by the mud. For example the 3d mud tags {oknight,(osword,+)} will show a knight wielding a sword.

For an actor to wield a sword the sword will need a skeleton so that if the actor performs a swipe then the sword move along with the actors arm:

files/actorsword.jpg

If sword is on the ground you dont want it to have a skeleton but be a normal freeform model. Thus you may need two versions of the same object depending on whether it is wielded or not. The way the mud client allows for wielded and non wielded models is to use the element carriedobjects which is a list of object that will be looked up first if an object is wielded. If the wielded item isnt in carriedobjects the mud client will look up objectlist instead. Thus in carriedobjects you can have the sword with the skeleton:

<OBJECTLIST>

<OBJECT name="sword" >
<FREEFORM collision="none" filename="models\sword\sword.ms3d" defaulttexturetype="@lindos" scalex="0.018" scaley="0.018" scalez="0.018" z="0.02" pitch="90" turn="90"/>
</OBJECT>

</OBJECTLIST>

<CARRIEDOBJECTS>

<OBJECT name="sword" >
<ACTOR animations="citizen" defaulttexturetype="@actor" filename="models\sword\swordwield.ms3d" scalex="0.07" scaley="0.07" scalez="0.07" z="0.09" pitch="90" turn="180" />
</OBJECT>

</CARRIEDOBJECTS>