The issue is the order of execution, and how the (show:)
macro works.
The content of a Passage is processed/executed from left to right, starting from the first line and working its way down to the last line. The (show:)
macro scans the current HTML structure of the page, looking for any instances of the supplied target, and “reveals” each instance it finds.
So if your code looks like the following (1)…
You find 2 large paintings hung up on the wall. They depict an epic battle between Greek and Turkish warriors. \
(if: $Perception)[{
Using your candle flame you can also see some protrusions from the paintings. It looks like you could reach out and grab them
(show: ?SpookyScary)
(show: ?SkeletonsSend)
(show: ?ShiversDown)
(show: ?YourSpine)
}]
|SpookyScary)[There is a cool chill in the air]
…then if the $Perception
variable has a value of true the (show: ?SpookyScary)
macro call gets executed before the line that defines the SpookyScary Hidden Hook is processed. Which means the HTML element that represents that Hook won’t yet exist in the HTML structure of the page, so the (show:)
macro can’t “reveal” it.
You can test this behaviour yourself by temporarily moving the |SpookyScary)[There is a cool chill in the air]
definition to the start of the content…
type or paste code here|SpookyScary)[There is a cool chill in the air]
You find 2 large paintings hung up on the wall. They depict an epic battle between Greek and Turkish warriors. \
(if: $Perception)[{
Using your candle flame you can also see some protrusions from the paintings. It looks like you could reach out and grab them
(show: ?SpookyScary)
(show: ?SkeletonsSend)
(show: ?ShiversDown)
(show: ?YourSpine)
}]
…which results in the (show:)
macro call now being able to find the Hook’s representative HTML element.
note: The (show:)
macro is normally called in response to an end-user’s interaction with the current page.
There are (at least) two ways to resolve this issue:
1: Don’t use Hidden Hooks.
You find 2 large paintings hung up on the wall. They depict an epic battle between Greek and Turkish warriors. \
(if: $Perception)[\
Using your candle flame you can also see some protrusions from the paintings. It looks like you could reach out and grab them
There is a cool chill in the air
The contents of the SkeletonsSend hook
The contents of the ShiversDown hook
The contents of the YourSpine hook
]
2: Move the code that “reveals” those Hooks to the end of the Passage.
You find 2 large paintings hung up on the wall. They depict an epic battle between Greek and Turkish warriors. \
(if: $Perception)[{
Using your candle flame you can also see some protrusions from the paintings. It looks like you could reach out and grab them
}]
|SpookyScary)[There is a cool chill in the air]
|SkeletonsSend)[The contents of SkeletonsSend]
|ShiversDown)[The contents of ShiversDown]
|YourSpine)[The contents of YourSpine]
(if: $Perception)[{
(show: ?SpookyScary)
(show: ?SkeletonsSend)
(show: ?ShiversDown)
(show: ?YourSpine)
}]
(1) You will likely notice that I changed your original code slightly. My variation uses uses Escaped line break & Collapsing Whitespace markup, along with line-breaks & indentation, to make it a little easier to read.
It also removes the usage of the is keyword comparison operator, which is redundant when determining if a Boolean variable is true or false.