Jump to content


  • Content Count

  • Joined

  • Last visited

  • Medals

Community Reputation

17 Good

1 Follower

About Blitzen88

  • Rank
    Staff Sergeant

Recent Profile Visitors

1665 profile views
  1. I'm modifying Nixx57's Ambient Combat Script but I'm having some difficulties getting consistent group spawning. The script stops spawning if the number of spawned groups is no longer less than the group limit (_SpawnedGroups < _GroupsLimit). However, it doesnt seem to be very reliable. I'm also having problems exec'ing the UPS script for some reason...? Here is what I got: /*========================================================================================== Arma III - Test Created by Nixx57 Edited by Blitzen =========================================================================================== * test https://forums.bohemia.net/forums/topic/231643-release-generic-ambient-combat-first-script/ * [2000, 8, "RHS", True, True, False, False, "UPS_Test", 20] execVM "Scripts\Testing\AI_AmbientCombat_Edits.sqf" ===========================================================================================*/ //Define Input Variables _SpawnAreaAroundPlayers = _this select 0; _GroupsLimit = _this select 1; _ModType = _this select 2; _SpawnBLUFOR = _this select 3; _SpawnOPFOR = _this select 4; _SpawnINDEPENDENT = _this select 5; _DisableVehicles = _this select 6; _UPSMarkerName = _this select 7; _SleepDelay = _this select 8; //Define Additional Variables _GroupsWest = []; _GroupsEast = []; _GroupsIndependent = []; _Sides = []; _SpawnedGroups = 0; _SelectedSide = []; _SelectedGroup = []; _NewGroup = []; _VehicleCheck = []; _GroupTracker = []; //Define Group Arrays based off of ModType Input Switch (_ModType) do { case "Vanilla": { _GroupsWest = [ ["B_Soldier_SL_F", "B_Soldier_F", "B_soldier_LAT_F", "B_soldier_M_F", "B_Soldier_TL_F", "B_soldier_AR_F", "B_Soldier_A_F", "B_medic_F"], ["B_Soldier_SL_F", "B_soldier_AR_F", "B_Soldier_GL_F", "B_soldier_M_F", "B_soldier_AT_F", "B_soldier_AAT_F", "B_Soldier_A_F", "B_medic_F"], ["B_APC_Wheeled_01_cannon_F", "B_Soldier_SL_F", "B_Soldier_TL_F", "B_Soldier_F", "B_soldier_LAT_F", "B_soldier_M_F", "B_soldier_AR_F", "B_Soldier_A_F", "B_medic_F"], ["APC_Wheeled_01_atgm_base_lxWS", "B_Soldier_SL_F", "B_Soldier_TL_F", "B_Soldier_F", "B_soldier_LAT_F", "B_soldier_M_F", "B_soldier_AR_F", "B_Soldier_A_F", "B_medic_F"] ]; _GroupsEast = [ ["O_Soldier_SL_F", "O_Soldier_F", "O_Soldier_LAT_F", "O_soldier_M_F", "O_Soldier_TL_F", "O_Soldier_AR_F", "O_Soldier_A_F", "O_medic_F"], ["O_Soldier_SL_F", "O_Soldier_AR_F", "O_Soldier_GL_F", "O_soldier_M_F", "O_Soldier_AT_F", "O_Soldier_AAT_F", "O_Soldier_A_F", "O_medic_F"], ["O_APC_Wheeled_02_rcws_v2_F", "O_Soldier_SL_F", "O_Soldier_TL_F", "O_Soldier_F", "O_Soldier_LAT_F", "O_soldier_M_F", "O_Soldier_AR_F", "O_Soldier_A_F", "O_medic_F"], ["O_APC_Tracked_02_cannon_F", "O_Soldier_SL_F", "O_Soldier_TL_F", "O_Soldier_F", "O_Soldier_LAT_F", "O_soldier_M_F", "O_Soldier_AR_F", "O_Soldier_A_F", "O_medic_F"] ]; _GroupsIndependent = [ ["I_Soldier_SL_F", "I_soldier_F", "I_Soldier_LAT_F", "I_Soldier_M_F", "I_Soldier_TL_F", "I_Soldier_AR_F", "I_Soldier_A_F", "I_medic_F"], ["I_Soldier_SL_F", "I_Soldier_AR_F", "I_Soldier_GL_F", "I_Soldier_M_F", "I_Soldier_AT_F", "I_Soldier_AAT_F", "I_Soldier_A_F", "I_medic_F"], ["I_APC_Wheeled_03_cannon_F", "I_Soldier_SL_F", "I_Soldier_TL_F", "I_soldier_F", "I_Soldier_LAT_F", "I_Soldier_M_F", "I_Soldier_AR_F", "I_Soldier_A_F", "I_medic_F"], ["I_APC_tracked_03_cannon_F", "I_Soldier_SL_F", "I_Soldier_TL_F", "I_soldier_F", "I_Soldier_LAT_F", "I_Soldier_M_F", "I_Soldier_AR_F", "I_Soldier_A_F", "I_medic_F"] ]; }; case "RHS": { _GroupsWest = [ ["B_Soldier_SL_F", "B_Soldier_F", "B_soldier_LAT_F", "B_soldier_M_F", "B_Soldier_TL_F", "B_soldier_AR_F", "B_Soldier_A_F", "B_medic_F"], ["B_Soldier_SL_F", "B_soldier_AR_F", "B_Soldier_GL_F", "B_soldier_M_F", "B_soldier_AT_F", "B_soldier_AAT_F", "B_Soldier_A_F", "B_medic_F"], ["rhsusf_stryker_m1126_m2_wd", "B_Soldier_SL_F", "B_Soldier_TL_F", "B_Soldier_F", "B_soldier_LAT_F", "B_soldier_M_F", "B_soldier_AR_F", "B_Soldier_A_F", "B_medic_F"], ["rhsusf_stryker_m1126_mk19_wd", "B_Soldier_SL_F", "B_Soldier_TL_F", "B_Soldier_F", "B_soldier_LAT_F", "B_soldier_M_F", "B_soldier_AR_F", "B_Soldier_A_F", "B_medic_F"], ["RHS_M2A3_wd", "B_Soldier_SL_F", "B_Soldier_TL_F", "B_Soldier_F", "B_soldier_LAT_F", "B_soldier_M_F", "B_soldier_AR_F", "B_Soldier_A_F", "B_medic_F"] ]; _GroupsEast = [ ["O_Soldier_SL_F", "O_Soldier_F", "O_Soldier_LAT_F", "O_soldier_M_F", "O_Soldier_TL_F", "O_Soldier_AR_F", "O_Soldier_A_F", "O_medic_F"], ["O_Soldier_SL_F", "O_Soldier_AR_F", "O_Soldier_GL_F", "O_soldier_M_F", "O_Soldier_AT_F", "O_Soldier_AAT_F", "O_Soldier_A_F", "O_medic_F"], ["rhs_btr80a_msv", "O_Soldier_SL_F", "O_Soldier_TL_F", "O_Soldier_F", "O_Soldier_LAT_F", "O_soldier_M_F", "O_Soldier_AR_F", "O_Soldier_A_F", "O_medic_F"], ["rhs_bmp2d_msv", "O_Soldier_SL_F", "O_Soldier_TL_F", "O_Soldier_F", "O_Soldier_LAT_F", "O_soldier_M_F", "O_Soldier_AR_F", "O_Soldier_A_F", "O_medic_F"], ["rhs_bmp3m_msv", "O_Soldier_SL_F", "O_Soldier_TL_F", "O_Soldier_F", "O_Soldier_LAT_F", "O_soldier_M_F", "O_Soldier_AR_F", "O_Soldier_A_F", "O_medic_F"] ]; _GroupsIndependent = []; // Independent units are not yet supported for RHS but have been included here for completness }; }; //Some RHS vehicles can hold 8 passengers, some can hold 6 - need to make an array _SixPassengers = [ "RHS_M2A3_wd", "rhs_bmp2d_msv", "rhs_bmp3m_msv" ]; //Create UPS Marker _UPSMarker = createMarker [_UPSMarkerName, getpos Player]; _UPSMarker setMarkerShapeLocal "ELLIPSE"; _UPSMarker setMarkerSizeLocal [_SpawnAreaAroundPlayers, _SpawnAreaAroundPlayers]; _UPSMarker setMarkerAlpha 0; //Apply selected Side(s) to Sides Array if(_SpawnBLUFOR) then {_Sides pushBack West}; if(_SpawnOPFOR) then {_Sides pushBack East}; if(_SpawnINDEPENDENT) then {_Sides pushBack Independent}; //Start Loop while {true} do { // Spawn "Check" if (_SpawnedGroups < _GroupsLimit) then { //Select a Side _SelectedSide = selectRandom _Sides; //Select a group from the selected side Switch (_SelectedSide) do { case West: { _SelectedGroup = selectRandom _GroupsWest; }; case East: { _SelectedGroup = selectRandom _GroupsEast; }; case Independent: { _SelectedGroup = selectRandom _GroupsIndependent; }; }; //Find a spawn position _SpawnPos = [Player, (_SpawnAreaAroundPlayers - 200), _SpawnAreaAroundPlayers, 3, 0, 10, 0] call Bis_fnc_findSafePos; //Spawn a group _NewGroup = [_SpawnPos, _SelectedSide, _SelectedGroup] call BIS_fnc_spawnGroup; //Give time for the new group to initialize Sleep 2; //Add new group to group tracking array _SpawnedGroups = _SpawnedGroups + 1; _GroupTracker = _GroupTracker + [_NewGroup]; //Set group parameters _NewGroup setBehaviour "AWARE"; _NewGroup setSpeedMode "NORMAL"; _NewGroup setCombatMode "RED"; _NewGroup setFormation "WEDGE"; _NewGroup deleteGroupWhenEmpty true; //See if the group has a vehicle _VehicleCheck = [_NewGroup, true] call Bis_Fnc_groupVehicles; //Delete the vehicle if vehicles are disabled (based on input) if ((_DisableVehicles) && (count _VehicleCheck > 0)) then { { deletevehicle _x} foreach _VehicleCheck; }; //Delete squad members if the vehicle can only hold 6 passengers { if (_x in _SixPassengers) then { {deletevehicle _x} foreach [(units _NewGroup select 6), (units _NewGroup select 7)]; }; }foreach _VehicleCheck; //Exec UPS Script [(leader _NewGroup), _UPSMarkerName, "NoSlow", "NoFollow"] execVM "Scripts\AI\AI_UrbanPatrolScript.sqf"; //Apply loadout script based on input Switch (_ModType) do { case "Vanilla": {[_NewGroup] execVM "Scripts\Loadouts\Vanilla\Loadout_Default.sqf"}; case "RHS": {[_NewGroup] execVM "Scripts\Loadouts\RHS\Loadout_RHS_Default.sqf"}; }; }; //Delete Groups Check { if ((leader _x distance player) > _SpawnAreaAroundPlayers && {alive _x} count units _x > 0) then { { if (vehicle _x != _x) then { deletevehicle (objectParent _x)}; deletevehicle _x; }foreach units _x; _SpawnedGroups = _SpawnedGroups - 1; }; }foreach _GroupTracker; //_SpawnedGroups = count _GroupTracker; //Move UPSMarker _UPSMarker setMarkerPos Player; sleep _SleepDelay; };
  2. I’ve defined “custom” (ie RHS and vanilla) groups via my description.ext file. Is there a way I can spawn those groups via Bis_fnc_spawngroup? Based off of my structure, would this be the correct syntax: configfile >> "CfgGroups" >> "West" >> "NATO_RHS" >> "Infantry" >> "NATO_RHS_RifleSquad" I don’t know if “configfile” needs to be concluded…? Description.ext: Nato
  3. Im trying to brainstorm a spawn script but I’m running into some issues when it comes to locating a spawn position. I’m trying to accomplish two things: 1) find a “safe” spawn position (ie don’t spawn tanks on top of a building) via BIS_fnc_findSafePos and 2) make sure the player does not see the spawn positions via checkvisibility. However, I don’t know how to structure the script so it will continue to search for a spawn position if it cant find one on the initial search. This is what I’m thinking:
  4. Thank you, thats what I was looking for!
  5. Thanks for the reply. I already use that for scripts which are called from the expression field. Im trying to figure out if you can change the script with another script.
  6. How do you modify a Spawn AI Module's Expression Field via a Script? Particularly, how do you modify it while retaining the existing input? For instance: Call with: [SpawnModule] execVM ScriptPath _SpawnModule = _this select 0; _Expression = ?? Get variable ?? _NewExpression = _Expression + (New Stuff) Thanks
  7. How would you do it if you were pulling from an array? For instance: _array = [ Vehicle1 Vehicle2 Vehicle3 ]; { _Object addaction ["How do I add the name here", {[_this select 0] execVM "Scripts\Blah.sqf"}]; } foreach _array;
  8. How can I pull and use a unit's classname in the title of an addaction? For instance: { _Object addaction ["How do I add the classname here", {[_this select 0] execVM "Scripts\Blah.sqf"}]; } foreach units group1;
  9. Think I figured it out - nevermind
  10. Greetings, I use Zenophon's Garrison Script to garrison buildings with AI. Its my favorite garrison script for a number of reasons. However, the script runs some sort of check to place an AI solider directly in front of a window - this way the AI unit can have a full field of view. Although this is ideal for most scenarios, sometimes I like to "fortify" a house by blocking all of the windows. This way, a player has to clear the house of AI as opposed to shooting them through the window. However, when I do this, Zenophon's script ignores/fails to place units in the building because their view is blocked. I'm trying to add a parameter to turn the view checking on/off but I cant figure it out. Here is a version of the script: Many years ago I reached out to Zenophon regarding this issue and he tried to help me fix this issue. Here is what he said: However, I cant figure out how to implement his suggestions - when I add a true/false check with the original conditions the script doesnt seem to work. I would reach out to him again but he seems inactive now. Any help would be appreciated
  11. Isnt that the same as re-execing it if you just re-call it?
  12. Got an AI hunt (ie stalk) script that I made and Im having some trouble re-execing it after a While loop has completed. Can anyone tell/show me how to make it loop without re-execing it? I feel like re-execing it is bad practice. Here it is (look at the very bottom):
  13. Probably going to take this route. I found this post which describes how MARTA classifies groups….probably gonna take the same approach.