alleycat 28 Posted September 22, 2013 http://www.armaholic.com/page.php?id=7116 Seems to fail in Arma3, getting a zero divisor. Share this post Link to post Share on other sites
Zenophon 110 Posted September 23, 2013 A 'zero divisor' error is probably an out of bounds error in this case; you are trying to access an element of any array that does not exist. That means that the paramArray does not contain what you expect it to. Try printing out the value of the paramsArray to see what is really there. Also make sure you save the mission to reload any changes made to the description.ext. It is working for me in a very simple test mission with an extremely simple params class. Create a new mission in the editor, save it, and put this in the description.ext: class Params { class Test { title = "Test"; values[] = {0,1,2}; texts[] = {"0","1","2"}; default = 0; } } Then save and preview the mission. In the debug console, type this and click local exec: hint str paramsArray The game should print out: [0] Share this post Link to post Share on other sites
alleycat 28 Posted September 23, 2013 Thx I'll check that out. Share this post Link to post Share on other sites
alleycat 28 Posted September 23, 2013 Ok the zero division error stopped, but how to connect this to something in the init.sqf? class Params { class Weather { title = "Weather"; values[] = {0,1}; texts[] = {"Sunny","Rainy"}; default = 1; }; }; }; Using this in init.sqf: 10 setOvercast (paramsArray select 1); Has no effect. Share this post Link to post Share on other sites
alleycat 28 Posted September 23, 2013 Another question. Why wont this work in a unit condition of presence: (paramsArray select 0) == 1 Share this post Link to post Share on other sites
Zenophon 110 Posted September 23, 2013 Each subclass that you define in params places a value in paramsArray. If only one param is defined, then paramsArray has only one element. '(paramsArray select 1)' is trying to access the second element. Array indexes start at 0. Also, the description.ext snippet that you posted has an extra } in it. I removed that and tested your code. It works fine using this: 10 setOvercast (paramsArray select 0); Regarding the unit condition, I cannot get that to work. It could be an issue with the order of initialization of the mission (paramsArray must be undefined when the game checks that condition). Share this post Link to post Share on other sites