Howdy, Stranger!

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

SugarCube releases

1235710

Comments

  • Okay... sorry to keep updating and posting (but maybe this will help someone else)
    I fixed that one by changing UISystem to just UI

    Now the popup box DOES appear. But it is empty. I will keep working on this, but if you can point me in the right direction, perhaps?
  • edited June 2015
    Yes, there were several syntax changes, most of which are noted in the post for 2.0.0-alpha.7.

    Assuming you're referring to Claretta's <<popup>> macro, try this version (which addresses the issue you were having, plus a few others plaguing the original macro):
    Macro.add("popup", {
    	version : { major: 1, minor: 0, revision: 0 },
    	handler : function () {
    		if (this.args.length < 2) {
    			var errors = [];
    			if (this.args.length < 1) { errors.push("link text"); }
    			if (this.args.length < 2) { errors.push("passage name"); }
    			return this.error("no " + errors.join(" or ") + " specified");
    		}
    
    		var	el      = document.createElement("a"),
    			passage = this.args[1],
    			title;
    		el.innerHTML = this.args[0];
    		el.className = "link-internal macro-popup";
    		el.setAttribute("data-passage", passage);
    		title = el.textContent;
    		UI.addClickHandler(el, null, function (evt) {
    			var	dialog = UI.setup(title, "popup");
    			new Wikifier(dialog, tale.get(passage).processText().trim());
    		});
    		this.output.appendChild(el);
    	}
    });
    
  • Super Awesome
    Thank you
  • edited June 2015
    Did the recent update to the replace macro set also update it to SugarCube 2? I haven't updated it yet, but I can't change to SugarCube 2 until I fix that macro set.

    I'm also getting problems with <<addclass>> and <<removeclass> where it says css elements do not exist anymore.
  • edited June 2015
    Claretta wrote: »
    Did the recent update to the replace macro set also update it to SugarCube 2? I haven't updated it yet, but I can't change to SugarCube 2 until I fix that macro set.
    The <<replacelink>> set? I've just uploaded updated versions of it and <<cyclinglink>> to the SugarCube 2.x page.

    Claretta wrote: »
    I'm also getting problems with <<addclass>> and <<removeclass> where it says css elements do not exist anymore.
    Off-hand, I can't think of any changes which were made which should affect those macros. No changes were made to the macros themselves and the order of operations during the display of a passage is exactly the as the last two 1.x releases well.

    Where are you using them and on what elements? Several UI elements have changed, so if you're selecting some of those, then that's likely the problem.


    Switching gears for a moment. I have an implementation of playlist fading done. It only fades the current/pending track, however, and not cross tracks. Is this suitable for your needs?
  • edited June 2015
    Oh silly me. I'm using them to select my own custom divs which I forgot to re-insert into the SugarCube 2 header. ;)

    And yes, all I need is a fade of the existing track. :) Thank you. That said, if it's SugarCube 2, then to implement it I do have to get up the motivation to install SugarCube 2 and make the css changes needed. I'm sure I can do that sometime...
  • Well, I will probably backport the <<playlist>> fade support to SugarCube 1.x, so there's no pressing need for you to upgrade your current project (unless you really want some of the other features unique to SugarCube 2.x).

    I've never intended SugarCube 2.x to be a mandatory upgrade for existing projects in SugarCube 1.x. While I think it's worth doing, because 2.x is better in a number of ways, it's not like 1.x is going anywhere (though, it's pretty much in maintenance mode now), so there's no pressure.
  • Announcing SugarCube v2.0.0-beta.2:

    Downloads & documentation for all Twine versions: http://www.motoslave.net/sugarcube/2/

    Changelog highlights (since 2.0.0-beta.1):
    • Attempts to focus the first element of incoming passages (for accessibility).
    • Updated the <<playlist>> macro to add the ability to fade the current track.
    • Further strings object updates (missed a few player-facing, non-error, strings).
    • Seedable PRNG related changes:
      • Calling History.initPRNG() outside of story initialization will now throw an error. It has always been required that the call happen during story initialization, the only change is the thowing of the error.
      • Added the <History>.random() method, which returns a call to either Math.random() or, if it's been enabled via History.initPRNG(), the seeded PRNG. It should be used in preference of Math.random(), if the author ever intends to use the seedable PRNG.
      • Math.random() is no longer replaced by the integrated seedable PRNG when History.initPRNG() is called. While a convenience for authors using the seedable PRNG, it is detrimental to any third-party code which cannot tolerate a predicable Math.random().
      • The story functions random() and randomFloat() now call state.random().
    Another general release, so have at it. And, please, report any issues you run into.
  • Thanks for the hard work. I will eventually migrate to 2, but I'm kinda up against a deadline to get a demo of my game ready, so I am avoiding all unnecessary coding. If something works currently, don't want to undo the duct tape holding my story together until I have a bit more time.
  • I've backported the <<playlist>> fade support update to SugarCube 1.0.24 (you know where the downloads are).
  • edited June 2015
    Notice for users of Twine 1: There is a flaw in the, as of this writing, current release of Twine 1 (1.4.2) in regards to how it handles the custom Header class file for story formats. See the notice on SugarCube's website for more information (for 2.x and 1.x, though the notice is largely the same in both cases).
  • Announcing SugarCube v2.0.0-beta.3:

    Downloads & documentation for all Twine versions: http://www.motoslave.net/sugarcube/2/

    Changelog highlights (since 2.0.0-beta.2):
    • Fixed an issue with the <<if>> macro's new error on = assignment operator feature which would flag valid code as erroneous.
    Another general release. You know the drill.
  • edited June 2015
    I was getting an issue using SugarCube 1.x in Twine 1.4.2 where the audio macros wouldn't cache a .wav file in Opera. Kept getting a message "error in contents, audio "whispers" does not exist" etc. When I converted it to .ogg, it worked.

    Can't see it being a file size issue since it was only 4mb wav, and I have 6mb ogg music tracks that cache properly.

    Also the old <<playaudio>> sound macros play wav files fine in Opera.
  • Which Opera, <= 12 (Presto-based) or >= 15 (Blink-based)? They're, effectively, completely different browsers, so the distinction matters. Also, if you can provide one, a link to the audio source would help.
  • Version 29.

    I'll PM you the file, it's custom designed.
  • Claretta wrote: »
    I was getting an issue using SugarCube 1.x in Twine 1.4.2 where the audio macros wouldn't cache a .wav file in Opera.
    Alright, I believe I've found and worked around the problem (new Opera is broken in different ways than old Opera, yay!). Let me know if the new release resolves the issue.

    FYI: You will want to provide more than simply a WAVE source for that audio track, as IE (and, likely, Edge when Win10 ships) does not play WAVE audio. My recommendation is to provide all audio in both MP3 and Ogg+Vorbis, since virtually everything supports at least one of those formats.
  • Announcing SugarCube v1.0.25:
    Changelog highlights:
    • Fixed a rare, but serious, bug in the macro formatter which could cause non-void macros to fail to find their tags.
    • Worked around another Opera HTML5 audio bug.
    • Changed the <<if>> macro to, optionally, return an error if the = assignment operator is used (default: enabled). Configured via the config.macros.disableIfAssignmentError config property.
  • edited June 2015
    Claretta wrote: »
    I was getting an issue using SugarCube 1.x in Twine 1.4.2 where the audio macros wouldn't cache a .wav file in Opera.
    Alright, I believe I've found and worked around the problem (new Opera is broken in different ways than old Opera, yay!). Let me know if the new release resolves the issue.

    FYI: You will want to provide more than simply a WAVE source for that audio track, as IE (and, likely, Edge when Win10 ships) does not play WAVE audio. My recommendation is to provide all audio in both MP3 and Ogg+Vorbis, since virtually everything supports at least one of those formats.

    Yeah,

    I just keep all files in wav format until I get them finalised, since wav I can edit without recompressing to mp3 (edit an mp3 too many times and it loses quality). Then once am happy with the final master, convert to ogg.

    But for testing purposes the bug is really annoying as I test in opera and I don't want to convert a wav every time I want to see it in game. Thanks for fixing it.

    In any case I only plan on offering my game as a standalone download with node webkit, so things will be converted to ogg purely to save space.
  • Announcing SugarCube v2.0.0-beta.4:

    Downloads & documentation for all Twine versions: http://www.motoslave.net/sugarcube/2/

    Changelog highlights (since 2.0.0-beta.3):
    • Fixed a rare, but serious, bug in the macro formatter which could cause non-void macros to fail to find their tags.
    • Worked around another Opera HTML5 audio bug.
    • Added the <<timed>> macro which wikifies its contents into the passage after the given delay.
    • Extension of the inline CSS markup to handle a hash-prefixed ID (e.g. #foo). This affects both the custom style markup (@@…@@) and table cell markup.
    I wanted to wait a bit before releasing another beta, but we be squashin' bugs, yo. Anyway, another general release.
  • Announcing SugarCube v1.0.26:
    Changelog highlights:
    • Fixed a bug in the heading formatter in WebKit/Blink-based browsers which caused it to fail to produce the correct markup in certain cases.
    • Reverted the SugarCube 1.x package directory structure change (from v1.0.24) for Twine 1 as it was causing issues.
  • Announcing SugarCube v2.0.0-beta.5:

    Downloads & documentation for all Twine versions: http://www.motoslave.net/sugarcube/2/

    Changelog highlights (since 2.0.0-beta.4):
    • Added the <<copy>> macro, which outputs the contents of the target element(s).
    • Updated the <<timed>> macro so that it terminates on passage navigation. Additionally, it now has the <<next>> child tag, which allows for follow on timed content within the same <<timed>>.
    • Updated the <<click>>/<<button>> macros so that instances which are passed a passage link now add a data-passage attribute to their generated markup (making them consistent with the other methods of generating passage links).
    • Normalized the output of both the naked $variable formatter and the <<print>> macro. Additionally, the results should be the same or better than before.
    • Fixed a bug in the heading formatter in WebKit/Blink-based browsers which caused it to fail to produce the correct markup in certain cases.
    • Restored the Rewind menu item and dialog.
    • Removed the UI bar footer and associated code, styles, and text (because it was time).
    • Minor updates to the UI and CSS.
    • Minor updates to the strings object.
    The Bleached style for 2.x was also updated.

    Note: I have not updated the documentation for <<copy>> and <<next>> yet.
  • Champion-status! Thank you!!
  • edited July 2015
    I installed this one as per instructions and everything works fine. I added the new bleached as well... and also the Bookish (nothing had changed there). It works. Literally everything works.

    The one oddity however, is that Twine says that SugarCube could not be loaded. It doesn't say SugarCube 2 could not be loaded. Just SugarCube.

    Weird... because... again, everything works and SugarCube 2.0.0-beta.5 DOES show up in the format list and I am also able to change stories both to and from it.

    I just get the error message. I can live with it, if need be. SugarCube works and that is what matters to me.

    Just thought I should report it in case I am not the only one (this time!).
  • Well, as I said, the instructions to allow SugarCube 1.x to be removed were untested. Maybe Twine 2 has additional references to it and since it can't find it now, you get the errors. Or it could be something else.

    BTW, you really should create an issue on the Twine 2 issue tracker requesting scrollable story formats windows (both the global management one and the story edit menu one).
  • haha - okay. I will.
  • edited August 2015
    A <<fadeallaudio>> to compliment <<stopallaudio>> would be a handy feature to have. My story is made up of non-linear passages, so on any one passage you might have particular sounds playing and I can't predict what sound will be playing on transition. It'd be nice to be able to fade out everything (except the music playlist, obviously) so I wouldn't need to write <<audio fade>> for every single track. <<stopallaudio>> for this purpose is a little sudden.

    Global volume controls would also be handy if at all possible (again separate from playlist) so as to allow a functioning sound options menu.
  • edited August 2015
    Hmmm I dunno after all. The way the current fadeout works, if a track is not playing, it starts it playing then fades it out.

    <<stopallaudio>> seems passable for now.

    Global volume may also have a problem if you have set the volume of different audio elements differently. Probably the best thing to do is just keep the current separation of music in playlists and audio, and allow people to tweak the music volume, and just use their own system volume to finetune the rest.
  • Announcing SugarCube v1.0.27:
    Changelog highlights:
    • Fixed a story title bug (only in Twine 1) where SugarCube would crash if the story title contained various kinds of markup (e.g. images).
    • Fixed a stylesheet compilation bug where wiki image markup interpolation would fail if the image URI contained parenthesis.
    • Normalized the output of the <<print>> macro and naked $variable formatter.
    • Removed the UI bar footer and associated code and styles.
  • Announcing SugarCube v1.0.28:
    Changelog highlights:
    • Addressed an issue with link and image markup where conflicts with global identifiers were causing hijinks.
Sign In or Register to comment.