Howdy, Stranger!

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

How to have multiple passages with the same name?

I know that the engine needs to know a passage name in order to show you it. But I was wondering if I could have is so that once I progress through the story have each branch of the story ignore the other branches. In example, the first choice could be female or male. and the the second choice regardless of the first is right or left. Because while the first choice may not be relevant then it will be relevant later.

Comments

  • I don't believe you can have the same name for multiple passages. You could use
    <<if>>
    
    macros to display different information based on gender choice which requires storing gender as a variable. Alternatively, copy and paste information in to two different branches of passages such as left-female, left-male, right-female, right-male, etc since the player never sees the passage name anyway. Using conditional logic seems easier to me, but branching paths may be more aesthetically pleasing to you if you don't mind having twice as many passages.
  • eddies13 wrote: »
    I don't believe you can have the same name for multiple passages. You could use
    <<if>>
    
    macros to display different information based on gender choice which requires storing gender as a variable. Alternatively, copy and paste information in to two different branches of passages such as left-female, left-male, right-female, right-male, etc since the player never sees the passage name anyway. Using conditional logic seems easier to me, but branching paths may be more aesthetically pleasing to you if you don't mind having twice as many passages.

    So if I use macros I wouldn't necessarily need to do branching passages, but I would have to make sure my passages can change depending on what has been chosen before? That sounds like is would be much easier for more linear stories, but sounds difficult for more complicated stories.
  • edited August 2015
    But why do you need to name your passages the same name? Why not just use numbers like Female Story 1, Female Story 2, Female Story 3, etc?
  • Claretta wrote: »
    But why do you need to name your passages the same name? Why not just use numbers like Female Story 1, Female Story 2, Female Story 3, etc?

    I don't have a problem until I need to have two separate threads make the same decision even though they would both result in a different outcome.
  • edited August 2015
    I'm still not understanding the issue. Just link each thread to a different passage is the simple way to handle that.
  • In that case you could use
    [[Choice->Destination Passage]]
    

    The passage name doesn't have to be the same as the choice the player makes. For instance.
    male makes choice a
    [[Choice a-> male choice a]]
    
    Female makes choice a
    [[Choice a-> female choice a]]
    

    You can have the same link text lead to differently named passages that way. Does that help?
  • edited August 2015
    Made with Twine 2 & (v2.0.0-beta.4)

    Sounds like you're doing a 'hub and spoke' design with multiple hubs. So, day1 you have an intro passage and things you can do that day(sunday) like Church, Brunch, Dinner at Ma's, Go to Bed(End hub). Hub2 (Monday) Go to work, Monday happy hour, etc.

    I looked at different ways of doing that. The cleanest way(less clutter and links is to have a different hub everyday (as Claretta said) and never repeat, or to have seven hubs, one per day. You can see the hubs, but if you don't want the player to see it's Daytime: Sunday you could title them so the second half of the link is hidden to the player:
    [[Daytime|Sunday 1]] for a different hub every time   or  
    [[Daytime|Sunday]] for 7 different hubs 1 per day of the week.
    
    That would hide it from them but not to you. The player would just see Daytime

    I took a more chaotic SANDBOX approach and changed the needed passages with if visited or time related statements:
    TIME BASED
    <<if GameDays[$gameDate.getDay()] is "Sun">>[[Attend Church Service]]
    <<endif>>
    <<if GameDays[$gameDate.getDay()] is "Mon">><<goto "The Church is Closed">>
    <<endif>>
    
    <<if $gameDate.getUTCHours() lt 7 or $gameDate.getUTCHours() gt 21>>
    <<goto "The Church is Closed">><</if>>
    

    IF VISITED:
    <<if visited ("Go to High School- Student Intro") is 0 and  $Skill is
     "Student">>[[Go to High School- Student Intro]]<<endif>>\
    
    <<if visited ("Go to High School- Student Intro")>>
    [[Go to High School- Parking Lot]]<<endif>>\
    

    FOR GOING HOME: Every link says Go Home but on the GO HOME passage I placed this:
    <<if $gameDate.getUTCHours() lt 5 or $gameDate.getUTCHours() gt 20>>
    <<goto "Late Night">><</if>>
    <<if $gameDate.getUTCHours() gt 5 and $gameDate.getUTCHours() lt 11>>
    <<goto "Rise and Shine">><</if>>
    
    Which will instantly redirect from the normal Go Home passage to "Late Night" or "Rise and Shine" if they go to Go Home during set times. The player will never know that they're on a different passage.

    The second SANDBOX way is very chaotic looking to you, but not the player. Frankly, I wish I had gone the way of the hub... at 20k words and 350 passages it's too late, lol.

    Hope some of that helps you or someone,
    -Thrown

  • I use a more complicated approach for it, but it makes it easier to reference later.

    You are a (set: $gender to "man")<tw-link class='cyclingLink' data-cycling-texts='["man", "woman", "human", "gender existing only in a distant ethereal realm"]' onclick='clickCyclingLink(this, "$gender");'>$gender</tw-link>.
    1
    Due to this, they redirect to the same page, with you only needing to use (if:) in order to show the passages for the certain gender. Whenever you want the gender itself to be mentioned, you can simply use $gender now, and you can use (if:) in order to set pronouns to $pronoun.
    Sorry if it sounds complicated, but it's easier to see in practice. Paste it onto a page and test it!
Sign In or Register to comment.