Howdy, Stranger!

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

SugarCube releases

1457910

Comments

  • Announcing SugarCube v2.0.0-rc.1: (Release Candidate 1)

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

    Changelog highlights (since 2.0.0-beta.8):
    • Fixed character escape shenanigans with the story name when compiled by Twine 2.
    • Fixed the window not scrolling to the top upon reset when on the starting passage.
    • Updated run-time error reporting to consider all errors, no matter how deeply nested.
    • Added the <<repeat>> and <<stop>> macros.
    • Other improvements.
  • Hey there, thanks for providing SugarCube! :-) I have a variable in my StoryInit Passage on which i rely in a custom Macro.

    StoryInit:
    <<set $videoQuality to "hd">>
    <<html5loadvideo "wasteland" "media/video/wasteland.mp4">>
    

    Story javascript:
    Macro.add("html5loadvideo",{	handler:function(){
    	
    	/* video qualitaty settings from var */
    	
    	var vQ = SugarCube.State.active.variables.videoQuality;
    
    	var fileName = this.args[1];
            var src = fileName.replace(".mp4", '_'+vQ+'.mp4');
    	src = src.replace(".ogg", '_'+vQ+'.ogg');
    	
    	if ($("#"+this.args[0]).length == 0){
    		$("body").append('<video id="'+this.args[0]+'" class="html5backgroundvideo" poster="'+this.args[2]+'"  style="display:none;" preload="none"><source src="'+src+'"></video>');
    	}
    	}
    });
    

    Unfortunately I get the following error since beta8 release - I used alpha7/beta2 before:
    Error [StoryInit]: cannot execute macro <<html5loadvideo>>: SugarCube.State is undefined.
    

    Help appreciated!

    Thanks in advance!

    Best regards,
    Matthias
  • Hey there, thanks for providing SugarCube! :-) I have a variable in my StoryInit Passage on which i rely in a custom Macro.

    StoryInit:
    <<set $videoQuality to "hd">>
    <<html5loadvideo "wasteland" "media/video/wasteland.mp4">>
    

    Story javascript:
    Macro.add("html5loadvideo",{	handler:function(){
    	
    	/* video qualitaty settings from var */
    	
    	var vQ = SugarCube.State.active.variables.videoQuality;
    
    	var fileName = this.args[1];
            var src = fileName.replace(".mp4", '_'+vQ+'.mp4');
    	src = src.replace(".ogg", '_'+vQ+'.ogg');
    	
    	if ($("#"+this.args[0]).length == 0){
    		$("body").append('<video id="'+this.args[0]+'" class="html5backgroundvideo" poster="'+this.args[2]+'"  style="display:none;" preload="none"><source src="'+src+'"></video>');
    	}
    	}
    });
    

    Unfortunately I get the following error since beta8 release - I used alpha7/beta2 before:
    Error [StoryInit]: cannot execute macro <<html5loadvideo>>: SugarCube.State is undefined.
    

    Help appreciated!

    Thanks in advance!

    Best regards,
    Matthias
  • Story javascript:
    Macro.add("html5loadvideo",{	handler:function(){
    	
    	/* video qualitaty settings from var */
    	
    	var vQ = SugarCube.State.active.variables.videoQuality;
    
    	var fileName = this.args[1];
            var src = fileName.replace(".mp4", '_'+vQ+'.mp4');
    	src = src.replace(".ogg", '_'+vQ+'.ogg');
    	
    	if ($("#"+this.args[0]).length == 0){
    		$("body").append('<video id="'+this.args[0]+'" class="html5backgroundvideo" poster="'+this.args[2]+'"  style="display:none;" preload="none"><source src="'+src+'"></video>');
    	}
    	}
    });
    

    Unfortunately I get the following error since beta8 release - I used alpha7/beta2 before:
    Error [StoryInit]: cannot execute macro <<html5loadvideo>>: SugarCube.State is undefined.
    
    I don't know why I didn't see this when it was first posted. Oh well, better late than never, I suppose.

    First of all, you should not be using the SugarCube global. It is for debugging purposes only.

    Second, I believe you have your story mixed up a bit. The State object has only existed since v2.0.0-beta.8, before then it would have been state (notice the case difference). The reason that SugarCube.state no longer works is because, again, the SugarCube global is only for debugging. You should have been using state.active.variables.videoQuality from the start, which still works because I've added legacy aliases.

    Anyway, from v2.0.0-beta.8 onwards, instead of even state.active.variables.videoQuality, what I'd recommend is State.variables.videoQuality.

    IOW, change the following:
    	var vQ = SugarCube.State.active.variables.videoQuality;
    
    To:
    	var vQ = State.variables.videoQuality;
    
  • Announcing SugarCube v1.0.32:
    Changelog highlights:
    • Fixed an issue in IE and Edge with the audio macros where a playing track would stop and restart when issued certain actions.
    • Fixed character escape shenanigans with the story name when compiled by Twine 2.
    Oh, Microsoft, you so nutty.
  • Announcing SugarCube v2.0.0:

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

    Changelog highlights (since 2.0.0-rc.1):
    • Fixed an issue in IE and Edge with the audio macros where a playing track would stop and restart when issued certain actions.
  • Announcing SugarCube v2.1.0:

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

    Changelog highlights:
    • Fixed an issue, chiefly on mobile devices, where the Saves dialog would declare saves unavailable even though all requirements were met.
    • Fixed an issue during startup where UI bar story elements would be executed twice.
    • Added the fadeoverto action to both the <<audio>> and <<playlist>> macros.
    • Other improvements.
  • Announcing SugarCube v1.0.33: Changelog highlights:
    • Added the fadeoverto action to both the <<audio>> and <<playlist>> macros.
    By request, for those heavily invested in SugarCube v1.x.
  • Added the fadeoverto action to both the <<audio>> and <<playlist>> macros.

    By request, for those heavily invested in SugarCube v1.x.
    Is there any documentation showing how to use the fadeoverto macro? It's not included in the current audio macro guide.

  • It's not a macro, its an action for the <<audio>> and <<playlist>> macros. Assuming that was simply a mistype, try refreshing your browser's cache, because I guarantee you that it is in the current v1.x <<audio>> macro documentation (likewise for <<playlist>>). If not, well, you should know where to look by now.

    I suppose I could also go over the basic usage for <<audio>> here as well:
    → Start playback and fade from the current volume to 75% volume over 30 seconds
    <<audio "track_id" fadeoverto 30 0.75>>
    
    → Start playback and fade from 25% to 75% volume over 30 seconds
    <<audio "track_id" volume 0.25 fadeoverto 30 0.75>>
    
  • Apologies. Don't know how I missed that.

    Thanks.
  • Doing a double update announcement, since both versions had to be updated to fix the audio issues. My apologies for the inconvenience.
    ----

    Announcing SugarCube v1.0.34: Changelog highlights:
    • Fixed some timing issues related to fading which affected the audio macros.
    ----

    Announcing SugarCube v2.1.1:

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

    Changelog highlights:
    • Fixed some timing issues related to fading which affected the audio macros.
    • Made a few changes to the default styling of <input[type="text"]> and <textarea> elements for small viewports.
  • Announcing SugarCube v2.1.2:

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

    Changelog highlights:
    • Fixed an issue with objects stored within story variables where the object's own methods would not be deserialized properly.
    • Updated the default print formatting for objects to use their custom toString() methods, if available, and altered the default formatting of Map objects slightly.
    • Reorganized the codebase a bit.
    • Updated some of the bundled libraries:
      • es5-shim: Updated to v4.4.1.
      • es6-shim: Updated to v0.34.0.
  • Announcing SugarCube v2.2.0:

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

    Changelog highlights:
    • Fixed a bug in the processing of config.history.maxStates where a setting of 0 was treated as though it were 1.
    • Fixed a styling issue with empty menu lists.
    • Added a debug view, which consists of a configuration object property config.debug and story loading hooks to automatically enable it in Twine 1 (Test Play From Here) & Twine 2 (Test Mode).
    • Altered the default formatting of Map objects slightly.
    • Some internal refactoring and cleanup.
    • Updated the Twine 1 story format support file to add coloring for the PassageFooter and PassageHeader as special passages.
    The Bleached style for 2.x was also updated (specifically, for the debug view).

    Debug view notes:
    It's enabled by default when in test mode. You can toggle it off with the button at the top of the UI bar. If you've removed/hidden the UI bar, a construct like the following will allow you to toggle it on and off:
    <<button "Toggle Debug View">><<script>>DebugView.toggle()<</script>><</button>>
    

    Hovering over most things shows the code behind them.

    I fully expect that the debug view may need tweaking, so don't hesitate to comment.
  • edited February 2016
    Announcing SugarCube v2.3.0:

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

    Changelog highlights:
    • Test mode/debug view changes:
      • Test mode now has, some, documentation.
      • Fixed an issue with the <<script>> macro where it could create two debug views.
      • Fixed an issue where the PassageReady and PassageDone special passages' debug views were created whether the passages existed or not.
      • Updated the <<silently>> macro's error message tooltip to include its full contents.
      • Added the hidden mode to the debug views for <<break>>, <<continue>>, and <<stop>>, as they produce no output.
      • Adjusted the vertical alignment for block debug views.
    • Added temporary _variables, which are like story $variables and should work in most of the same places. Their differences: they aren't part of the story state, their lifetime is limited to that of their containing passage, and they are not supported by the <<remember>> and <<forget>> macros.
    • Added optional CSS transitions to the <<timed>> and <<repeat>> macros.
    • Added the missing macro-display class to the <<display>> macro's optional content container.
    • All time sensitive DOM operations now have a minimum delay. This is mostly to protect against pathological instances (e.g. reflows) which can take significant time to complete.
    • Refactored the macro context payload objects to include an args object, which is similar in form and function to the macro context args object.
    • Internal refactoring and cleanup.
    • Some documentation cleanup.
    See the documentation for more information.

    PS: Under Downloads > Add-ons is a new optional macro package <<numberbox>>. Might be useful to some.
  • Announcing SugarCube v2.3.1:

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

    Changelog highlights:
    • Fixed a fatal issue with the raw HTML formatter's debug view.
  • Announcing SugarCube v2.3.2:

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

    Changelog highlights:
    • Fixed the ordering of the code markup formatters.
    • Fixed a few issues with dialogs.
  • Announcing SugarCube v2.3.3:

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

    Changelog highlights:
    • Fixed an issue with one of the dialog fixes in v2.3.2.
  • Announcing SugarCube v2.5.0-beta.1 for testing.

    This is the first release of a rather significant update, so this is a testing release only—not a general release. Those who don't want to play guinea pig should skip it. For those who do try it out, please report any regressions or other issues so they may be addressed.

    Downloads: Changelog highlights:
    • Major refactoring. Chiefly revolving around updating the codebase to ES6 (mostly).
    • Refactored how expired moments are handled to allow the "visited" family of story functions (lastVisited, visited, visitedTags) to work as intended even over long playthroughs when expiring moments.
    • Fixed the filenames of exported saves and added a datestamp to them.
    • A slew of other fixes and improvements.
  • Announcing SugarCube v2.5.0:

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

    Changelog highlights:
    • Major refactoring. Chiefly revolving around updating the codebase to ES6 (mostly).
    • Refactored how expired moments are handled to allow the "visited" family of story functions (lastVisited, visited, visitedTags) to work as intended even over long playthroughs when expiring moments.
    • Fixed the filenames of exported saves and added a datestamp to them.
    • Added the <Array>.delete() and <Array>.deleteAt() native object methods.
    • A slew of other fixes and improvements.
    Additionally, the documentation has seen some expansion and cleanup.
  • Re: debug mode, is there a way to set it to default to off? I like to use "test play" to see how individual passages will look without debugging them or going through the story from the beginning, so I don't always want to have debug mode on even though it is pretty cool.

    The toggle button works, but I'd rather not have to click that every time.
  • edited April 2016
    Yes. As per the documentation, you may forcibly enable or disable Test Mode via the Config object's debug property.

    For example, put the following in your Story JavaScript (or, if using Twine 1, a script-tagged passage):
    Config.debug = false;
    
    Whenever you want Test Mode to function again, simply comment that line out or remove it.
  • edited April 2016
    Yes. As per the documentation, you may forcibly enable or disable Test Mode via the Config object's debug property.

    For example, put the following in your Story JavaScript (or, if using Twine 1, a script-tagged passage):
    Config.debug = false;
    
    Whenever you want Test Mode to function again, simply comment that line out or remove it.

    Oh, cool. Already tried that using the documentation but it didn't work--copy and paste'd and now it does, so I guess I typed it wrong or something.

    Guess I might as well say this to make this post not wasted space: sugarcube is awesome, I don't think I'd be using Twine if not for it. So thanks for making it.
  • Doing a double update announcement, since both versions had to be updated to fix the audio issue.
    ----

    Announcing SugarCube v2.6.0:

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

    Changelog highlights:
    • Fixed an issue with the <<cacheaudio>> macro whereby it would fail to properly handle URLs containing query or hash strings.
    • Moved the core font and color properties from the body to the html element to make it easier for authors to set whole page backgrounds.
    ----

    Announcing SugarCube v1.0.35: Changelog highlights:
    • Fixed an issue with the <<cacheaudio>> macro whereby it would fail to properly handle URLs containing query or hash strings.
  • edited May 2016
    Announcing SugarCube v2.6.1:

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

    Changelog highlights:
    • Fixed an issue with Math.clamp() and <Number>.clamp() whereby the min and max parameters were being erroneously converted to integers.
    • Improvements to the audio macros:
      • Authors can now get unsupported codec errors, from <<cacheaudio>>, while in Test Mode.
      • Players should no longer see playback errors, from <<audio>> or <<playlist>>, due to unsupported codecs.
      • Updated the audio file extension mappings.
  • Announcing SugarCube v2.6.2:

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

    Changelog highlights:
    • Fixed an issue where the settings object was not always properly initialized.
  • Announcing SugarCube v2.7.0:

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

    Changelog highlights:
    • Fixed the visited link class feature so that it checks the entire played history, rather than just the in-play history (i.e. it now checks expired moments too).
    • Moved the core foreground/background color properties from the html element back to the body element. This is a reversion of a change made in v2.6.0—it's proven itself to be more annoying than the issue it was meant to alleviate.
    • Modified the line continuation markup to support being used at the start of lines, in addition to at the end.
    • Added backtick expressions to discrete argument style macros, which allows you to use an expression as a singular argument. See the macro library documentation (at the top) for more information.
    • Added the hasVisited() story function, which returns whether the given passages have been played. If you simply want to know if the player has been to a passage, this is the most efficient method.
    • A few other improvements.
  • Announcing SugarCube v2.7.1:

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

    Changelog highlights:
  • Announcing SugarCube v2.7.2:

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

    Changelog highlights:
    • Fixed a bug in the <<switch>> macro which would cause it to always throw an error outside of Test Mode.
    • A few other improvements.
  • Announcing that the <<numberpool>> macro set add-on (SugarCube v2 only) has been updated.

    Downloads & documentation for all Twine versions: http://www.motoslave.net/sugarcube/2/ (under: Downloads > Add-ons)

    Changelog highlights:
    • Fixed a bug which caused the <<numberpool>> macro's <<onchange>> to be executed before the associated variables and controls were updated, rather than after.
Sign In or Register to comment.