Maybe I missed it in the documentation for SugarCube (v.2.21.0) but I can’t seem to find how to add the content of an array.
Specifically, I have a list of perks and want to track how many the player can take.
<<set $perk to {
adaptimmune: 0,
cortex: 0,
miasma: 0,
}>>
(There’s more to it, but I’m asking this from my bloody phone)
after a player chooses one , the number is set to 1. Basically Boolean with 0/1 instead of false/true.
can I then somehow set, say, “$temp” to the sum of the array without having to go through and test each sub-object within the array and add them to $temp one at a time?