Timelines

Tutorial:Advanced Concepts - Timelines
Time to complete: 10 minutes approximately
Summary: This tutorial will show you how to move a sound using a timeline.
Aim: To learn how to create a timeline in the IMML Editor.
Required application: VastPark Creator

In this tutorial you will learn how to use the Timeline to change the position of a sound.

Requires:

  • Portal
  • Sound

A portal can be inserted through the Insert menu and pressing the portal button.
The portal then needs to be set as the park's default portal and can be done by clicking on My Park and going to its properties tab. In the appearance menu there is a drop down menu labeled portal, select your portal from there. To make it easier for us when scripting the timeline set the portal's position to 0,0,0. We are adding this in so that our start position when we are Interactive Preview is at the position of the Portal.

Choose a sound from the library, add it to the scene, and position it so that it is close to the portal. My sound is positioned at 4,2,0.

NOTE:The sound needs to be made Spatial in its properties in order to be able to see it

I find staring into the default grey scene pretty boring and a little disorientating at times, and although it's not needed for this tutorial I added in a skybox.

The scene is now setup for us to go into IMML and create a timeline. To view the IMML you need to click the IMML tab which sits in the bottom left of the scene. This will open the IMML editor which is similar to HTML editor's like Dreamweaver.

The first thing that you will notice is that there is already IMML written in the editor, this is the code for the light and sound that we added to the scene earlier.

Now it's time to add in the Timeline, so here it is....


   1.<Timeline Name="Sound Position" Enabled="True" Loop="True" AutoTween="True" Speed="1">
   2.<PropertyEvent Target="Position" Value="0,2,-4" Element="NIN - Ghosts 04" Time="00:00:03"/>
   3.<PropertyEvent Target="Position" Value="-4,2,0" Element="NIN - Ghosts 04" Time="00:00:06"/>
   4.<PropertyEvent Target="Position" Value="0,2,4" Element="NIN - Ghosts 04" Time="00:00:09"/>
   5.<PropertyEvent Target="Position" Value="4,2,0" Element="NIN - Ghosts 04" Time="00:00:12"/>
   6.</Timeline>

OK now I have given you the code, but what's it all mean?

The timeline needs a name so give it one that is meaningful and unambiguous. Make sure that Enabled is set to true for this particular timeline as we want this to occur as soon as the park has loaded. Set AutoTween to true if you want a smooth transition between shifting the sounds positions.

There are three types of events that can occur in a timeline, a property event, a keyframe event and an executable event. For this tutorial we are going to use a property event to change the position of the sound. The target refers to the object properties we want to change (the position) and the value relates to a vector, the element is the name of the sound we want to apply the property changes to and the time is how long we want it to take to get to the target value.

We are almost ready to test this, but by default the sound isn't enabled, so you will need to change this.
Find the sound in your IMML and change Enabled to equal true, it should look like this.

 
  1.<Sound Name="NIN - Ghosts 04" Spatial="True" Enabled="True" Stream="False" Source="http://..." Position="4,2,0"/>

Switch Back to design view, run interactive preview and listen to the sound as it moves around. Moving the position of an object is just one of the many things Timelines can do. Why not challenge yourself and make a flight path for a camera by inserting a camera and making it the default camera for the park.

timeline_scene.jpg (9.7 kB) Michael Louca, 03/02/2010 03:10 pm