Active Quest Tracker difficulties

Twine Version: 2.1.0
Sugarcube 2.37.3

Hi All! I’m very next to this, but am finding it all quite fascinating. I’m trying to include a quest tracker in the Story Caption to display the “Title” of the active quest. It will currently work until I include an <> macro to provide an alternate option in the event that no quest/task is currently in the active array.

My quests themselves are in the setup object in StoryInit, as nothing changes about them. Here is the code :

<<set setup.tasks to {
	"T001": {
		"ID": "T001",
		"Short": "Go to Work.",
		"Long": "Make your way to the office and start the day. It's on the corner of High and Prince streets",
		"Title": "Go to Work",
		"Passage": "Work"
	},
	"T002": {
		"ID": "T002",
		"Short": "Service call #1.",
		"Long": "Head back to Clarion street and fix the internet at your neighbour's house.",
		"Title": "Service Call: Neighbour",
		"Passage": "House 1"
	}
}>>

Here is the section of code in StoryCaption that prints the “Title”:

<<nobr>>Active Task: 
<<if $Active.includesAny()>>
<<=print setup.tasks[$Active[0]]["Title"]>>
<<else>>None<</if>><</nobr>>

I then also have arrays set up at the start of my story:

<<nobr>><<set $Active to []>>
<<set $Completed to []>>
<</nobr>>

Then finally a bit of code to add the current quest to the Active array when it starts:

<<run $Active.push("T001")>>

Everything else that I’ve currently implemented is working, namely alternative content in a passage when the player visits after the quest is activated, so I don’t think it’s a problem with the contents of the Array. I’ve checked it in test mode and it all looks like it should be working. What am I doing wrong?

I get the confusion, but that’s not how the .includesAny() method works.

Change <<if $Active.includesAny()>> to <<if $Active.length gt 0>>.

You should also change <<=print ...>> to <<print ...>> or <<= ...>>.

Hope this helps.

Thank you, really appreciate the help.