no big deal, but when the array gets huge... it becomes pretty painful
What I'd really like to do is run a nested array, but I haven't had any luck splitting the data off.
_weaponsList = [
[["SCAR_L_STD_EGLM_RCO","30Rnd_556x45_Stanag"],0.1],
[["SCAR_H_CQC_CCO","20Rnd_762x51_B_SCAR"],0.2]
];
/*
Oh noes I am lost here
*/
_weightedArray = [_weapons,_chance] call fnc_buildWeightedArray;
I've tried quite a few things, this was the strongest lead I had. I do need the split weapons and chance further in the script.
_listCount = (count _weaponsList) -1;
_weapons = [];
_chance = [];
for "_x" from 0 to _listCount do
{
_weapons = ((_weaponsList select _x) select 0) + _weapons;
_chance = ((_weaponsList select _x) select 1) + _chance;
};
but, doesn't work... I'm hoping it is simple, and I am starting to wonder if it is treating my arrays as strings.
not a lot of examples of the weighted array out there. Can anyone throw me a bone?
Question
Mr White
Hello,
I am attempting to build a weapons/magazine list for AI. I'm using fnc_buildWeightedArray which right now is an agent of Satan in my eyes.
I can build two arrays:
no big deal, but when the array gets huge... it becomes pretty painful
What I'd really like to do is run a nested array, but I haven't had any luck splitting the data off.
I've tried quite a few things, this was the strongest lead I had. I do need the split weapons and chance further in the script.
but, doesn't work... I'm hoping it is simple, and I am starting to wonder if it is treating my arrays as strings.
not a lot of examples of the weighted array out there. Can anyone throw me a bone?
Link to comment
Share on other sites
2 answers to this question
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now