Jump to content

aeroson

Member
  • Content Count

    160
  • Joined

  • Last visited

  • Medals

Everything posted by aeroson

  1. Here a recursive code to get base weapons without any attachments, notice dexterity check instead of type. private["_box","_type","_boxn","_bType","_bType","_bPos","_boxn","_cfgweapons","_weapons","_magazines","_cur_wep","_classname","_wep_type","_scope","_picture","_items","_backpacks"]; _boxn = _this select 0; clearWeaponCargo _boxn; clearMagazineCargo _boxn; clearItemCargo _boxn; clearBackpackCargo _boxn; _cfgweapons = configFile >> "CfgWeapons"; _weapons = []; get = { private["_cur_wep","_classname","_wep_type","_scope","_picture","_parent"]; _cur_wep=_this select 0; _classname = configName _cur_wep; _scope = getNumber(_cur_wep >> "scope"); _picture = getText(_cur_wep >> "picture"); _dexterity = getNumber(_cur_wep >> "dexterity"); if(_scope >= 2 && _picture != "" && _dexterity>0) then { if(!(_classname in _weapons)) then { _parent=inheritsFrom(_cfgWeapons>>_classname); if(0==([_parent] call get)) then { 0; // parent was added, all good } else { diag_log format["Class: %1 - Dexterity: %2 - Scope: %3 - Pic: %4 - WEP: %5",_classname,_dexterity,_scope,_picture,_cur_wep]; _weapons set[count _weapons, _classname]; // parent was not added, do add child 0; }; } else { 0; // parent does match but was already added } } else { 1; // parent does not match our neeed, do add child }; }; for "_i" from 0 to (count _cfgWeapons)-1 do { _cur_wep = _cfgweapons select _i; if(isClass _cur_wep) then { [_cur_wep] call get; }; }; diag_log format["%1",_weapons]; hint format ["%1 %2",time,_weapons]; { _boxn addWeaponCargo [_x,50]; } foreach _weapons; Output: _weapons == ["launch_NLAW_F","launch_RPG32_F","srifle_EBR_F","LMG_Mk200_F","hgun_P07_F","hgun_Rook40_F","arifle_Khaybar_F","arifle_Khaybar_C_F","arifle_Khaybar_GL_F","arifle_MXC_F","arifle_MX_F","arifle_MX_GL_F","arifle_MX_SW_F","arifle_MXM_F","arifle_SDAR_F","arifle_TRG21_F","arifle_TRG20_F","arifle_TRG21_GL_F"]"
  2. Thank you. Updated the init.sqf code, changed the classnames to ["ReammoBox","ReammoBox_F"], tested and works for all/13 ammo boxes. Also check out this module, it might suit your needs better. Riouken's Selectable loadouts - Module
  3. Fixed after removing "_boxn" from the private ["_bType","_bType",...] inside case: Looks like it created it again empty within the case's scope, there might be some problems with other re-privated vars as well.
  4. I'm glad it came in handy. Updated it, now you can use it in addAction.
  5. Use selectWeapon, also do add magazine first so the weapon is added already loaded. removeallweapons this; this addMagazine "RPG32_AA_F" this addweapon "launch_RPG32_F"; this selectWeapon "launch_RPG32_F";
  6. Replacing getPos with getPosATL and setPos with setPosATL seems to have fixed the floating/bouncing problem.
  7. This one should reduce lag, and delay regarding ammo boxes. It does hide the global box and creates same one locally (with same class,pos and rot), does also locally refill the box every 5 minutes. _box = _this select 0; //Locally hide the crate for player hideObject _box; // Make new one localy with same classname, position and dir _c = (typeof _box) createVehicleLocal [0,0,9001]; _c setPosATL (getPosATL _box); _c setDir (getDir _box); _box=_c; while {alive _box} do { // Remove the stock items from the crate clearMagazineCargo _box; clearWeaponCargo _box; clearItemCargo _box; clearBackpackCargo _box; _CfgWeapons = configFile >> "cfgWeapons"; _weapons = []; _items = []; _misc = []; for "_i" from 0 to (count _Cfgweapons)-1 do { _weapon = _CfgWeapons select _i; if(isClass _weapon) then { _wep = configName _weapon; _wep_type = getNumber(_weapon >> "type"); _scope = getNumber(_weapon >> "scope"); if(_scope == 2 && _wep_type != 65536) then { if(_wep_type in [1,2,4,5,4096] && _wep != "NVGoggles") then { _weapons set[count _weapons,_wep]; } else { _items set[count _items,_wep]; }; }; }; }; //Build Throw/Put magazine array {_misc=_misc+getArray (configFile/"CfgWeapons"/"Throw"/_x/"magazines")} forEach getArray (configFile/"CfgWeapons"/"Throw"/"muzzles"); {_misc=_misc+getArray (configFile/"CfgWeapons"/"Put"/_x/"magazines")} forEach getArray (configFile/"CfgWeapons"/"Put"/"muzzles"); { _box addMagazineCargo [_x,100]; } foreach _misc; //Add weapons & Mags { _box addWeaponCargo [_x,100]; diag_log format["Weapon %1 added", _x]; _mags = getArray(configFile >> "CfgWeapons" >> _x >> "magazines"); if(count _mags > 0) then { { if(!(_x in ((getMagazineCargo _box) select 0))) then { _box addMagazineCargo [_x,100]; diag_log format["Magazine %1 added", _x]; }; } foreach _mags; }; } foreach _weapons; //Add Items { _box addItemCargo [_x,100]; } foreach _items; // Refill every 5 mins sleep 3000; };
  8. you can fill the uniform with placeholders while loadUniform < 1 , add items to your vest and then remove the placeholders here this, script will add one satchel to your vest // fill uniform with placeholders _t = player; _c = 0; while { loadUniform _t < 1 } do { _t addItem "ItemWatch"; _c = _c + 1; }; // add stuff to yout vest here _t addMagazine "SatchelCharge_Remote_Mag"; // remove placeholders for "_i" from 0 to _c-1 do { _t removeItem "ItemWatch"; };
  9. shift + mouse wheel = changes movement speed (spliner cell style) ctrl + mouse wheel = changes stance height ability to set custom keys for everything, including action menu browsing and radio ALWAYS POSSIBILITY TO CANCEL CURRENT ACTION (reloading my machinegun, enemy pops up, nothing to do since i have to wait for the reloading to finish, we should be able throw away the gun/magazine or whatever just to pull out pistol as soon as possible) usage of movement keys to change positions in vehicles (iam in humwee on seat right of driver, i press D(right) i disembark vehicle, i press A(left) i move to driver, i press S(back) i move to back seat, i press C(stand) i go to roof mounted machine gun) @BIS just implement ideas that we are not able to do ourselves & steam workshop would be the best you could do for casual player (i see alot of vehicle and weapons requests, that is the stuff we can do ourselves, do not waste time with that)
×