Howdy, Stranger!

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

Maintaining that status of an item that has been picked up

In this video:

He creates the option to pick up a Lantern and a Teapot. When going back to that same page (where you can pick either of them up), the option to pick up the Lantern or the Teapot is still there, even if you had already picked them up.

Is there a way to remove the option to pick them up again within the same story?

Thank you

Comments

  • There are two things you need to change in the Another Spooky Room (ASR) passage.

    1. Move the initialising of the check related variables to some other passage.

    Each time you (re-)visit the ASR passage you are initialising the check variables to false which the equivalent of the player dropping the items in the room if they were carrying them.

    The idea place to initialise those variables would be in your story's startup tagged passage that way they will be set to false at the start of the story. It is a good practice to initalise all your story's variable in your startup tagged passage.
    (set: $lanternCheck to false)
    (set: $teapotCheck to false)
    

    2. Use an (if:) macro to only show the Lantern and/or Teapot if the related variable is false.
    You see:
    (if: not $lanternCheck)[[Lantern]<getLantern|]
    (if: not $teapotCheck)[[Teapot]<getTeapot|]
    
    [[Next Area]]
    
    (click: ?getLantern)[
    You pick up the lantern!
    (set: $lanternCheck to true)
    ]
    (click: ?getTeapot)[
    You pick up the teapot!
    (set: $teapotCheck to true)
    ]
    

    Personally I would shorten the $lanternCheck and $teapotCheck variables to $lantern and $teapot respectively.
  • Awesome that worked, thank you!! I have one follow up question -

    I'm going move away from the code in the video and switch to the actual code from my story:

    I moved (set: $PrimeSiteCheck to false) to my startup Passage like you said.

    Then I added the following to a later passage:

    Qualifiers:

    (if: not $PrimeSiteCheck)[[PrimeSite]<addPrimeSite|]

    Added Qualifiers

    (click: ?addPrimeSite)[
    You've Added PrimeSite to Qualifiers
    (set: $PrimeSiteCheck to true)]

    Then on the Added Qualifiers passage I have:

    (if: $PrimeSiteCheck)[
    You've Added:
    $PrimeSiteCheck[It's their Primary Site]
    ]

    (link-goto: "Go Back to Discover", "Discover")


    Like I said above, everything is working, but here is my question:


    Upon arriving at the added Added Qualifiers passage the user is presented with two options - clicking the back arrow, or clicking "Go Back to Discover"

    When clicking "Go Back to Discover", everything works just fine, when clicking the back arrow, I'm running into the same problem I had before.

    Is there a way to make this work when clicking either "Go Back to Discover" OR the back arrow?

    Side note - I do know that by adding this to your stylesheet:

    tw-sidebar
    {
    display: none;
    }

    You can remove the back arrow, which is a possible solution, but I don't really want to lose the back arrow throughout the entire story.

    Another potential solution would to remove the back arrow from just that one passage - is that a possibility?

    Thanks again for your help!!!
  • I am assuming when you say "back arrow" you actually mean the Undo link, you can see its name by placing the mouse cursor over the link and reading it's tooltip.

    The Undo link winds back the History/Timeline of the story, thus anything that happened in the current passage didn't happen and all variables are returned to the state they had just before the content's of the passage (that was current before the Undo link was selected) was processed.

    This Undo behaviour is similar to that of word-processor, spreadsheet, etc software.
  • I see - yes, I was referring to the Undo link.

    Is there any way to remove it on one passage only?
  • The Hiding the sidebar on my first passage thread explains how to use a passage tag to conditionally hide the sidebar.
Sign In or Register to comment.