Twine Version: 2.7.0 (Sugarcube 2.36.1)
I need an idea, an explanation why it doesn’t work and what other alternatives are there?
In sugarcube documentation, it gives me following example:
Given: $fruits = ["Apples", "Oranges", "Plums", "Oranges"]
$fruits.count("Oranges") → Returns 2
therefore I change it to:
<<set $numero = random(1, 3)>><<set $Vikavote = random(1, 3)>><<set $Leovote = random(1, 3)>>
$vcount = ["$numero", "$Vikavote", "$Leovote"]
<<print $vcount.count("1")>>
but the error message gives me the following:
Error: <<print>>: bad evaluation: Cannot read properties of undefined (reading 'count')
<<print $vcount.count("1")>>
ChatGPT tells me it is because it reads/parses the variable, not the value. If so, what other possibilities are there that it counts the amount of votes? I am out of ideas. Or, at least, is there a redundant command for counting the amount of votes?
Also, I tried with this one from sugarcube documentation:
$numbers = [1, 2.3, 4, 76, 3.1]
$numbers.countWith(Number.isInteger) → Returns 3
but I have no idea what kind of command do I write? …countWith(Number.isAmount)?