|Page (1) of 2 - 06/09/05||email article||print page|
Conditional Chapter Jumps in DVD Studio ProScripting dynamic chapter playback and a 'play all' button
It sounds tricky, and, normally, it might be even more time-consuming than than creating individual stories. (For example, many might create individual scripts for each chapter jump.) However, there are always ways to economize the scripting process and make the whole thing dynamic. I'll show you two such ways in this tutorial that will allow us to use just three scripts for the entire project, no matter how many chapters you might have. Using these scripts, we can jump to any chapter from our chapter index menu without having to target each one individually.
For my project, I happen to be using Apple DVD Studio Pro 4, but any version as early as version 2.0 will work just fine. One thing to keep in mind is that we will be using scripts for the end jumps of individual chapters, which will cause a stuttering in playback within Simulator. However, this stuttering does not seem to occur when the final disc is created and played on a standalone player. (If this is something that could potentially cause you problems, you may want to opt for the Story method. However, typically when you're creating a disc that will play back one chapter at a time, you're working with some sort of training material where slight hiccups--if they even occur at all--probably won't be a problem.)
Now, it's a new policy of mine to provide projects for my DVD Studio Pro tutorials. So, if you'd like to have one to work with just to make it easier to follow along, please feel free to download this one via the following link.
Download: DVDSP_Dynamic_Chapters.zip (80 KB, includes assets)
This is a bare-bones project composed of stills for the track, which has four chapters. (Each chapter shows the name of the chapter in the track.) There are two menus--one for the "play all" button, and one that's a chapter index. It also includes the three scripts used in the project. This project was created in DVDSP 4 but will open in previous versions down to version 2.
This project assumes that you're using one track and only one menu for your chapter index. The process will be different for multiple chapter index menus and multiple tracks. You should be able to figure that out once you see the basics here.
Script 1: Creating the 'Play All' button
The most simple step in all of this is to create a script for our "Play All" button. Normally we wouldn't need to use a script at all, but we will be using conditional statements in the other scripts, so we need to set a value in two of our GPRMs before we move on to playing the entire track.
To do this, create a new script (Project > Add to Project > Script). Change the name of the new script to "Play All," and open it up in the Script Editor tab. This particular script will use three commands.
Command 1: Set GPRM. For the first command, we're going to set GPRM 0 to 0. In this way, whenever this button is clicked, whatever is stored in GPRM 0 will be reset to 0. To do this, change the default Nop command in the Script editor to Set GPRM. Set to Operation to "mov," the Source Type to "Immediate," the Source Value to "0" and the Target to "GPRM 0."
Command 2: Set GPRM. For the second command, we need to clear out the value stored in GPRM 1. There's nothing there yet, but there will be, so we need to clear it anytime the "Play All" button is pressed. So create a second command by pressing the "+" symbol in the Script Editor, and make it the same as the first command, except that the Target will be "GPRM 1."
Command 3: Jump. Now we're going to add a second command to the script. Hit the "+" button in the Script Editor to add a new command, and set this command to "Jump." Set the Target to your track. (In my case, the track is called "Feature.")
And that's it. Just connect this script to the Play All button in your menu, and you're done.
Script 2: Creating the dynamic 'Play Chapter X' buttons
Now we get to the exciting part, which is the creation of a single script that we can use to jump to any chapter. The key to this script is the position of the buttons in your chapter index. The button that will link to Chapter 1 must be "Button #1." The button that links to Chapter 2 must be "Button #2." Et cetera. (You can find out the order of your buttons by looking in the Connections tab. The first button listed is button 1; the second is button 2; etc. If you've already created buttons that knock these chapter buttons out of order, delete those buttons and then recreate them. The chapter buttons must be the first buttons on the page, and the must be in order.)
Okay, so here's what this script is going to do. It's going to set GPRM 0 to 1; it will then determine which button is being pressed; and, finally, it will then perform a little math and jump to the desired chapter based on that chapter's reference number. (All elements in a DVD have numerical equivalent; you just don't see these. But once you know them, you can do some pretty tricky stuff with your scripts, as we're about to do.)
The first step is to create a new script, and rename it "Play Chapter." Then use the following commands in it (six total).
Command 1: Set GPRM. The first command will be used as a reference later on. It will set GPRM 0 to 1 (as opposed to our "Play All" script, which sets GPRM 0 to 0).
Command 2: Set GPRM. Now we move on to setting a value in a separate GPRM. For this one, we'll use GPRM 2. And for the first of our Set GPRM commands, we'll set it based son the currently highlighted button. This is the key to this whole script, as, once we do this, we can perform math to arrive at a value that will take us to a particular chapter. The currently highlighted button is a value stored in SPRM 8. So for this command, we'll set the operation to "mov," the Source Type to "SPRM," the Source Value to "SPRM 8" and the Target to "GPRM 2." So, at this point, whichever button is currently highlighted, its value will move to GPRM 2.
Command 3: Set GPRM. For the third command, we're going to begin doing our math. Buttons in any given menu have a specific numerical value. They start at 1024 and increase by 1024 each. So button 1 is 1024; button 2 is 2048; button 3 is 3096; et cetera. So what we want to do is divide our button by 1024 to give us a more simple number, like 1, 2, 3, 4, etc. To do this, after you add your Set GPRM command, set the Operation to "div" (divide), the Source Type to "Immediate," the Source Value to "1024" and the Target to "GPRM 2."
Command 4: Set GPRM. Now we want to add another Set GPRM command, but this time we're going to use a subtract operation to subtract 1 from the current value stored in GPRM 2. The reason for this is that we're determining a value that will take us to a particular chapter, but the chapters are offset by 1 in their numerical references. So we'll need a 0 result here to take us to chapter 1, a 1 result to take us to chapter 2, a 2 result to take us to chapter 3, etc. (More information on this follows in the next step.) The way you do this is to set the Operation to "sub" (subtract), the Source Type to "Immediate," the Source Value to "1" and the Target to "GPRM 2."
Related Keywords:apple dvd studio pro, dvdsp, dvd studio pro 4, scripting, free scripting tutorial, chapter selection, end jumps, chapter markers
To Comment on This Article, Click HERE
Most Recent Reader Comments:
Click Here To Read All Posts
Must be Registered to Respond (Free Registration!!!, CLICK HERE)
Source:Digital Media Online. All Rights Reserved