|
TUTORIAL TOPIC: SCRIPTING
TUTORIAL TITLE: SCRIPTING BASICS
There are a number of bscis things that are helpful to know before begininng to script. This tutorial will walk you through two important topics: How do I use a script, and When do I script?
Welcome visitor! Thanks for dropping by...
The complete contents of this Tutorial are available to anyone, but most of our tutorials are for
DVD Pro Club Members exclusively. If you like this Tutorial, why not join us today?
Some scripting basics you should know
How Do I Use A Script?
One of the first things to learn about scripting is what you can DO with the script.
Scripts can move you around the disc:
. •Navigate to a MENU (Jump To “MenuName”)
. •Navigate to a BUTTON (Jump To “MenuName::ButtonName”)
. •Navigate to a TRACK (Jump To “TrackName”)
. •Navigate to a MARKER (Jump To “TrackName::MarkerName”)
. •Navigate to a STORY (Jump To “TrackName::Story::EntryPoint”)
. •Navigate to a SLIDESHOW (Jump To “SlideshowName”)
. •Navigate to a SLIDE (Jump To “SlideshowName::SlideName”)
•Navigate to a SCRIPT (Jump To “ScriptName”)
Scripts can change what’s being seen, or heard, and control GPRMs:
. •Set an Audio Stream (1-8; Immediate, or GPRM-based)
. •Set a Subtitle Stream (1-32; Immediate, or GPRM-based) (On/Off)
. •Set a Video Angle (1-9; Immediate, or GPRM-based)
. •Set a GPRM (Variable) (mov, add, etc., Value to “TargetGPRM”)
. •Perform Conditional Branching (“Jump If...” commands)
. •Generate Random numbers to create random play!
. •Perform mathematical operations (+, -, *, ÷, divide modulo)
. •Perform Binary operations on bits (AND, OR, XOR)
. •Determine DVD operation/status (read SPRM commands)
. ...and SO much more...
. •Navigate to a Script from a Button (JUMP WHEN ACTIVATED)
. •Navigate to a Script from a Track (JUMP WHEN FINISHED)
. •Navigate to a Script from a Menu (TIMEOUT ACTION)
. •Navigate to a Script from a Marker (Chapter End Jump)
. •Call a Script from another Script (“Jump to Script”)
. •Call a Script before playing a Track, Story, Slideshow, or Menu
. •Call a Script in response to the Title, Menu or Return Controls.
. ...and of course, even more options exist.
When To Use Scripting
One of the first things to do with your project is determine if you need to use a script, or if you can instead utilize the built-in navigation of DVD Studio Pro. Many functions that appear to require scripting may be easily programmed using the built-in navigation instead! You may find, foe example, that Display Conditions may be used in many cases to target a specific button for highlighting, without using a Script!
As you review the list in the previous paragraph, it should be obvious that scripting is the means to enhance or upgrade the interactivity of your DVD, and really only needs to be used when the normal interactivity doesn’t suffice...
Here are a few typical times when you might use DVDSP Scripting:
• To perform Conditional branching in conjunction with a test i.e. “Play SlideShow ‘Catalog’ if GPRM0=1”
. • To generate or modify a random number ‘ran GPRM0, 255” (usually used with conditional branching – “Jump if”)
. • To initialize (set) a GPRM value, or perform a function on a GPRM (mov, swap, add, subtract, multiply, divide, divide modulo)
. • To perform Binary logic operations on a GPRM value (AND, OR, XOR)
. • To create and use a “Play All” type of project. This uses a GPRM (variable) and conditional branching...
. • To “password protect” some content This requires setting and testing GPRMs (variables)
Of course, there are many more times when you might wish to use scripting - these are just a few of the most-used basics.
General Notes on Using Scripts
When a script is executed, it can do any number of things, but the last thing it must ALWAYS do is EXIT to another project Element – a Script needs to have an "escape clause" - a command to jump to some other Element where navigation may continue. If not, the script (and your DVD!) will STOP DEAD. Oops!
How to learn more about scripts
One of the best ways to really learn how Scripting works is to Simulate your DVD project with the Info pane revealed. When this Pane is open, you will be able to watch the real-time interpretation of the script commands, including seeing the evaluation of formulas, the changing of GPRM (variable) and SPRM values, etc. This is an INVALUABLE LESSON in how scripts control the innermost functions of the DVD, and I urge you to do this a lot while you are learning about Scripting.
That's It! - Enjoy this tutorial, and don't forget to rate it for others!
Bruce - "the Digital Guy"
|