This is an auditory "hello world" tutorial for Zelda Classic. It will show you how to script the iconic Zelda unlock chime to play upon loading a quest.
Part I: Writing & Compiling the Script
1. Run notepad and create a file called "unlock.zs" containing:
Code:
// This script will play sound effect #27 (the secret sound, by default).
ffc script SecretSound
{
void run()
{
Game->PlaySound(27);
}
}
2. Launch zeditor.exe
3. File->New
4. ZScript->Compile ZScript
5. Click "Load" and select unlock.zs (click Yes to proceed with erasing the current buffer)
6. Click "Compile" (should return code '0' for success and you will hear the unlock chime)
7. Click OK
Part II: Using the Script
At this point, you should see the "Assign Compiled Script" editor-modal window.
1. Click SecretSound in the right listbox and then click the << button in-between the listboxes to assign it to Slot 1
2. Click OK (You should get a msgbox that ZScripts were successfully loaded into script slots and hear the unlock chime again)
3. Click OK at the "Init Script Changed" msgbox
4. Screen->Freeform Combos
5. Click "Edit"
6. In "Data" tab, click the picturebox to the right of "Link to" dropdown
7. Select any combo other than combo #0 (which is totally black) and Click Done
8. You should see the combo you selected appear in the picturebox; now goto "Script" tab
9. Select "SecretSound (1)" in the Action Script dropdown
10. Click OK (you should see the "Choose Freeform Combo" window appear)
11. Click Done (all modal dialog boxes should be closed now)
12. Quest->Test
13. Save your quest somewhere & Click OK
14. In the "Test Quest" window, click "Test" button
15. Listen for Zelda unlock chime as quest loads