Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Twine Game bug fixing 1.4.2 Sugarcane

edited February 2017 in Help! with 1.x
Here is the link to my game: http://sulley.cah.ucf.edu/~mi963011/3024TwineProject/Twine Server Test/Legends of Luminia Server Test.html

Problems I've noticed

Music volume is too high/some sound effects are too low.

Sidebar overlaps on some computers, how do I fix it?


It's due for class tonight and if I can at least get these two issues fixed I would be a happy man. I'm going to try to look up the volume after this, but I couldn't find much on working with the sidebar, might just remove it.

Comments

  • My Music Script in case its helpful

    (function () {
    "use strict";
    version.extensions = {
    major: 1,
    minor: 1,
    revision: 2
    };
    var p = macros = {
    soundtracks: {},
    handler: function (a, b, c, d) {
    var loop = function (m) {
    if (m.loop == undefined) {
    m.loopfn = function () {
    this.play();
    };
    m.addEventListener('ended', m.loopfn, 0);
    } else m.loop = true;
    m.play();
    };
    var s = eval(d.fullArgs());
    if (s) {
    s = s.toString();
    var m = this.soundtracks[s.slice(0, s.lastIndexOf("."))];
    if (m) {
    if (b == "playsound") {
    m.play();
    } else if (b == "loopsound") {
    loop(m);
    } else if (b == "pausesound") {
    m.pause();
    } else if (b == "unloopsound") {
    if (m.loop != undefined) {
    m.loop = false;
    } else if (m.loopfn) {
    m.removeEventListener('ended', m.loopfn);
    delete m.loopfn;
    }
    } else if (b == "stopsound") {
    m.pause();
    m.currentTime = 0;
    } else if (b == "fadeoutsound" || b == "fadeinsound") {
    if (m.interval) clearInterval(m.interval);
    if (b == "fadeinsound") {
    if (m.currentTime>0) return;
    m.volume = 0;
    loop(m);
    } else {
    if (!m.currentTime) return;
    m.play();
    }
    var v = m.volume;
    m.interval = setInterval(function () {
    v = Math.min(1, Math.max(0, v + 0.005 * (b == "fadeinsound" ? 1 : -1)));
    m.volume = Math.easeInOut(v);
    if (v == 0 || v == 1) clearInterval(m.interval);
    if (v == 0) {
    m.pause();
    m.currentTime = 0;
    m.volume = 1;
    }
    }, 10);
    }
    }
    }
    }
    }
    macros = p;
    macros = p;
    macros = p;
    macros = p;
    macros = p;
    macros = p;
    macros = {
    handler: function () {
    var s = macros.playsound.soundtracks;
    for (var j in s) {
    if (s.hasOwnProperty(j)) {
    s[j].pause();
    if (s[j].currentTime) {
    s[j].currentTime = 0;
    }
    }
    }
    }
    }
    var div = document.getElementById("storeArea").firstChild;
    var fe = ["ogg", "mp3", "wav", "webm"];
    while (div) {
    var b = String.fromCharCode(92);
    var q = '"';
    var re = "([^" + q + "']*?)" + b + ".(ogg|mp3|wav|webm)";
    k(new RegExp(re, "gi"));
    div = div.nextSibling;
    }

    function k(c, e) {
    do {
    var d = c.exec(div.innerHTML);
    if (d) {
    var a = new Audio();
    if (a.canPlayType) {
    for (var i = -1; i < fe.length; i += 1) {
    if (i >= 0) d[2] = fe;
    if (a.canPlayType("audio/" + d[2])) break;
    }
    if (i < fe.length) {
    a.setAttribute("src", d[1] + "." + d[2]);
    a.interval = null;
    macros.playsound.soundtracks[d[1]] = a;
    } else console.log("Browser can't play '" + d[1] + "'");
    }
    }
    } while (d);
    }
    }());
  • Changing the volume the old fashioned way, by editing the file, but if someone wants to post how to fix it in Twine for someone else in the future I'm sure they'll appreciate it.
  • I'm only going to touch on the audio issue here.

    Please use the code tag when posting code or markup—it's C on the editor bar. By posting Leon's HTML5 sound macros without doing so, you've caused the forums to damage them.

    Beyond that, volume adjustment simply isn't a feature of those macros, there is nothing to fix. A new volume control macro could be written to accompany them, however, considering that there are better solutions out there I'm dubious as to how worthwhile of an endeavor that would be.

    If audio is that important to someone's project, then they should probably be using either the Howler.js library or SugarCube v2, which has built-in audio macros—full disclosure, I'm the author of SugarCube.
Sign In or Register to comment.