Tutorial: Page (3) of 4 - 10/12/04 Email this story to a friend. email article Print this page (Article printing at MyDmn.com).print page facebook

DVD Studio Pro Scripting, Part 2

Creating a score counter for interactive quizzes
Script 2: Correct
Our second script is a little more involved, but no more difficult. It will be used for the correct answers in our quiz. And it needs to do three things: add one to the score, add one to the question counter and decide where to go from there after the user chooses the correct answer. Where it needs to decide to go is either the next question or one of the final result screens, depending on the score. (The particular method described below is efficient in some ways, in that it allows us to use just one script for all of the buttons corresponding to correct answers; but it's also a little bit clumsy. See if you can figure out why. At any rate, it gets the job done!)

To begin, we need to add 1 to each of the GPRMs that we're using. We add 1 to GPRM 3 to add to the user's score, since this script is used for a correct answer. And we need to add 1 to GPRM 4 so that the script will know which question to jump to next. These first two commands use the "Set GPRM" command. But instead of using the "mov" operation, as we did in the previous script, we'll be using the "add" operation, which literally adds the number we choose to the base value set in the previous script. And the effects will be cumulative over the course of the quiz. Here's what these first two commands look like.

Next we want to use the script to determine whether we have a winner. For this script, the quiz will jump to the "Winner" menu as soon as the score reaches 4. So we'll use the Jump command and set the target to the menu called Winner. But we also need to do some checking to make sure that we do indeed have a winner. To do this checking, select the "Compare Command" checkbox. And set the values as follows.

These tell the program to jump to the Winner menu only if the score (as represented by GPRM 3) has reached 4 or higher. If it hasn't yet reached that number, this line will be ignored, and the next line will be read.

Page: Prev Page 1 2 3 4 Next Page

Related Keywords:apple dvd studio pro, dvdsp, scripting, interactive, quiz, game


Our Privacy Policy --- @ Copyright, 2015 Digital Media Online, All Rights Reserved