Blitzen88 18 Posted May 21 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; }; Share this post Link to post Share on other sites
avibird 1 154 Posted May 24 Hi. First UPS has not been updated in a very long time and has a lot of bugs. I find it only useful for vehicles now. Infantry groups don't really work as intended. JEBUS MGI advanced modules https://steamcommunity.com/workshop/filedetails/?id=1682280809 Are my two respawn go to methods. I just started using MGI it has some other functions that jebus does not have and vice versa. Both methods work well together in the same mission. Both can use editor placed groups. Both can be set up to stop respawning through several methods of triggers are you killing the unit destroying an object for reaching a location. You should look into those two methods. 1 Share this post Link to post Share on other sites
Gunter Severloh 4054 Posted May 24 Have you tried RYD_PT? 1 Share this post Link to post Share on other sites
avibird 1 154 Posted May 25 @Gunter Severloh hi I'm glad you're healthy situation is better brother. Question for you I'm always looking for more and updated patrol scripts. like UPmons UpS Gaia ect most of these scripts are semi broken you the fact I have not been updated in a while. Does this script allow for editor place groups to use it can I use a different methods of respawning and only used the patrol script portion. Is there a way to set up a trigger to stop the respawns of groups. 1 Share this post Link to post Share on other sites
Gunter Severloh 4054 Posted May 25 3 hours ago, avibird 1 said: Does this script allow for editor place groups to use it can I use a different methods of respawning and only used the patrol script portion Yes, dont matter how you spawn them when a squad or whatever is spawned they will patrol what you specify. 3 hours ago, avibird 1 said: Is there a way to set up a trigger to stop the respawns of groups. Respawn is customizable you can set how many times you want them to spawn, or have them spawn when a player enters a trigger, or an existing group enters a trigger that spawns a new group, use radio triggers, dont matter. Ask Rydygier on the release thread he can give you a more definitive answer with details as to what the script can do as he wrote it. My videos on the release thread show you how to set it up, and then also show you what you can do with it. Share this post Link to post Share on other sites