I'm writing an interactive novella. I'm creating sounds/music in FL Studio. So far, I've gotten audio to work well except for the fact that when a player returns to a given passage, the sound effect/music plays again.
This gets repetitive because some of the sounds are intentionally jarring. Is it possible to set it so that it only plays on first visit?
Example of what I've tried:
(if: (count: (history:), "Bianca") is 0[<audio src="Bianca Singing.mp3" autoplay>]
But it looks like HTML elements don't work with hooks. I get that this code would be redundant, but I figure it would be part of the logic I would use to get it to play only once.
I'm just starting out in programming. That's why I'm using Harlow, I guess. (Well, it looks great right off the bat, too)
Is there a workaround? Or would I use Java for this? (Which I don't know :P)
TY!!
Comments
warning: The array returned by the (history:) macro gets larger each time the Reader navigates from one passage to another. This means that each search for a particular passage name will take slightly longer the more passages a Reader has seen, which could cause a slight delay if the number of passages seen becomes large enough or if your story contains many checks.
You make want to use variables instead, the following assumes you have set $heardBianca to false at the start of your story.