Playing Sound/Music in Gamebook

sneenlantern
17 Oct 2012, 18:40
Hey first of all, I want to say this software is great! I wanted to make gamebooks since I used to read Grailquest and Choose Your Own Adventures as a kid!

Now, I want to apologize if this is a stupid question, but I've spent the last hour trying to figure this out and I just can't get it to work. I want to add a musical soundtrack to my gamebook. I suppose you do this by adding scripts directly into the code. I looked into the wikie, and it says you add this:

play sound (string file, boolean wait, boolean loop)


now, I know nothing about coding so I'm not sure how to input the info into this example. this is the code for my entire game:

<!--Saved by Quest 5.2.4515.34846-->
<asl version="520">
<include ref="GamebookCore.aslx" />
<game name="Space Wanderer">
<gameid>8aba4b93-69a5-455c-9aee-3f06d3ef1d86</gameid>
<version>1.0</version>
</game>
<object name="Page1">
<description>You awake naked in a cold room. Dim light descends from electric lamps above you. There are no windows or doors; but there is a hooded stranger watching you from one of the room's corners. You hesitate, and then speak:</description>
<options type="stringdictionary">Page2 = "Who are you?";Page3 = "Where am I?"</options>
<object name="player">
<inherit name="defaultplayer" />
</object>
</object>
<object name="Page2">
<description>This is page 2. Type a description here, and then create links to other pages below.</description>
</object>
<object name="Page3">
<description>This is page 3. Type a description here, and then create links to other pages below.</description>
</object>
</asl>


First, where do I input the command? I want it to play through page one and on until I tell it to stop. Is that possible? And how exactly do I phrase it? the name of the file is musicone.mp3, and I have put it in the same directory as my game file.

Thanks for bearing with me on this. I'm new, but love the medium, and I would really like to see if this is possible. That's the most complex thing I want to do, really.

Thanks again,
Matt

sgreig
18 Oct 2012, 07:56
<!--Saved by Quest 5.2.4515.34846-->
<asl version="520">
<include ref="GamebookCore.aslx" />
<game name="Space Wanderer">
<gameid>8aba4b93-69a5-455c-9aee-3f06d3ef1d86</gameid>
<version>1.0</version>
</game>
<object name="Page1">
<description>You awake naked in a cold room. Dim light descends from electric lamps above you. There are no windows or doors; but there is a hooded stranger watching you from one of the room's corners. You hesitate, and then speak:</description>
<options type="stringdictionary">Page2 = "Who are you?";Page3 = "Where am I?"</options>
<object name="player">
<inherit name="defaultplayer" />
</object>
<beforeenter type="script">
play sound ("musicone.mp3", false, true)
</beforeenter>
</object>
<object name="Page2">
<description>This is page 2. Type a description here, and then create links to other pages below.</description>
</object>
<object name="Page3">
<description>This is page 3. Type a description here, and then create links to other pages below.</description>
</object>
</asl>


Try that. It works with regular text adventure games. Haven't tried it with gamebooks yet.

Alex
18 Oct 2012, 09:21
That won't work as it's the main Core.aslx (for text adventures) that checks for a "beforeenter" attribute.

It could easily be reimplemented in Gamebook mode (you'll need to attach something to changedparent just as Core.aslx does)

Definitely one for the features list, would be easy to add to the gamebook lib.

sneenlantern
18 Oct 2012, 13:48
darn. well, thanks anyway.....