Tutorial: Page (4) 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
The next line in this case tells the program to move to the next question, "Question2," if GPRM 4 is equal to 2. If not, then it moves to the next line, which tells the program to move to "Question3," if GPRM 4 is equal to 3. And so on down the line. This is the reason we're adding 1 to GPRM 4 each time this script is read: It tells the script which question to move to next.

Finally, we're also going to throw a line in here to tell the script to jump to the "Loser" screen when all the questions are completed and if the user's score does not equal 4 or greater. This is the somewhat clumsy part of the script, but it works; you'll have to trust me on this one. This is yet another Jump command, this time targeting the "Loser" menu, using a Compare Command to check to see whether GPRM 4 is equal to 6. There's only one case where this is possible: when all the questions are answered and when the user's score does not equal 4 or greater. And in order for this to work, it should be the last command in this script. Here's what it looks like.

It's weird, but it works. At any rate, this script is now done, and you can go ahead and connect it to the buttons in your menus that represent correct answers.

Script 3: Incorrect
Finally we come to the last--and easiest--script in this project. This is the script that will be connected to all of the buttons representing incorrect answers. It is identical to Script 2 in every way except one: It does not include a command to add 1 to GPRM 3 because, of course, GPRM 3 is keeping our score, and there's no reason to add 1 to the score for an incorrect answer. So, if you'd like, you can simply duplicate the "Correct" script, rename it "Incorrect," and then delete the first command. (If you're using DVD Studio Pro 3, you can also just copy the commands from the previous script and paste them into this one, leaving out the first command.)

So then all you need to do is to connect this last script to all of the buttons representing incorrect answers, and you're done. Again, do this by simply dragging the appropriate script from the Outline tab onto the appropriate buttons in the menu viewer.

Again, next time we'll look at incorporating a timer into this quiz. In the meantime, if you have any questions, be sure to visit me in the DVD Studio Pro forum by clicking here.

Page: Prev Page 1 2 3 4

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

To Comment on This Article, Click HERE

Most Recent Reader Comments:
  • DVD Studio Pro Scripting, Part 2 by DMN Editorial at Oct. 12, 2004 11:55 am gmt (Rec'd 5)

    Click Here To Read All Posts
    Must be Registered to Respond (Free Registration!!!, CLICK HERE)
  • [ServletException in:/common/ads/links.jsp] Unable to load class for JSP'

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