Howdy, Stranger!

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

Bug or not bug. Twine 2.0.6 SugarCube

Hi,

i made a macro with Twine 2.0.4 and SugarCube 1.0.21 wich works.
Macro
/* Usage: <<rolldice dice side>> */
macros.add("rolldice", {
	version : { major : 1, minor : 0, revision : 0 },

	handler : function () {
		var mavar;
		var dice = this.args[0];
		var side = this.args[1];
	
		mavar = random(dice, side * dice);
		state.active.variables["roll"]=mavar;

	}
});
Passage
<<set $roll to null>>
<<click "Roll dice">><<rolldice 1 6>><<replace "#dice">><<print $roll>><</replace>><</click>>

You roll a: <span id = "dice"><<print $roll>></span>

<<rolldice 3 4>>
<<print $roll>>

When i use it in Twine 2.0.6 (test or play) macro seem to works, but everey time i click on "rolldice"

i got this message with end of text unreadable.

error.jpg

If i publish to file that works fine.

Comments

  • There are known bugs in Twine 2.0.5 and 2.0.6 which affect Test and Play (2.0.6 has fewer than 2.0.5). They're just editor (i.e. Twine) issues and do not affect published files.
  • Thank you.
    I have nocited an another bug.

    modifications in passage are saved. But not in 'Edit story javascript' and change format is not memorized.

    As a example i change macros.add to Macro.add (SugarCube2) if i quit Twine my modifications are not memorized.
  • Really? (checks NW.js-based Twine 2.0.6 on Win7)

    Yes. I can verify that, as least some of the time, non-story map changes (e.g. Edit Story JavaScript, Edit Story Stylesheet, Snap to Grid, etc) are not being saved. (issue tracker: issue #155)
Sign In or Register to comment.