Hi there !
First of all : I'm french, so please, excuse my clumsy English....
I try to remove an element from an array ( using the element value, not his index)
On the wiki's Faq, I found this exemple for Twine 1 :
<<set $currentLoops.splice($currentLoops.indexOf($march),1)>>
For Twine 2 I change this into :
(set: $dests.splice($dests.indexOf($dest),1))
Witch actually works ! besides I got this error : "(set:)'s 1st value is an array, but should be an assignment operation."
Is this the good way to achieve this ? How I could get rid of the error ?
(I use the default Harlowe story format)
Comments
The Harlowe (set:) macro expects you to be assigning the result of the Javascript expression to a variable, which is why you get the error message. You can solve this by assigning the result of your expression to a dummy meaningless variable, as shown in the following example: If you want to save line space you could reformat the above like so:
It make sens now.