Scripting a return to a menu
By Hal MacLean
From time to time you may need to use several different menus to access the footage in a single track. Since a track can only have one menu call, you can find yourself wondering how to get back to the right menu each time. Fortunately the answer is fairly easy, and the following method involves a few scripts (although you *may* not need to script it… more on that later).
Before we start, let’s think about what has to happen. I’ll assume you have three menus and for whatever reason you need each to go to the same track - it could be a set of scene selection menus, for example, with buttons to start at different chapter markers.
The first thing you need to do is set up a script for each menu which identifies the menu numerically. All I do here is add three scripts. In each I use the script editor to write the following lines:
mov GPRM0, 1 Jump Menuname1
You have to change the value in the first line for each script, and remember to use the correct name for each menu. Script 2 would look like this:
mov GPRM0, 2 Jump Menuname2
You can see that if I go to this script after going to the first one, that GPRM0 will get a new value written in to it. Great! If this is working then we are almost finished! What you need to do last of all is create the main script which is where you put the final set of statements which govern where you end up. This last script must be set as the menu call AND as the end jump for the track. The chances are that if a viewer starts to play back from a menu and wants to return to a menu they’ll press the menu key on the remote… this is a ‘menu call’. Similarly, if the track completes playing you might like to take the viewer back to the menu they last left, which this system will do for you.
The last script only needs a bunch of ‘jump’ statements with some conditions set. With the three menu example, you need just three lines:
Jump menuname1 If (GPRM0 = 1) Jump menuname2 If (GPRM0 = 2) Jump menuname3 If (GPRM0 = 3)
So - how do we connect all this together?
The first scripts MUST be set so that they get called before a menu appears. You could do this by making them ‘pre-scripts’ but this has disadvantages when you get more advanced. The better way is to set any button on any menu that should take you to a different menu to go to the correct script instead. The second line of the script will make sure the viewer ends up where they wanted to be, but the first line sets up the value we rely on later.
Let’s say your viewer starts at menu 1 but uses a button on that to move to menu 2. Instead of setting the button target to be for the menu, set it to be for the script instead… it’s that easy. On menu 2 they want to go back to menu 1… set that button target to go to the script for menu 1 instead of the menu itself. Do this for any button that should take the viewer to a menu and you will always have the last menu value in the GPRM for whenever you need it.
