I'm trying to use Sugarcube v1.0.10 and the Sugarcube version of cyclinglink to determine which passage the player goes to next. I thought that cycling the link was supposed to change what's assigned to the variable, but it doesn't seem to be.
I wrote this:
<<cyclinglink "$heat" "off" "low" "high" "fearsome">>
[[go|$heat]]
and I created passages called "off", "low", etc.
No matter what I cycle the link to, when I click "go" I end up at the passage called "off". The "replacelink" macro is "Removed pending update". Is there a problem with v1.0.10 and the cyclinglink macro?
Comments
Your problem stems from faulty expectations. When you do this: The variable
$heat
is evaluated immediately, as soon the wiki link is processed (i.e. early evaluation). At that time,$heat
will always be set tooff
. What you seem to want is a link that evaluates$heat
only when the link is finally clicked (i.e. late evaluation).Most wiki markup and macros evaluate $variable arguments as soon as they're processed. Note: The setter portion of a wiki link and the contents of the
<<click>>
/<<button>>
macros are not "arguments" and do get processed late (i.e. on click).Anyway, it's not pretty, but this will do what you want:
No. There are, as far as I know, no problems with
<<cyclinglink>>
. The reason that the<<replacelink>>
set is down because Leon issued a bugfix release not that long ago and I simply haven't gotten around to putting out a SugarCube version of it yet.Actually, it does (under: Downloads > Macros) have a port of Leon's macro.