|Page (1) of 1 - 03/04/05||email article||print page|
Display Conditions in DVD Studio ProRedirecting menus based on prior user input
For our example today, we're going to create a project that uses a set-up menu, which will be the default menu that displays when the disc is first played. This menu will allow the user to select his or her language without relying on the DVD player's language configuration. But, since this setup menu is the main menu, it would also display every time the user hits the Menu button or finishes watching a track. We don't want that to happen, so we'll set up a display condition based on user input to ensure that the viewer only encounters this menu once and is redirected to the appropriate secondary main menu for as long as the disc is playing.
If you have not done so already, you might benefit from going back and reading our previous tutorials on scripting in DVD Studio Pro. Here's a list of our instructional articles on DVD Studio Pro to date.
DVD Studio Pro Scripting, Series 1
Part 1: General scripting information
Part 2: Creating an interactive quiz
Part 3: Keeping track of time
Part 4: Pausing and resuming a timer
DVD Studio Pro Scripting, Series 2
Part 1: The basics of working with SPRMs
Part 2: Bit-wise operations and binary number conversion
Other scripting articles
Scripting a dynamic 'play all' button
General design and authoring topics
DVDSP General Walkthrough
Customizing Button States
Highlights and Overlays
Fixing color shift (for DVDSP 2.0)
Motion Masks (custom patches)
Setting Up DTS Playback on the Mac
Creating Alpha Transitions, Part 1
Quick Tip on Stories
Alpha Transitions, Part 2
Delaying Button Highlights
Buttons over Video
Creating a "Play All" Button by Merging Tracks
The language scripts
First to our opening menu. Here we want to present the user with our language options, in this case English and French. Selecting a particular language will redirect the viewer to the appropriate menu and also record the choice in a GPRM.
So, for this, we're going to need two scripts--one for button 1 (English) and one for button 2 (French) to record the selection and jump to the proper menu--the English menu (Menu 2) or the French menu (Menu 3). This involves two commands per script.
Script 1: English. Create a script for your project (called "Script 1"). Change the default Nop command to Set GPRM. Set the Operation to "Mov," the Source type to "Immediate," the Value to "1" and the Target to "GPRM 1." This means that when this script is run, a value of 1 will be inserted into GPRM 1. The actual value we've set here is arbitrary. It's just something we'll refer back to later.
Then add a second command, this time a Jump command. Set the target to Menu 2, which, for the sake of argument, is our English menu.
That's it for the first script.
Script 2: French. Now duplicate your first script by right-clicking or Control-clicking on the script in the Outline tab and selecting "Duplicate" from the contextual menu.
Select the new script ("Script 2"). Then, in the Script Editor, change the first command's Immediate value to 2. And, for the second command, set the Jump to "Menu 3."
Now simply connect Script 1 to Button 1 and Script 2 to Button 2 by dragging the scripts over their respective buttons in the Menu window.
When Button 1 is selected, it will change the value stored in GPRM 1 to 1 and jump to Menu 2. When Button 2 is selected, it will change the value in GPRM 1 to 2 and jump to Menu 3.
And that's the basic setup.
Setting up the display conditions
Now we want to make sure that whenever the viewer hits the Menu button on the remote or whenever a track ends and jumps back to a menu, the proper menu is displayed based on the language the user has chosen.
The first step is to prevent Menu 1--the language selection menu--from being viewed at all after the initial selection is made. To do this, select Menu 1 in the Outline tab. Then, in the Inspector palette, click on the Advanced tab. At the bottom, you'll see a checkbox labeled "Display Condition." Check this box. Then you need to set the display condition. Set it to "GPRM 1 = 0." This means that this menu will only display if GPRM 1 is zero, which is the default state until a user chooses a language, which will also change the value in GPRM 1 because of our scripts.
If GPRM 1 does not equal 0, then the menu won't display. This means you need to set an "alternate target." From the list of available alternate targets, choose Menu 2. This isn't necessarily where the user will want to jump to, but we'll cover that next.
Now select Menu 2 (the English menu). And you're going to set a display condition here too. Set it to display if GPRM 1 = 1. If GPRM 1 is 1, it's because the user has selected English for his or her language, so we'd want this menu to display. Then, for the alternate target, set it to Menu 3.
For Menu 3, you're going to set a display condition "GPRM 1 = 2." And set the alternate target to Menu 2.
And that's it. Try it out. In SImulator, your first play will be your language selection menu. Select a language, and you'll go to that particular menu. Hit the Menu button, and you won't be taken back to the language selection menu, but rather stay where you are. Only by ejecting the disc and replaying it will you be able to make another selection.
Of course, you might want people to be able to go back to the language selection menu at some point, so you could always add another button to the submenus that would change GPRM 1 back to 0 and then jump to Menu 1, but that's up to you.
If you have any further questions, be sure to visit me in our DVD Studio Pro forum by clicking here.
Related Keywords:dvd studio pro, apple, dvd authoring, display conditions, redirecting menus
Source:Digital Media Online. All Rights Reserved