Why This Randomizer Does not Works?!
-
Hey Friends
I have a small problem here, Why this Errors me!
const var AllCmbs = [Content.getComponent("ComboBox1"), Content.getComponent("ComboBox2"), Content.getComponent("ComboBox3"), Content.getComponent("ComboBox4")]; const var AllRands = [Content.getComponent("Rand1"), Content.getComponent("Rand2"), Content.getComponent("Rand3"), Content.getComponent("Rand4")]; // Master Randomzier const var MasterRand = Content.getComponent("MasterRand"); inline function onMasterRandControl(component, value) { local idx = AllCmbs.indexOf(component); if(!value) return; if(AllCmbs[idx].getValue() == 1) return; AllRands[idx].setValue(1); AllRands[idx].changed(); AllRands[idx].setValue(0); }; Content.getComponent("MasterRand").setControlCallback(onMasterRandControl);
HiseSnippet 1103.3ocwW01aaaCDlxwJqVqsnEXedPKexFHKU9ktV.if4ZmjAi0jXT2ErghtNZIZahHQZPQkFug9eX+j1Oo8OX6ndwRNQ10VEAQePPGu643yc7zQxABtMw2mKPZUd67YDj1C0GNmIm1aJlxP8OBo8X8Sw9RhvLZntymg88INHMsc9I0.ZUJiBe92erK1EyrIoCgPWvo1jWS8nxzQGz4mottmfcHuk5kw5Vc5ayY83t7.fO6naglgsuDOgbFVYVIcj1tG6PkbwPIVR7Aa5xclObJ+irH6uf5SG4RTB0QCAGEMLp2TpqyfjX0GgzJOHMx2IJx+F8SoNzEimlAdRnByTDYyAZkVGkpuETRKCkJGQompOzVPmIS0n3yWq2mAKHiwPpNKUhrEU52Kq2iCVvjG3gujbh.DVfnZKKq8MaZYUqsg5Ax39RyqvByW451yaju4gluKA9DhrG2aFmABU2C9bDuK+556UaeCy7dVOtFEDWyBhq0d0de6aFhuAybVSLpTu53yb0fZTDPMKBnjv5YOyL9OS0nbu+jRDYh0HcJUPzlu2RMYOnZfxboLh43.lsjxYlbVpdEdA2spcB38g4vMfTy3uLpDFAtbarqI04ZX1hqjNfxbHWe93TTvrnrM7Ecb0uK1GIwrfHCDr1KjSrK1euC796UgvEJXUqYd3gl0uEZ.UlTZ3mIK6QNvOwA0ioyxpsmhYSHNUyU4BrV0RoYTBvz3SsM974YkKhyl8vttifNbUyISWqcl0gy3Rx4rpQI6OYXdSUiGmqtXW4RD4pV07UrNfUYAdiHhkVpACgtSK2xa2MqkmcTtIigbVeFUd9LRr7IbWGUqL022tAIJN4BsJ0iYHXpLrQ4ShaTl7qOh5n5StniEJLDxtWEZKcQiubWz7K2Es1.W73XWzMPJ4rPG7P8zBrb7vuz+HrDq1BJNECo8YDgjpVc0NhbErGdzFRUzOh3eojOC9bQANR6Aa3pv0YOZv7EBc9iNdXPmtlNH8QpibpRvADlRnSlJUReKHQkDOfRORGJ4MpazznkwyU0EaIQZjkH+Vm6OhzLKQn2iDoUFh7Oh6DhTYkUmekd3ttqp5.RLqXdUR93qH8YCDDnup5PPDFF58nNv1qIXASMD0+TtGvAr.bpVosgTqrR49jTqrp49jTqrB5tjT6tYc7VUgUlB5+V6lLCc6iiCWDf6D3hkKe6.00fhU.6etzQxUG6l4Skyy1ucKtxf0ZuxvlRwmpOfJsmlOGKkCGgsBtK3X7Esdj9wiGSrkoDrr9I+ZQuU0mY5eCOPRYSNEKETUeryB7FB2uzl.yNiQb8Uq2kTmtHR1RIqx.CILmPg+CdhUVWIqEqrdhRjG1Vv+fcz9vpqx8fvQ.NwBu4ZEnXDjMWbLDccqCrPdPU9GrsUg+2CG3IeLMJ.llE.SqBf44E.yOT.Lun.Xd4ZwnZv7p.I2K52AXfAGGdFHMsiC6.EVEh9ejpq2EM
-
@Natan You're calling this function with the MasterRand button. The
local idx = AllCmbs.indexOf(component);
has no meaning in that case.
Maybe you want to check the CB values in that way :
for(i = 0; i < AllCmbs.length; i++) { if(AllCmbs[i].getValue() == 1) return; }
It depends on what you're trying to do...
-
@Matt_SF Cheers mate