Howdy, Stranger!

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

Leaving and entering a room, want text to remain the same.

I'm trying to make a game where you have a small number of rooms to walk between, and you solve puzzles and notice things within the rooms. I want the player to have to click on trigger-words to get more info about said words. (when I click on ball, text appears saying it's blue.)
My problem is that when the player leaves and re-enters the room, they have to click on the trigger-words again to get the info. I would like the info to stay there, even after exiting and re-entering.
I have tried tackling this a bunch of different ways, but none of them have worked. If I set a 'hook' going from the trigger-words to a 'set: variable to info', the info doesn't show up immediately. I have to exit and re-enter, and then the info is there but the trigger-words are click-able again (even though they change nothing). If I set the entire sentence that the trigger-words are in to a variable, and have it output the info as well as changing the variable to the info, it works the way I want it to, but I can't put different trigger-words leading to different info in the same sentence, and overall looks and feels a bit clunky.
I'm using Harlowe.
Sorry for the bad explanation, first time posting.

Comments

  • You did not supply an example of which method you are using to adding a link to your trigger-word nor which method you are using to replace the trigger-word with it's description so I will have to guess.

    One way you could do what you want is to:

    1. Define trigger word in your story's startup tagged passage:
    (set: $ball to "ball")
    

    2. Modify the trigger word when the Reader clicks on the link:
    There is a [$ball]<ball| on the table.
    
    (click: ?ball)[{
    (set: $ball to "blue ball")
    (replace: ?ball)[$ball]
    }]
    
    ... when you return to this passage the link will now show blue ball

    If you don't want the link to appear next time the visit this passage after they clicked the trigger-word you could do something like the following in step 2:
    There is a [$ball]<ball| on the table.
    
    {(if: $ball is "ball")[
    (click: ?ball)[{
    (set: $ball to "blue ball")
    (replace: ?ball)[$ball]
    }]]}
    
  • That wasn't quite what I was trying to do, but I realize now I should've explained it by showing the code instead of describing it. I figured it out anyways, by doing this:
    A calm, flowing (if: $river is "")[[river]<river|](else:)[river] bars the way forward. A small paddle boat is tied up on the opposite side. A tall, skinny tree waves in the breeze beside you.(click: ?river)[(set: $river to "
    
    The water is much too cold to swim through, you'll have to find a different way across.")$river]$river
    
Sign In or Register to comment.