GPRM Counters

By Hal MacLean

Download the project files here

GPRMs are the main storage areas we use when we are writing scripts. They are general parameter registers, which means we can put pretty much whatever we want in to them (in terms of values to help when calculating things). However, GPRMs can have a different function - they can also act as counters.

In DVD Studio Pro the property inspector gives you access to all of the available settings fro whatever item you are concerned with. To access the GPRM settings, you need to create a new script and then click on the ‘NOP’ (No Operation) statement which is placed by default on line 1. When you do so you can access the commands interface and from there set the features that you want.

To set a counter, use the ‘GPRM Mode’ option and then select the radio button for either ‘register’ (the default setting) or ‘counter’. If you choose counter, then the GPRM will behave very differently to normal. Instead of you placing values in to it, the GPRM will automatically increment its value by one every second. In effect, it counts upwards in one second intervals.

This is only really useful if you want to have the user respond to a menu prompt within a certain amount of time - for example, answer a quiz question within a time limit, but you can also use conditional statements with them as well. For example, set a GPRM to a counter *if* some other GPRM has a particular value. Again, this has applications if you are seting up a quiz, but it could also be used for playing an Easter Egg on your disc.

gprm counterThe download files a counter to see if the user responds to a prompt within five seconds. To set it up, the counter script is set as the first play and then the viewer goes to the menu. If they activate the correct button in time, the ‘egg’ plays. Otherwise a second menu appears and the only choice is the main clip itself.

Remember that this in no way prevents your content from being found and played - your material cannot be so simply protected, unfortunately.

You could also use a counter in other ways, for example to automatically play a clip if a certain amount of time has elapsed (other scripts will be needed to make this happen) - you might use end jumps on chapter markers to go to a script to evaluate the amount of time that has passed since the timer began. If it has been long enough the disc could automatically go to a menu to show some additional feature. If the menu then times out and goes to a ‘resume’ script, the user will go back to the original track at the marker they left from.