Howdy, Stranger!

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

How to make an early decision have a later impact

MJBMJB
edited April 2016 in Help! with 2.0
I'm working on my first Twine game for a school project, and I want to make a choice in the beginning of my game have a consequence later on. For example if I was making a game about a road trip I could have a decision to fill up the car with gas or not, and then later on the car could run out of gas if the player did not fill up with gas in the beginning. Is it possible to do something like that? If so, how do I do it?

Comments

  • edited April 2016
    You need to state which Story Format you are using when you ask a question, as answers can be different for each one. I am going to assume you are using Harlowe.

    You can use Harlowe's (set:) macro to assign a value to a variable which you can check later using an (if:) macro

    1. At the start of your story (preferable in a startup tagged passage) assign the variable a default value:
    (set: $boughtGas to false)
    

    2. In the passage where they buy gas change the variable to true:
    (set: $boughtGas to true)
    

    3. In any passage you want to check if they bought gas do one of the following:
    To check if they bought gas
    (if: $boughtGas)[It looks like they bought some gas!]
    
    To check if they did not buy gas
    (if: not $boughtGas)[It looks like they did not buy any gas!]
    
  • Oh, yes I'm using Harlowe. Thank you for your help!
Sign In or Register to comment.