Senshuken Posted May 4, 2012 Share Posted May 4, 2012 add setdarray getdarray Link to comment Share on other sites More sharing options...
Brian Posted May 4, 2012 Share Posted May 4, 2012 add setdarray getdarray I think getelementofarray can be used to do some of this. For example: set [email protected], 1; // for each element in .items_1[] for (set [email protected],0; [email protected]<10; set [email protected], [email protected]+1) { set [email protected]_item, getelementofarray(getd(".items_"[email protected]), [email protected]); // do stuff with [email protected]_item } Link to comment Share on other sites More sharing options...
Senshuken Posted May 5, 2012 Author Share Posted May 5, 2012 add setdarray getdarray I think getelementofarray can be used to do some of this. For example: set [email protected], 1; // for each element in .items_1[] for (set [email protected],0; [email protected]<10; set [email protected], [email protected]+1) { set [email protected]_item, getelementofarray(getd(".items_"[email protected]), [email protected]); // do stuff with [email protected]_item } Sorry, I meant it as a dynamic array setter and getter. Link to comment Share on other sites More sharing options...
saithis Posted May 5, 2012 Share Posted May 5, 2012 This does already work with setd and getd: getd(".somearray["[email protected]+"]"); setd ".somearray["[email protected]+"]", 0; or did you mean something like that: setdarray ".somearray", 0, 5, 4, 3, 6; but here getdarray would make no sense, since you can only get 1 value at a time 1 Link to comment Share on other sites More sharing options...
Senshuken Posted May 5, 2012 Author Share Posted May 5, 2012 This does already work with setd and getd: getd(".somearray["[email protected]+"]"); setd ".somearray["[email protected]+"]", 0; or did you mean something like that: setdarray ".somearray", 0, 5, 4, 3, 6; but here getdarray would make no sense, since you can only get 1 value at a time You're right, getdarray would be pointless, but yes I do mean the setdarray ".somearray", 0, 1, 2, 3, 4 Link to comment Share on other sites More sharing options...
ToastOfDoom Posted November 24, 2012 Share Posted November 24, 2012 you can already do this using a combination of getd and setarray. setarray getd(".test[0]"), 1, 2, 3, 4, 5; Also sorry for the necro... =P 1 Link to comment Share on other sites More sharing options...
Euphy Posted November 24, 2012 Share Posted November 24, 2012 Added the array example to script_commands.txt in r16963 since it could be helpful. :> Link to comment Share on other sites More sharing options...