Howdy, Stranger!

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

Can I make my story playable within a map?

edited July 2016 in Help! with 2.0
I'm new to both twine and programming and google is turning up nothing (Not even really sure I asked the right question), so I'll just ask a yes no question.
Lets say I have 4 passages (representing a hallway) and you can move north and south through these. In the furthest north passage there's someone to talk to. You then go south and for whatever reason you end up going north again.
Is it possible that once you get back to the furthest north passage the person says something else or there is someone different entirely? Almost like the passage has been replaced?

I understand I could just create a new passage for this, but I want some things in the game to move at their own pace separate to the main story as the player chooses to engage them.
Kind of like sidequests

The only way I can figure out to do this currently would be with lots of passages that would be really messy and difficult to try to navigate through.

Comments

  • 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 that you are using Harlowe.

    You can use variables to track what is happening in your story, you can also base what happens on the values stored within those variables.

    eg.
    You could use a variable to track if the Reader chose to speak to the person in the room, and then use the value stored in the variable to conditionally change what is shown to the Reader the next time they visit the same room.

    1. Use a (set:) macro to initialise the variable within your story's startup tagged passage.
    (set: $spokeToPerson to false)
    

    2. The following uses an (if:) macro to check the current value of the variable, it uses a (link:) macro to implement speaking to person, and it uses a (go-to:) macro to move the Reader to another passage containing the dialogue.
    You enter the north most room......
    
    You see (if: $spokeToPerson)[someone you know](else:)[a stranger] sitting in the corner.
    
    What do you do?
    (link: "Speak to person")[
    	(set: $spokeToPerson to true)
    	(go-to: "Name of passage containing dialogue")
    ]
    [[Leave the room->Name of some other passage]]
    
  • Sorry, should of thought of that. I'm using sugarcube. Not near my desk right now or I'd try it out. Does the same apply to sugarcube or is it different?
    I'd like to stick with sugarcube as I do intend to learn some programming
  • The code for SugarCube 1.x is very similar.

    1. Use a <<set>> macro to initialise the variable within your story's StoryInit special passage.
    <<set $spokeToPerson to false>>
    

    2. Use an <<if>> macro and a Setter Markup Link in your passage.
    You enter the north most room......
    
    You see <<if $spokeToPerson>>someone you know<<else>>a stranger<</if>> sitting in the corner.
    
    What do you do?
    [[Speak to person|Name of passage containing dialogue][$spokeToPerson to true]]
    [[Leave the room|Name of some other passage]]
    
    ... instead of a Setter Markup Link you could also uses a <<click>> macro like the following:
    <<click "Speak to person" "Name of passage containing dialogue">>
    	<<set $spokeToPerson to true>>
    <</click>>
    
  • Thanks for your help greyelf
Sign In or Register to comment.