PDA

View Full Version : Play sound only once



Brandi
04-30-2002, 03:30 PM
Hello.

I have an mp3 file that plays when a user enters a specific scene. From there are are forwarded to other sub scenes the return them back to the main menu.

What is the best way to set the original MP3 file to play only the first time the user enters the scene and not subsequent times?

Example:

User enters reports scene - play MP3
User clicks on report 1 - user is forwarded to report scene - when the scene is done they are automatically sent back to the reports scene - MP3 should not play

Any ideas? Thanks ahead of time!

Shawna
05-01-2002, 08:50 AM
Brandi,

This can be done using an Event Object. Here are the steps.

Place an Event Object in your Scene set at 0.0 seconds. In the condition builder, you want a custom condition that says the following:

If Global(Number1) equals 0

This will check a global variable that we set. If the variable is 0, this means the user has not been to the Scene yet. If it is 1, then the user has been here. So set up the True and False Actions as follows:

True
Play Sound
Increment Global(Number1) {do this using the Perform Calculation Action}

False
{Leave Blank}

So, if the user has not been to the Scene before, the sound will play and the global variable will be incremented to 1. Then, if the user comes back, the sound will not play.