So, I have two scenes. At the start of the first scene, I create an array - to be precise, I create this:
(set: $people_in_office to (array:"the queen", "the queen's guards"))
I call $people_in_office's first just fine, as well as $people_in_office's length.
However, I transition to a new scene. $people_in_office still exists, and it still contains "the queen" and "the queen's guard". However, when I run it in debug mode, this message shows up where the function is called.
You can only use positions ('4th', 'last', '2nd-last', etc.) and 'length' with a an array.
But... it is an array. What do I do to fix this? And is it a problem with Twine itself, or something I'm doing wrong?
Comments
I assume you mean $people_in_office's 1st because $people_in_office's first will result in the error message you say you are seeing.
I created two passages, the first passage has a link to the second as well as your (set:) macro. I then added the following three tests to both of these passages. The first and third test work correct and the second test correctly displays the error message as expected.
Tests
Outputs
And I realize that me saying "first" was a mis-type. I've been using "1st" throughout the story.
Anyway, I must've been calling it in the wrong way or something, because I tinkered with it a bit it's working now.
Gotta love programming.