|
Beth Cataldo, May 1, 2007 |
| Assignment
#13 - Creating Scripts
1. Open the project that you created for the Track and Story Assignment (#9), which you should have a copy of on your hard drive. 2. Add a script to the project. 3. Double click the new script to open up the Script Editor. 4. In the Inspector, name the script Jump to Loop Point. 5. In the Script Editor, select the first line of code (NOP). The Script Inspector should appear. 6. In the Script Command
Inspector, choose Jump as the command. 8. Select the Start At Loop Point checkbox. 6. Simulate to see if this works. You can put this script anywhere that it would jump back to the main menu. For this exercise, attach it to the four tracks where you were jumping back to the main menu. Randomly Playing Tracks For this script, we'll use the same project. It should have four tracks. The script will randomly choose one track to play once a menu times out after it has been active for a set amount of time. To create a Random Play script: 1. Create a new script. 2. Double click on the script to open it. The Script Editor opens and the Script Inspector appears. 3. In the Inspector, name the script Random Play. 4. In the Script Editor, select the first command line (NOP). The Script Command Inspector appears 5. In the Script Command Inspector, choose Set GPRM as the command. 6. The configure the set GPRM command: * Choose "ran"
as the Operation (for random) 8. In the Script
Command Inspector, choose Jump as the command. 12. You need to configure the menu's timeout setting by selecting the menu in the and then clicking the General tab in the Menu Inspector. Choose Timeout from the At End pop-up menu and enter a value (in seconds) for the timeout. Choose this script (Random Play) from the Action pop-up menu. What this does: Each time this menu sits idle for the specified amount of time, the script starts, generates a random number and then plays one of the four tracks. Once the track ends, it will jump to the asset specified by its End Jump setting.
|