Jump to content

Blitzen88

Member
  • Content Count

    244
  • Joined

  • Last visited

  • Medals

Everything posted by Blitzen88

  1. Blitzen88

    EricJ Release thread

    This might be an unusual request but is there a variant of this mod that adds the attachments (laser & flashlight combos, scopes, etc) but not the weapons? I like using vanilla weapons with a variety of attachments.
  2. Greetings everyone, When I first got into Arma @Larrow helped me by writing a script (thread link) which would move a marker to the closest enemy or uncaptured sector. After fooling around for awhile I took that script snippet and mashed it together with Iceman77's Helicopter reinforcement script to create a helicopter reinforcement script that is compatible with Arma's Spawn AI and AI Sector Tactics Modules. The script, using the Spawn AI Module's expression field, takes spawned AI, places them in a spawned helicopter, drops them off near a sector and then returns back to base. The script uses the script from @Larrow's script to pick the closest enemy or uncaptured sector. Although it works 98% of the time I sometimes get an error that derails the script. Here is the script: /*========================================================================================== Arma III Helicopter Transport - CSAT =========================================================================================== * Creates a helicopter which transports infantry to the nearest neutral or enemy sector * The helicopter's spawn position and return location is the same position as the spawn module * Call with: _this execVM "Scripts\SpawnAI_HelicopterTransport_CSAT.sqf" ===========================================================================================*/ //Define Variables params[ "_group", "_module", "_groupData" ]; //Create Helicopter Group and Helicopter _heloCrew = createGroup East; _helo = [getPos _module, getDir _module, "O_Heli_Light_02_F", EAST] call BIS_FNC_spawnVehicle; //Assign the crew to the Helicopter group & assign cargo to the Helicopter {[_x] joinSilent _heloCrew;} forEach crew (_helo select 0); {_x assignAsCargo (_helo select 0); _x moveInCargo (_helo select 0);} forEach units _group; //Find the Closest Neutral or Enemy Sector _sectors = +BIS_fnc_moduleSector_sectors apply{ [ _x distanceSqr _module, _x ] }; _sectors sort true; _index = _sectors findIf { _x params[ "", "_sector" ]; _sectorOwner = _sector getVariable[ "owner", sideUnknown ]; _sectorOwner isEqualTo sideUnknown || _sectorOwner isEqualTo West }; //Find a flat position around the LZ marker & create an HPad there. _flatPos = [getPos ( _sectors select _index select 1 ), 0, 550, 10, 0, 0.3, 0] call BIS_fnc_findSafePos; _hPad = createVehicle ["Land_HelipadEmpty_F", _flatPos, [], 0, "NONE"]; //Give the helicopter an unload waypoint onto the hpad _heloWp = _heloCrew addWaypoint [_hPad, 0]; _heloWp setWaypointType "TR UNLOAD"; _heloWp setWaypointBehaviour "CARELESS"; _heloWp setWaypointCombatMode "BLUE"; _heloWp setWaypointSpeed "FULL"; _heloWp setWaypointStatements ["true", "(vehicle this) LAND 'LAND';"]; //Wait until the helicopter is touching the ground before ejecting the cargo WaitUntil {isTouchingGround (_helo select 0) || {!canMove (_helo select 0)}}; //Eject the Infantry {unAssignVehicle _x; _x action ["eject", vehicle _x]; sleep 0.5;} forEach units _group; //Eject the cargo //Wait Until the infantry group is no longer in the helicopter before assigning a new WP to the helicopter WaitUntil {{!alive _x || !(_x in (_helo select 0))} count (units _group) == count (units _group)}; //Delete the helipad {deletevehicle _hPad}; _heloWp = _heloCrew addWaypoint [getpos _module, 0]; _heloWp setWaypointType "MOVE"; _heloWp setWaypointBehaviour "AWARE"; _heloWp setWaypointCombatMode "BLUE"; _heloWp setWaypointSpeed "FULL"; _heloWp setWaypointStatements ["true", "{deleteVehicle _x;} forEach crew (vehicle this) + [vehicle this];"]; //End The error that I get has something to do with the sector selection process. Here is a picture of the error I get. Error: _flatPos = [getPos ( _sectors #select _index select 1 ), 0, 550, 10, 0, 0.3, 0] call BIS_fnc_findSafePos; Error Zero Divisor Anyone have any ideas how to fix this?
  3. I was able to test it this morning and it does return an error when the friendly side holds all of the sectors at once. How can I fix/account for that in the script? I cant exit the script if that condition is met because units are being spawned by the Spawn AI module and then the script is executing. Stopping the script from running wont stop the units from spawning. I would like for the helicopter to still fly off to a sector...I will start looking into that today.
  4. I will definitely try out those suggestions but I dont think its a syntax issue. Like I said, the script works 98% of the time. If it was an issue like that then I would think the script would mess up more often. I was thinking it might be related to a scenario where one side controls all the sectors at once. I think the script “filters” out friendly sectors and only selects uncaptured or enemy sectors. If the friendly side controls all the sectors then there is no where to go. Havent been able to test that yet though
  5. I know this is a heavily discussed issue but I can't piece it together despite searching and trying for several hours. Im trying to setup a script which will remove or add NVG goggles to each side based upon how the script is called via init. The idea is to setup an easy and fast way to quickly configure NVG settings for each side. This is what I have but I cant get it to work: /*========================================================================================== Arma III AI NightVision Settings ===========================================================================================*/ // 1) East NVG Setting - "True" to Add NVGs for all East Units, "False" to Remove NVGs for all East Units // 2) West NVG Setting - "True" to Add NVGs for all West Units, "False" to Remove NVGs for all West Units // 3) Independent NVG Setting - "True" to Add NVGs for all Independent Units, "False" to Remove NVGs for all Independent Units // 4) IR Laser Setting - "True" to enable IR Lasers for all units equipped with NVGs, "False" to disable IR Lasers for all units with NVGs // 5) Amount of time (in seconds) that will pass before the script loops _EastNVG = _this select 0; _WestNVG = _this select 1; _AAFNVG = _this select 2; _IRLaser = _this select 3; _Time = _this select 4; if (_EastNVG) then { { if ((side _x) == East) then { _x linkitem "NV_Goggles_Opfor"; _x action ["nvGoggles", _x]; _x EnableIRLasers _LaserSetting; }; } forEach allUnits; } else { { if ((side _x) == East) then { _x unlinkItem hmd _x; _x EnableIRLasers False; }; } forEach allUnits; }; Systemchat "AI NightVision Settings Loaded"; sleep _time; [] execvm Script.sqf My goal is do something like that for each side (East, West, Indep). If the input from init is "True" then the unit is given NVGs and they can operate their IR laser. If the setting is set to "False" then the NVGs are removed and their IR laser is turned off. The script is not complete but I cant get it to work for one side so I havent attempted to make it work for all the other sides.
  6. I got it to work if anyone wants to check it out. /*========================================================================================== Arma III AI NightVision Settings =========================================================================================== * Applies or removes nightvision goggles to all units of a particular side based upon the settings defined in Init * Runs on initialization and will apply nightvision settings to units placed by the mission maker at the start of the mission * Script loops in intervarls to account for units spawned after the start of the mission * Captive units (setcaptive true) will not be effected by this script * Call with: Called via Init.sqf ===========================================================================================*/ //Define Variables/Input Selection _EastNVG = _this select 0; _WestNVG = _this select 1; _IndependentNVG = _this select 2; _LaserSetting = _this select 3; _Time = _this select 4; //START While {True} do { //Create Arrays _AllEastUnits = []; _AllWestUnits = []; _AllIndependentUnits = []; //"Filter" Units into their respective Arrays {If ((side _x) == East) then {_AllEastUnits pushBack _x}} forEach allUnits; {If ((side _x) == West) then {_AllWestUnits pushBack _x}} forEach allUnits; {If ((side _x) == Independent) then {_AllIndependentUnits pushBack _x}} forEach allUnits; //East //--------------------------------------- if (_EastNVG) then { {_x linkitem "NVGoggles_Opfor"; _x action ["nvGoggles", _x]; _x EnableIRLasers _LaserSetting} foreach _AllEastUnits; } else { {_x unlinkItem hmd _x; _x EnableIRLasers False} foreach _AllEastUnits; }; //West //--------------------------------------- if (_WestNVG) then { {_x linkitem "NVGoggles"; _x action ["nvGoggles", _x]; _x EnableIRLasers _LaserSetting} foreach _AllWestUnits; } else { {_x unlinkItem hmd _x; _x EnableIRLasers False} foreach _AllWestUnits; }; //Independent //--------------------------------------- if (_IndependentNVG) then { {_x linkitem "NVGoggles_Opfor"; _x action ["nvGoggles", _x]; _x EnableIRLasers _LaserSetting} foreach _AllIndependentUnits; } else { {_x unlinkItem hmd _x; _x EnableIRLasers False} foreach _AllIndependentUnits; }; Systemchat "AI NVG Settings Loaded"; Sleep _Time; //END };
  7. Im trying to create a basic weapon swap script for units that are spawned via the AI Spawn Module. I was hoping I could pull this off by executing a script via the module’s expression field. I tried searching and found some examples but I cant pull it off myself. Can someone tell/show me how to call the script and apply it to the spawned group? Thank you so much!!
  8. I tried it out and it works...Im still trying to wrap my head around why/how it works 😆 Thank you for your help!
  9. Sorry, Im an idiot and got confused about what to use. This is what I just tried and it worked: While {True} do { _AllVehicles = Vehicles; // ForEach loop { if (not (_x isKindOf "staticWeapon") && (_x isKindOf "AllVehicles")) then { if ( (not canMove _x) || (not alive _x) || (({ alive _x } count (crew _x)) isEqualTo 0) ) then { deletevehicle _x; }; }; } foreach _AllVehicles; Player SideChat "AI Vehicle Script Loaded"; sleep 600; _AllVehicles = []; // Looks pointless }; This now accounts for ammoboxes but I dont think it accounts for mines? Also, why does it work like: (_x iskindof "AllVehicles")) and not _AllVehicles? I assumed "AllVehicles" is not a type of cfg "parent" class like "staticweapons" etc are...?
  10. Thanks for updating it! I tried that out and it gives an error. Here is what I have: _AllVehicles = Vehicles; { if (not (_x isKindOf "staticWeapon")) && (not (_x isKindOf "Reammobox_F")) && (not (_x isKindOf "MineGeneric")) then { if ( (not canMove _x) || (not alive _x) || (({ alive _x } count (crew _x)) isEqualTo 0) ) then { {deletevehicle _X} foreach crew _x; deletevehicle _x; }; }; } foreach _AllVehicles; The error it gives is this: if (not (_x isKindOf "staticWeapon")) && #(not (_x isKindOf "Reammobox_F")) && (not (_x isKindOf "MineGeneric")) then Type If, Expected Bool
  11. After playing with the script for awhile, I think its a little too broad: it currently deletes ammo boxes and I'm assuming it will also delete mines. Is there a way to add those into the initial "check" along with staticweapons? IE: if (not (_x isKindOf "staticWeapon")) && (not (_x isKindOf "Reammobox_F")) && (not (_x isKindOf "MineGeneric")) then { Thank you again for your help
  12. This runs perfectly! Thank you so much for your help!!!
  13. I tested the updated code and it does not produce any errors. However, it might not be deleting vehicles when the crew is dead. I added "this setdamage 1" to all of the crew members of a vehicle and then ran the script. That particular vehicle was not deleted. Is this type of scenario different from AI being killed in battle?
  14. Thank you for your help That produces an error message: if { (not canMove _x) || (not alive _x) || (count crew _x isEqualTo 0) } then { #if { (not canMove _x) || (not alive _x) || (count crew _x isEqualTo 0) } then { Error If: Type code, Expected Bool I have no clue what the issue is.
  15. Im trying to use a trigger to continuously spawn units until a cap is reached. My problem is that the trigger only activates once even though it is set to "repeatable." Here is a what I have so far, which is very basic: _ranGrp = ["BUS_InfSquad","BUS_InfSquad_Weapons"] call BIS_fnc_selectRandom; _infgrp = [getMarkerPos "Hide_Spawn", WEST, (configFile >> "CfgGroups" >> "West" >> "BLU_F" >> "Infantry" >> _ranGrp)] call BIS_fnc_spawnGroup; The Trigger condition is this: this && count thislist < 40 The trigger does spawn a group when it is activated but does not continue to spawn groups until the cap (40 units) is reached. Can anyone explain to me what I need to do? Thank you!
  16. Im using a modified (ie simplified) version of Iceman77's helicopter reinforcement script. The script works great but I wanted the infantry group to attack and defend sectors instead of the default seek and destroy. Here is what I got: /*========================================================================================== Arma III Helicopter Transport/Reinforcement Script =========================================================================================== Parameter(s): 1. Side - East, West, Resistance (Select 0) 2. Spawn Marker - Spawn position of the helicopter (Select 1) 3. Landing Zone Marker - Landing zone for the helicopter (Select 2) 4. Search & Destroy Mode - Whether or not the infantry group should initiate search and destory (true) or patrol (false) 5. Cylce Mode - Whether or not the script should run continously (True) or only once (False) (Select 4) 6. Minimum Sleep Time - Minimum amount of time the script should wait before running again. Only applies to cycle mode (Select 5) 7. Maximum Sleep Time - Maximum amount of time the script should wait before running again. Only applies to cycle mode (Select 6) Example: _nul = [SIDE, "Spawn Position (Marker)", "Landing Position (Marker)", Search & Destroy Mode, Cycle Mode, Min Sleep Time, Max Sleep Time] spawn TAG_fnc_reinforcements _nul = [WEST, "Obj_NatoHeli", "Obj_Nato", True, True, 300, 600] spawn TAG_fnc_reinforcements ===========================================================================================*/ TAG_fnc_reinforcements = { if (!isServer) exitWith {}; //Define Variables/Definitions: _side = _this select 0; _spawnMrk = _this select 1; _LZMrk = _this select 2; _sadMode = _this select 3; _cycleMode = _this select 4; _time1 = _this select 5; _time2 = _this select 6; _heloCrew = createGroup _side; //Set the scope of local variables that are defined in other scope(s), so they can be used over the entire script private ["_ranGrp","_helo","_infgrp"]; //**SPAWNS** Spawn helicopter and infantry groups based off of the "side" input Switch (_side) do { //West Helicopter and Infantry Group //---------------------------------------------------- case WEST : { _ranGrp = ["BUS_InfSquad","BUS_InfSquad_Weapons"] call BIS_fnc_selectRandom; _helo = [getMarkerPos _spawnMrk, markerDir _spawnMrk, "B_Heli_Transport_01_F", WEST] call BIS_FNC_spawnVehicle; _infgrp = [getMarkerPos _spawnMrk, WEST, (configFile >> "CfgGroups" >> "West" >> "BLU_F" >> "Infantry" >> _ranGrp)] call BIS_fnc_spawnGroup; }; //East Helicopter and Infantry Group //---------------------------------------------------- case EAST : { _ranGrp = ["OIA_InfSquad","OIA_InfSquad_Weapons"] call BIS_fnc_selectRandom; _helo = [getMarkerPos _spawnMrk, markerDir _spawnMrk, "O_Heli_Light_02_F", EAST] call BIS_FNC_spawnVehicle; _infgrp = [getMarkerPos _spawnMrk, EAST, (configFile >> "CfgGroups" >> "East" >> "OPF_F" >> "Infantry" >> _ranGrp)] call BIS_fnc_spawnGroup; }; //Resistance Helicopter and Infantry Group //---------------------------------------------------- case RESISTANCE : { _ranGrp = ["HAF_InfSquad","HAF_InfSquad_Weapons"] call BIS_fnc_selectRandom; _helo = [getMarkerPos _spawnMrk, markerDir _spawnMrk, "I_Heli_Transport_02_F", RESISTANCE] call BIS_FNC_spawnVehicle; _infgrp = [getMarkerPos _spawnMrk, RESISTANCE, (configFile >> "CfgGroups" >> "Indep" >> "IND_F" >> "Infantry" >> _ranGrp)] call BIS_fnc_spawnGroup; }; }; //Assign the crew to a group & assign cargo to the helo {[_x] joinSilent _heloCrew;} forEach crew (_helo select 0); {_x assignAsCargo (_helo select 0); _x moveInCargo (_helo select 0);} forEach units _infgrp; //Find a flat position around the LZ marker & create an HPad there. _flatPos = [getMarkerPos _LZMrk , 0, 400, 10, 0, 0.3, 0] call BIS_fnc_findSafePos; _hPad = createVehicle ["Land_HelipadEmpty_F", _flatPos, [], 0, "NONE"]; //Give the helicopter an unload waypoint onto the hpad _heloWp = _heloCrew addWaypoint [_hPad, 0]; _heloWp setWaypointType "TR UNLOAD"; _heloWp setWaypointBehaviour "CARELESS"; _heloWp setWaypointCombatMode "BLUE"; _heloWp setWaypointSpeed "FULL"; _heloWp setWaypointStatements ["true", "(vehicle this) LAND 'LAND';"]; //Wait until the helicopter is touching the ground before ejecting the cargo WaitUntil {isTouchingGround (_helo select 0) || {!canMove (_helo select 0)}}; //Eject the Infantry {unAssignVehicle _x; _x action ["eject", vehicle _x]; sleep 0.5;} forEach units _infgrp; //Eject the cargo //Wait Until the infantry group is no longer in the helicopter before assigning a new WP to the helicopter WaitUntil {{!alive _x || !(_x in (_helo select 0))} count (units _infGrp) == count (units _infGrp)}; _leader = (leader _infgrp); sleep 2; _leader synchronizeObjectsAdd [SecTactic]; //Delete the helipad {deletevehicle _hPad}; _heloWp = _heloCrew addWaypoint [getmarkerpos _spawnMrk, 0]; _heloWp setWaypointType "MOVE"; _heloWp setWaypointBehaviour "AWARE"; _heloWp setWaypointCombatMode "BLUE"; _heloWp setWaypointSpeed "FULL"; _heloWp setWaypointStatements ["true", "{deleteVehicle _x;} forEach crew (vehicle this) + [vehicle this];"]; //Cycle Mode //---------------------------------------------------- // IF _cycleMode is passed as true, then re-run the function (this function!), else do nothing. if (_cycleMode) then { sleep _time1 + (random _time2); [_side, _spawnMrk, _LZMrk, _sadMode, _cyclemode, _time1, _time2] spawn TAG_fnc_reinforcements; }; // Function End }; From my understanding, you can add units to the sector tactics by synching them to it. My thought was to do that via the sychronizeobjectsadd command but it doesnt seem to work
  17. Im trying to use Beerkan's AI Skill Script to set AI skill levels. The script seems to run fine for the first interation but seems to run into issues when the script loops. This is what Im using: ConfigUnits = { _unit = _this select 0; _unit AllowFleeing 0; _unit AllowCrewInImmobile True; _unit setSkill ["aimingAccuracy", 0.4 + (random 0.25)]; _unit setSkill ["aimingShake", 0.25 + (random 0.25)]; _unit setSkill ["aimingSpeed", 0.75 + (random 0.25)]; _unit setSkill ["commanding", 1 + (random 0.15)]; _unit setSkill ["courage", 1 + (random 0.15)]; _unit setSkill ["general", 0.75 + (random 0.25)]; _unit setSkill ["reloadSpeed", 0.8 + (random 0.05)]; _unit setSkill ["spotDistance", 1 + (random 0.20)]; _unit setSkill ["spotTime", 0.75+ (random 0.25)]; }; // Now save this array of units for later use _CheckedUnits = allUnits; // We now have all Units that started on the map with configured with our new settings. // We can now set up a loop to monitor for anything new being created (3 minute second loop) while {true} do { _NewUnits = []; // this variable will contain any new units that were not included on a previous loop _NewUnits = allUnits - _CheckedUnits; // Remove checked Units from the updated Unit array to create a list of new Units if (count _NewUnits > 0) then // Now only do the following if there are new units found. {[_x] spawn ConfigUnits} forEach _NewUnits; composeText [parsetext format["<t size='1.5' align='left' color='#ffffff'>There are <t color='#00ff00'>%1 <t color='#ffffff'>new units found and <t color='#ff0000'>%2 <t color='#ffffff'>Checked Units",count _NewUnits,count _CheckedUnits]] remoteExec ["hint"];// Debug _CheckedUnits append _NewUnits; sleep 20; }; Im getting the following error: Undefined variable in expression: _unit _unit = _this select 0; #_unit AllowFleeing 0; Anyone have any ideas?
  18. I tested the mission out and it appears to work. I have no idea what I am doing differently.
  19. Has anyone had any trouble getting this script to work with buildings on Livonia?
  20. What error are you getting.
  21. If you look back a few pages Dread gVe an example of how to addaction to a unit. My understanding was to have the unit execute a script which adds the addaction
  22. For whatever reason my SpawnAI Module does not spawn units with all of their gear; they spawn in with their uniform, vest, backpack, and weapon but do not have first aidkits, weapon scopes, etc. I made a script to fix the issue: /*========================================================================================== Arma III Attachment(s) Fix Created by Blitzen Updated: 7/22/2019 =========================================================================================== * AI infantry units that are spawned by the AI Spawn Module are, for whatever reason, stripped of their weapon scopes and attachments * This script re-applys weapon scopes and lasers back to units depending upon the units class * Call with: _this execVM "Scripts\SpawnAI_AttachmentsFix.sqf" ===========================================================================================*/ params[ "_group", "_module", "_groupData" ]; //Define Unit Types (Case Sensitive!) _SquadLeader = ["O_Soldier_SL_F", "B_Soldier_SL_F", "I_Soldier_SL_F"]; _RiflemanAT = ["O_Soldier_LAT_F", "B_Soldier_LAT_F", "I_Soldier_LAT_F"]; _TeamLeader = ["O_Soldier_TL_F", "B_Soldier_TL_F", "I_Soldier_TL_F"]; _Ammobearer = ["O_Soldier_A_F", "B_Soldier_A_F", "I_Soldier_A_F"]; _Rifleman = ["O_Soldier_F", "B_Soldier_F", "I_Soldier_F"]; _Marksman = ["O_soldier_M_F", "B_soldier_M_F", "I_Soldier_M_F"]; _Autorifleman = ["O_Soldier_AR_F", "B_Soldier_AR_F", "I_Soldier_AR_F"]; _Medic = ["O_medic_F", "B_medic_F", "I_medic_F"]; _Grenadier = ["O_Soldier_GL_F", "B_Soldier_GL_F", "I_Soldier_GL_F"]; _MissleSpecialist = ["O_Soldier_AT_F", "B_Soldier_AT_F", "I_Soldier_AT_F"]; _AsstMissleSpecialist = ["O_Soldier_AAT_F", "B_Soldier_AAT_F", "I_Soldier_AAT_F"]; _HeavyGunner = ["O_HeavyGunner_F", "B_HeavyGunner_F"]; _AsstAutorifleman = ["O_Soldier_AAR_F", "B_Soldier_AAR_F", "I_Soldier_AAR_F"]; _Sharpshooter = ["O_Sharpshooter_F", "B_Sharpshooter_F", "I_Sharpshooter_F"]; //START { _x params[ "_unit" ]; _unitType = typeOf _unit; //East //--------------------------------------- if ( side _group isEqualTo East ) then { if (_unitType in _SquadLeader) then {[_unit, configfile >> "CfgVehicles" >> "O_Soldier_SL_F"] call BIS_fnc_loadinventory;}; if (_unitType in _RiflemanAT) then {[_unit, configfile >> "CfgVehicles" >> "O_Soldier_LAT_F"] call BIS_fnc_loadinventory;}; if (_unitType in _TeamLeader) then {[_unit, configfile >> "CfgVehicles" >> "O_Soldier_TL_F"] call BIS_fnc_loadinventory;}; if (_unitType in _Ammobearer) then {[_unit, configfile >> "CfgVehicles" >> "O_Soldier_A_F"] call BIS_fnc_loadinventory;}; if (_unitType in _Rifleman) then {[_unit, configfile >> "CfgVehicles" >> "O_Soldier_F"] call BIS_fnc_loadinventory;}; if (_unitType in _Marksman) then {[_unit, configfile >> "CfgVehicles" >> "O_soldier_M_F"] call BIS_fnc_loadinventory;}; if (_unitType in _Autorifleman) then {[_unit, configfile >> "CfgVehicles" >> "O_Soldier_AR_F"] call BIS_fnc_loadinventory;}; if (_unitType in _Medic) then {[_unit, configfile >> "CfgVehicles" >> "O_medic_F"] call BIS_fnc_loadinventory;}; if (_unitType in _Grenadier) then {[_unit, configfile >> "CfgVehicles" >> "O_Soldier_GL_F"] call BIS_fnc_loadinventory;}; if (_unitType in _MissleSpecialist) then {[_unit, configfile >> "CfgVehicles" >> "O_Soldier_AT_F"] call BIS_fnc_loadinventory;}; if (_unitType in _AsstMissleSpecialist) then {[_unit, configfile >> "CfgVehicles" >> "O_Soldier_AAT_F"] call BIS_fnc_loadinventory;}; if (_unitType in _HeavyGunner) then {[_unit, configfile >> "CfgVehicles" >> "O_HeavyGunner_F"] call BIS_fnc_loadinventory;}; if (_unitType in _AsstAutorifleman) then {[_unit, configfile >> "CfgVehicles" >> "O_Soldier_AAR_F"] call BIS_fnc_loadinventory;}; if (_unitType in _Sharpshooter) then {[_unit, configfile >> "CfgVehicles" >> "O_Sharpshooter_F"] call BIS_fnc_loadinventory;}; //_unit linkItem "NVGoggles_OPFOR"; }; //West //--------------------------------------- if ( side _group isEqualTo West ) then { if (_unitType in _SquadLeader) then {[_unit, configfile >> "CfgVehicles" >> "B_Soldier_SL_F"] call BIS_fnc_loadinventory;}; if (_unitType in _RiflemanAT) then {[_unit, configfile >> "CfgVehicles" >> "B_Soldier_LAT_F"] call BIS_fnc_loadinventory;}; if (_unitType in _TeamLeader) then {[_unit, configfile >> "CfgVehicles" >> "B_Soldier_TL_F"] call BIS_fnc_loadinventory;}; if (_unitType in _Ammobearer) then {[_unit, configfile >> "CfgVehicles" >> "B_Soldier_A_F"] call BIS_fnc_loadinventory;}; if (_unitType in _Rifleman) then {[_unit, configfile >> "CfgVehicles" >> "B_Soldier_F"] call BIS_fnc_loadinventory;}; if (_unitType in _Marksman) then {[_unit, configfile >> "CfgVehicles" >> "B_soldier_M_F"] call BIS_fnc_loadinventory;}; if (_unitType in _Autorifleman) then {[_unit, configfile >> "CfgVehicles" >> "B_Soldier_AR_F"] call BIS_fnc_loadinventory;}; if (_unitType in _Medic) then {[_unit, configfile >> "CfgVehicles" >> "B_medic_F"] call BIS_fnc_loadinventory;}; if (_unitType in _Grenadier) then {[_unit, configfile >> "CfgVehicles" >> "B_Soldier_GL_F"] call BIS_fnc_loadinventory;}; if (_unitType in _MissleSpecialist) then {[_unit, configfile >> "CfgVehicles" >> "B_Soldier_AT_F"] call BIS_fnc_loadinventory;}; if (_unitType in _AsstMissleSpecialist) then {[_unit, configfile >> "CfgVehicles" >> "B_Soldier_AAT_F"] call BIS_fnc_loadinventory;}; if (_unitType in _HeavyGunner) then {[_unit, configfile >> "CfgVehicles" >> "B_HeavyGunner_F"] call BIS_fnc_loadinventory;}; if (_unitType in _AsstAutorifleman) then {[_unit, configfile >> "CfgVehicles" >> "B_Soldier_AAR_F"] call BIS_fnc_loadinventory;}; if (_unitType in _Sharpshooter) then {[_unit, configfile >> "CfgVehicles" >> "B_Sharpshooter_F"] call BIS_fnc_loadinventory;}; //_unit linkItem "NVGoggles"; }; //Independent //--------------------------------------- if ( side _group isEqualTo Independent ) then { if (_unitType in _SquadLeader) then {[_unit, configfile >> "CfgVehicles" >> "I_Soldier_SL_F"] call BIS_fnc_loadinventory;}; if (_unitType in _RiflemanAT) then {[_unit, configfile >> "CfgVehicles" >> "I_Soldier_LAT_F"] call BIS_fnc_loadinventory;}; if (_unitType in _TeamLeader) then {[_unit, configfile >> "CfgVehicles" >> "I_Soldier_TL_F"] call BIS_fnc_loadinventory;}; if (_unitType in _Ammobearer) then {[_unit, configfile >> "CfgVehicles" >> "I_Soldier_A_F"] call BIS_fnc_loadinventory;}; if (_unitType in _Rifleman) then {[_unit, configfile >> "CfgVehicles" >> "I_Soldier_F"] call BIS_fnc_loadinventory;}; if (_unitType in _Marksman) then {[_unit, configfile >> "CfgVehicles" >> "I_soldier_M_F"] call BIS_fnc_loadinventory;}; if (_unitType in _Autorifleman) then {[_unit, configfile >> "CfgVehicles" >> "I_Soldier_AR_F"] call BIS_fnc_loadinventory;}; if (_unitType in _Medic) then {[_unit, configfile >> "CfgVehicles" >> "I_medic_F"] call BIS_fnc_loadinventory;}; if (_unitType in _Grenadier) then {[_unit, configfile >> "CfgVehicles" >> "I_Soldier_GL_F"] call BIS_fnc_loadinventory;}; if (_unitType in _MissleSpecialist) then {[_unit, configfile >> "CfgVehicles" >> "I_Soldier_AT_F"] call BIS_fnc_loadinventory;}; if (_unitType in _AsstMissleSpecialist) then {[_unit, configfile >> "CfgVehicles" >> "I_Soldier_AAT_F"] call BIS_fnc_loadinventory;}; if (_unitType in _AsstAutorifleman) then {[_unit, configfile >> "CfgVehicles" >> "I_Soldier_AAR_F"] call BIS_fnc_loadinventory;}; if (_unitType in _Sharpshooter) then {[_unit, configfile >> "CfgVehicles" >> "I_Sharpshooter_F"] call BIS_fnc_loadinventory;}; //_unit linkItem "NVGoggles_Indep"; }; Sleep 2; }forEach units _group; //END Note that the _unit linkitem NVgoggles lines were commented out whenever I tested the script.
  23. I was able to run it real quick and it seems to work well with units that placed down at the start of the mission but not as well with units that spawn after the mission starts. Some of the spawned units have their NVG's removed but other units (within the same squad) do not have their NVGs removed. I observed the units through what should have been multiple loops and the NVGs were never removed. I didnt get any errors. **EDIT** My guess is that this issue relates to how the unit is equipped upon spawning. It seems there is a delay between when the unit spawns and when it receives its gear. The unit spawns in, gets HMD_Checked true'd, and then receives its gear...?
  24. @Larrow Thank you for your help! Every time you post something I learn of new commands and ways of doing things that I didnt know about before
  25. Wow, thats a lot of scripting. My feeble mind was able to pick up on the redressing part of the script but then blew a fuse. Im trying to utilize the frame work of your script to give/remove night vision goggles to units of a particular side. The thought is to change how the script is called via the init file to easily change who has access to night vision, ie: [true, true, false] execvm script Where each true/false input corresponds to a side. I need the script to loop because I use a lot of spawning in my missions.
×