Sorry, pretty new to this, but my combined google-fu and experimentation has been failing me for about an hour now.
In sugarcube, is it possible to use a variable as a span ID, or to otherwise provide a dynamic way to generate span IDs on the fly? (I also tried workarounds with using both Print and Replace, but that failed for reasons I can't quite understand.)
For reference, I was trying to work on this: <<widget nestdialogue>><span id= "bob"><<click $args[0]>><<replace "#bob">><i>$args[0]</i><br>$args[1]<br>$args[2]<</replace>></span><</click>><</widget>>
and while it works, I'd like to have the text remain after each iteration. So, for me, a workaround is just as good as an answer to the title question. Thanks.
Comments
I think you need to use jQuery, or at least JavaScript to add an id with a variable. You can add classes though.
Yes, however, you'd have to use the Stupid Print Trick™. For example:
You could also dip into JavaScript, but that's a new level of complexity.
Please use the code tag when posting code or markup—it's C on the editor bar.
You have the opening <span> tag outside of the <<click>> and its closing tag inside the <<click>>, which is never going to work. You cannot interleave the tags of non-void/container pieces of markup like that.
I'm pretty sure I understand what you're going for in a broad sense, however, I'm unclear on how you were intending to use that widget to achieve it. Can you give an example of how you envisioned that being used?
Version is 1.0.3.4 of Sugarcube, in Twine 2.0.11.
Widget functionality is: args[0] is dialogue the player says. args[1] is response text, and args[2] is a recursive call to another nestdialogue or dialogue piece.
Got it to work using "stupid print trick."
Thank you all for the help.