PDA

View Full Version : Scripts Changing Midis.



Russ
01-30-2008, 02:01 PM
Recently, the ability to have a script change the current midi was added. I have a question about it. How long will the new midi play? Will it change back to the dmap midi when you change screens? Or will it when you change dmaps?

Russ
02-07-2008, 12:52 PM
*Bumb*

Um, anyone want to help me? Please.

DarkDragon
02-07-2008, 07:33 PM
I don't know; test it out ;)

There are some actions which will reset the MIDI for sure, such as changing DMaps. Other things you should test, since there's a good chance of resetting the MIDI: dying, entering a cave/passage warp, getting a fairy heart refill.

ScaryBinary
02-07-2008, 07:38 PM
I did a preliminary experiment by using the PlayMIDI function in a ffc script:

ffc script PlaySong{
void run(int MidiNumber){
Game->PlayMIDI(MidiNumber);
}
}
With this approach, the MIDI only played on the screen in which the ffc was defined. The MIDI started when Link entered the screen, and quit when Link exited the screen (either by a standard side-scroll, or through a tile warp). It didn't dawn on me until now to see if the MIDI kept looping if I just stayed on the same screen.

When I defined a MIDI for the whole DMap, that MIDI played until Link entered the screen with the ffc script - then the scripted MIDI played. When Link exited the screen, the DMap MIDI started playing again.

You might be able to acheive different results depending on how you call the PlayMIDI function....I haven't tried getting it to play in a global script or item script. Go ahead and run a few experiments! I haven't ever played too much with MIDIs, but the Game->PlayMIDI() function appears to take at least one argument, the first of which is the number of the MIDI loaded in the Quest > Music > MIDIs... window (in the script above, I passed the MIDI to play as the D0 argument in the fcc script).

Joe123
02-07-2008, 07:40 PM
Perhaps if you set the ffc to carry over, the MIDI would aswell?

Or maybe you'd need a little bit of a while loop to keep it going.

Russ
02-08-2008, 02:48 AM
Perhaps if you set the ffc to carry over, the MIDI would aswell?

Or maybe you'd need a little bit of a while loop to keep it going.
The carry over FFC seems like it would work. Although it might restart the midi very new screen. But I'll try it out. Thanks guy.

bigjoe
02-08-2008, 01:14 PM
I think that it's present behavior may be affected by the somewhat newly added "Screen Midi" feature. You are on one screen in which the midi is changed, but then you travel to another screen that has "Use DMAP Midi", and it reverts to the the Dmap Midi. This would be counterproductive if, for instance, you wanted to make a choke point within a dmap that changed the midi for a specific area. PlayMIDI would still be useful if you just want the MIDI to play for a specific event. For someone to create choke points as mentioned above, the functionality would either have to be changed, or there could be a new function called ForceMIDI, which, once used, would turn the "Screen Midi" feature off until the DMap were re-entered or exited

DarkDragon
02-08-2008, 07:05 PM
Well, what you really want is something like
Game->DMapMidi[]
which would permanently set the DMap midi. Something good to request post-2.50.