Howdy, Stranger!

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

Using to direct to different passages.

edited June 2014 in Help! with 1.x
Hey everyone,
I am trying to write a scene using <<cyclelink>> that will send you to a different scene depending on which option you choose. I have tried it two ways and both only send the player to the passage "Gunman 1" rather than looking at what the variable is and then sending them to the appropriate passage. How can I get around this? Is there a way to delay variable calculation or have the passage recalculate the variables?

[quote]Gunman 1, 2 and three each have a gun on you. Who do you draw your gun on?

Draw your gun on <<cyclinglink $gunman "Gunman 1" "Gunman 2" "Gunman 3">>
<<nobr>>
[[Continue|$gunman]]

[quote]Gunman 1, 2 and three each have a gun on you. Who do you draw your gun on?

Draw your gun on <<cyclinglink $gunman "Gunman 1" "Gunman 2" "Gunman 3">>
<<nobr>>
<<if $gunman is "Gunman 1">><<set $transition = "Gunman 1">>
<<else if $gunman is "Gunman 2">><<set $transition = "Gunman 2">>
<<else if $gunman is "Gunman 3">>\<<set $transition = "Gunman 3">><<endif>>
<<endnobr>>\

[[Continue|$transition]]

Comments

  • Kairnth wrote:

    Hey everyone,
    I am trying to write a scene using <<cyclelink>> that will send you to a different scene depending on which option you choose. I have tried it two ways and both only send the player to the passage "Gunman 1" rather than looking at what the variable is and then sending them to the appropriate passage. How can I get around this? Is there a way to delay variable calculation or have the passage recalculate the variables?

    [quote]Gunman 1, 2 and three each have a gun on you. Who do you draw your gun on?

    Draw your gun on <<cyclinglink $gunman "Gunman 1" "Gunman 2" "Gunman 3">>
    <<nobr>>
    [[Continue|$gunman]]


    [quote]Gunman 1, 2 and three each have a gun on you. Who do you draw your gun on?

    Draw your gun on <<cyclinglink $gunman "Gunman 1" "Gunman 2" "Gunman 3">>
    <<nobr>>
    <<if $gunman is "Gunman 1">><<set $transition = "Gunman 1">>
    <<else if $gunman is "Gunman 2">><<set $transition = "Gunman 2">>
    <<else if $gunman is "Gunman 3">>\<<set $transition = "Gunman 3">><<endif>>
    <<endnobr>>\

    [[Continue|$transition]]

    The problem here is that the links' destinations don't work as you'd quite expect - they are calculated while the page is rendered ([[Continue|$gunman]], for instance, is converted to [[Continue|Gunman 1]]) - then remain fixed at that value, unaltered by the cyclinglink.

    This is, I realise, not just a little bothersome - there isn't really a way ATM to defer the evaluation of $gunman's value without creating an intermezzo 'launchpad' passage that leads to the correct one - shudder, squirm. Someone could conceivably shove a custom function call onto the "tail" of a setter-link... but the tail is really designed solely to mutate state, and not to override the link destination in ad-hoc style.

    I'll have to think about this. Consider this evidence of the inherent, unspoken conflict between the turn-based essence of Twine 1, and the real-time nature of my custom macros.
Sign In or Register to comment.