Your browser lacks required capabilities. Please upgrade it or switch to another to continue.
Loading…
alright today i'm gonna show you the Cool Things i found while making my twine
all of this is for sugarcube, so be sure to go into the menu and change your story format from harlowe (which is the default) to sugarcube 2.21 (which is the latest version) to use all of these
first you can add audio to these, which you probably already knew
the audio im using is a little loud, so be prepared for that.
[[gonna go over to the next one to start the audio|next]]okay now the music starts
<<audio "dog" loop play volume 0 fadein>>
the code is
<< audio "name of file" loop play volume 0 fadein >>
without the spaces after the triangle brackets
if you want it to just suddenly start, you drop the "volume 0 fadein" from the code.
if you want it to play only once, you drop the "loop."
the name of the file is whatever you named it in the StoryInit passage, which i will explain in a bit.
if you want your whole game to have music, you should pick something that loops seemlessly.
[[and it keeps going|next again]]<<cacheaudio "dog" "https://a.tumblr.com/tumblr_ny934mhEw31r3j55xo1.mp3">>
<<cacheaudio "nice" "https://a.tumblr.com/tumblr_n8rz34o6Yk1rjmdnxo1.mp3">>
<<cacheaudio "eee" "https://a.tumblr.com/tumblr_mtytgbTvSz1rc8p9uo1_r1.mp3">>and going
[[it will end soon do not worry|stop]]and done
<<audio "dog" stop volume 1 fadeout>>
to stop audio (and make it fade out) you use:
<< audio "name of file" stop volume 1 fadeout >>
(the audio takes a second to fade out, so you should wait for that to happen before you click to the next passage)
[[maybe you want it to just end suddenly|sudden]]you can do quick sounds too
<<audio "eee" play>>
that's
<< audio "name of file" play >>
you could make the sound effect loop and/or fade in if you wanted i guess. you use the same code for all audio.
and then do cool things like this:
<<linkreplace "hey click here" t8n>>boom surprise.
the code is
<< linkreplace "text you click" t8n >>text that appears<< /linkreplace>><</linkreplace>>
<<linkreplace "and if you dont want it to fade in...">>...you drop the "t8n" bit out of the code<</linkreplace>>
i hope you're ready because [[it's about to get wild|even more]]
easy it's the standard html code
<img src="http://i59.tinypic.com/2eekfu0.jpg">
that's
< img src="url goes here" >
without the spaces btw
[[oh yeah the StoryInit passage|last]]the StoryInit passage is where you put your audio files
for example the StoryInit for this very twine is:
<< cacheaudio "dog" "https://a.tumblr.com/tumblr_ny934mhEw31r3j55xo1.mp3" >>
<< cacheaudio "nice" "https://a.tumblr.com/tumblr_n8rz34o6Yk1rjmdnxo1.mp3" >>
<< cacheaudio "eee" "https://a.tumblr.com/tumblr_mtytgbTvSz1rc8p9uo1_r1.mp3" >>
without the spaces of course. the blank code is:
<< cacheaudio "name of file" "url of file" >>
as far as i know, your file has to be an mp3. i went with what i knew and made a tumblr blog specifically for hosting the audio i wanted to use for my game, and i will show you how all that works.
[[that's over here|mp3 get]]we can do that too
<<audio "nice" loop play volume 0 fadein>>
[[just wait|wait]](im letting it play for a sec for teaching purposes)
[[but it will stop now|stop nice]]tada
<<audio "nice" stop>>
if you want it to just cut off you go with:
<< audio "name of file" stop >>
you can make a playlist if you want, but since i used a song that looped i didn't see a point. if you want a playlist, <a href="https://www.motoslave.net/sugarcube/2/docs/macros.html#macros-createplaylist">you can check this out</a>
[[but that's not all|more]]<center><iframe width="560" height="315" src="https://www.youtube.com/embed/lCAaihBA12Y" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe></center>
i have no idea why the video is five minutes long
you cant see the left click menu, so what i did was left click on the bar and pick "inspect element," then copied that url i highlighted.
[[but what about that tumblr blog?|blog]]you can also make stuff fade in <<timed 1.5s t8n>>like this
the code is:
<< timed #s t8n >>text you want to fade in<< /timed >>
if you want you can use linkreplace with this code to do <<linkreplace "this">>this
<<timed .1s t8n>>which is fun<</timed>><</linkreplace>>
the code for that one is
blah blah here's some << linkreplace "text" >>text
<< timed .1s t8n >>and here's the bit that appears<< /timed >><< /linkreplace >>
don't forget the closing linkreplace because i almost did when i typed out this passage. sugarcube will let you layer code like this and i have yet to find the limit for it. go nuts
[[what about images, you ask?|img]]
<</timed>>SO if you already have a tumblr account it's as easy as making a side blog. if you dont have an account, making one is free. what i did was set the new blog to unlisted so no one could find it in searches and then make it private/password protected. i didn't want anyone stumbling upon it. then i uploaded the free-to-use audio i wanted so i would have a host to link to.
harlowe apparently has a way to do audio, but all i could find said you had to use javascript for it. java's hard to use and all the guides for it that i found were outdated, so i switched over to sugarcube.
that's the end!
you can go back to [[the start if you want|Start]]