Twine Version: 2.36.1
Hi, I’m having some issues with creating a system that allows the player to go to either a random (non-repeatable) event that plucks from an array, and a few passages that I want to be repeatable. Here is the code I’m using.
In StoryInit:
<<set $passages to ["passage 1", "passage 2", "passage 3", "passage 4", "passage 5"]>>\
In passage:
<<if $passages.length > 0>>\
<div class="choice">
<<link "Go to Passage">>\
<<goto `either($passages.pluck(),"repeatable1","repeatable2","repeatable3")`>>
<</link>>\
</div>\
<<else>>\
<div class="choice">[[Go to Passage|No Passage]]</div>\
<</if>>\
It works a bit strange though, when clicking the link it DOES go to a random passage, either from the $passages.pluck array or the 3 repeatable passages, but it seems to remove a passage from the array either way. For example, going to “repeatable1” passage will remove a “passage” from the 5 passages that are in the array, even though it’s not in the array.
Is there any solution to make it so that the repeatable passages are not taken from the non-repeatable array, so that even when the player has gone through all 5 $passages events, they still have the 3 “repeatable” events to do (infinitely)?
Sorry for horrible explanation!