|Page (1) of 4 - 10/26/04||email article||print page|
DVD Studio Pro Scripting, Part 4Pausing and resuming a timer
This specific function is not a particularly difficult one. However, we're pretty deep into this project now, and I'm not going to review all of the steps we've taken to get to this point. Therefore, if you're just joining us, you'd do well to go back and complete our previous scripting tutorials before moving into this one. Follow these tutorials exactly as they're given, and everything will make sense. As usual, these tutorials are not meant to illustrate the best way to create your own project--after all, I can't know how you want to structure your DVD--but rather to show you how scripting commands work in real-world examples so that you'll be able to extrapolate the information for use in your own projects.
? General Introduction to Scripting
? Scripting, Part 2 (first in the interactive quiz series)
? Scripting, Part 3 (second in the interactive quiz series)
Note: You can download the current project at the end of this article. It contains all of the completed scripts, menus and graphics used in this tutorial series so far.
And now to the task at hand.
The basic setup
For our current project, we have a timed, score-based quiz centered around several menus.
1. A general introductory menu that kicks off the quiz. Clicking the "PLAY IT NOW!" activates the script called "Start Quiz." This script sets the current time to 0 using GPRM 2; sets the current score to 0 using GPRM 3; sets the current question to 1 using GPRM 4 so that the script knows which question in the quiz comes next (and so that we don't have to write a separate script for each question); and jumps to Question 1 in the quiz.
For this tutorial, the Start Quiz script will remain unchanged.
2. We also have five individual menus that contain the questions for the quiz and several buttons each for the choices the user can select. For a correct answer, the script "Correct" is played, which adds one to the score (GPRM 3); adds one to the question count (GPRM 4); checks the time (stored in GPRM 2); and forwards the user to the next question or to the Winner or Loser screen, depending on the current time and current score. Incorrect answers invoke the "Incorrect" script, which does all of the above but does not add one to the score.
This setup will need to be modified for this part of the tutorial. To the existing set of menus, we're going to add two new ones: one to notify the user that he or she has given the correct answer and one to notify the user that he or she has given the incorrect answer. (You could also create individual screens for each correct or incorrect answer to give an explanation or a hint for the next time the user takes a quiz; or you could show a track from the movie illustrating the answer to each question. But I want to keep things as simple as possible here.)
We will also have to create two additional scripts consisting of two simple commands each (stopping the timer and jumping to the Correct or Incorrect splash screens) and also add one command to our existing Correct and Incorrect scripts. We'll get to these steps in the next section.
3. Finally, we also have our concluding splash screens, one announcing that the user has succeeded in the challenge, the other announcing that the user has lost the challenge. These will also remain unchanged.
Related Keywords:apple dvd studio pro, dvdsp, scripting, timer, countdown, interactive quiz
Source:Digital Media Online. All Rights Reserved