Quantcast
Channel: Help! with 2.0 - Twine Forum
Viewing all articles
Browse latest Browse all 1844

Add Macros in Twine 2 with SugarCube 2

$
0
0
New to Twine, started with Twine 2 and SugarCube 2.

I want to experiment with custom macros, but every time I try to play my Story with any macros I get an error. The alert dialog is partially cut off, but I think it reads: "Error [tw-user-script-0]: undefined is not a function". The macro in question is:
macros.add("mytest", {
		handler: function () {
			try {
				console.log("This is a test.");
			}
			catch (e) {
				return this.error("Yay, you broke it! " + e.message);
			}
		}
});

Help?

Viewing all articles
Browse latest Browse all 1844

Trending Articles