Howdy, Stranger!

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

cycle/cyclinglink help. [Sugarcane, Twine 1.4.2]

edited October 2015 in Help! with 1.x
So, what I want to do is to be able to click on a bit of text and replace it with a passage or the return value of a function. (Specifically, I'm making procedurally generated text via twinecery, and I want a snippet of text to be a link to re-generate itself.) Having some trouble getting that to work with either <<cycle>> or <<cyclinglink>>. Any help to set me in the right direction would be very, very appreciated.

= = = = =

It looks like <<cyclinglink>> is very close to what I need, but it can only rotate between plain strings, and I need to feed it a passage or a function call.

i.e., this doesn't work:
<<cyclinglink $fruit either("apple", "banana", "cherry")>>

= = = = =

So, <<cycle>> can rotate between a passage or function call, but... the trigger macro <<revise>> has the same problem as <<cyclinglink>>.

i.e., this doesn't work:
<<cycle foo>><<revise foo "<<set $fruit to either("apple","banana","cherry")>><<$fruit>>">><<endcycle>>

This would maybe work if revise was instead using the <<revise>>...<<endrevise>> model, but...

Comments

  • The Sugarcane story format is no longer being maintained and due to Chromium recently restricting access to it's History sub-system people using an up to date version of either the Chrome or Opera web-browser will receive a error warning when playing any story written using the Sugarcane story format.

    I would suggest changing to an actively supported Twine 1 story format like SugarCube.
    SugarCube 1 will display a warning message instead of the error message, while SugarCube 2 has been modified so that it is not effected by Chromium's History restriction. Both versions of SugarCube have downloadable add-on versions of the GloriousTrainWrecks extendard macro scripts.
  • edited October 2015
    I saw that on another thread, and while annoying, isn't that only an issue when testing/viewing local files in Chrome?

    Also, I think I run into the same issue with <<cycle>>/<<cyclinglink>> in SugarCube unless the SC ports have changed the functionality.
  • mrfb wrote: »
    ... isn't that only an issue when testing/viewing local files in Chrome?
    Yes, if your story will not be available in downloadable version then the issue will not effect the people that read it.

    I don't know if the SC ports have the same limitations or not but at least it's developer (TheMadExile) is available to offer help and updates/bug fixes, whereas Sugarcane is no longer maintained.
  • Does anyone who's used Harlowe/T2.x extensively know if this behavior is something that the syntax there would permit? Am I at the point where I need to think about *gulp* developing my own macro to do this?
  • In Harlowe you could use the combination of a named hook and a (click-replace:) macro to show text that when clicked on would be replaced with the contents of a different passage, like so:
    [Click on this text to replace it with the contents of the Other passage]<someHook|
    (click-replace: ?someHook)[(display: "Other")]
    
Sign In or Register to comment.