Jump to content

Blitzen88

Member
  • Content Count

    105
  • Joined

  • Last visited

  • Medals

Community Reputation

9 Neutral

About Blitzen88

  • Rank
    Sergeant

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. I tested the mission out and it appears to work. I have no idea what I am doing differently.
  2. Has anyone had any trouble getting this script to work with buildings on Livonia?
  3. What error are you getting.
  4. 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
  5. 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.
  6. 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...?
  7. @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
  8. 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.
  9. All of that got it work perfectly! Is there anyway you could show me how to take the framework of that script and apply it to equiping/removing a unit's nightvision goggles? I have tried and tried but I dont know what I am doing wrong. This is what I got: //Define Variables _NVGWest = _this select 0; _NVGEast = _this select 1; _NVGIndep = _this select 2; // Now save this array of units for later use _CheckedUnits = []; // 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 = 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. If (_NVGWest) then { {If ((side _x) == West) then {_x AddItem "NVGoggles"; _x AssignItem "NVGoggles";}}forEach allunits; } Else {_x UnAssignItem "NVGoggles"; _x RemoveItem "NVGoggles";}forEach allunits; If (_NVGEast) then { {If ((side _x) == East) then {_x AddItem "NVGoggles_Opfor"; _x AssignItem "NVGoggles_Opfor";}}forEach allunits; } Else {_x UnAssignItem "NVGoggles_Opfor"; _x RemoveItem "NVGoggles_Opfor";}forEach allunits; If (_NVGIndep) then { {If ((side _x) == Independent) then {_x AddItem "NVGoggles_Indep"; _x AssignItem "NVGoggles_Indep";}}forEach allunits; } Else {_x UnAssignItem "NVGoggles_Indep"; _x RemoveItem "NVGoggles_Indep";}forEach allunits }; 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 15; };
  10. Still trying to figure out what I am doing wrong
  11. 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?
  12. That seems to work. Thank you!
  13. I’ve tried “_this” and it didnt work...?
  14. I have modified my description.ext file to add an init eventhandler to the CAManBase: class Extended_Init_Eventhandlers { class CAManBase { init = "_this execVM 'Scripts\AISkillSettings.sqf';"; }; }; That code snippet executes my AI skill script whenever the unit is spawned. The relevant part of the script is: { _x AllowFleeing 0; _x AllowCrewInImmobile True; _x setSkill ["aimingAccuracy", 0.5 + (random 0.25)]; _x setSkill ["aimingShake", 0.25 + (random 0.25)]; _x setSkill ["aimingSpeed", 0.75 + (random 0.25)]; _x setSkill ["commanding", 1 + (random 0.15)]; _x setSkill ["courage", 1 + (random 0.15)]; _x setSkill ["general", 0.75 + (random 0.25)]; _x setSkill ["reloadSpeed", 0.8 + (random 0.05)]; _x setSkill ["spotDistance", 1 + (random 0.20)]; _x setSkill ["spotTime", 0.75+ (random 0.25)]; } forEach allUnits; Is there anyway to change this script from applying to all units to just applying to the individual unit that has spawned? I have tried "this" and "_this" instead of "foreach allunits" but it I always get errors when I mess around with it. Thanks
  15. You guys are amazing lol. I assumed there would be an update to CBA at some point.
×