I'm trying to send a player to two different places, depending on how they got to the current passage.
I figured since (history:) is an array, I should be able to use last, 2ndlast, 3rdlast, etc. with it, yeah?
I first tried:
(set: $eaten to it+1)
(if: (history:)'s 3rdlast is "Day's End")[(link-goto: "Now what?", "Day's End")]
(else:)[(link-goto: "Now what?", "Still Off")]
but it only gives the link leading to "Still Off", no matter the path I took.
Noticed in another thread that someone had had difficulty getting (history:)'s last to work, and so I used a similar workaround to what they'd come up with:
(set: $eaten to it+1)(set: $history to (history:))
(if: $history's 3rdlast is "Day's End")[(link-goto: "Now what?", "Day's End")]
(else:)[(link-goto: "Now what?", "Still Off")]
but still no luck.
For reference, I
can get the "Day's End" version of the link to come up if I use last, but not if I use 2ndlast, 3rdlast, and so on.
The branching point I want to return the player to is a few passages back, so using regular last won't give the needed result.
Is this a problem other people have run into? Suggestions? Obvious stuff I'm missing?
All help appreciated!
Comments
Wanted to let you know that I've now found I also run into trouble using 1st, etc with other defined arrays.
I had a array of things that I wanted to slowly move to another array. I tried doing this by but I'd get an error telling me that 1st, 4th, last, etc are only available with arrays. I've tried displaying the $tablelibrary array on the same page, to confirm that it IS a working array. Just some weird thing where it's not being recognized.
My current workaround for this is which works fine building the $tablegame array, with the only drawback being it doesn't actually delete the piece it moved over, so I eventually end up with duplicates.
Not sure if these issues might be related to the history bug, but there you go.