I have created an array, containing every possible character to choose from (8, to be specific), however when I needed to discard one random character from the list before presenting a choice for the player, I encountered this problem. I created an empty array $chardiscard and tried to move one of the characters there, however, all 8 of them stayed in the original array. This is the code I used to set up the array:
(set: $chardeck to (a: "Character 1", "Character 2", "Character 3", "Character 4", "Character 5", "Character 6", "Character 7", "Character 8"))
And this is me trying to move it:
{(set: $chardiscard to (a: ))
(move: (either: ...$chardeck) into $chardiscard)}
$chardiscard succesfully received variable, yet it also stayed in the original array. Where is my mistake?..
The only way I could resolve that problem was by using (random:) and checking each possibility...
{(set: $chardiscard to (a: ))
(set: _random to (random: (1,8)))
(if: _random is 1)[(move: $chardeck's 1st into $chardiscard)]
(if: _random is 2)[(move: $chardeck's 2nd into $chardiscard)]
(if: _random is 3)[(move: $chardeck's 3rd into $chardiscard)]
(if: _random is 4)[(move: $chardeck's 4th into $chardiscard)]
(if: _random is 5)[(move: $chardeck's 5th into $chardiscard)]
(if: _random is 6)[(move: $chardeck's 6th into $chardiscard)]
(if: _random is 7)[(move: $chardeck's 7th into $chardiscard)]
(if: _random is 8)[(move: $chardeck's 8th into $chardiscard)]}
But when the amount of values will be much greater (and it will), this code will become too cumbersome. Is there a more elegant solution?