KaRRiLLioN 0 Posted October 22, 2002 Since the other thread regarding bigpoppa's console for OFP was a bit off-topic for these questions, I though I'd ask them here: I'm trying to understand some basic things about Dialogs, specifically List boxes and the data you can pass with them. Is it correct to say that the only data you can pass to a script that is exec'd from the listbox consists of: lbText, lbData, lbValue and lbColor and that only one of each can be passed? In other words, with the script you can take the useful data out of only: _text = lbText [_idc, _index] _data = lbData [_idc, _index] _number = lbValue [_idc, _index] What i'm trying to find out is if there is some way to pass a complete array of information using any of the commands available. I've tried equating the _data in the lbSetData command by making _data an array, but that doesn't seem to get passed. Does anyone have any ideas on this? I'd like to pass an array that contains the person who used the dialog box, and serveral other bits of info. Thanks! Share this post Link to post Share on other sites
whisperFFW06 0 Posted October 23, 2002 Hmmmmm... lbText represent the text written in the list box, not the data currently associated with it. lbData represents a text value associated with the lbText with same index lbValue represents an integer value associated with the lbText with same index. I don't know if you can have lbData and lbValue set for the same index, I assume not, so with lbText of index n, you can associate only a string or an integer. So, to pass an array as value, you have to do a little trick, that is to use the string to define your array when you create your dialog : </span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Code Sample </td></tr><tr><td id="CODE"> lbSetData [12364, 2, "myArray=[a, b, c]"] <span id='postcolor'> To get the value of the array, you should then get the lbData and assign the array : </span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Code Sample </td></tr><tr><td id="CODE"> myString=lbData [12364, 2] call myString <span id='postcolor'> After that, the array myArray is filled with [a, b, c] When you create your array, you can use variable value : </span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Code Sample </td></tr><tr><td id="CODE"> lbSetData [12364, 2, format ["myArray=[%1, %2, %3]", a, b, c]] <span id='postcolor'> By doing so, the array will contain the values of variables a, b and c. Whis' Share this post Link to post Share on other sites
uiox 0 Posted October 23, 2002 You can see some advanced dialogs I have do, for example the Wp dialog recreate or the menu bar of units. I have put a sample mission in pending editor depot of OFPEC. For the moment the most advanced for me is a dialog with an update of the pos of the unit and the possiblity to change the param of the group (combat,formation,etc). Share this post Link to post Share on other sites