acoustic 82 Posted April 20, 2018 Some sort of a script that gets units equipment from a predefined pool would be extremely helpful. Looked around but couldn't find anything. Share this post Link to post Share on other sites
HazJ 1289 Posted April 20, 2018 Something like: params ["_unit"]; _uniformPool = [ "", "", "", "" ]; _vestPool = [ "", "", "", "" ]; _backpackPool = [ "", "", "", "" ]; _headgearPool = [ "", "", "", "" ]; _gogglesPool = [ "", "", "", "" ]; // lazy quick checks if (count _uniformPool > 0) then // just in case :P { _unit forceAddUniform (selectRandom _uniformPool); }; if (count _vestPool > 0) then { _unit addVest (selectRandom _vestPool); }; if (count _backpackPool > 0) then { _unit addBackpackGlobal (selectRandom _backpackPool); }; if (count _headgearPool > 0) then { _unit addHeadgear (selectRandom _headgearPool); }; if (count _gogglesPool > 0) then { _unit addGoggles (selectRandom _gogglesPool); }; // in AI init: 0 = [this] execVM "loadouts.sqf"; You will need to add classnames in yourself, I am feeling very lazy since it is gone 3 am. Above is just one way of doing it. I personally create config with pre-defined loadouts (for certain cases) but that might be a bit overwhelming if you are new to scripting SQF. Feel free to dive in though! Something like (rough example): class config_loadouts { loadouts[] = { }; class testLoadout { name = "Test Loadout"; uniform = ""; vest = ""; backpack = ""; headgear = ""; goggles = ""; weapons[] = {}; magazines[] = {}; items[] = {}; condition = ""; }; }; I then use getMissionConfig to fetch all this and do some stuff with code, lol. https://community.bistudio.com/wiki/getMissionConfig 1 Share this post Link to post Share on other sites
zagor64bz 1225 Posted April 20, 2018 I often use THIS SCRIPT which is basically ready to go: add classnames and boom, you're in business. It even let you re-dress randomly more than one faction at the time with different gear. 1 Share this post Link to post Share on other sites
L. Terry 27 Posted April 24, 2018 Is there a way to do it without using class names,? I basiclly want to create a totally random unit that will be equipped with random stuff from the mods I have installed. And there are a lot of them!!! (basiclly using the randomise gear button from virtual arsenal in the editor) Share this post Link to post Share on other sites
Grumpy Old Man 3547 Posted April 24, 2018 3 hours ago, Lefterboy123 said: Is there a way to do it without using class names,? I basiclly want to create a totally random unit that will be equipped with random stuff from the mods I have installed. And there are a lot of them!!! (basiclly using the randomise gear button from virtual arsenal in the editor) Sure it's possible if you don't mind some silly combinations like this: Made something similar a while ago without including backpacks for some reason, should get you started: _unit = player; removeallweapons _unit; removeUniform _unit; removeVest _unit; removeBackpack _unit; removeHeadgear _unit; _allHeadgear = ("getNumber (_x >> 'scope') >= 2 AND getNumber (_x >> 'ItemInfo' >> 'type') isEqualTo 605" configClasses (configFile >> "CfgWeapons")) apply {configName _x}; _allUniforms = ("getNumber (_x >> 'scope') >= 2 AND getNumber (_x >> 'ItemInfo' >> 'type') isEqualTo 801" configClasses (configFile >> "CfgWeapons")) apply {configName _x}; _allVests = ("getNumber (_x >> 'scope') >= 2 AND getNumber (_x >> 'ItemInfo' >> 'type') isEqualTo 701" configClasses (configFile >> "CfgWeapons")) apply {configName _x}; _allRifles = ("getNumber (_x >> 'scope') >= 2 AND getNumber (_x >> 'type') isEqualTo 1" configClasses (configFile >> "CfgWeapons")) apply {configName _x}; _allHandguns = ("getNumber (_x >> 'scope') >= 2 AND getNumber (_x >> 'type') isEqualTo 2" configClasses (configFile >> "CfgWeapons")) apply {configName _x}; _unit addHeadgear selectRandom _allHeadgear; _unit forceAddUniform selectRandom _allUniforms; _unit addVest selectRandom _allVests; [_unit,selectRandom _allRifles,6] call BIS_fnc_addWeapon; [_unit,selectRandom _allHandguns,2] call BIS_fnc_addWeapon; Cheers 1 Share this post Link to post Share on other sites
L. Terry 27 Posted April 24, 2018 Sure it's possible if you don't mind some silly combinations like this: Made something similar a while ago without including backpacks for some reason, should get you started:_unit = player;removeallweapons _unit;removeUniform _unit;removeVest _unit;removeBackpack _unit;removeHeadgear _unit;_allHeadgear = ("getNumber (_x >> 'scope') >= 2 AND getNumber (_x >> 'ItemInfo' >> 'type') isEqualTo 605" configClasses (configFile >> "CfgWeapons")) apply {configName _x};_allUniforms = ("getNumber (_x >> 'scope') >= 2 AND getNumber (_x >> 'ItemInfo' >> 'type') isEqualTo 801" configClasses (configFile >> "CfgWeapons")) apply {configName _x};_allVests = ("getNumber (_x >> 'scope') >= 2 AND getNumber (_x >> 'ItemInfo' >> 'type') isEqualTo 701" configClasses (configFile >> "CfgWeapons")) apply {configName _x};_allRifles = ("getNumber (_x >> 'scope') >= 2 AND getNumber (_x >> 'type') isEqualTo 1" configClasses (configFile >> "CfgWeapons")) apply {configName _x};_allHandguns = ("getNumber (_x >> 'scope') >= 2 AND getNumber (_x >> 'type') isEqualTo 2" configClasses (configFile >> "CfgWeapons")) apply {configName _x};_unit addHeadgear selectRandom _allHeadgear;_unit forceAddUniform selectRandom _allUniforms;_unit addVest selectRandom _allVests;[_unit,selectRandom _allRifles,6] call BIS_fnc_addWeapon;[_unit,selectRandom _allHandguns,2] call BIS_fnc_addWeapon; CheersBrilliant thank you very much, I am going for a bit of silly . I'm trying to create a free for all with Ai type of mission.Sent from my D6503 using Tapatalk 1 Share this post Link to post Share on other sites