Howdy, Stranger!

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

2 Same options linking to different choices? [SOLVED]

edited October 2014 in Help! with 1.x
I want to have a story that gives you options then when you pick that option you get the same set of options but they lead to different outcomes and again and again. Is this possible?

Comments

  • Yes, you can. Here's how:

    Suppose you are about to fight (or flee from) a monster, and you were given the option to pick up a sword earlier. You also had the option to pick up winged shoes. If you fight the goblin with the sword, you win. If you choose to fight the goblin without the sword, you die. The same applies to having the shoes and running away.

    <<if $sword is "Yes">>[[Fight Goblin|Victory]]<<endif>><<if $sword is "No">>[[Fight Goblin|Death]]<<endif>>
    <<if $wingedShoes is "Yes">>[[Run away| Safety]]<<endif>><<if $wingedShoes is "No">>[[Run away| Death]]<<endif>>
  • What about something like this :

    Eat the Duck(leads to a eat the duck scene and then you get the same 2 options but eat the duck leads to a different passage with the same 2 choices on again)

    Drink Water (Leads to a drink water scene and then you get the same 2 options but drink the water leads to a different passage with the same 2 choices on again)

    Possible?
  • I guess I fail to see the practicality of that, but I'm sure you have your reasons. Unfortunately, though, the only way I know of to do that is to put the links in manually or use the display macro. To use the display macro put the "eat the duck links" in their own passage. Then, where you want the links, put the name of the passage in double brackets, like <<passagetitle>>. The display macro copies the text from the passage you are referring to and subs them into wherever you put the macro. This allows you to put large blocks of code or text into multiple places without typing them out over and over again.

    This article explains the concept a little better, I feel: http://twinery.org/wiki/display
  • I don't think that's what i'm looking for, I'm going for a 'Gods Will Be Watching' type scenario where you get choices but instead of replaying the same scene because I have created a game similar to that, it goes to a different scene and displays the same options again. Is there a way to say change the link name so the passage could be called say 4 but the link is called 'Eat The Duck'?
  • Links allow you to assign a "displayed text" so you can have multiple links with different text going to the same passage and you can have links with the same text go to different passages. You can also set $variables when people select a link.

    (note: I am using TWEE notation, the line that starts with a double colon '::' is the Title of the Passage and is not pasted into the Passage Content)

    1. Simple example using three passages.

    In your first passage you could have your two links, in your second passage you would have the same two links but they would point to a third passage:

    :: StoryInit
    <<set $had to "">>

    :: First Passage
    [[Eat the Duck|Second Passage][$had = "Duck"]]
    [[Drink Water|Second Passage][$had = "Water"]]

    :: Second Passage
    [[Eat the Duck|Third Passage][$had += ",Duck"]]
    [[Drink Water|Third Passage][$had += ",Water"]]

    :: Third Passage
    We got here and had <<print $had>>
    2. More complex example using two passages, where you check the $had variable to determine whatlinks to show the user.

    :: StoryInit
    <<set $had to "">>

    :: First Passage
    <<if $had is "">>
    [[Eat the Duck|First Passage][$had = "Duck"]]
    [[Drink Water|First Passage][$had = "Water"]]
    <<else>>
    [[Eat the Duck|Second Passage][$had = "Duck"]]
    [[Drink Water|Second Passage][$had = "Water"]]
    <<endif>>

    :: Second Passage
    We got here and had <<print $had>>
    3. More complex option using the <<display>> macro

    [code]
    :: StoryInit
    <<set $had to "">>
    <<set $goto to "">>

    :: Passage of Links
    Please choose one of the following
    <<if $had is "">>
    <<print '[[Eat the Duck|' + $goto + '][$had = "Duck"]]'>>
    <<print '[[Drink Water|' + $goto + '][$had = "Water"]]'>>
    <<else>>
    <<print '[[Eat the Duck|' + $goto + '][$had += ",Duck"]]'>>
    <<print '[[Drink Water|' + $goto + '][$had += ",Water"]]'>>
    <<endif>>

    :: First Passage
    Description of whats going on in the first scene
    <<set $goto to "Second Passage">>
    <<display "Passage of Links">>

    :: Second Passage
    Description of whats going on in the second scene
    <<set $goto to "Third Passage">>
    <<display "Passage of Links">>

    :: Third Passage
    We got here and had <<print $had>>
  • Yup that works exactly how I want it to, thankyou :D.
Sign In or Register to comment.