Possible to Avoid Underscore+Character Being Interpreted as Temp Variable?

Twine Version: 2.3.16
Story Format: Harlowe 3.2.3

I am new to Twine, and have been slowly learning the Harlowe story format.
After some perfunctory scene setting passages, I have finally gotten to the meat of the story.
The story Main Page consists of several data tags, which have as a convention only alphanumeric characters, periods, and underscores. Most of the data tags presented include underscores. These same data tags are links to their own respective passages. While I discovered that back-ticking escapes out each underscore (_), back-ticking within a link’s [[double brackets]] renders all of the back ticks along with the underscores. The data tags within the double brackets successfully become links to their own respective passages, and the data tags effectively present upon playing the story. The issue, however, is that when arriving to the main menu passage, Twine kicks up the debug dialog box in the lower right corner that there are 43 Errors, all of which state “There isn’t a temp variable named _XXXX_XXXX in this place.”

Does the debug dialog box only show up for me, or will it show up once the story gets published (to everyone)?
If the debug dialog box will show up for everyone, is there some way to suppress these errors?

Is there some way to use underscores within links, as they appear within the data tags, short of switching to a different story format (see reddit URL, below)?

Selecting a different story format would mean I would have to start back at the beginning, and re-code everything under the new story format!

If I must switch to a new story format, which is the best, out of these seven?
Chapbook 1.2.1
Harlowe 2.1.0
Harlow 1.2.4
Snowman 2.0.2
Snowman 1.4.0
SugarCube 2.36.1
SugarCube 1.0.35

A sample of the Twine code appears below.

((within the Story Stylesheet))

tw-hook[name="recess"] {
   padding-left: 1em;

((within the passage))

(text-style:"smear")+(text-size:2.675)[''Main Menu'']
(text-style:"smear")[//(U`//`FOUO) Select a data tag, in order to assess whether it is legally permissible for your query.//]

1 Like

There are Story Formats that appear multiple times in your list (Harlowe, Snowman, SugarCube). The instances with lower version numbers are only included with the Twine 2.x application for backward compatibility reasons, and should not be used in a new project.
So your list of potential replacement Story Format should be trimmed down to just…
Chapbook 1.2.1
Snowman 2.0.2
SugarCube 2.36.1

Most of the functionality within your example can be achieve in the Story Formats listed by simply using standard CSS techniques, with possibly a little of the selected Story Format’s own functionality.

eg. the equivalent of the Named Hook based styling could be done like so…
(TWEE Notatation based untested example)

:: Story Stylesheet [stylesheet]
.recess {
   display: inline-block;
   padding-left: 1em;

:: Library
<!-- Using standard HTML element, which should work in all Story Formats -->
<span class="recess">[[PAI_EU_GDPR]]</span>

<!-- Using SugarCube's Custom Style feature -->

The (text-style:"smear") and (text-size:2.675) macro calls in your example would likely need to be replaced with CSS based equivalents, using code similar to the above example.

The Column markup (formatted “table”) part of your example may require a little more effort to achieve, but should be possible in each of the Story Formats you listed using standard HTML techniques for displaying content in a “grid” or “table” like layout.

1 Like

Mr. Grayelf:

Thank you so much for your prompt response, Sir.
So, based upon what you have written, I take it that I will need to change to one of the three remaining story formats? :confused:
How inconvenient. I wish I had known this, before investing time and energy in learning the Harlowe Story Format. :cry:

You could change your underscores for dash if that’s your only inconvenience with harlowe.

That is an option. The organization I work for actually deprecated data tags with hypens, demonstrating an obvious preference for using the underscore as a way to separate alphanumerics. So, replacing the underscores for dashes would be technically incorrect, given the specific context.

Here’s the best I can offer: use (verbatim:) to show the underscores as something else than a variable, then use another term in the link.

(verbatim:)[PAI_EU_GDPR]: [["Check"| "EU GPDR"]]

Interesting. Thank you so much!
I will apply this suggestion when I return to work on Monday, and will report back whether it works or not at that time…

The upshot: I have switched to SugarCube.

Thank you so much for your suggestion, but it didn’t work. :frowning_with_open_mouth:
The link syntax [[double brackets]] has the same effect as (v6m:)[].
So, in the example you provided, using verbatim actually kicks back the same error as [[xxx]].
Hence, using the following syntax actually doubled the number of errors:

(v6m:)[PAI_EU_GDPR]: [["Check"|PAI_EU_GDPR]]

I also tried combining the two, but they conflict with each other.


Each of the lines above have the effect of rendering exactly what is within the other… [[PAI_EU_GDPR]] for the first, and (v6m:)[PAI_EU_GDPR] for the second, with the second also producing a passage/link with the same title.

Long story short, I have switched to SugarCube.

Well you tried something different than what I did offer: I renamed the passage name (“EU GPDR”).

Anyway, as you’ve decided to switch to sugarcube it’s a moot point.