Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Determining player pathway with (history:)'s #edlast

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

  • This is a bug - my apologies. I'll fix it promptly.
  • Cool. I figured out a workaround for the time being, by assigning a variable at that page and then taking it away when I redirect.

    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
    (move: $tablelibrary's 1st into $newtable)
    (set: $tablegame to it+(a: $newtable))
    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
    (move: (either: ...$tablelibrary) into $newtable)
    (set: $tablegame to it+(a: $newtable))
    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.
Sign In or Register to comment.