Jump to content

OOT/Majora's Ocarina

Overview
Creator: Emily Added: 31 Jul 2018 Tags: FFC, Global, Item, Misc
Rating[?]: Rating: 3/5 (1 rating)
View Script
Information

Description Setup Reviews Comments

Step 1: Change the constant values to your settings. The constants that must be changed can be easily found with CTRL+F "//CHANGE//", though a list of these values is:

NOTECOMBO_A, NOTECOMBO_DOWN, NOTECOMBO_RIGHT, NOTECOMBO_LEFT, NOTECOMBO_UP:
A combo to be displayed during ocarina playing to indicate the given note having been played.
The combo will be displayed near the top-middle of the screen on Layer 6. No layer screen setting is required.
NOTECSET_A, NOTECSET_DOWN, NOTECSET_RIGHT, NOTECSET_LEFT, NOTECSET_UP:
The CSet to display the corresponding NOTECOMBO in.
NOTESOUND_A, NOTESOUND_DOWN, NOTESOUND_RIGHT, NOTESOUND_LEFT, NOTESOUND_UP:
These may be left at their default values of 195-199, or changed to whichever SFX id you want to play when the given note is played.
SFX_ERROR:
An SFX to be played if there is an error (Trying to make the scarecrow's song identical to an existing song, or playing an invalid song)
SONGMIDI_ constants:
A MIDI id for each song. If you do not intend the player to learn a given song, the ID may be set to 0. Otherwise, set this to the MIDI id of the song.

There is a section marked with //CHANGE// which asks how many frames your midi takes to play. For songs which you do not have a MIDI set for, leaving this at the default 20 is fine. If you set a MIDI, you MUST set this value properly- setting this too low will cause your MIDI to be cut off, setting it too long will make the player stuck standing still in silence after the MIDI is over.
Step 2: Add custom songs (Optional, requires scripting knowledge)-
For this, you want to CTRL+F "//CUSTOMSONG//" and duplicate whichever part of the code is needed for a song there. Mostly, you will just be creating an extra SONG_, SONGSOUND_, and SONGNOTES_ variable, and then copying a bit of code and switching the existing variables to the one you created.

Step 3: Add song functionality (Optional, requires scripting knowledge)
By default you can set it up so that songs can trigger secrets. If you want them to do anything else, you need to script it yourself. In the activateSong() method, there are various lines which begin with "//INSERT CODE//". Put whatever code you want to run when the song activates here. You can use this to tie into a custom external script, or do pretty much anything, given that you have the scripting know-how.

These are all the steps before compiling the quest into ZQuest.

QUEST SETUP STEPS:

Import the 3 FFC Scripts, 1 item script, and the global script.

Create a custom item of a custom item class, and attach the item script Ocarina.

Add the FFC script LearnASong to a screen. Give the song id you want it to teach Link as the first parameter. The song ids are the SONG_ constants. This FFC should be visible, perhaps looking like a music sheet or somesuch. It does not need to be, but it should- it will become invisible once Link knows the song it teaches.

Add the FFC script MakeScarecrowsSong IF you wish to use the scarecrow's song. Link must stand on the FFC and play a song of his choice, which will become the scarecrows song. This song may not be identical to another existing song, and must be 8 notes in length.

Add the FFC script SongTriggersSecrets anywhere you want playing a song to trigger secrets. The first parameter is the Song id from the SONG_ constants. The second parameter should be 1 for the secrets to be permanent or 0 for them to be temporary. The third parameter should be 1 to require Link to stand on the FFC when playing the song or 0 for Link to be able to play it anywhere on screen.

And finally, if you custom-added any song functionality, do whatever you need to do to set that up... I can't exactly give instructions because that would be part of your own addon to this script.