I've started to make our BHD MOD control dialog, but I have not a problem, but a stop:
I need to change the text for every buttons in my dialog (circa 12) every time the dialog itself is called and checks for units under my command.
I'll try to explain it:
If you have 4 soldiers under your command, when I call the dialog, 4 of the 12 buttons should change their text into my units' names.
That can be done via command
ctrlSetText, and the sintax for it is:
ctrlSetText [idc,"text"]
To make it easy and quickly, I did the following:
Since every buttons in my dialog have an IDC that starts from 10 and ends with 19, I used this method to call every button and change their text:
_player = _this select 0
_grp = group _player
_count = count (units _grp)
_n = 0
#START
_number = format["1%1",_n]
ctrlSetText [(_number),"Soldier 1"]
? (_n >= _count) : exit
_n = (_n+1)
In this way, I don't have to create all the labels according with the number of soldiers under my command, but i simply put a variable
_n that SHOULD be passed to the ctrlSetText command as a number (via format command)
i say SHOULD, cause it doesn't happen!
Why??
As you can see,
_number is a real number:
_number = format["1%1",_n]
doesn't ctrlSetText use also variables that represent numbers as IDC?
can someone help me???
pls....
Linker Split