How to display text only once, though it could appear in different sections

bgbg
I've been trying to figure out how to display some text only once, when there is a possibility of that text appearing in various sections. But I can't seem to conditionally display text and then set a flag that it's been displayed.

Here's an example: the "listening" text should appear in either the "password" passage or the "data" passage, but not both.

I've tried setting a flag immediately after displaying the conditional text:

[[Eavesdropping]]:
@set suspicion=inactive

You could talk to her about [the weather](weather), or the [secret password](password), or the [highly sensitive data](data).


[weather]:

You make some boring remarks about the weather.

[listening]:

You have a sneaking suspicion someone may be listening to your private conversation, but you have no choice.

[password]:

{if suspicion=inactive:{listening}}
@set suspicion=active

You tell her the secret password.

[data]:

{if suspicion=inactive:{listening}}
@set suspicion=active

You tell her the sensitive data.



I've also tried setting a flag within the embedded passage:


[[Eavesdropping]]:
@set suspicion=inactive

You could talk to her about [the weather](weather), or the [secret password](password), or the [highly sensitive data](data).


[weather]:

You make some boring remarks about the weather.

[listening]:

@set suspicion=active

You have a sneaking suspicion someone may be listening to your private conversation, but you have no choice.


[password]:

{if suspicion=inactive:{listening}}

You tell her the secret password.

[data]:

{if suspicion=inactive:{listening}}

You tell her the sensitive data.



And tried using "seen," but it doesn't seem to work for embedded text:

[[Eavesdropping]]:
You could talk to her about [the weather](weather), or the [secret password](password), or the [highly sensitive data](data).

[weather]:

You make some boring remarks about the weather.

[password]:

{if listening seen:}{else:{listening}}

You tell her the secret password.

[data]:

{if listening seen:}{else:{listening}}

You tell her the sensitive data.


[listening]:

You have a sneaking suspicion someone may be listening to your private conversation, but you have no choice.

I am very newb, but I think your syntax is wrong on the third attempt? The one using seen? I think it needs to be "if seen listening", not the other way around.

however, since in that case the person never clicked on the word listening, I suspect it won't actually register as having been seen.


You're right--the example in the documentation has it the other way around. Unfortunately, as you also said, it still doesn't solve the problem. I forget now what workaround I used to solve this.


This topic is now closed. Topics are closed after 180 days of inactivity.

Support

Forums