I'm using an 'if / else' variable to change the description of a location on second visit, but I'm wondering if it's at all possible to prevent the 'else' taking effect if the player is returning from the game's inventory.
If a player is at this location, and decides to click on their inventory in the sidebar, their return means the 'else' description will trigger. It's important that it only does this if the player is returning from a specific passage.
Here's the whole passage:
<<if not $visitedBody>>\
<<set $visitedBody to true>>\
The crow takes off.
Clearly a body, and very dead. The poor man's face is bloated, blotched with green.
A backpack lies trapped benath him.
A quick search of the dead man's pockets reveal a pocket knife and a box of bullets.
[[Push on]]
<<click [[Take everything|Approach object]]>><<set $hasBullets to true>><<set $hasKnife to true>><<set $hasPack to true>><<set $hasClearLiquid to true>><<set $hasSleepingBag to true>><<set $hasHoodedFleece to true>><<set $hasBakedBeans to true>><</click>>
<<else>>\
The body lies plundered.
[[Push on]]
[[Examine takings->packcon]] <</if>>
I only want the 'else' description to trigger if the player clicks on 'Take everything', otherwise they'll lose their chance to do so.
Comments
i.e
First visit - first description
Second visit - second description
Third visit - third description
Tip: The contents of a <<click>> macro are silent, so you don't usually have to worry about whitespace there. Meaning that you may, as in my above example, use indention/line breaks to make things more readable for yourself.
Sure.
If using variables. Instead of using a boolean flag, use an integer counter. For example, in the StoryInit special passage: And then in the specific passage:
If using the visited() function.
Also thanks for the multiple visits formula. It can get so damn confusing for a beginner, knowing how to nest correctly is something that gets me in a right muddle.