Hello all, I previously got help here with pulling a random string from an array and it went well. The thing is, I need to do the same thing a few times in a row, and when I try to do it even with replicating the code perfectly, it won't work.
Here is the code that works.
var pool = ["A", "E", "I", "Y", "U"];
var pill = ["B", "J", "S", "M", "W"];
$gameVariables.setValue(20, pool[Math.floor(Math.random() * pool.length)]);
$gameVariables.setValue(21, pill[Math.floor(Math.random() * pill.length)]);
And then I try to display whatever is in both variables
Here is the code that works.
var pool = ["A", "E", "I", "Y", "U"];
$gameVariables.setValue(20,pool[Math.floor(Math.random() * pool.Length)])
Pretty straightforward, works like a charm. The thing is, when I copy that exact code but just change it a little, for instance to this$gameVariables.setValue(20,pool[Math.floor(Math.random() * pool.Length)])
var pool = ["A", "E", "I", "Y", "U"];
var pill = ["B", "J", "S", "M", "W"];
$gameVariables.setValue(20, pool[Math.floor(Math.random() * pool.length)]);
$gameVariables.setValue(21, pill[Math.floor(Math.random() * pill.length)]);
\V[20] \V[21]
I only get a random result from the first variable, then a ZERO for the second one. Can anyone shed some light into why this is happening? Would it be easier if I just made a big external text file with all the text in it and pulled from that somehow?