Adding Music that plays throughout, but then different music for combat

Twine Version: Harlowe 3.3.6

Hello, all! I’m totally lost as to where to even start with this one. I have a small game and two pieces of music, one for standard reading and one for combat sections.

Standard: I’d like to have this play consistently over all sections EXCEPT combat, and not restart every time a new section is accessed.

Combat: I’d like this to stop the standard music and take over but then stop once a non-combat section is accessed, with the Standard music resuming.

I’m guessing I use the style sheet for the primary music (referencing files included under the index) and different code within the specific combat sections, but I don’t even know where to start with the commands. I have looked at other topics and read the Harlowe menu but I’m confused and was hoping to get some more direct assistance here.

Thank you in advance!

When if comes to Harlowe 3.x and all things Audio the general advise is to add Chapel’s Harlowe Audio Library (HAL) addon to your project, and to use its features and custom macros.

warning: The Passage Editor Extension supplied by the Harlowe 3.x Story Format only knows about Harlowe’s own core/built-in macros. So its syntax highlighter will display a warning when it encounters any custom third-party macro usage in a Passage, even when that custom macro is actually available for use.

You’ll most likely want to use this…

Harlowe Audio Library

Everything you need to know is documented there.

Harlowe doesn’t support audio with its native functionality so you’ll need to use that 3rd party HAL add-on. It has features that can detect if music is playing or not, stop the current one and play a new one and lots of other features.

Your only other alternative is to code your own in JavaScript, but that would require a much deeper understanding of web technologies.

Let us know if that helps and if you have any other questions. :slight_smile:

Edit: Damn it! Ninja’d by @Greyelf.

Thank you very much! I finally had a chance to implement Harlowe Audio Library today and have everything up and working very nicely!

1 Like