ok, i'm no scripting guru, but i actually thought this numbers-on-tank script would be easy enough for me. well, i was wrong:
error messages: zero divisor in row 5 if no fifth value and
"picture imuc_datx/bmd" with an OK-button and no texture appearing.
_bmd = _this select 0
_1st = _this select 1
_2nd = _this select 2
_3rd = _this select 3
_colour = _this select 4
_arr_nums = ["0","1","2","3","4","5","6","7","8","9"]
#start
?(!(_1st in _arr_nums)): goto "random_white_numbers"
?(_colour == red): goto "red_numbers"
#white_numbers
_bmd setobjecttexture [0,(format ["\imuc_datx\bmd\n\%1.paa",_1st])]
_bmd setobjecttexture [1,(format ["\imuc_datx\bmd\n\%1.paa",_2nd])]
_bmd setobjecttexture [2,(format ["\imuc_datx\bmd\n\%1.paa",_3rd])]
exit
#red_numbers
_bmd setobjecttexture [0,(format ["\imuc_datx\bmd\n\%1r.paa",_1st])]
_bmd setobjecttexture [1,(format ["\imuc_datx\bmd\n\%1r.paa",_2nd])]
_bmd setobjecttexture [2,(format ["\imuc_datx\bmd\n\%1r.paa",_3rd])]
exit
#random_white_numbers
_r1 = random 10
_r2 = random 10
_r3 = random 10
_bmd setobjecttexture [0,(format ["\imuc_datx\bmd\n\%1.paa",_r1])]
_bmd setobjecttexture [1,(format ["\imuc_datx\bmd\n\%1.paa",_r2])]
_bmd setobjecttexture [2,(format ["\imuc_datx\bmd\n\%1.paa",_r3])]
exit
ok, the question: 1. how can i check if there is any fifth value and 2. is there a way to do this with the format command. would be a lot more elegant than to check the numbers one by one.
edit: 1. yes, the selections are defined in the cfgmodels selection and the hiddenselections of the cfgvehicles-
2. @ mods: please don't shift this thread to addon editing. it is about an addon, but the scripting side of it.