Hey there guys, so I have tried countless things, tried default macros and nothing is working for me... I just want to be able to play music(loops) and sound effects(nonloops), but for some reason NOTHING is working.. This is the setup I have(all in the StoryInit Passage):
<<cacheaudio track_id source_list>>
<<cacheaudio "BGMDanger" "media/audio/danger.mp3">>
<<audio track_id action_list>>
<<audio "BGMDanger" play>>
So basically the regular macros, I always get an error saying:
Error [StoryInit]: <<audio>>:no track by ID: track_id
I want people to be able to download my game and play it offline or online, so I have the game file and a folder called:
media, then audio, then I have my music in there, called: danger.mp3
Any thoughts on how I can get my audio to work??
Comments
In your storyinit passage. That's just an example of the format. You're getting further errors because you also don't have quotation marks around it, so you're confusing everything that comes next, since you're opening the macro but never closing it.
Just delete those lines.
Also, don't put <<audio play>> macros in StoryInit. If you want something to be playing at the start, put it in the Start passage.
Might be an issue with Twine 2 blocking the file. Try downloading Twine 1.4, make a small test story and see if it works.
If you're using the app version, then you have to Publish your story and test that, as the app itself doesn't support audio, so the Test and Play modes cannot play audio.
OMG I love you thank you man!! Just one more question though.. when I am uploading my file to a website or something, it says I must upload an index.html file, do I have to name my game file index? or is there something missing, cause in my folder I just have the game file (name of game) and a media folder, holding all my music, so do I just rename the file index.html? Thanks