Howdy, Stranger!

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

Probably a stupid question

I'm trying to create a story where I want an option to affect an option later in the story, but I don't want to have to make a completely double the amount of paths. Is there any way to do this? I've looked at the wiki, but either I'm having a dur moment or I missed something. So, if it's something the wiki could explain, feel free to link me to the page. Thanks in advance.

Example: Player gets the option to pick up a magic book early in the story. Towards the end of the story the book can be used to defeat the evil villain. How do I make that happen without having to make an entire duplicate of the story branch?

Comments

  • Set a variable called $magicbook for example to 1 when they pick up the magic book in the story. Later when they fight the villain check to see if $magicbook is 1. If so they have the book otherwise they don't have it. I hope I understood your question correctly.
  • Adding to the advice given by Eureka84, you would do the following steps:

    1. Initialize your variable in the special StoryInit passage, you can create it using the Story >  Special Passages > StoryInit option.

    <<set $has_magic_book to false>>
    2. In the passage in which the player obtains the Magic Book add the following:

    <<set $has_magic_book to true>>
    3. In the passage in which you want to check if the player has the Magic Book add something like the following:

    <<if $has_magic_book>>
    The Player uses the Magic Book to kill the monster!
    <<else>>
    The monster kills the player! If only you had a Magic Book to help you defeat the monster.
    <<endif>>
    The wiki has information about variables, the set macro, the if/else macros, as well as many other things related to Twine 1.x
Sign In or Register to comment.