0 votes
asked by (130 points)

Hello. I am using Harlowe 2.0.1 and Twine online (2.1.3) I am trying to have the character not being able to go to one room before he's visited the bathroom. I have managed to do this with 2 variables, but when I go back to the first room from the bathroom, I still have to re-do everything in that passage before I can go on to the next room I want. (when I get to the point I can continue on just fine, but it would make no sens in the story to redo everything in the room twice.

(set: $toiletVisit to false)
(if: $visit2 is true) [(set: $toiletVisit to true)]
Zzzzzzzz.....

Zzzzzz....

Light streaming in through the windows finally reached my face and I blinked my eyes open. In my half awake state, I glanced around the room and wondered where I [was]<myRoom|.

(click: ?myRoom) [The room wassmall with only one bed in it, to the left of the bed was a [window]<annoyingWindow|. Sitting up, I could see my bag dropped by the end of the bed. A [[door->doorBath]] to the bathroom was besides the [door]<doorDown| downstairs.]

(click-replace:?annoyingWindow) [dysty window that somehow still let those traitorus beams of sunlight through to hit my face.]

(click: ?doorDown) [(if: $toiletVisit is false)[I should freshen up first]
(if: $toiletVisit is true) [I should head [[downstairs]]]
]

-------------------------------------

(set: $toiletVisit to true)
(set: $visit2 to true)

The bathroom was tiny. Only a small sink with a [mirror]<appearance| and a toilet. If I am finished oing my business, I guess I am finished [[here->Morning]]. 

(click: ?appearance) [You looked at yourself in the mirror. You looked like you just woke up.]

The first code snippet is the first room you're in. the second is the bathroom I want to enter and then leave to go back to the first room.

I hope I was clear enough in my question, and any help would be apprechiated

2 Answers

0 votes
answered by (5k points)
1. I don't see the problem. The code is fine.

2. What's the $visit2 variable for? It's completely pointless.
commented by (130 points)
If I didn't have it, when I got back to the first rooom, it would set the $toiletVisit to false again.
should I remove both of them from the first passage then?

My problem is that when I click on [[here->Morning]] in the second passage, I have to read through all of the firs passage again, as if the charracter is just waking up again. And I do not know hot to set it as visible or already having been done when I come back from the bathroom/second passage
commented by (5k points)

Add this to your passage:

(if: $wakeUp is 1)[Zzzzzzzz.....

Zzzzzz....

Light streaming in through the windows finally reached my face and I blinked my eyes open. In my half awake state, I glanced around the room and wondered where I [was]<myRoom|.(set: $wakeUp to 0)]

In a starter tagged passage, set $wakeUp to 1

commented by (130 points)
When I do the coding in the passage, nothing ends up showing up when I test it.
the starter tagged passage, how do you set that up? (Sorry, I am very new with Twine).
Is it a seperate passage with a tag I call starter? And do I use that same tag in the first passage?
commented by (5k points)
Yeah. The starter is a passage with a tag called starter. Everything in that passage runs once before the game actually starts. Only have one passage with the tag though.
+1 vote
answered by (1.3k points)

I'm not a hundred percent sure, but maybe a strategy using (history:) in the Bedroom passage would help?

(if: (history:) includes "Bathroom")[post-bathroom description]
(else:)[pre-bathroom description]

 

commented by (130 points)
I will try this out!
I am new to Twine so I didn't know of this.
Thank you :)
Welcome to Twine Q&A, where you can ask questions and receive answers from other members of the community.

You can also find hints and information on Twine on the official wiki and the old forums archive.

See a spam question? Flag it instead of downvoting. A question flagged enough times will automatically be hidden while moderators review it.
...