Now then. Hopefully you're feeling more comfortable with the FSM. In this section we'll talk about stringing animations
together. The final product will be a door that you can kick down...cool huh? =)


First make your door, group it to a true room, make it dynamic, and rename your door to door. You'll need to set
the playercollide & bulletcollide triggers like in the last tutorial. IMO the perfect door size is 2.5m High x 1.5m
Wide

Make sure the door is selected and hit tab to get the keyframes for your door. Rename the first frame to something easy
to remember...like start. Create a new frame named Slide. Make sure Slide is selected and push the goto button.

Close the window. Make your grid pretty small(I used 0.1250m) and drag the door back a few squares.

Mouse over the door and push tab again to get back to the keyframe menu. Add another keyframe named Fallback.
Select Fallback and push Goto again. Now rotate your door by one of the vertices at it's base. You do this by
mousing over one of the vertices, holding 1, 2, or 3 and moving the mouse. Its okay if you screw up the direction since
MaxED overwrites the keyframe you have selected each time you move the object. Keep rotating it until the door looks like
its lying on the ground.

Now we need to edit the door's animations to put those keyframes to use. Mouse over the door and push shift-tab. This is
our animations window. Push the Add button and set the start keyframe to Start and the end keyframe to Slide
Next, add another animation but use slide to start and fallback to end. Set the length for both of the animations
to something short, 0.25 should do. You can double click each of the animations to watch them play.

We need to create a trigger to tell the game when to start the animations. Create an actionButton trigger and place
it somewhere infront of the door. Name it doorButton and don't forget to group it with the room. Select the new
button and push 4 to edit the FSM. Push the Messages button from here and click the T_Activate tab. Add these messages
in the Leaving Keyframe One box:

parent::door->a_play3dsound(dynamic, door_wood_kick, "");
parent::door->do_animate(animation_0);
this->t_enable(false);


Lastly, edit the door's FSM Messages. Select the Animation(Animation_0) tab and enter this script into the
Reaching Keyframe Two box:

this->do_animate(animation_1);

The last line tells the game to run the Slide-Fallback animation immediately after the Start-Slide one. Effectively making
a seamless animation out of the two.

Download the *.lvl file here.

Just for fun <-- Back to the Basics     More advanced stuffs -->