0 votes
by (640 points)
I have music playing in the first page of my game. I want it to stop when I load a save. where do I enter the code <playlist stop> to apply to the sidebar's load option?

Thanks a bunch.

1 Answer

+1 vote
by (65.8k points)
selected by
 
Best answer

You'll need to use the Config.saves.onLoad callback.  What you need to do within it depends on exactly which audio you wish to stop.  You mentioned wanting to stop a playlist, but I'd suggest stopping all audio.  For example:

Config.saves.onLoad = function () {
	$.wiki('<<masteraudio stop>>');
};

SEE: Config.saves.onLoad, $.wiki(), and <<masteraudio>>.

[EDIT] Updated to show the proper callback.

by (640 points)
helpful as always!
Welcome to Twine Q&A, where you can ask questions and receive answers from other members of the community.

You can also find hints and information on Twine on the official wiki and the old forums archive.

See a spam question? Flag it instead of downvoting. A question flagged enough times will automatically be hidden while moderators review it.
...