One thing I've been thinking about is the addition of links that, when clicked, set or alter variables while simultaneously going to passages. Many would agree that this could potentially simplify a number of Twine coding cases.
A proprietary "Twine clone" program called AXMA has this functionality in the form of this extension to the link syntax:
[[Kiss her once|Flower Patch{$kisses = 1}]] [[Kiss her twice|Flower Patch{$kisses = 2}]] [[Kiss her four times|Flower Patch{$kisses = 4}]]
<<set>>
-style declaration. I feel ambiguous about this syntax - it seems like it doesn't mesh with the rest of Twine's syntax, using curly braces just for this one occurrence.
In my mind, I've been turning over a possible alternative, one which continues the use of the pipe character as a separator between parameters of the link syntax:
[[Kiss her once|Flower Patch|$kisses = 1]] [[Kiss her twice|Flower Patch|$kisses = 2]] [[Kiss her four times|Flower Patch|$kisses = 4]]
<<insert>>
and <<goto>>
macros:<<insert "rush off">><<set $stealth = 0>><<goto "Glasshouse">><<endinsert>> <<insert "sneak off">><<set $stealth = 1>><<goto "Glasshouse">><<endinsert>>
<<insert>>
as long as it finishes with <<goto>>
. It also makes use of already extant macros in a clever way.P.S: This example, I think, reveals an under-appreciated genericity in <<insert>>
/<<replace>>
that I didn't notice before. I'm considering making a short alias to <<insert>>
, called <<link>>
. While its functionality would of course be identical to <<insert>>
, it would be meant for use by the author in making a "custom link" - a link that executes a set of enclosed macros when clicked. I like this notion of encouraging authors to combine these macros to create higher-level link functionality.
(Of course, this requires the use of "immediate macros" - macros that run immediately instead of creating a passage structure. These include <<set>>
,<<remember>>
, <<display>>
(when made to display other immediate macros), <<refresh>>
(in Sugarcane only), my <<timed...>>
macros (including <<goto>>
), <<toggletag>> etc.
and <<playsound>>
etc.)