You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sorry for the issue spam; should be the last one related to the mod I'm working on.
My mod does something like this:
audioStream = nil
if (seqID == SEQ_EVENT_CUTSCENE_COLLECT_STAR) then
audioStream = audio_stream_load("SEQ_EVENT_CUTSCENE_COLLECT_STAR.mp3");
elseif (seqID == SEQ_MENU_TITLE_SCREEN) then
audioStream = audio_stream_load("SEQ_MENU_TITLE_SCREEN.mp3");
...
end
if (audioStream) then
audio_stream_set_looping(audioStream, true);
audio_stream_play(audioStream, true, 1);
else
-- No override available. Play the SM64 music.
return seqID;
end
With the idea being that users can drop in a SEQ_EVENT_CUTSCENE_COLLECT_STAR.mp3 or SEQ_MENU_TITLE_SCREEN.mp3 file and the SM64 Midi sequence will be overridden with the mp3 file if it exists. If the override doesn't exist, audioStream returns nil, and the original Midi sequence is returned.
This works as-is currently, but it does result in a Your script has errors! pop-up when an override doesn't exist, as the audio_stream_load reports an error if the file is not found. I think the cleanest way to address this would be if I could do something like:
audioStream = nil
if (
seqID == SEQ_EVENT_CUTSCENE_COLLECT_STAR &&
mod_file_exists("sound/SEQ_EVENT_CUTSCENE_COLLECT_STAR.mp3")
) then
...
but as far as I can tell there isn't a function quite like that.
The text was updated successfully, but these errors were encountered:
Sorry for the issue spam; should be the last one related to the mod I'm working on.
My mod does something like this:
With the idea being that users can drop in a
SEQ_EVENT_CUTSCENE_COLLECT_STAR.mp3
orSEQ_MENU_TITLE_SCREEN.mp3
file and the SM64 Midi sequence will be overridden with the mp3 file if it exists. If the override doesn't exist, audioStream returns nil, and the original Midi sequence is returned.This works as-is currently, but it does result in a
Your script has errors!
pop-up when an override doesn't exist, as the audio_stream_load reports an error if the file is not found. I think the cleanest way to address this would be if I could do something like:but as far as I can tell there isn't a function quite like that.
The text was updated successfully, but these errors were encountered: