DVD Studio Pro - General Scripting Information

background image

General Scripting Information

There are a number of good practices to keep in mind when creating your scripts:

Plan your GPRM partitioning: Partitioning one or more of the eight 16-bit GPRM registers

can add a lot of flexibility to your script writing by making many GPRM registers available
to be used. However, keep in mind that some scripting configurations and display
conditions require full 16-bit GPRM registers. Also, when you import a script item
description, any GPRMs used by the script must be partitioned exactly the same as they
were when the script was originally created. To ensure compatibility, it is a good idea
to consistently partition your GPRMs the same way for each project. See

General Purpose

Register Memories

for information on saving and loading GPRM configurations.

Don’t forget about display conditions: Menus, tracks, and stories can all have display

conditions applied to them. Display conditions work a lot like a simple pre-script—they
determine whether the element should play, and if not, provide a jump to an alternative
element. One advantage of a display condition is that it is part of the track and is placed
in the same video title set (VTS) file as the track—by default, all scripts are placed in
VTS 1 (though you can move them to the track’s VTS with the VTS Editor). In some
cases, there could be a slight delay as the DVD player jumps from one VTS to the other
to run a script. An additional advantage is that a display condition executes whether
you jump to an element’s root or to a part of it (such as a button or marker). See

Pre-Scripts

and

Display Condition

for more information.

There are many ways to do the same thing: When creating your script, you will often find

that there are alternate ways to accomplish the same task. The simplest approach is
often the best, but other considerations, such as a lack of available GPRMs, may force
you to be creative in your script writing. Sometimes it is better to create several small
scripts rather than one large one that covers all situations.

Make sure the script has a way to end: It is important for the script to have an exit point

that terminates its running and returns to playing the disc. For example, if you run a
script that only uses the set command to configure some registers, the DVD player will
just sit and wait for the script to finish, which it never will.

You create the exit point by using one of three commands: jump, resume, and exit
pre-script. You can use a jump command in any script; however, you can use the resume
and exit pre-script commands only in specific script types. See