No, this is not the "proper" way brother BloodyVomit. Although, it WILL work.
See, the repeat is still there, and yeah, it WILL exit eventually - but the number of loops is still random.
Just think that at the 10nth entry, there will be 9 "trues" and 1 "false" array entries, so the loop will run until that specific "false" is chosen. This is an unnecessary number of calculations.
If you were to:
1] remove the Repeat.
2] after each choice, instead of having the entry set to "true", just remove it from the table, and
3] choose based on this: g_random = World_GetRand(1, table.getn(t_RandomIEPlayed)) instead of this: g_random = World_GetRand(1, 10),
it would be much better!
And you need not use this exiting condition: if g_random_ie_counter == 10 then
But this: if table.getn(t_RandomIEPlayed) == 0 then
Bottomline, you do not even need to use a loop at all
Just delete each entry you play, and re-select from an array with "trimmed" entries, until they reach 0.
- BloodyVomit likes this