Hello, everyone. I'm currently working on my first Twine project as part of my Master's thesis. Although things are progressing nicely, I seem to have run into a snag.
<<nobr>>
<<set $location = "Woods [South] - Shack">>
<<set $roomWidth = 10>>
<<set $roomLength = 10>><</nobr>>
<<display "header">>
You pass through the [[door|woods1_entrance][$playerMoves +=1]] of the shack and scan your surroundings. The shack is <<print $roomWidth>> feet by <<print $roomLength>> feet. On the east wall, a small rusty <span id="shovel"><<click "shovel">></span><<replace "#shovel">>shovel<</replace>><<replace "#output1">>You pick up the shovel and put it in your backpack.<</replace>><</click>> hangs on a nail.
On the north wall, there is a small wooden table. On it, sits a <span id="lamp"><<click "lamp">></span><<replace "#lamp">><span id="keyItem">lamp</span><</replace>><<replace "#output1">>You pick up the <span id="keyItem">lamp</span> and put it in your backpack.<</replace>><</click>>.
<span id="output1"></span>
I've read
TheMadExiles'
post on a similar question, but what I'm wondering is
can what I'm wanting to do be done?
For what it's worth, I've declared outputs' 1-5 in my story's CSS as per
F2Andy's advice. If I could have my way, I'm looking for a solution that's somewhat of a "melding" of what I'm already doing and what F2Andy is doing.
Thanks!
Comments
If the header passage is supposed to be some kind of global passage header, the PassageHeader special passage exists for that very purpose.
I don't know if you're aware, however, you do not have to use the <<print>> macro simply to print story/temporary variables. The naked variable markup allows that to be written as the following:
In both of the above cases, you have the opening <span> tag outside of the <<click>> and its closing tag inside the <<click>>, that's never going to work. You cannot interleave the tags of non-void/container pieces of markup like that. Also, the <<click>> macro is deprecated, the <<link>> macro is its replacement.
Using <<link>> and placing the <span> tags correctly would look like the following:
That said, and while you could do it the way you're attempting—as I just showed—if you want the links to be single use, then it would be simpler to start with the <<linkreplace>> macro. For example: