Hello.
I’m trying to randomly distribute stat points when on equipment roll.
I have 4 main parameters, and I want to randomly distribute 16 stat points between them. I also don’t want to repeat my code 16 times on my own. I think it’s possible to use <<for>> looping in this case, I just don’t know how to do it right.
I have that version, but It works wrong. “range is not a function”. So I need a function, or what?
0 is 0, $statpoints is a variable with the number of stat points. My idea was to make an array from 0 to $statpoints, which is eq to 16 in this case. Because I need all 16 steps, 16points=16 steps (0,1,2,3,4,5…15,16).
Maybe I just don’t know how to make an array from 0 to variable’s value…
An array is set with these brackets [] instead of parentheses.
But you could just do: <<for _i to 0; _i lt $statpoints ; _i++>>
There no real need for an array in this case. This will loop until _i reaches the value of $statpoints.