Jump to content

Recommended Posts

Can someone help me please.  I am trying to get this script to eventualkly work with Epoch, I am using the CUPS version.  Right now, I ahve stripped all of section 7 out of the script, and changed any Ravage specific items to Epoch items.  I made 6 markers on a small Island near Altis' Capital CIty, but no camps will spawn at all.  Can't reallyu find any error messages.  Can someone use the script as I have it on a test server, or look it over and tell me why it wouldn't spawn any camps at all?

 

<spoiler>

////////////////////////////////////////
//LOOPER////////
////////////////////////////////////////
while {true} do {// THIS LOOPS THE SCRIPT

  /////////////////////////////////////////////////////////////////////
  //1. ARRAY OF MARKERS THAT NEED TO BE PLACED ON THE MAP. ///////////
  //EACH MARKER STANDS FOR A POSSIBLE CAMP LOCATION//
  //THE MARKERS HERE AND THE MARKERS ON THE MAP INGAME NEED TO CORRESPOND//
  //E.G. IF YOU ADD A MARKER HERE, ADD IT IN THE EDITOR INGAME AS WELL AND VICE VERCA////////////
  /////////////////////////////////////////////////////////////////////
_mark = ["mrkrA_1","mrkrA_2","mrkrA_3","mrkrA_4","mrkrA_5","mrkrA_6"] call BIS_fnc_selectRandom; // THIS SELECTS ONE OF THE MARKER. GOING FORWARD, _mark WILL REFER TO THE MARKER SELECTED HERE

//1.1 SOME DETAILS THAT CAN BE CONFIGURED:
_activationRadius = 4000; // (REFERENCE FOR CODE UNDER ITEM 2) SETS THE RADIUS AROUND THE FIRST MARKER, WHERE THE SCRIPT IS ACTIVE. WHEN THE PLAYER IS OUTSIDE THIS RADIUS, THE SCRIPT WILL PAUSE TO SAVE FPS
_despawnSleepRnd = 3600; // (REFERENCE FOR CODE UNDER ITEM 8)SETS THE TIMER IN SECONDS FOR THE CAMPT TO DESPAWN, WILL SELECT A RANDOM NUMBER (E.G. 3600: IT WILL SELECT A RANDOM NUMBER BETWEEN 1 AND 3600)
_despawnSleepFix = 1000;// (REFERENCE FOR CODE UNDER ITEM 8)SETS A FIX TIMER IN SECONDS THAT WILL RUN AFTER THE RANDOM TIMER
_despanPauseProxy = 200;// (REFERENCE FOR CODE UNDER ITEM 9)SETS A RADIUS AROUND THE CAMP POSITION.WHEN THE PLAYER IS WITHIN THIS RADIUS, DESPAWNING IS PAUSED
//////////////////////
//2 PROXIMITY CHECK///
//- CHECKS IF THE PLAYER IS CLOSE ENOUGH TO THE MAIN MARKER.//
/////////////////////////////////////////////////////////
WaitUntil {player distance (GetMarkerPos "mrkrA_1") < _activationRadius}; ///THE MARKER, IN THIS CASE "mrkrA_1" MUST ALWAYS BE IN THE CENTER OF A 4000 METERS RADIOS AND ALL ADDITIONAL MARKERS MUST BE WITHIN THIS RADIUS. CHANGE THE NUMBER TO INCREASE OR DECREASE THE RADIUS

/////////////////////////////////////////////////////////////////////
//3. ARRAYS OF OBJECTS, STRUCTURES AND ITEMS THAT WILL SPAWN/////////
/////////////////////////////////////////////////////////////////////
//3.1. LOOTABLE OBJECTS AND WRECKS
_lootableObjectArray = ["Land_Sack_F","Land_BarrelTrash_F","Land_Sacks_goods_F"];
_objectsArray = ["Land_Sack_F","Land_BarrelTrash_F","Land_Sacks_goods_F","Land_CratesWooden_F","Land_Cages_F","Land_GarbagePallet_F","Land_GarbageBarrel_01_F","Land_Pallets_F","Land_Garbage_square5_F","Land_CratesShabby_F","Land_CanisterPlastic_F","Land_Garbage_line_F","Land_WoodenBox_F","Land_Sacks_heap_F","Land_PaperBox_closed_F","Land_GarbageBags_F"];
_objectsArray1 = ["TargetP_Zom_F","Land_Sack_F","Land_BarrelTrash_F","Land_Sacks_goods_F","Land_CratesWooden_F","Land_Cages_F","Land_GarbagePallet_F","Land_GarbageBarrel_01_F","Land_Pallets_F","Land_Garbage_square5_F","Land_CratesShabby_F","Land_CanisterPlastic_F","Land_Garbage_line_F","Land_WoodenBox_F","Land_Sacks_heap_F","Land_PaperBox_closed_F","Land_GarbageBags_F"];
_objectsArray2 = ["Land_WoodPile_large_F","Land_WoodPile_F","Land_Sack_F","Land_BarrelTrash_F","Land_Sacks_goods_F","Land_CratesWooden_F","Land_Cages_F","Land_GarbagePallet_F","Land_GarbageBarrel_01_F","Land_Pallets_F","Land_Garbage_square5_F","Land_CratesShabby_F","Land_CanisterPlastic_F","Land_Garbage_line_F","Land_WoodenBox_F","Land_Sacks_heap_F","Land_PaperBox_closed_F","Land_GarbageBags_F"];
_objectsArray3 = ["Land_TentA_F","Land_TentDome_F","Land_Sack_F","Land_BarrelTrash_F","Land_Sacks_goods_F","Land_CratesWooden_F","Land_Cages_F","Land_GarbagePallet_F","Land_GarbageBarrel_01_F","Land_Pallets_F","Land_Garbage_square5_F","Land_CratesShabby_F","Land_CanisterPlastic_F","Land_Garbage_line_F","Land_WoodenBox_F","Land_Sacks_heap_F","Land_PaperBox_closed_F","Land_GarbageBags_F"];
_objectsArray4 = ["CamoNet_OPFOR_open_F","CamoNet_INDP_open_F","CamoNet_BLUFOR_open_F","CamoNet_OPFOR_open_F","CamoNet_INDP_open_F","CamoNet_BLUFOR_open_F","CamoNet_OPFOR_open_F","CamoNet_INDP_open_F","CamoNet_BLUFOR_open_F","Land_Sack_F","Land_BarrelTrash_F","Land_Sacks_goods_F","Land_CratesWooden_F","Land_Cages_F","Land_GarbagePallet_F","Land_GarbageBarrel_01_F","Land_Pallets_F","Land_Garbage_square5_F","Land_CratesShabby_F","Land_CanisterPlastic_F","Land_Garbage_line_F","Land_WoodenBox_F","Land_Sacks_heap_F","Land_PaperBox_closed_F"];
_wreckArray = ["Mi8Wreck","BlackhawkWreck","Land_Wreck_Heli_Attack_01_F","Land_ScrapHeap_1_F","Land_ScrapHeap_2_F","Land_Scrap_MRAP_01_F","Land_WoodenCart_F","Land_Wreck_Car2_F","Land_Wreck_Truck_dropside_F","Land_Wreck_Ural_F","Land_Wreck_Heli_Attack_02_F","Land_Wreck_HMMWV_F"];

//3.2. STRUCTURES SUCH AS TENTS, HOUSES,...
_tents = ["Camp","Land_tent_east"];
_tents2 = ["Land_tent_east","Land_tent2_west"];
_tents3 = ["Land_tent_west","CampEast"];
_tents4 = ["Camp","Land_tent_east","CampEast"];
_camonets = ["CamoNet_BLUFOR_big_F","Land_GarbageBarrel_01_F"];
_campfire = ["Campfire_burning_F","MetalBarrel_burning_F"];

/////////////////////////////////////////////////////////////////////
//4. ARRAYS OF ITEMS THAT WILL SPAWN/////////
/////////////////////////////////////////////////////////////////////
//TIP: THE MORE OFTEN AN ITEM APPEARS IN AN ARRAY, THE MORE LIKELY IT IS THAT THIS ITEM WILL SPAWN. HENCE, YOU COULD ENTER COMMON ITEMS 4 TIMES AND RARE ITEMS ONLY ONCE
//4.1 EXAMPLE, PUT IN SOMETHING THAT YOU WANT TO SPAWN MULTIPLE TIME AND WHERE YOU WANT TO BE SURE ONLY THIS ITEM DROPS
_itemArray = ["Krypto"];
//4.2. EXAMPLE, PUT IN COMMON ITEMS THAT YOU WANT TO SPAWN
_itemArray2 =[
"ItemBriefcaseSilver100oz",
"ItemCopperBar10oz",
"ChainSaw",
"ItemSafe",
"WhiskeyNoodle",
"jerrycan_epoch",
"lighter_epoch",
"lighter_epoch",
"Pumpkin",
"meatballs_epoch",
"TacticalBacon",
"CookedSheep_EPOCH",
"ItemSeaBassCooked",
"FoodWalkNSons",
"ItemVitamins",
"CUP_NVG_PVS7",
"muzzle_snds_B",
"muzzle_snds_L",
"acc_flashlight_pistol",
"CUP_optic_CompM4",
"optic_DMS",
"CUP_H_RUS_6B27_olive",
"CUP_V_CDF_6B3_3_FST",
"CUP_U_B_CDF_FST_2",
"CUP_V_CDF_6B3_3_FST"
];

//4.3. EXAMPLE, PUT IN COMMON ITEMS THAT YOU WANT TO SPAWN
_itemArray3 =[
"CUP_NVG_PVS7",
"muzzle_snds_B",
"muzzle_snds_L",
"acc_flashlight_pistol",
"CUP_optic_CompM4",
"optic_DMS",
"CUP_H_RUS_6B27_olive",
"CUP_V_CDF_6B3_3_FST",
"CUP_U_B_CDF_FST_2",
"CUP_V_CDF_6B3_3_FST"
];

//4.4. EXAMPLE ARRAY OF WEAPONS YOU WANT TO SPAWN.
_WeaponArray = [
"CUP_hgun_Makarov",
"CUP_hgun_TaurusTracker455",
"CUP_hgun_Colt1911",
"CUP_srifle_CZ550",
"CUP_srifle_LeeEnfield_rail",
"CUP_hgun_Makarov",
"CUP_hgun_TaurusTracker455",
"CUP_hgun_Colt1911",
"CUP_srifle_CZ550",
"CUP_srifle_LeeEnfield_rail",
"CUP_hgun_Makarov",
"CUP_hgun_TaurusTracker455",
"CUP_hgun_Colt1911",
"CUP_srifle_CZ550",
"CUP_srifle_LeeEnfield_rail",
"CUP_arifle_M4A1_camo",
"CUP_arifle_G36C_camo",
"CUP_sgun_AA12",
"CUP_lmg_minimi_railed",
"CUP_arifle_M16A4_GL",
"CUP_srifle_AWM_wdl",
"CUP_hgun_BallisticShield_Armed",
"CUP_arifle_AK74",
"CUP_srifle_CZ550_rail",
"CUP_sgun_Saiga12K",
"CUP_launch_RPG7V",
"CUP_arifle_AKS74U"
];

// EXAMPLE: HERE I SPAWN MEDICAL ITEMS OR FOOD
_mediclootArray =[
"FAK",
"clean_water_epoch",
"Soap_Epoch",
"adrenaline_epoch",
"morphine_epoch",
"orlistat_epoch",
"iodide_pills_epoch",
"iodide_pills_epoch",
"ItemWaterPurificationTablets"];

// EXPLOSIVES YOU WANT TO SPAWN, EXPLOSIVES AND MAGAZINES CAN NOT BE SPAWNED TOGETHER WITH WEAPONS OR ITEMS FYI
_explosivesArray = [
"CUP_HandGrenade_RGO",
"HandGrenade",
"SmokeShellBlue",
"SmokeShellGreen",
"SmokeShellOrange",
"SmokeShellPurple",
"SmokeShellRed",
"SmokeShell",
"SmokeShellYellow",
"DemoCharge_Remote_Mag",
"ClaymoreDirectionalMine_Remote_Mag",
"SatchelCharge_Remote_Mag",
"APERSTripMine_Wire_Mag",
"APERSMine_Range_Mag"
];

/////////////////////////////////////////////////////////////////////
//5. SPAWNER:
//THIS PART;
//-  SELECTS RANDOM ITEMS, OBJECTS, STRUCTURES FROM POINT 4. ABOVE
//-  CREATES A SPAWNPOINT RELATIVE TO THE MARKER RANDOMLY SELECTED UNDER POINT 3. ABOVE
//-  SPAWNS STRUCTURES, OBJECTS AND THE LOOTBOX
//-  DISABLE DAMAGE OF SPAWNED STRUCTURES, OBJECTS OR LOOTBOX
//-  SET THE DIRECTION THE OBJECT OR STRUCTURE IS HEADING/////////
/////////////////////////////////////////////////////////////////////
//5.1 FIREPLACE, TENTS, CAMONETS SPAWNER
_fireplace = _campfire call BIS_fnc_selectRandom createVehicle getMarkerPos _mark; //SELECTS SPAWN POSITION RELATIVE TO _MARK AND SPAWNS A STRUCTURES FROM THE RESPECTIVE ARRAY
_fireplace allowDamage false; // DISABLE DAMANGE FOR THE OBJECT
_fireplace setDir 180; // SET DIRECTION
_tent = _tents call BIS_fnc_selectRandom createVehicle [(getMarkerPos _mark select 0) + 18*sin(0), (getMarkerPos _mark select 1) + 18*cos(0), 0];
_tent allowDamage false;
_tent setDir 190;
_camonet = _camonets call BIS_fnc_selectRandom createVehicle [(getMarkerPos _mark select 0) + 18*sin(0), (getMarkerPos _mark select 1) + 18*cos(0), 0];
_camonet allowDamage false;
_camonet setDir 10;
_tent2 = _tents2 call BIS_fnc_selectRandom createVehicle [(getMarkerPos _mark select 0) + 15*sin(90), (getMarkerPos _mark select 1) + 15*cos(90), 0];
_tent2 allowDamage false;
_tent2 setDir 85;
_camonet2 = _camonets call BIS_fnc_selectRandom createVehicle [(getMarkerPos _mark select 0) + 15*sin(90), (getMarkerPos _mark select 1) + 15*cos(90), 0];
_camonet2 allowDamage false;
_camonet2 setDir 85;
_tent3 = _tents3 call BIS_fnc_selectRandom createVehicle [(getMarkerPos _mark select 0) + 15*sin(180), (getMarkerPos _mark select 1) + 15*cos(180), 0];
_tent3 allowDamage false;
_tent3 setDir 250;
_tent4 = _tents4 call BIS_fnc_selectRandom createVehicle [(getMarkerPos _mark select 0) +15*sin(270), (getMarkerPos _mark select 1) +10*cos(270), 0];
_tent4 allowDamage false;
_tent4 setDir 320;

//5.2 Ambient or lootable props (if ravage mod is active) selection and spawn point relative to _mark
_object1 = _objectsArray call BIS_fnc_selectRandom createVehicle [(getMarkerPos _mark select 0) + 10*sin(0), (getMarkerPos _mark select 1) + 10*cos(0), 0]; //SELECTS SPAWN POSITION RELATIVE TO _MARK
_object1 allowDamage false; // DISABLE DAMANGE FOR THE OBJECT
_object1 setDir (random 359); // SET DIRECTION
_object2 = _objectsArray1 call BIS_fnc_selectRandom createVehicle [(getMarkerPos _mark select 0) + 10*sin(75), (getMarkerPos _mark select 1) + 10*cos(75), 0];
_object2 allowDamage false;
_object2 setDir (60);
_object3 = _wreckArray call BIS_fnc_selectRandom createVehicle [(getMarkerPos _mark select 0) + 30*sin(130), (getMarkerPos _mark select 1) + 30*cos(130), 0];
_object3 allowDamage false;
_object3 setDir (random 359);
_object4 = _objectsArray2 call BIS_fnc_selectRandom createVehicle [(getMarkerPos _mark select 0) + 11*sin(135), (getMarkerPos _mark select 1) + 11*cos(135), 0];
_object4 allowDamage false;
_object4 setDir (random 359);
_object5 = _objectsArray3 call BIS_fnc_selectRandom createVehicle [(getMarkerPos _mark select 0) + 8*sin(225), (getMarkerPos _mark select 1) + 8*cos(225), 0];
_object5 allowDamage false;
_object5 setDir (random 359);
_object6 = _objectsArray3 call BIS_fnc_selectRandom createVehicle [(getMarkerPos _mark select 0) + 16*sin(225), (getMarkerPos _mark select 1) + 16*cos(225), 0];
_object6 allowDamage false;
_object6 setDir (random 359);
_object7 = _objectsArray4 call BIS_fnc_selectRandom createVehicle [(getMarkerPos _mark select 0) + 13*sin(225), (getMarkerPos _mark select 1) + 13*cos(225), 0];
_object7 allowDamage false;
_object7 setDir (180);

//5.3 LOOTSPAWNS
//5.3.1 LOOTBOX THAT YOU WANT TO LOOT FOR FANCY STUFF! NOTES BELOW:
		_item = _itemArray select (floor (random (count _itemArray))); // SELECTS AN ITEM OUT OF THE RESPECTIVE ARRAY FOR THE FIRST LOOT POSITION IN ITEMBOX
    _item2 = _itemArray2 select (floor (random (count _itemArray2)));// SELECTS AN ITEM OUT OF THE RESPECTIVE ARRAY FOR NEXT LOOT POSITION IN ITEMBOX
    _item3 = _itemArray2 select (floor (random (count _itemArray2)));// SAME FOR NEXT LOOT POSITION
    _item4 = _itemArray2 select (floor (random (count _itemArray2)));// SAME FOR NEXT LOOT POSITION
    _item5 = _itemArray3 select (floor (random (count _itemArray3)));// SAME FOR NEXT LOOT POSITION
    _explo = _explosivesArray select (floor (random (count _explosivesArray))); //SAME FOR NEXT LOOT POSITION BUT SELECTS AN EXPLOSIVE FROM EXLOSIVES ARRAY
    _weapon = _weaponArray select (floor (random (count _weaponArray))); // SELECTS A RANDOM WEAPON FROM THE WEAPON ARRAY FOR THE FIRST WEAPON LOOT POSITION OF THE LOOTBOX
    _weapon1 = _weaponArray select (floor (random (count _weaponArray)));// SELECTS A RANDOM WEAPON FROM THE WEAPON ARRAY FOR THE NEXT WEAPON LOOT POSITION OF THE LOOTBOX
		_itemBox = "Box_FIA_Wps_F" createVehicle [0,0,0]; // SPAWNS THE LOOT BOX
		_itemBox allowDamage false; // DISABLE DAMAGE FOR LOOTBOX
    _itemBox setDir (90); // ORIENTATION OF THE LOOTBOX
		clearMagazineCargoGlobal _itembox; // CLEAR CONTENT OF LOOTBOX
		clearWeaponCargoGlobal _itembox;
		clearItemCargoGlobal _itembox;
		clearBackpackCargoGlobal _itembox;
		_itemBox setPos [(getMarkerPos _mark select 0) +8*sin(270), (getMarkerPos _mark select 1) +8*cos(270), 0]; // SETS THE POSITION OF THE LOOTBOX RELATIVE TO THE RANDOM SELECTED MARKER _MARK
		_itemBox additemCargoGlobal [_item, 50 +random 50]; // SPAWNS THE ITEMS THAT WHERE RANDOMLY SELECTED FOR THIS LOOT POSITION. IN THIS EXAMPLE THE ARRAY ONLY CONTAINS RVG_MONEY, HENCE IT WILL SPAWN 50 X RVG_MONEY + A RANDOM AMOUNT OF 0-50 IN ADDITION
    _itemBox additemCargoGlobal [_item2, 1 +random 1];// SPAWNS THE ITEMS THAT WHERE RANDOMLY SELECTED FOR THIS LOOT POSITION. 1 FOR SURE AND WITH A CHANCE TO SPAWN 1 ADDITIONAL ITEM
    _itemBox additemCargoGlobal [_item5, 1 +random 1];// SPAWNS THE ITEMS THAT WHERE RANDOMLY SELECTED FOR THIS LOOT POSITION.1 FOR SURE AND WITH A CHANCE TO SPAWN 1 ADDITIONAL ITEM
    _itemBox addMagazineCargoGlobal [_explo, 1 +random 2];// SPAWNS THE EXPLOSIVES THAT WHERE RANDOMLY SELECTED FOR THIS LOOT POSITION. NOTE THAT MAGAZINES AND EXPLOSIVES NEED TO BE SPAWNED USING "ADDMAGAZINECARGOGLOBAL" 1 FOR SURE AND WITH A CHANCE TO SPAWN 2 ADDITIONAL ITEM
    _itemBox additemCargoGlobal [_item3, 1 +random 1];// SPAWNS THE ITEMS THAT WHERE RANDOMLY SELECTED FOR THIS LOOT POSITION.1 FOR SURE AND WITH A CHANCE TO SPAWN 1 ADDITIONAL ITEM
    _itemBox additemCargoGlobal [_item4, 1 +random 1];// SPAWNS THE ITEMS THAT WHERE RANDOMLY SELECTED FOR THIS LOOT POSITION.1 FOR SURE AND WITH A CHANCE TO SPAWN 1 ADDITIONAL ITEM
    _itemBox addWeaponCargo [_weapon,1 +random 1];// SPAWNS THE WEAPON THAT WHERE RANDOMLY SELECTED FOR THIS LOOT POSITION.1 FOR SURE AND WITH A CHANCE TO SPAWN 1 ADDITIONAL ITEM
    _magazines = getArray (configFile >> "CfgWeapons" >> _weapon >> "magazines"); // SELECTS MATCHING MAGAZINES FOR THE WEAPON SPAWNED
    _mag = _magazines select (floor (random (count _magazines)));// SELECTS MATCHING MAGAZINES FOR THE WEAPON SPAWNED
    _itemBox addMagazineCargoGlobal [_mag, 2 +random 4];// SPAWNS 2 MATCHING MAGAZINES PLUS RANDOM AMOUNT OF 4 IN ADDITION
    _itemBox addWeaponCargo [_weapon1,1 +random 1]; // SAME AS ABOVE
    _magazines = getArray (configFile >> "CfgWeapons" >> _weapon1 >> "magazines");// SAME AS ABOVE
    _mag = _magazines select (floor (random (count _magazines)));// SAME AS ABOVE
    _itemBox addMagazineCargoGlobal [_mag, 2 +random 4];// SAME AS ABOVE

//////////////////////////////////////////////////////////
//6. LOOT SPAWNERS FOR STRUCTURES SUCH AS HOUSES OR TENTS
/////////////////////////////////////////////////////////
//6.1 FILLS HOUSES, WORKS WELL ON ALL VANILLA AND DLC STRUCTURES, NOT SO WELL WITH TENTS
// THIS PLACES LOOTABLE OBJECTS FOR RAVAGE
_itemBoxArray1 = [];
_houseArray1 = getMarkerPos _mark nearObjects ["camp",50]; //SEARCHES FOR HOUSES NEAR THE MAIN MARKER OF THE CAMP (50 METERS RADIUS)
{
	_buildingPositions1 = [_x] call BIS_fnc_buildingPositions; // FINDS THE BUILDING POSITIONS OF THE HOUSES IN THE AREA
	{
		if (30 > random 100) then { //30% OF THE BUILDING POSITIONS ARE FILLED - NOTE: NOT 100% SURE IF IT WORKS THIS WAY, BUT HERE YOU CAN LOWER THE AMOUNT OF ITEMS/OBJECTS THAT SPAWN IN HOUSES
		_lootobject = _lootableObjectArray select (floor (random (count _lootableObjectArray))); //SELECTS RANDOM OBJECTS FROM ARRAY
		_itemBox1 = _lootobject createVehicle [0,0,0]; // CREATE THE SELECTED OBJECT
		_itemBox1 allowDamage false; //DISABLES DAMAGE
		_itemBox1 setPos _x; // NOT 100% SURE BUT THIS MEMORIZES THE LOTO POSITIONS
		_itemBoxArray1 = _itemBoxArray1 + [_itemBox1]; //WHATEVER THIS DOES..
	};
	} forEach _buildingPositions1; // EXECUTES THE SPAWN CODE FOR EACH BUILDINGPOSITION IN A HOUSE
} forEach _houseArray1; // EXECUTES THE SPAWN CODE FOR EACH HOUSE IN THE AREA

//6.2. THIS SPAWNS ACTUAL ITEMS ON THE GROUND (VIA "GROUNDEWWAPONHOLDER"), IN THIS CASE, MEDICAL AND SURVIVAL (RAVAGE) ITEMS.
_itemBoxArray2 = [];
_houseArray2 = getMarkerPos _mark nearObjects ["house",50];
{
	_buildingPositions2 = [_x] call BIS_fnc_buildingPositions;
	{
		if (20 > random 100) then {
		_medicloot2 = _mediclootArray select (floor (random (count _mediclootArray)));
		_itemBox2 = "GroundWeaponHolder" createVehicle [0,0,0];
		_itemBox2 allowDamage false;
		_itemBox2 setPos _x;
    _itemBox2 addItemCargoGlobal [_medicloot2, 1 +random 0]; // THIS WILL SELECT RANDOM LOOT FROM THE RESPECTIVE ARRAY AND SPAWNS 1 + 0 RANDOM ITEMS. HERE, 0 COULD BE UPDATED TO 6 FOR A CHANCE TO SPAWN 6 ADDITIONA ITEMS, AS AN EXAMPLE
		_itemBoxArray2 = _itemBoxArray2 + [_itemBox2];
	};
	} forEach _buildingPositions2;
} forEach _houseArray2;

//6.3 SAME AS ABOVE BUT "CAMP" WILL CAPTURE SOME OF THE CUP AND VANILLA TENTS YOU MIGHT WANNA SPAWN, NOT ALL HOWEVER.
_itemBoxArray3 = [];
_houseArray3 = getMarkerPos _mark nearObjects ["camp",50];
{
	_buildingPositions3 = [_x] call BIS_fnc_buildingPositions;
	{
		if (20 > random 100) then {
		_medicloot3 = _mediclootArray select (floor (random (count _mediclootArray)));
		_itemBox3 = "GroundWeaponHolder" createVehicle [0,0,0];
		_itemBox3 allowDamage false;
		_itemBox3 setPos _x;
    _itemBox3 addItemCargoGlobal [_medicloot3, 1];
		_itemBoxArray3 = _itemBoxArray3 + [_itemBox3];
	};
	} forEach _buildingPositions3;
} forEach _houseArray3;


////////////////////////////////////////
//8. TIMER IN SECONDS UNTIL THE CAMP DESPAWNS AND RESPAWNS AGAIN
///////////////////////////////////////////////////////
Sleep (random _despawnSleepRnd);Sleep _despawnSleepFix; // (CHANGE FIGURES UNDER ITEM 1.1)FIRST NUMBER STES A RANDOM AMOUNT OF SECONDS BETWEEN 1-3600 AND THE SECOND NUMBER SETS A DEFINITE TIMER OF 1000 SECODS. SO THE CAMP WILL RESPAWN EARLIEST AFTER 1000 SECONDS AND AT MAXIMUM AFTER 4600 SECONDS OR IF POINT 9. BELOW IS THE CASE.

////////////////////
//9. PAUSE DESPAWN, IF PLAYER IS TOO CLOSE TO THE CAMP
//////////////////////
WaitUntil {player distance (GetMarkerPos _mark) > _despanPauseProxy}; // (CHANGE FIGURES UNDER ITEM 1.1)IF THE PLAYER IS WITHIN xyz METERS CLOSE TO THE MAIN MARKER, THE SCRIPT WILL PAUSE AND WILL NOT DESPAWN. THE SCRIPT WILL PROCEED ONCE THE PLAYER IS FURTHER AWAY THAN 200 METERS.

///////////////////////////
//10. DESPAWN/DELETION/////
///////////////////////////
//- ANY SPAWNED OBJECT RECEIVES A REFERENCE (EG. _FIREPLACE) AND NEEDS TO BE DELETED AS SHOWN BELOW
deleteVehicle _fireplace;
deleteVehicle _itembox;
deleteVehicle _tent;
deleteVehicle _tent2;
deleteVehicle _tent3;
deleteVehicle _tent4;
deleteVehicle _Object1;
deleteVehicle _camonet;
deleteVehicle _camonet2;
deleteVehicle _Object2;
deleteVehicle _Object3;
deleteVehicle _Object4;
deleteVehicle _Object5;
deleteVehicle _Object6;
deleteVehicle _Object7;

//10.1 DELETES ITEMS THAT WHERE SPAWNED IN MULTIPLE BUILDING POSITIONS
{	deleteVehicle _x; } forEach _itemBoxArray1;
{	deleteVehicle _x; } forEach _itemBoxArray2;
{	deleteVehicle _x; } forEach _itemBoxArray3;

</spolier>

Share this post


Link to post
Share on other sites

hi @steam-76561198063590739,

alright lets see, whats in your init.sqf?

to test the script i would put all markers very close and put your player next to the marker (best as civilian else he will be attacked;) put the fix and random despawn time to 5 and the despawn safezone to 1. the script should now keep spawning camps in front of your nose. make sure the markers are named correctly too.  

 

i ll try to run your Version above to see if i detect any issues too.

 

Share this post


Link to post
Share on other sites

This is my init...

 

//extra missions
execVM "debug\blckClient.sqf";
//Supply Drop Alert Event
"SDROP_Alert" addPublicVariableEventHandler {
hint parseText format["%1", _this select 1];
};
//IGNATZ-STUFF
if (hasInterface) then {
	[] execVM "addons\Ignatz_EarPlugs.sqf";
	[] execVM "addons\Ignatz_Statusbar.sqf";
	Ignatz_Client_DoorOpener = compilefinal preprocessfilelinenumbers "addons\Ignatz_Client_DoorOpener.sqf";
};
//BANDIT CAMP
[] execVM "banditcamp.sqf";

Basically I put 6 markers together on an island, and nothing ever spawned.  Since I am new to this, I will ask, I only loaded mission.sqm into my editor and made the markers from the instructions given.  Is that correct?  Once I know it will spawn camps, then I will see if someone in the Epoch community can help spawn in AI. using A3EAI

 

Share this post


Link to post
Share on other sites

@steam-76561198063590739 in your mission folder you will need the init.sqf, the mission.sqm and the banditcamp.sqf file.

the markers (take the "empty" ones) variable names must match the ones in the banditcamp.sqf file. 

 

you do not get an error message right?

my first thought would be that maybe the markers are wrong and the script runs correctly but it can not find the right markers.

have you named the markers as "marker..." or as marker... in eden editor? you dont need the " " in the editor.

 

 

 

 

Share this post


Link to post
Share on other sites

Curious why you aren't dynamically generating the arrays for items. For example explained here:

 

// Automate fetching weapon classes
_cfgWeapons = "true" configClasses (configFile >> "cfgWeapons");

{
	_weaponString = configName (_x);
	_parents = [_x,true] call BIS_fnc_returnParents;

	if ("Rifle" in _parents) then {
		_WeaponArray append [_weaponString];
	};

	if ("Pistol" in _parents) then {
		_weaponArray append [_weaponString];
	};

	if ("Launcher" in _parents) then {
		_WeaponArray append [_weaponString];
	};
} forEach _cfgWeapons;
// Automation process

The above was tested and it works a treat! The weapon crates spawned at the bandit camp includes weapons. Using something like this would mean you could add whatever weapon mods you wanted to a mission without the need manually update the array. I suspect this could be used for other classes too; clothes, magazines (Ravage items etc). 

 

 

  • Like 1

Share this post


Link to post
Share on other sites
2 hours ago, JasonTheRed said:

Curious why you aren't dynamically generating the arrays for items. For example explained here:

 


// Automate fetching weapon classes
_cfgWeapons = "true" configClasses (configFile >> "cfgWeapons");

{
	_weaponString = configName (_x);
	_parents = [_x,true] call BIS_fnc_returnParents;

	if ("Rifle" in _parents) then {
		_WeaponArray append [_weaponString];
	};

	if ("Pistol" in _parents) then {
		_weaponArray append [_weaponString];
	};

	if ("Launcher" in _parents) then {
		_WeaponArray append [_weaponString];
	};
} forEach _cfgWeapons;
// Automation process

The above was tested and it works a treat! The weapon crates spawned at the bandit camp includes weapons. Using something like this would mean you could add whatever weapon mods you wanted to a mission without the need manually update the array. I suspect this could be used for other classes too; clothes, magazines (Ravage items etc). 

 

 

haha this is funny, i am currently rewriting the bandit camp script and was trying to figure out how to pull mod specific uniforms, vests and such from configfile yesterday evening:)

 

so yeah it is indeed my goal to have the process automated for most arrays.

my criteria is to exclude vanilla arma stuff however.

 

with weapons i personally prefer to have a selected variety of arms. but surely i can offer both options to the script users;)

 

my main problem is to figure out what parameters from the config file i have to use to get the specific array i want. (uniforms, vests, mod specific weapons and so on) gotta rewatch the mentioned tutorial:)

  • Like 2

Share this post


Link to post
Share on other sites
Spoiler

weaponarraycustom = [];
weaponArray = [];
_count = count weaponarraycustom;

if (_count >= 1) then {weaponArray append weaponarraycustom;}
else {
_cfgWeapons = "true" configClasses (configFile >> "cfgWeapons");

{
	_weaponString = configName (_x);
	_parents = [_x,true] call BIS_fnc_returnParents;

	if ("Rifle" in _parents) then {
		weaponArray append [_weaponString];
	};
  if ("Pistol" in _parents) then {
		weaponArray append [_weaponString];
	};
  if ("Launcher" in _parents) then {
  		weaponArray append [_weaponString];
  	};
} forEach _cfgWeapons;};

 

alright the next BC spawner will have arrays like this, so it will apply mods automatically but if you want to limit the arrays to your own custom list of e.g. weapons you can enter them in the respective field and it will only add those.

 

I would like to extract the vanilla weapons, so if someone has a list of all the weapons in a nice format i will add a option to remove such weapons via a blacklist function of some sort=)

 

  • Like 1

Share this post


Link to post
Share on other sites

 

Spoiler
Quote

VD_weaponarraycustom = ["CUP_srifle_Mk12SPR","CUP_srifle_ksvk_PSO3"];
VD_weaponarrayblacklist = ["CUP_srifle_Mk12SPR"];
VD_weaponArray = [];
_count = count VD_weaponarraycustom;

if (_count >= 1) then {VD_weaponArray append VD_weaponarraycustom;}
else {
_cfgWeapons = "true" configClasses (configFile >> "cfgWeapons");

{
    _weaponString = configName (_x);
    _parents = [_x,true] call BIS_fnc_returnParents;

    if ("Rifle" in _parents) then {
        VD_weaponArray append [_weaponString];
    };
  if ("Pistol" in _parents) then {
        VD_weaponArray append [_weaponString];
    };
  if ("Launcher" in _parents) then {
          VD_weaponArray append [_weaponString];
      };
} forEach _cfgWeapons;};
VD_weaponarray = VD_weaponarray - VD_weaponarrayblacklist;
 

 

k so in this example you can see that i added custom weapons, also, i listed weapons that i specifically want to exclude.

in this example, the script sees that i want to add custom weapons, and will therefore not call all weapons from cfgWeapons but will only add the custom weapons to the  weaponarray. However, it notices that I have blacklsted items, and will remove those from the weaponarray.

 

if you want to have the script get all weapons, vanilla plus mods, use the below clean template:

Spoiler

VD_weaponarraycustom = [];
VD_weaponarrayblacklist = [];
VD_weaponArray = [];
_count = count VD_weaponarraycustom;

if (_count >= 1) then {VD_weaponArray append VD_weaponarraycustom;}
else {
_cfgWeapons = "true" configClasses (configFile >> "cfgWeapons");

{
    _weaponString = configName (_x);
    _parents = [_x,true] call BIS_fnc_returnParents;

    if ("Rifle" in _parents) then {
        VD_weaponArray append [_weaponString];
    };
  if ("Pistol" in _parents) then {
        VD_weaponArray append [_weaponString];
    };
  if ("Launcher" in _parents) then {
          VD_weaponArray append [_weaponString];
      };
} forEach _cfgWeapons;};
VD_weaponarray = VD_weaponarray - VD_weaponarrayblacklist;
 

 

will do this for all type of loot and then implement it in the BC script.

Edited by Vandeanson
ups, made the global variables a little more unique;)
  • Like 1

Share this post


Link to post
Share on other sites

@Vandeanson I was not expecting as quick a turnaround! Thanks. I'll play around with this and let you know if I have any issues. I like the addition of a blacklist as it would allow me to tailor the items for my Ravage scenarios. Thanks!

  • Like 1

Share this post


Link to post
Share on other sites

Alright, to exclude all arma 3 vanilla weapons, use this array. I have exported this from the BI page and have not tested it yet, so it should work in theory, but is to be tested;)

 

Spoiler

VD_WeaponArrayBlacklist = ["arifle_ARX_ghex_DMS_Pointer_Snds_Bipod_F",
"arifle_ARX_Viper_F",
"arifle_ARX_Viper_hex_F",
"arifle_CTAR_blk_F",
"arifle_CTAR_hex_F",
"arifle_CTAR_ghex_F",
"arifle_CTAR_GL_blk_F",
"arifle_CTAR_GL_hex_F",
"arifle_CTAR_GL_ghex_F",
"arifle_CTAR_blk_ACO_Pointer_F",
"arifle_CTAR_blk_Pointer_F",
"arifle_CTAR_blk_ACO_F",
"arifle_CTAR_GL_blk_ACO_F",
"arifle_CTAR_GL_blk_ARCO_Pointer_F",
"arifle_CTAR_blk_ARCO_Pointer_F",
"arifle_CTAR_blk_ACO_Pointer_Snds_F",
"arifle_CTAR_GL_blk_ACO_Pointer_Snds_F",
"arifle_CTAR_blk_ARCO_Pointer_Snds_F",
"arifle_CTAR_blk_ARCO_F",
"arifle_CTARS_blk_F",
"arifle_CTARS_hex_F",
"arifle_CTARS_ghex_F",
"arifle_CTARS_blk_Pointer_F",
"arifle_SPAR_01_blk_F",
"arifle_SPAR_01_khk_F",
"arifle_SPAR_01_snd_F",
"arifle_SPAR_01_GL_blk_F",
"arifle_SPAR_01_GL_khk_F",
"arifle_SPAR_01_GL_snd_F",
"arifle_SPAR_01_blk_ERCO_Pointer_F",
"arifle_SPAR_01_blk_ACO_Pointer_F",
"arifle_SPAR_01_GL_blk_ACO_Pointer_F",
"arifle_SPAR_01_GL_blk_ERCO_Pointer_F",
"arifle_SPAR_02_blk_F",
"arifle_SPAR_02_khk_F",
"arifle_SPAR_02_snd_F",
"arifle_SPAR_02_blk_Pointer_F",
"arifle_SPAR_02_blk_ERCO_Pointer_F",
"arifle_SPAR_03_blk_F",
"arifle_SPAR_03_khk_F",
"arifle_SPAR_03_snd_F",
"arifle_SPAR_03_blk_MOS_Pointer_Bipod_F",
"SMG_05_F",
"B_Patrol_Soldier_Leader_weapon_F",
"B_Patrol_Soldier_Operator_weapon_F",
"B_Patrol_Soldier_Marksman_weapon_F",
"B_Patrol_Soldier_Medic_weapon_F",
"B_Patrol_Soldier_Autorifleman_weapon_F",
"B_Patrol_Soldier_MachineGunner_weapon_F",
"B_Patrol_Soldier_HeavyGunner_weapon_F",
"B_Patrol_Soldier_Carrier_weapon_F",
"B_Patrol_Soldier_Specialist_weapon_F",
"B_Patrol_Soldier_Pistol_F",
"arifle_CTAR_blk_flash_F",
"arifle_CTAR_blk_aco_flash_F",
"arifle_CTAR_blk_arco_flash_F",
"arifle_CTARS_blk_flash_F",
"arifle_CTAR_GL_blk_aco_flash_F",
"arifle_CTAR_GL_blk_arco_flash_F",
"srifle_DMR_07_blk_F_arco_flash_F",
"SMG_02_flash_F",
"launch_MRAWS_olive_F",
"launch_MRAWS_olive_rail_F",
"launch_MRAWS_green_F",
"launch_MRAWS_green_rail_F",
"launch_MRAWS_sand_F",
"launch_MRAWS_sand_rail_F",
"launch_O_Vorona_brown_F",
"launch_O_Vorona_green_F"];

 

If anyone has the chance to test it before me, let me know=)

I will build in another line of code that will deal with the scenario, where only vanilla weapons should be used (eg. in that case the blacklist would empty the weaponarray, which needs to be undone)..

Share this post


Link to post
Share on other sites

Im having 

On 3/27/2018 at 7:50 AM, Vandeanson said:

Alright gents, both the script and OP are updated.

I have added a CUP version of the script with line by line explanation of the script. I hope this provides some clarity.=)

 

See changelog 27.03.2018 in OP

 

Any questions, please let me know

br

vandeanson

 

On 3/5/2018 at 5:46 AM, Vandeanson said:

Dynamic Bandit Camp Spawn Script

The idea behind this script is, that bandits or survivors in your survival mission will set up a camp somewhere to store their loot, money, even cars or helicopters.

Inspired by countless hours of searching for player hideouts in DayZ SA back in the days.

As the camps are spawned dynamically (de- and re-spawn every hour, in different compositions and randomly selected markers)

this should give your mission a nice immersive touch which will improve replay ability.

 

Showcase Videos: (slightly outdated, might provide a new one at some point)

 

 

 

 

Functions of the script

- random selection of 1 of 5 pre-placed markers

- random selection of structures to be placed around that marker

- random loot in main "treasure" lootbox

- random loot in the buildings

- random props spawn in buildings (that can be looted if you are running the Ravage mod)

- survival supplies (FAK, food, drinks) (food and drink is depending on the Ravage mod)

 - AI group that patrols the camp

- the camp will be deleted after 3600 seconds and the script will loop, starting from scratch

 

How to create, use and Install the script:

Step 1 - init.sqf

1. Open notepad.

2. Copy this code ------->  [] execVM "banditcamp.sqf";  

3. Paste the code into your notepad doc.

4. Save the notepad document with this name ----->  init.sqf

5. Move the init.sqf to your mission folder.

===================================

Note - if you already have an init.sqf then just add the code from 2 to it.

 

Step 2 - banditcamp.sqf

1. Open notepad.

2. Copy this code ------> from the spoiler below

3. Paste the code into your notepad doc.

4. Save the notepad document with this name ------> banditcamp.sqf

5. Move the banditcamp.sqf to your mission folder.

=========================================


banditcamp.sqf (uses CUP assets as there are more tents)

CUP Version:

- CUP Core

-CUP Terrain

  Reveal hidden contents


////////////////////////////////////////
//LOOPER////////
////////////////////////////////////////
while {true} do {// THIS LOOPS THE SCRIPT

  /////////////////////////////////////////////////////////////////////
  //1. ARRAY OF MARKERS THAT NEED TO BE PLACED ON THE MAP. ///////////
  //EACH MARKER STANDS FOR A POSSIBLE CAMP LOCATION//
  //THE MARKERS HERE AND THE MARKERS ON THE MAP INGAME NEED TO CORRESPOND//
  //E.G. IF YOU ADD A MARKER HERE, ADD IT IN THE EDITOR INGAME AS WELL AND VICE VERCA////////////
  /////////////////////////////////////////////////////////////////////
_mark = ["mrkrA_1","mrkrA_2","mrkrA_3","mrkrA_4","mrkrA_5"] call BIS_fnc_selectRandom; // THIS SELECTS ONE OF THE MARKER. GOING FORWARD, _mark WILL REFER TO THE MARKER SELECTED HERE

//1.1 SOME DETAILS THAT CAN BE CONFIGURED:
_activationRadius = 4000; // (REFERENCE FOR CODE UNDER ITEM 2) SETS THE RADIUS AROUND THE FIRST MARKER, WHERE THE SCRIPT IS ACTIVE. WHEN THE PLAYER IS OUTSIDE THIS RADIUS, THE SCRIPT WILL PAUSE TO SAVE FPS
_despawnSleepRnd = 3600; // (REFERENCE FOR CODE UNDER ITEM 8)SETS THE TIMER IN SECONDS FOR THE CAMPT TO DESPAWN, WILL SELECT A RANDOM NUMBER (E.G. 3600: IT WILL SELECT A RANDOM NUMBER BETWEEN 1 AND 3600)
_despawnSleepFix = 1000;// (REFERENCE FOR CODE UNDER ITEM 8)SETS A FIX TIMER IN SECONDS THAT WILL RUN AFTER THE RANDOM TIMER
_despanPauseProxy = 200;// (REFERENCE FOR CODE UNDER ITEM 9)SETS A RADIUS AROUND THE CAMP POSITION.WHEN THE PLAYER IS WITHIN THIS RADIUS, DESPAWNING IS PAUSED
//////////////////////
//2 PROXIMITY CHECK///
//- CHECKS IF THE PLAYER IS CLOSE ENOUGH TO THE MAIN MARKER.//
/////////////////////////////////////////////////////////
WaitUntil {player distance (GetMarkerPos "mrkrA_1") < _activationRadius}; ///THE MARKER, IN THIS CASE "mrkrA_1" MUST ALWAYS BE IN THE CENTER OF A 4000 METERS RADIOS AND ALL ADDITIONAL MARKERS MUST BE WITHIN THIS RADIUS. CHANGE THE NUMBER TO INCREASE OR DECREASE THE RADIUS

/////////////////////////////////////////////////////////////////////
//3. ARRAYS OF OBJECTS, STRUCTURES AND ITEMS THAT WILL SPAWN/////////
/////////////////////////////////////////////////////////////////////
//3.1. LOOTABLE OBJECTS AND WRECKS
_lootableObjectArray = ["Land_Sack_F","Land_BarrelTrash_F","Land_Sacks_goods_F"];
_objectsArray = ["Land_Sack_F","Land_BarrelTrash_F","Land_Sacks_goods_F","Land_CratesWooden_F","Land_Cages_F","Land_GarbagePallet_F","Land_GarbageBarrel_01_F","Land_Pallets_F","Land_Garbage_square5_F","Land_CratesShabby_F","Land_CanisterPlastic_F","Land_Garbage_line_F","Land_WoodenBox_F","Land_Sacks_heap_F","Land_PaperBox_closed_F","Land_GarbageBags_F"];
_objectsArray1 = ["TargetP_Zom_F","Land_Sack_F","Land_BarrelTrash_F","Land_Sacks_goods_F","Land_CratesWooden_F","Land_Cages_F","Land_GarbagePallet_F","Land_GarbageBarrel_01_F","Land_Pallets_F","Land_Garbage_square5_F","Land_CratesShabby_F","Land_CanisterPlastic_F","Land_Garbage_line_F","Land_WoodenBox_F","Land_Sacks_heap_F","Land_PaperBox_closed_F","Land_GarbageBags_F"];
_objectsArray2 = ["Land_WoodPile_large_F","Land_WoodPile_F","Land_Sack_F","Land_BarrelTrash_F","Land_Sacks_goods_F","Land_CratesWooden_F","Land_Cages_F","Land_GarbagePallet_F","Land_GarbageBarrel_01_F","Land_Pallets_F","Land_Garbage_square5_F","Land_CratesShabby_F","Land_CanisterPlastic_F","Land_Garbage_line_F","Land_WoodenBox_F","Land_Sacks_heap_F","Land_PaperBox_closed_F","Land_GarbageBags_F"];
_objectsArray3 = ["Land_TentA_F","Land_TentDome_F","Land_Sack_F","Land_BarrelTrash_F","Land_Sacks_goods_F","Land_CratesWooden_F","Land_Cages_F","Land_GarbagePallet_F","Land_GarbageBarrel_01_F","Land_Pallets_F","Land_Garbage_square5_F","Land_CratesShabby_F","Land_CanisterPlastic_F","Land_Garbage_line_F","Land_WoodenBox_F","Land_Sacks_heap_F","Land_PaperBox_closed_F","Land_GarbageBags_F"];
_objectsArray4 = ["CamoNet_OPFOR_open_F","CamoNet_INDP_open_F","CamoNet_BLUFOR_open_F","CamoNet_OPFOR_open_F","CamoNet_INDP_open_F","CamoNet_BLUFOR_open_F","CamoNet_OPFOR_open_F","CamoNet_INDP_open_F","CamoNet_BLUFOR_open_F","Land_Sack_F","Land_BarrelTrash_F","Land_Sacks_goods_F","Land_CratesWooden_F","Land_Cages_F","Land_GarbagePallet_F","Land_GarbageBarrel_01_F","Land_Pallets_F","Land_Garbage_square5_F","Land_CratesShabby_F","Land_CanisterPlastic_F","Land_Garbage_line_F","Land_WoodenBox_F","Land_Sacks_heap_F","Land_PaperBox_closed_F"];
_wreckArray = ["Mi8Wreck","BlackhawkWreck","Land_Wreck_Heli_Attack_01_F","Land_ScrapHeap_1_F","Land_ScrapHeap_2_F","Land_Scrap_MRAP_01_F","Land_WoodenCart_F","Land_Wreck_Car2_F","Land_Wreck_Truck_dropside_F","Land_Wreck_Ural_F","Land_Wreck_Heli_Attack_02_F","Land_Wreck_HMMWV_F"];

//3.2. STRUCTURES SUCH AS TENTS, HOUSES,...
_tents = ["Camp","Land_tent_east"];
_tents2 = ["Land_tent_east","Land_tent2_west"];
_tents3 = ["Land_tent_west","CampEast"];
_tents4 = ["Camp","Land_tent_east","CampEast"];
_camonets = ["CamoNet_BLUFOR_big_F","Land_GarbageBarrel_01_F"];
_campfire = ["Campfire_burning_F","MetalBarrel_burning_F"];

/////////////////////////////////////////////////////////////////////
//4. ARRAYS OF ITEMS THAT WILL SPAWN/////////
/////////////////////////////////////////////////////////////////////
//TIP: THE MORE OFTEN AN ITEM APPEARS IN AN ARRAY, THE MORE LIKELY IT IS THAT THIS ITEM WILL SPAWN. HENCE, YOU COULD ENTER COMMON ITEMS 4 TIMES AND RARE ITEMS ONLY ONCE
//4.1 EXAMPLE, PUT IN SOMETHING THAT YOU WANT TO SPAWN MULTIPLE TIME AND WHERE YOU WANT TO BE SURE ONLY THIS ITEM DROPS
_itemArray = ["rvg_money"];
//4.2. EXAMPLE, PUT IN COMMON ITEMS THAT YOU WANT TO SPAWN
_itemArray2 =[
"rvg_canOpener",
"rvg_plasticBottlePurified",
"rvg_spirit",
"rvg_franta",
"rvg_milk",
"rvg_rice",
"rvg_hose",
"rvg_guttingKnife",
"rvg_tire",
"rvg_purificationTablets",
"rvg_flare",
"rvg_matches",
"rvg_Geiger",
"rvg_toolkit",
"rvg_antiRad",
"CUP_NVG_PVS7",
"muzzle_snds_B",
"muzzle_snds_L",
"acc_flashlight_pistol",
"CUP_optic_CompM4",
"optic_DMS",
"CUP_H_RUS_6B27_olive",
"CUP_V_CDF_6B3_3_FST",
"CUP_U_B_CDF_FST_2",
"CUP_V_CDF_6B3_3_FST"
];

//4.3. EXAMPLE, PUT IN COMMON ITEMS THAT YOU WANT TO SPAWN
_itemArray3 =[
"CUP_NVG_PVS7",
"muzzle_snds_B",
"muzzle_snds_L",
"acc_flashlight_pistol",
"CUP_optic_CompM4",
"optic_DMS",
"CUP_H_RUS_6B27_olive",
"CUP_V_CDF_6B3_3_FST",
"CUP_U_B_CDF_FST_2",
"CUP_V_CDF_6B3_3_FST"
];

//4.4. EXAMPLE ARRAY OF WEAPONS YOU WANT TO SPAWN.
_WeaponArray = [
"CUP_hgun_Makarov",
"CUP_hgun_TaurusTracker455",
"CUP_hgun_Colt1911",
"CUP_srifle_CZ550",
"CUP_srifle_LeeEnfield_rail",
"CUP_hgun_Makarov",
"CUP_hgun_TaurusTracker455",
"CUP_hgun_Colt1911",
"CUP_srifle_CZ550",
"CUP_srifle_LeeEnfield_rail",
"CUP_hgun_Makarov",
"CUP_hgun_TaurusTracker455",
"CUP_hgun_Colt1911",
"CUP_srifle_CZ550",
"CUP_srifle_LeeEnfield_rail",
"CUP_arifle_M4A1_camo",
"CUP_arifle_G36C_camo",
"CUP_sgun_AA12",
"CUP_lmg_minimi_railed",
"CUP_arifle_M16A4_GL",
"CUP_srifle_AWM_wdl",
"CUP_hgun_BallisticShield_Armed",
"CUP_arifle_AK74",
"CUP_srifle_CZ550_rail",
"CUP_sgun_Saiga12K",
"CUP_launch_RPG7V",
"CUP_arifle_AKS74U"
];

// EXAMPLE: HERE I SPAWN MEDICAL ITEMS OR FOOD
_mediclootArray =[
"FirstAidKit",
"rvg_spirit",
"rvg_franta",
"rvg_beans",
"rvg_bacon",
"rvg_milk",
"rvg_rice",
"rvg_hose",
"rvg_purificationTablets"];

// EXPLOSIVES YOU WANT TO SPAWN, EXPLOSIVES AND MAGAZINES CAN NOT BE SPAWNED TOGETHER WITH WEAPONS OR ITEMS FYI
_explosivesArray = [
"CUP_HandGrenade_RGO",
"HandGrenade",
"SmokeShellBlue",
"SmokeShellGreen",
"SmokeShellOrange",
"SmokeShellPurple",
"SmokeShellRed",
"SmokeShell",
"SmokeShellYellow",
"DemoCharge_Remote_Mag",
"ClaymoreDirectionalMine_Remote_Mag",
"SatchelCharge_Remote_Mag",
"APERSTripMine_Wire_Mag",
"APERSMine_Range_Mag"
];

/////////////////////////////////////////////////////////////////////
//5. SPAWNER:
//THIS PART;
//-  SELECTS RANDOM ITEMS, OBJECTS, STRUCTURES FROM POINT 4. ABOVE
//-  CREATES A SPAWNPOINT RELATIVE TO THE MARKER RANDOMLY SELECTED UNDER POINT 3. ABOVE
//-  SPAWNS STRUCTURES, OBJECTS AND THE LOOTBOX
//-  DISABLE DAMAGE OF SPAWNED STRUCTURES, OBJECTS OR LOOTBOX
//-  SET THE DIRECTION THE OBJECT OR STRUCTURE IS HEADING/////////
/////////////////////////////////////////////////////////////////////
//5.1 FIREPLACE, TENTS, CAMONETS SPAWNER
_fireplace = _campfire call BIS_fnc_selectRandom createVehicle getMarkerPos _mark; //SELECTS SPAWN POSITION RELATIVE TO _MARK AND SPAWNS A STRUCTURES FROM THE RESPECTIVE ARRAY
_fireplace allowDamage false; // DISABLE DAMANGE FOR THE OBJECT
_fireplace setDir 180; // SET DIRECTION
_tent = _tents call BIS_fnc_selectRandom createVehicle [(getMarkerPos _mark select 0) + 18*sin(0), (getMarkerPos _mark select 1) + 18*cos(0), 0];
_tent allowDamage false;
_tent setDir 190;
_camonet = _camonets call BIS_fnc_selectRandom createVehicle [(getMarkerPos _mark select 0) + 18*sin(0), (getMarkerPos _mark select 1) + 18*cos(0), 0];
_camonet allowDamage false;
_camonet setDir 10;
_tent2 = _tents2 call BIS_fnc_selectRandom createVehicle [(getMarkerPos _mark select 0) + 15*sin(90), (getMarkerPos _mark select 1) + 15*cos(90), 0];
_tent2 allowDamage false;
_tent2 setDir 85;
_camonet2 = _camonets call BIS_fnc_selectRandom createVehicle [(getMarkerPos _mark select 0) + 15*sin(90), (getMarkerPos _mark select 1) + 15*cos(90), 0];
_camonet2 allowDamage false;
_camonet2 setDir 85;
_tent3 = _tents3 call BIS_fnc_selectRandom createVehicle [(getMarkerPos _mark select 0) + 15*sin(180), (getMarkerPos _mark select 1) + 15*cos(180), 0];
_tent3 allowDamage false;
_tent3 setDir 250;
_tent4 = _tents4 call BIS_fnc_selectRandom createVehicle [(getMarkerPos _mark select 0) +15*sin(270), (getMarkerPos _mark select 1) +10*cos(270), 0];
_tent4 allowDamage false;
_tent4 setDir 320;

//5.2 Ambient or lootable props (if ravage mod is active) selection and spawn point relative to _mark
_object1 = _objectsArray call BIS_fnc_selectRandom createVehicle [(getMarkerPos _mark select 0) + 10*sin(0), (getMarkerPos _mark select 1) + 10*cos(0), 0]; //SELECTS SPAWN POSITION RELATIVE TO _MARK
_object1 allowDamage false; // DISABLE DAMANGE FOR THE OBJECT
_object1 setDir (random 359); // SET DIRECTION
_object2 = _objectsArray1 call BIS_fnc_selectRandom createVehicle [(getMarkerPos _mark select 0) + 10*sin(75), (getMarkerPos _mark select 1) + 10*cos(75), 0];
_object2 allowDamage false;
_object2 setDir (60);
_object3 = _wreckArray call BIS_fnc_selectRandom createVehicle [(getMarkerPos _mark select 0) + 30*sin(130), (getMarkerPos _mark select 1) + 30*cos(130), 0];
_object3 allowDamage false;
_object3 setDir (random 359);
_object4 = _objectsArray2 call BIS_fnc_selectRandom createVehicle [(getMarkerPos _mark select 0) + 11*sin(135), (getMarkerPos _mark select 1) + 11*cos(135), 0];
_object4 allowDamage false;
_object4 setDir (random 359);
_object5 = _objectsArray3 call BIS_fnc_selectRandom createVehicle [(getMarkerPos _mark select 0) + 8*sin(225), (getMarkerPos _mark select 1) + 8*cos(225), 0];
_object5 allowDamage false;
_object5 setDir (random 359);
_object6 = _objectsArray3 call BIS_fnc_selectRandom createVehicle [(getMarkerPos _mark select 0) + 16*sin(225), (getMarkerPos _mark select 1) + 16*cos(225), 0];
_object6 allowDamage false;
_object6 setDir (random 359);
_object7 = _objectsArray4 call BIS_fnc_selectRandom createVehicle [(getMarkerPos _mark select 0) + 13*sin(225), (getMarkerPos _mark select 1) + 13*cos(225), 0];
_object7 allowDamage false;
_object7 setDir (180);

//5.3 LOOTSPAWNS
//5.3.1 LOOTBOX THAT YOU WANT TO LOOT FOR FANCY STUFF! NOTES BELOW:
		_item = _itemArray select (floor (random (count _itemArray))); // SELECTS AN ITEM OUT OF THE RESPECTIVE ARRAY FOR THE FIRST LOOT POSITION IN ITEMBOX
    _item2 = _itemArray2 select (floor (random (count _itemArray2)));// SELECTS AN ITEM OUT OF THE RESPECTIVE ARRAY FOR NEXT LOOT POSITION IN ITEMBOX
    _item3 = _itemArray2 select (floor (random (count _itemArray2)));// SAME FOR NEXT LOOT POSITION
    _item4 = _itemArray2 select (floor (random (count _itemArray2)));// SAME FOR NEXT LOOT POSITION
    _item5 = _itemArray3 select (floor (random (count _itemArray3)));// SAME FOR NEXT LOOT POSITION
    _explo = _explosivesArray select (floor (random (count _explosivesArray))); //SAME FOR NEXT LOOT POSITION BUT SELECTS AN EXPLOSIVE FROM EXLOSIVES ARRAY
    _weapon = _weaponArray select (floor (random (count _weaponArray))); // SELECTS A RANDOM WEAPON FROM THE WEAPON ARRAY FOR THE FIRST WEAPON LOOT POSITION OF THE LOOTBOX
    _weapon1 = _weaponArray select (floor (random (count _weaponArray)));// SELECTS A RANDOM WEAPON FROM THE WEAPON ARRAY FOR THE NEXT WEAPON LOOT POSITION OF THE LOOTBOX
		_itemBox = "Box_FIA_Wps_F" createVehicle [0,0,0]; // SPAWNS THE LOOT BOX
		_itemBox allowDamage false; // DISABLE DAMAGE FOR LOOTBOX
    _itemBox setDir (90); // ORIENTATION OF THE LOOTBOX
		clearMagazineCargoGlobal _itembox; // CLEAR CONTENT OF LOOTBOX
		clearWeaponCargoGlobal _itembox;
		clearItemCargoGlobal _itembox;
		clearBackpackCargoGlobal _itembox;
		_itemBox setPos [(getMarkerPos _mark select 0) +8*sin(270), (getMarkerPos _mark select 1) +8*cos(270), 0]; // SETS THE POSITION OF THE LOOTBOX RELATIVE TO THE RANDOM SELECTED MARKER _MARK
		_itemBox additemCargoGlobal [_item, 50 +random 50]; // SPAWNS THE ITEMS THAT WHERE RANDOMLY SELECTED FOR THIS LOOT POSITION. IN THIS EXAMPLE THE ARRAY ONLY CONTAINS RVG_MONEY, HENCE IT WILL SPAWN 50 X RVG_MONEY + A RANDOM AMOUNT OF 0-50 IN ADDITION
    _itemBox additemCargoGlobal [_item2, 1 +random 1];// SPAWNS THE ITEMS THAT WHERE RANDOMLY SELECTED FOR THIS LOOT POSITION. 1 FOR SURE AND WITH A CHANCE TO SPAWN 1 ADDITIONAL ITEM
    _itemBox additemCargoGlobal [_item5, 1 +random 1];// SPAWNS THE ITEMS THAT WHERE RANDOMLY SELECTED FOR THIS LOOT POSITION.1 FOR SURE AND WITH A CHANCE TO SPAWN 1 ADDITIONAL ITEM
    _itemBox addMagazineCargoGlobal [_explo, 1 +random 2];// SPAWNS THE EXPLOSIVES THAT WHERE RANDOMLY SELECTED FOR THIS LOOT POSITION. NOTE THAT MAGAZINES AND EXPLOSIVES NEED TO BE SPAWNED USING "ADDMAGAZINECARGOGLOBAL" 1 FOR SURE AND WITH A CHANCE TO SPAWN 2 ADDITIONAL ITEM
    _itemBox additemCargoGlobal [_item3, 1 +random 1];// SPAWNS THE ITEMS THAT WHERE RANDOMLY SELECTED FOR THIS LOOT POSITION.1 FOR SURE AND WITH A CHANCE TO SPAWN 1 ADDITIONAL ITEM
    _itemBox additemCargoGlobal [_item4, 1 +random 1];// SPAWNS THE ITEMS THAT WHERE RANDOMLY SELECTED FOR THIS LOOT POSITION.1 FOR SURE AND WITH A CHANCE TO SPAWN 1 ADDITIONAL ITEM
    _itemBox addWeaponCargo [_weapon,1 +random 1];// SPAWNS THE WEAPON THAT WHERE RANDOMLY SELECTED FOR THIS LOOT POSITION.1 FOR SURE AND WITH A CHANCE TO SPAWN 1 ADDITIONAL ITEM
    _magazines = getArray (configFile >> "CfgWeapons" >> _weapon >> "magazines"); // SELECTS MATCHING MAGAZINES FOR THE WEAPON SPAWNED
    _mag = _magazines select (floor (random (count _magazines)));// SELECTS MATCHING MAGAZINES FOR THE WEAPON SPAWNED
    _itemBox addMagazineCargoGlobal [_mag, 2 +random 4];// SPAWNS 2 MATCHING MAGAZINES PLUS RANDOM AMOUNT OF 4 IN ADDITION
    _itemBox addWeaponCargo [_weapon1,1 +random 1]; // SAME AS ABOVE
    _magazines = getArray (configFile >> "CfgWeapons" >> _weapon1 >> "magazines");// SAME AS ABOVE
    _mag = _magazines select (floor (random (count _magazines)));// SAME AS ABOVE
    _itemBox addMagazineCargoGlobal [_mag, 2 +random 4];// SAME AS ABOVE

//////////////////////////////////////////////////////////
//6. LOOT SPAWNERS FOR STRUCTURES SUCH AS HOUSES OR TENTS
/////////////////////////////////////////////////////////
//6.1 FILLS HOUSES, WORKS WELL ON ALL VANILLA AND DLC STRUCTURES, NOT SO WELL WITH TENTS
// THIS PLACES LOOTABLE OBJECTS FOR RAVAGE
_itemBoxArray1 = [];
_houseArray1 = getMarkerPos _mark nearObjects ["camp",50]; //SEARCHES FOR HOUSES NEAR THE MAIN MARKER OF THE CAMP (50 METERS RADIUS)
{
	_buildingPositions1 = [_x] call BIS_fnc_buildingPositions; // FINDS THE BUILDING POSITIONS OF THE HOUSES IN THE AREA
	{
		if (30 > random 100) then { //30% OF THE BUILDING POSITIONS ARE FILLED - NOTE: NOT 100% SURE IF IT WORKS THIS WAY, BUT HERE YOU CAN LOWER THE AMOUNT OF ITEMS/OBJECTS THAT SPAWN IN HOUSES
		_lootobject = _lootableObjectArray select (floor (random (count _lootableObjectArray))); //SELECTS RANDOM OBJECTS FROM ARRAY
		_itemBox1 = _lootobject createVehicle [0,0,0]; // CREATE THE SELECTED OBJECT
		_itemBox1 allowDamage false; //DISABLES DAMAGE
		_itemBox1 setPos _x; // NOT 100% SURE BUT THIS MEMORIZES THE LOTO POSITIONS
		_itemBoxArray1 = _itemBoxArray1 + [_itemBox1]; //WHATEVER THIS DOES..
	};
	} forEach _buildingPositions1; // EXECUTES THE SPAWN CODE FOR EACH BUILDINGPOSITION IN A HOUSE
} forEach _houseArray1; // EXECUTES THE SPAWN CODE FOR EACH HOUSE IN THE AREA

//6.2. THIS SPAWNS ACTUAL ITEMS ON THE GROUND (VIA "GROUNDEWWAPONHOLDER"), IN THIS CASE, MEDICAL AND SURVIVAL (RAVAGE) ITEMS.
_itemBoxArray2 = [];
_houseArray2 = getMarkerPos _mark nearObjects ["house",50];
{
	_buildingPositions2 = [_x] call BIS_fnc_buildingPositions;
	{
		if (20 > random 100) then {
		_medicloot2 = _mediclootArray select (floor (random (count _mediclootArray)));
		_itemBox2 = "GroundWeaponHolder" createVehicle [0,0,0];
		_itemBox2 allowDamage false;
		_itemBox2 setPos _x;
    _itemBox2 addItemCargoGlobal [_medicloot2, 1 +random 0]; // THIS WILL SELECT RANDOM LOOT FROM THE RESPECTIVE ARRAY AND SPAWNS 1 + 0 RANDOM ITEMS. HERE, 0 COULD BE UPDATED TO 6 FOR A CHANCE TO SPAWN 6 ADDITIONA ITEMS, AS AN EXAMPLE
		_itemBoxArray2 = _itemBoxArray2 + [_itemBox2];
	};
	} forEach _buildingPositions2;
} forEach _houseArray2;

//6.3 SAME AS ABOVE BUT "CAMP" WILL CAPTURE SOME OF THE CUP AND VANILLA TENTS YOU MIGHT WANNA SPAWN, NOT ALL HOWEVER.
_itemBoxArray3 = [];
_houseArray3 = getMarkerPos _mark nearObjects ["camp",50];
{
	_buildingPositions3 = [_x] call BIS_fnc_buildingPositions;
	{
		if (20 > random 100) then {
		_medicloot3 = _mediclootArray select (floor (random (count _mediclootArray)));
		_itemBox3 = "GroundWeaponHolder" createVehicle [0,0,0];
		_itemBox3 allowDamage false;
		_itemBox3 setPos _x;
    _itemBox3 addItemCargoGlobal [_medicloot3, 1];
		_itemBoxArray3 = _itemBoxArray3 + [_itemBox3];
	};
	} forEach _buildingPositions3;
} forEach _houseArray3;

//////////////////
//7. AI SPAWNER//
////////////////
//7.1 FIRST GROUP
_bandits = createGroup east; // CREATES A GROUP CALLED _bandits
"O_G_Survivor_F" createUnit [getMarkerPos _mark, _bandits, "[this] call rvg_fnc_equip;", 1, "corporal"]; // SPAWNS A SURVIVOR WITHOUT GEAR ON THE MAIN MARKER INTO THE _bandits GROUP WITH RAVAGE GEAR, MAXIMUM SKILLS AND WITH RANK CORPORAL. BELOW REPEATS BUT WITH LOWER RANKS.
"O_G_Survivor_F" createUnit [getMarkerPos _mark, _bandits, "[this] call rvg_fnc_equip;", 1, "private"]; // REPLACE "[this] call rvg_fnc_equip; [_unit] call HG_fnc_aiUnitSetup;" WITH "" IF YOU DO NOT WANT THIS CODE TO BE INITIALISED FOR EACH UNIT.
if (40 > random 100) then { // % CHANCE THAT THIS AI IS SPAWNED
"O_G_Survivor_F" createUnit [getMarkerPos _mark, _bandits, "[this] call rvg_fnc_equip;", 1, "private"];};
if (30 > random 100) then { // % CHANCE THAT THIS AI IS SPAWNED
"O_G_Survivor_F" createUnit [getMarkerPos _mark, _bandits, "[this] call rvg_fnc_equip;", 1, "private"];};
if (20 > random 100) then { // % CHANCE THAT THIS AI IS SPAWNED
"O_G_Survivor_F" createUnit [getMarkerPos _mark, _bandits, "[this] call rvg_fnc_equip;", 1, "private"];};

//7.2 SECOND GROUP
// SAME AS ABOVE BUT A DIFFERENT GROUP, THIS WAY NOT ALL AI MOVE THE SAME WAYPOINTS
_bandits2 = createGroup east;
"O_G_Survivor_F" createUnit [getMarkerPos _mark, _bandits2, "[this] call rvg_fnc_equip;", 1, "corporal"];
"O_G_Survivor_F" createUnit [getMarkerPos _mark, _bandits2, "[this] call rvg_fnc_equip;", 1, "private"];
if (40 > random 100) then {
"O_G_Survivor_F" createUnit [getMarkerPos _mark, _bandits2, "[this] call rvg_fnc_equip;", 1, "private"];};
if (30 > random 100) then {
"O_G_Survivor_F" createUnit [getMarkerPos _mark, _bandits2, "[this] call rvg_fnc_equip;", 1, "private"];};
if (20 > random 100) then {
"O_G_Survivor_F" createUnit [getMarkerPos _mark, _bandits2, "[this] call rvg_fnc_equip;", 1, "private"];};

//7.3 WAYPOINTS - THIS IS VERY BASIC AND JUST MAKES THE BANDITS MOVE AROUND CLOSE TO THE CAMP
// THE BELOW SETS A "SEARCH AND DESTROY" WAYPOINT THAT MAKES THE AI WANDER THE CAMP AND LOOK FOR ENEMIES
_wp1 = _bandits addWaypoint [getmarkerpos _mark, 0];
    _wp1 setWaypointType "SAD"; //SETS THE WAYPOINT AS SEARCH AND DESTROY
    _wp1 setWaypointSpeed "Limited"; //SETS THE SPEED
    _wp1 setWaypointBehaviour "AWARE"; // SETS THE COMBAT STANCE
    _wp1 setWaypointFormation "COLUMN"; // SETS THE FORMATION

_wp1 = _bandits2 addWaypoint [getmarkerpos _mark, 0];
    _wp1 setWaypointType "SAD";
    _wp1 setWaypointSpeed "Limited";
    _wp1 setWaypointBehaviour "COMBAT";
    _wp1 setWaypointFormation "LINE";

////////////////////////////////////////
//8. TIMER IN SECONDS UNTIL THE CAMP DESPAWNS AND RESPAWNS AGAIN
///////////////////////////////////////////////////////
Sleep (random _despawnSleepRnd);Sleep _despawnSleepFix; // (CHANGE FIGURES UNDER ITEM 1.1)FIRST NUMBER STES A RANDOM AMOUNT OF SECONDS BETWEEN 1-3600 AND THE SECOND NUMBER SETS A DEFINITE TIMER OF 1000 SECODS. SO THE CAMP WILL RESPAWN EARLIEST AFTER 1000 SECONDS AND AT MAXIMUM AFTER 4600 SECONDS OR IF POINT 9. BELOW IS THE CASE.

////////////////////
//9. PAUSE DESPAWN, IF PLAYER IS TOO CLOSE TO THE CAMP
//////////////////////
WaitUntil {player distance (GetMarkerPos _mark) > _despanPauseProxy}; // (CHANGE FIGURES UNDER ITEM 1.1)IF THE PLAYER IS WITHIN xyz METERS CLOSE TO THE MAIN MARKER, THE SCRIPT WILL PAUSE AND WILL NOT DESPAWN. THE SCRIPT WILL PROCEED ONCE THE PLAYER IS FURTHER AWAY THAN 200 METERS.

///////////////////////////
//10. DESPAWN/DELETION/////
///////////////////////////
//- ANY SPAWNED OBJECT RECEIVES A REFERENCE (EG. _FIREPLACE) AND NEEDS TO BE DELETED AS SHOWN BELOW
deleteVehicle _fireplace;
deleteVehicle _itembox;
deleteVehicle _tent;
deleteVehicle _tent2;
deleteVehicle _tent3;
deleteVehicle _tent4;
deleteVehicle _Object1;
deleteVehicle _camonet;
deleteVehicle _camonet2;
deleteVehicle _Object2;
deleteVehicle _Object3;
deleteVehicle _Object4;
deleteVehicle _Object5;
deleteVehicle _Object6;
deleteVehicle _Object7;

//10.1 DELETES ITEMS THAT WHERE SPAWNED IN MULTIPLE BUILDING POSITIONS
{	deleteVehicle _x; } forEach _itemBoxArray1;
{	deleteVehicle _x; } forEach _itemBoxArray2;
{	deleteVehicle _x; } forEach _itemBoxArray3;

//10.1 DELEETES ALIVE AI FROM GROUP _bandits (NEEDS TO BE SET UP FOR ALL GROUPS OF AI)
if(isNil("_bandits"))exitWith{};
{
	if(vehicle _x != _x)then{deleteVehicle (vehicle _x);};
	deleteVehicle _x;
}forEach units _bandits; //EXECUTES DELETION FOR ALL UNITS OF SAID GROUP

//10.1 DELEETES ALIVE AI FROM GROUP _bandits
if(isNil("_bandits2"))exitWith{};
{
	if(vehicle _x != _x)then{deleteVehicle (vehicle _x);};
	deleteVehicle _x;
}forEach units _bandits2;

//10.2 DELETES DEAD AI
{ deleteVehicle _x; } forEach allDead;
//10.3 DELETS OBJECTS THAT MAY HAVE BEEN SPAWNED INTO SPAWNED STRUCTURES VIA RAVAGE LOOT MODULE
{ deleteVehicle _x; } forEach nearestObjects [getMarkerPos _mark,["WeaponHolder","GroundWeaponHolder"],550];
};

 

banditcamp.sqf (vanilla version)

Version that runs with Ravage and CBA only

  Reveal hidden contents


////////////////////////////////////////
//LOOPER////////
////////////////////////////////////////
while {true} do {// THIS LOOPS THE SCRIPT

  /////////////////////////////////////////////////////////////////////
  //1. ARRAY OF MARKERS THAT NEED TO BE PLACED ON THE MAP. ///////////
  //EACH MARKER STANDS FOR A POSSIBLE CAMP LOCATION//
  //THE MARKERS HERE AND THE MARKERS ON THE MAP INGAME NEED TO CORRESPOND//
  //E.G. IF YOU ADD A MARKER HERE, ADD IT IN THE EDITOR INGAME AS WELL AND VICE VERCA////////////
  /////////////////////////////////////////////////////////////////////
_mark = ["mrkrA_1","mrkrA_2","mrkrA_3","mrkrA_4","mrkrA_5"] call BIS_fnc_selectRandom; // THIS SELECTS ONE OF THE MARKER. GOING FORWARD, _mark WILL REFER TO THE MARKER SELECTED HERE

//1.1 SOME DETAILS THAT CAN BE CONFIGURED:
_activationRadius = 4000; // (REFERENCE FOR CODE UNDER ITEM 2) SETS THE RADIUS AROUND THE FIRST MARKER, WHERE THE SCRIPT IS ACTIVE. WHEN THE PLAYER IS OUTSIDE THIS RADIUS, THE SCRIPT WILL PAUSE TO SAVE FPS
_despawnSleepRnd = 3600; // (REFERENCE FOR CODE UNDER ITEM 8)SETS THE TIMER IN SECONDS FOR THE CAMPT TO DESPAWN, WILL SELECT A RANDOM NUMBER (E.G. 3600: IT WILL SELECT A RANDOM NUMBER BETWEEN 1 AND 3600)
_despawnSleepFix = 1000;// (REFERENCE FOR CODE UNDER ITEM 8)SETS A FIX TIMER IN SECONDS THAT WILL RUN AFTER THE RANDOM TIMER
_despanPauseProxy = 200;// (REFERENCE FOR CODE UNDER ITEM 9)SETS A RADIUS AROUND THE CAMP POSITION.WHEN THE PLAYER IS WITHIN THIS RADIUS, DESPAWNING IS PAUSED
//////////////////////
//2 PROXIMITY CHECK///
//- CHECKS IF THE PLAYER IS CLOSE ENOUGH TO THE MAIN MARKER.//
/////////////////////////////////////////////////////////
WaitUntil {player distance (GetMarkerPos "mrkrA_1") < _activationRadius}; ///THE MARKER, IN THIS CASE "mrkrA_1" MUST ALWAYS BE IN THE CENTER OF A 4000 METERS RADIOS AND ALL ADDITIONAL MARKERS MUST BE WITHIN THIS RADIUS. CHANGE THE NUMBER TO INCREASE OR DECREASE THE RADIUS

/////////////////////////////////////////////////////////////////////
//3. ARRAYS OF OBJECTS, STRUCTURES AND ITEMS THAT WILL SPAWN/////////
/////////////////////////////////////////////////////////////////////
//3.1. LOOTABLE OBJECTS AND WRECKS
_lootableObjectArray = ["Land_Sack_F","Land_BarrelTrash_F","Land_Sacks_goods_F"];
_objectsArray = ["Land_Sack_F","Land_BarrelTrash_F","Land_Sacks_goods_F","Land_CratesWooden_F","Land_Cages_F","Land_GarbagePallet_F","Land_GarbageBarrel_01_F","Land_Pallets_F","Land_Garbage_square5_F","Land_CratesShabby_F","Land_CanisterPlastic_F","Land_Garbage_line_F","Land_WoodenBox_F","Land_Sacks_heap_F","Land_PaperBox_closed_F","Land_GarbageBags_F"];
_objectsArray1 = ["TargetP_Zom_F","Land_Sack_F","Land_BarrelTrash_F","Land_Sacks_goods_F","Land_CratesWooden_F","Land_Cages_F","Land_GarbagePallet_F","Land_GarbageBarrel_01_F","Land_Pallets_F","Land_Garbage_square5_F","Land_CratesShabby_F","Land_CanisterPlastic_F","Land_Garbage_line_F","Land_WoodenBox_F","Land_Sacks_heap_F","Land_PaperBox_closed_F","Land_GarbageBags_F"];
_objectsArray2 = ["Land_WoodPile_large_F","Land_WoodPile_F","Land_Sack_F","Land_BarrelTrash_F","Land_Sacks_goods_F","Land_CratesWooden_F","Land_Cages_F","Land_GarbagePallet_F","Land_GarbageBarrel_01_F","Land_Pallets_F","Land_Garbage_square5_F","Land_CratesShabby_F","Land_CanisterPlastic_F","Land_Garbage_line_F","Land_WoodenBox_F","Land_Sacks_heap_F","Land_PaperBox_closed_F","Land_GarbageBags_F"];
_objectsArray3 = ["Land_TentA_F","Land_TentDome_F","Land_Sack_F","Land_BarrelTrash_F","Land_Sacks_goods_F","Land_CratesWooden_F","Land_Cages_F","Land_GarbagePallet_F","Land_GarbageBarrel_01_F","Land_Pallets_F","Land_Garbage_square5_F","Land_CratesShabby_F","Land_CanisterPlastic_F","Land_Garbage_line_F","Land_WoodenBox_F","Land_Sacks_heap_F","Land_PaperBox_closed_F","Land_GarbageBags_F"];
_objectsArray4 = ["CamoNet_OPFOR_open_F","CamoNet_INDP_open_F","CamoNet_BLUFOR_open_F","CamoNet_OPFOR_open_F","CamoNet_INDP_open_F","CamoNet_BLUFOR_open_F","CamoNet_OPFOR_open_F","CamoNet_INDP_open_F","CamoNet_BLUFOR_open_F","Land_Sack_F","Land_BarrelTrash_F","Land_Sacks_goods_F","Land_CratesWooden_F","Land_Cages_F","Land_GarbagePallet_F","Land_GarbageBarrel_01_F","Land_Pallets_F","Land_Garbage_square5_F","Land_CratesShabby_F","Land_CanisterPlastic_F","Land_Garbage_line_F","Land_WoodenBox_F","Land_Sacks_heap_F","Land_PaperBox_closed_F"];
_wreckArray = ["Mi8Wreck","BlackhawkWreck","Land_Wreck_Heli_Attack_01_F","Land_ScrapHeap_1_F","Land_ScrapHeap_2_F","Land_Scrap_MRAP_01_F","Land_WoodenCart_F","Land_Wreck_Car2_F","Land_Wreck_Truck_dropside_F","Land_Wreck_Ural_F","Land_Wreck_Heli_Attack_02_F","Land_Wreck_HMMWV_F"];

//3.2. STRUCTURES SUCH AS TENTS, HOUSES,...
_tents = ["Camp","Land_tent_west","CampEast"];
_tents2 = ["Camp","Land_tent_west","CampEast"];
_tents3 = ["Camp","Land_tent_west","CampEast"];
_tents4 = ["Camp","Land_tent_east","CampEast"];
_camonets = ["CamoNet_BLUFOR_big_F","Land_GarbageBarrel_01_F"];
_campfire = ["Campfire_burning_F","MetalBarrel_burning_F"];

/////////////////////////////////////////////////////////////////////
//4. ARRAYS OF ITEMS THAT WILL SPAWN/////////
/////////////////////////////////////////////////////////////////////
//TIP: THE MORE OFTEN AN ITEM APPEARS IN AN ARRAY, THE MORE LIKELY IT IS THAT THIS ITEM WILL SPAWN. HENCE, YOU COULD ENTER COMMON ITEMS 4 TIMES AND RARE ITEMS ONLY ONCE
//4.1 EXAMPLE, PUT IN SOMETHING THAT YOU WANT TO SPAWN MULTIPLE TIME AND WHERE YOU WANT TO BE SURE ONLY THIS ITEM DROPS
_itemArray = ["rvg_money"];
//4.2. EXAMPLE, PUT IN COMMON ITEMS THAT YOU WANT TO SPAWN
_itemArray2 =[
"rvg_canOpener",
"rvg_plasticBottlePurified",
"rvg_spirit",
"rvg_franta",
"rvg_milk",
"rvg_rice",
"rvg_hose",
"rvg_guttingKnife",
"rvg_tire",
"rvg_purificationTablets",
"rvg_flare",
"rvg_matches",
"rvg_Geiger",
"rvg_toolkit",
"rvg_antiRad",
"muzzle_snds_B",
"muzzle_snds_L",
"acc_flashlight_pistol",
"optic_DMS"
];

//4.3. EXAMPLE, PUT IN COMMON ITEMS THAT YOU WANT TO SPAWN
_itemArray3 =[
"muzzle_snds_B",
"muzzle_snds_L",
"acc_flashlight_pistol",
"optic_DMS"
];

//4.4. EXAMPLE ARRAY OF WEAPONS YOU WANT TO SPAWN.
_WeaponArray = [

];

// EXAMPLE: HERE I SPAWN MEDICAL ITEMS OR FOOD
_mediclootArray =[
"FirstAidKit",
"rvg_spirit",
"rvg_franta",
"rvg_beans",
"rvg_bacon",
"rvg_milk",
"rvg_rice",
"rvg_hose",
"rvg_purificationTablets"];

// EXPLOSIVES YOU WANT TO SPAWN, EXPLOSIVES AND MAGAZINES CAN NOT BE SPAWNED TOGETHER WITH WEAPONS OR ITEMS FYI
_explosivesArray = [
"HandGrenade",
"SmokeShellBlue",
"SmokeShellGreen",
"SmokeShellOrange",
"SmokeShellPurple",
"SmokeShellRed",
"SmokeShell",
"SmokeShellYellow",
"DemoCharge_Remote_Mag",
"ClaymoreDirectionalMine_Remote_Mag",
"SatchelCharge_Remote_Mag",
"APERSTripMine_Wire_Mag",
"APERSMine_Range_Mag"
];

/////////////////////////////////////////////////////////////////////
//5. SPAWNER:
//THIS PART;
//-  SELECTS RANDOM ITEMS, OBJECTS, STRUCTURES FROM POINT 4. ABOVE
//-  CREATES A SPAWNPOINT RELATIVE TO THE MARKER RANDOMLY SELECTED UNDER POINT 3. ABOVE
//-  SPAWNS STRUCTURES, OBJECTS AND THE LOOTBOX
//-  DISABLE DAMAGE OF SPAWNED STRUCTURES, OBJECTS OR LOOTBOX
//-  SET THE DIRECTION THE OBJECT OR STRUCTURE IS HEADING/////////
/////////////////////////////////////////////////////////////////////
//5.1 FIREPLACE, TENTS, CAMONETS SPAWNER
_fireplace = _campfire call BIS_fnc_selectRandom createVehicle getMarkerPos _mark; //SELECTS SPAWN POSITION RELATIVE TO _MARK AND SPAWNS A STRUCTURES FROM THE RESPECTIVE ARRAY
_fireplace allowDamage false; // DISABLE DAMANGE FOR THE OBJECT
_fireplace setDir 180; // SET DIRECTION
_tent = _tents call BIS_fnc_selectRandom createVehicle [(getMarkerPos _mark select 0) + 18*sin(0), (getMarkerPos _mark select 1) + 18*cos(0), 0];
_tent allowDamage false;
_tent setDir 190;
_camonet = _camonets call BIS_fnc_selectRandom createVehicle [(getMarkerPos _mark select 0) + 18*sin(0), (getMarkerPos _mark select 1) + 18*cos(0), 0];
_camonet allowDamage false;
_camonet setDir 10;
_tent2 = _tents2 call BIS_fnc_selectRandom createVehicle [(getMarkerPos _mark select 0) + 15*sin(90), (getMarkerPos _mark select 1) + 15*cos(90), 0];
_tent2 allowDamage false;
_tent2 setDir 85;
_camonet2 = _camonets call BIS_fnc_selectRandom createVehicle [(getMarkerPos _mark select 0) + 15*sin(90), (getMarkerPos _mark select 1) + 15*cos(90), 0];
_camonet2 allowDamage false;
_camonet2 setDir 85;
_tent3 = _tents3 call BIS_fnc_selectRandom createVehicle [(getMarkerPos _mark select 0) + 15*sin(180), (getMarkerPos _mark select 1) + 15*cos(180), 0];
_tent3 allowDamage false;
_tent3 setDir 250;
_tent4 = _tents4 call BIS_fnc_selectRandom createVehicle [(getMarkerPos _mark select 0) +15*sin(270), (getMarkerPos _mark select 1) +10*cos(270), 0];
_tent4 allowDamage false;
_tent4 setDir 320;

//5.2 Ambient or lootable props (if ravage mod is active) selection and spawn point relative to _mark
_object1 = _objectsArray call BIS_fnc_selectRandom createVehicle [(getMarkerPos _mark select 0) + 10*sin(0), (getMarkerPos _mark select 1) + 10*cos(0), 0]; //SELECTS SPAWN POSITION RELATIVE TO _MARK
_object1 allowDamage false; // DISABLE DAMANGE FOR THE OBJECT
_object1 setDir (random 359); // SET DIRECTION
_object2 = _objectsArray1 call BIS_fnc_selectRandom createVehicle [(getMarkerPos _mark select 0) + 10*sin(75), (getMarkerPos _mark select 1) + 10*cos(75), 0];
_object2 allowDamage false;
_object2 setDir (60);
_object3 = _wreckArray call BIS_fnc_selectRandom createVehicle [(getMarkerPos _mark select 0) + 30*sin(130), (getMarkerPos _mark select 1) + 30*cos(130), 0];
_object3 allowDamage false;
_object3 setDir (random 359);
_object4 = _objectsArray2 call BIS_fnc_selectRandom createVehicle [(getMarkerPos _mark select 0) + 11*sin(135), (getMarkerPos _mark select 1) + 11*cos(135), 0];
_object4 allowDamage false;
_object4 setDir (random 359);
_object5 = _objectsArray3 call BIS_fnc_selectRandom createVehicle [(getMarkerPos _mark select 0) + 8*sin(225), (getMarkerPos _mark select 1) + 8*cos(225), 0];
_object5 allowDamage false;
_object5 setDir (random 359);
_object6 = _objectsArray3 call BIS_fnc_selectRandom createVehicle [(getMarkerPos _mark select 0) + 16*sin(225), (getMarkerPos _mark select 1) + 16*cos(225), 0];
_object6 allowDamage false;
_object6 setDir (random 359);
_object7 = _objectsArray4 call BIS_fnc_selectRandom createVehicle [(getMarkerPos _mark select 0) + 13*sin(225), (getMarkerPos _mark select 1) + 13*cos(225), 0];
_object7 allowDamage false;
_object7 setDir (180);

//5.3 LOOTSPAWNS
//5.3.1 LOOTBOX THAT YOU WANT TO LOOT FOR FANCY STUFF! NOTES BELOW:
		_item = _itemArray select (floor (random (count _itemArray))); // SELECTS AN ITEM OUT OF THE RESPECTIVE ARRAY FOR THE FIRST LOOT POSITION IN ITEMBOX
    _item2 = _itemArray2 select (floor (random (count _itemArray2)));// SELECTS AN ITEM OUT OF THE RESPECTIVE ARRAY FOR NEXT LOOT POSITION IN ITEMBOX
    _item3 = _itemArray2 select (floor (random (count _itemArray2)));// SAME FOR NEXT LOOT POSITION
    _item4 = _itemArray2 select (floor (random (count _itemArray2)));// SAME FOR NEXT LOOT POSITION
    _item5 = _itemArray3 select (floor (random (count _itemArray3)));// SAME FOR NEXT LOOT POSITION
    _explo = _explosivesArray select (floor (random (count _explosivesArray))); //SAME FOR NEXT LOOT POSITION BUT SELECTS AN EXPLOSIVE FROM EXLOSIVES ARRAY
    _weapon = _weaponArray select (floor (random (count _weaponArray))); // SELECTS A RANDOM WEAPON FROM THE WEAPON ARRAY FOR THE FIRST WEAPON LOOT POSITION OF THE LOOTBOX
    _weapon1 = _weaponArray select (floor (random (count _weaponArray)));// SELECTS A RANDOM WEAPON FROM THE WEAPON ARRAY FOR THE NEXT WEAPON LOOT POSITION OF THE LOOTBOX
		_itemBox = "Box_FIA_Wps_F" createVehicle [0,0,0]; // SPAWNS THE LOOT BOX
		_itemBox allowDamage false; // DISABLE DAMAGE FOR LOOTBOX
    _itemBox setDir (90); // ORIENTATION OF THE LOOTBOX
		clearMagazineCargoGlobal _itembox; // CLEAR CONTENT OF LOOTBOX
		clearWeaponCargoGlobal _itembox;
		clearItemCargoGlobal _itembox;
		clearBackpackCargoGlobal _itembox;
		_itemBox setPos [(getMarkerPos _mark select 0) +8*sin(270), (getMarkerPos _mark select 1) +8*cos(270), 0]; // SETS THE POSITION OF THE LOOTBOX RELATIVE TO THE RANDOM SELECTED MARKER _MARK
		_itemBox additemCargoGlobal [_item, 50 +random 50]; // SPAWNS THE ITEMS THAT WHERE RANDOMLY SELECTED FOR THIS LOOT POSITION. IN THIS EXAMPLE THE ARRAY ONLY CONTAINS RVG_MONEY, HENCE IT WILL SPAWN 50 X RVG_MONEY + A RANDOM AMOUNT OF 0-50 IN ADDITION
    _itemBox additemCargoGlobal [_item2, 1 +random 1];// SPAWNS THE ITEMS THAT WHERE RANDOMLY SELECTED FOR THIS LOOT POSITION. 1 FOR SURE AND WITH A CHANCE TO SPAWN 1 ADDITIONAL ITEM
    _itemBox additemCargoGlobal [_item5, 1 +random 1];// SPAWNS THE ITEMS THAT WHERE RANDOMLY SELECTED FOR THIS LOOT POSITION.1 FOR SURE AND WITH A CHANCE TO SPAWN 1 ADDITIONAL ITEM
    _itemBox addMagazineCargoGlobal [_explo, 1 +random 2];// SPAWNS THE EXPLOSIVES THAT WHERE RANDOMLY SELECTED FOR THIS LOOT POSITION. NOTE THAT MAGAZINES AND EXPLOSIVES NEED TO BE SPAWNED USING "ADDMAGAZINECARGOGLOBAL" 1 FOR SURE AND WITH A CHANCE TO SPAWN 2 ADDITIONAL ITEM
    _itemBox additemCargoGlobal [_item3, 1 +random 1];// SPAWNS THE ITEMS THAT WHERE RANDOMLY SELECTED FOR THIS LOOT POSITION.1 FOR SURE AND WITH A CHANCE TO SPAWN 1 ADDITIONAL ITEM
    _itemBox additemCargoGlobal [_item4, 1 +random 1];// SPAWNS THE ITEMS THAT WHERE RANDOMLY SELECTED FOR THIS LOOT POSITION.1 FOR SURE AND WITH A CHANCE TO SPAWN 1 ADDITIONAL ITEM
    _itemBox addWeaponCargo [_weapon,1 +random 1];// SPAWNS THE WEAPON THAT WHERE RANDOMLY SELECTED FOR THIS LOOT POSITION.1 FOR SURE AND WITH A CHANCE TO SPAWN 1 ADDITIONAL ITEM
    _magazines = getArray (configFile >> "CfgWeapons" >> _weapon >> "magazines"); // SELECTS MATCHING MAGAZINES FOR THE WEAPON SPAWNED
    _mag = _magazines select (floor (random (count _magazines)));// SELECTS MATCHING MAGAZINES FOR THE WEAPON SPAWNED
    _itemBox addMagazineCargoGlobal [_mag, 2 +random 4];// SPAWNS 2 MATCHING MAGAZINES PLUS RANDOM AMOUNT OF 4 IN ADDITION
    _itemBox addWeaponCargo [_weapon1,1 +random 1]; // SAME AS ABOVE
    _magazines = getArray (configFile >> "CfgWeapons" >> _weapon1 >> "magazines");// SAME AS ABOVE
    _mag = _magazines select (floor (random (count _magazines)));// SAME AS ABOVE
    _itemBox addMagazineCargoGlobal [_mag, 2 +random 4];// SAME AS ABOVE

//////////////////////////////////////////////////////////
//6. LOOT SPAWNERS FOR STRUCTURES SUCH AS HOUSES OR TENTS
/////////////////////////////////////////////////////////
//6.1 FILLS HOUSES, WORKS WELL ON ALL VANILLA AND DLC STRUCTURES, NOT SO WELL WITH TENTS
// THIS PLACES LOOTABLE OBJECTS FOR RAVAGE
_itemBoxArray1 = [];
_houseArray1 = getMarkerPos _mark nearObjects ["camp",50]; //SEARCHES FOR HOUSES NEAR THE MAIN MARKER OF THE CAMP (50 METERS RADIUS)
{
	_buildingPositions1 = [_x] call BIS_fnc_buildingPositions; // FINDS THE BUILDING POSITIONS OF THE HOUSES IN THE AREA
	{
		if (30 > random 100) then { //30% OF THE BUILDING POSITIONS ARE FILLED - NOTE: NOT 100% SURE IF IT WORKS THIS WAY, BUT HERE YOU CAN LOWER THE AMOUNT OF ITEMS/OBJECTS THAT SPAWN IN HOUSES
		_lootobject = _lootableObjectArray select (floor (random (count _lootableObjectArray))); //SELECTS RANDOM OBJECTS FROM ARRAY
		_itemBox1 = _lootobject createVehicle [0,0,0]; // CREATE THE SELECTED OBJECT
		_itemBox1 allowDamage false; //DISABLES DAMAGE
		_itemBox1 setPos _x; // NOT 100% SURE BUT THIS MEMORIZES THE LOTO POSITIONS
		_itemBoxArray1 = _itemBoxArray1 + [_itemBox1]; //WHATEVER THIS DOES..
	};
	} forEach _buildingPositions1; // EXECUTES THE SPAWN CODE FOR EACH BUILDINGPOSITION IN A HOUSE
} forEach _houseArray1; // EXECUTES THE SPAWN CODE FOR EACH HOUSE IN THE AREA

//6.2. THIS SPAWNS ACTUAL ITEMS ON THE GROUND (VIA "GROUNDEWWAPONHOLDER"), IN THIS CASE, MEDICAL AND SURVIVAL (RAVAGE) ITEMS.
_itemBoxArray2 = [];
_houseArray2 = getMarkerPos _mark nearObjects ["house",50];
{
	_buildingPositions2 = [_x] call BIS_fnc_buildingPositions;
	{
		if (20 > random 100) then {
		_medicloot2 = _mediclootArray select (floor (random (count _mediclootArray)));
		_itemBox2 = "GroundWeaponHolder" createVehicle [0,0,0];
		_itemBox2 allowDamage false;
		_itemBox2 setPos _x;
    _itemBox2 addItemCargoGlobal [_medicloot2, 1 +random 0]; // THIS WILL SELECT RANDOM LOOT FROM THE RESPECTIVE ARRAY AND SPAWNS 1 + 0 RANDOM ITEMS. HERE, 0 COULD BE UPDATED TO 6 FOR A CHANCE TO SPAWN 6 ADDITIONA ITEMS, AS AN EXAMPLE
		_itemBoxArray2 = _itemBoxArray2 + [_itemBox2];
	};
	} forEach _buildingPositions2;
} forEach _houseArray2;

//6.3 SAME AS ABOVE BUT "CAMP" WILL CAPTURE SOME OF THE CUP AND VANILLA TENTS YOU MIGHT WANNA SPAWN, NOT ALL HOWEVER.
_itemBoxArray3 = [];
_houseArray3 = getMarkerPos _mark nearObjects ["camp",50];
{
	_buildingPositions3 = [_x] call BIS_fnc_buildingPositions;
	{
		if (20 > random 100) then {
		_medicloot3 = _mediclootArray select (floor (random (count _mediclootArray)));
		_itemBox3 = "GroundWeaponHolder" createVehicle [0,0,0];
		_itemBox3 allowDamage false;
		_itemBox3 setPos _x;
    _itemBox3 addItemCargoGlobal [_medicloot3, 1];
		_itemBoxArray3 = _itemBoxArray3 + [_itemBox3];
	};
	} forEach _buildingPositions3;
} forEach _houseArray3;

//////////////////
//7. AI SPAWNER//
////////////////
//7.1 FIRST GROUP
_bandits = createGroup east; // CREATES A GROUP CALLED _bandits
"O_G_Survivor_F" createUnit [getMarkerPos _mark, _bandits, "[this] call rvg_fnc_equip;", 1, "corporal"]; // SPAWNS A SURVIVOR WITHOUT GEAR ON THE MAIN MARKER INTO THE _bandits GROUP WITH RAVAGE GEAR, MAXIMUM SKILLS AND WITH RANK CORPORAL. BELOW REPEATS BUT WITH LOWER RANKS.
"O_G_Survivor_F" createUnit [getMarkerPos _mark, _bandits, "[this] call rvg_fnc_equip;", 1, "private"]; // REPLACE "[this] call rvg_fnc_equip; [_unit] call HG_fnc_aiUnitSetup;" WITH "" IF YOU DO NOT WANT THIS CODE TO BE INITIALISED FOR EACH UNIT.
if (40 > random 100) then { // % CHANCE THAT THIS AI IS SPAWNED
"O_G_Survivor_F" createUnit [getMarkerPos _mark, _bandits, "[this] call rvg_fnc_equip;", 1, "private"];};
if (30 > random 100) then { // % CHANCE THAT THIS AI IS SPAWNED
"O_G_Survivor_F" createUnit [getMarkerPos _mark, _bandits, "[this] call rvg_fnc_equip;", 1, "private"];};
if (20 > random 100) then { // % CHANCE THAT THIS AI IS SPAWNED
"O_G_Survivor_F" createUnit [getMarkerPos _mark, _bandits, "[this] call rvg_fnc_equip;", 1, "private"];};

//7.2 SECOND GROUP
// SAME AS ABOVE BUT A DIFFERENT GROUP, THIS WAY NOT ALL AI MOVE THE SAME WAYPOINTS
_bandits2 = createGroup east;
"O_G_Survivor_F" createUnit [getMarkerPos _mark, _bandits2, "[this] call rvg_fnc_equip;", 1, "corporal"];
"O_G_Survivor_F" createUnit [getMarkerPos _mark, _bandits2, "[this] call rvg_fnc_equip;", 1, "private"];
if (40 > random 100) then {
"O_G_Survivor_F" createUnit [getMarkerPos _mark, _bandits2, "[this] call rvg_fnc_equip;", 1, "private"];};
if (30 > random 100) then {
"O_G_Survivor_F" createUnit [getMarkerPos _mark, _bandits2, "[this] call rvg_fnc_equip;", 1, "private"];};
if (20 > random 100) then {
"O_G_Survivor_F" createUnit [getMarkerPos _mark, _bandits2, "[this] call rvg_fnc_equip;", 1, "private"];};

//7.3 WAYPOINTS - THIS IS VERY BASIC AND JUST MAKES THE BANDITS MOVE AROUND CLOSE TO THE CAMP
// THE BELOW SETS A "SEARCH AND DESTROY" WAYPOINT THAT MAKES THE AI WANDER THE CAMP AND LOOK FOR ENEMIES
_wp1 = _bandits addWaypoint [getmarkerpos _mark, 0];
    _wp1 setWaypointType "SAD"; //SETS THE WAYPOINT AS SEARCH AND DESTROY
    _wp1 setWaypointSpeed "Limited"; //SETS THE SPEED
    _wp1 setWaypointBehaviour "AWARE"; // SETS THE COMBAT STANCE
    _wp1 setWaypointFormation "COLUMN"; // SETS THE FORMATION

_wp1 = _bandits2 addWaypoint [getmarkerpos _mark, 0];
    _wp1 setWaypointType "SAD";
    _wp1 setWaypointSpeed "Limited";
    _wp1 setWaypointBehaviour "COMBAT";
    _wp1 setWaypointFormation "LINE";

////////////////////////////////////////
//8. TIMER IN SECONDS UNTIL THE CAMP DESPAWNS AND RESPAWNS AGAIN
///////////////////////////////////////////////////////
Sleep (random _despawnSleepRnd);Sleep _despawnSleepFix; // (CHANGE FIGURES UNDER ITEM 1.1)FIRST NUMBER STES A RANDOM AMOUNT OF SECONDS BETWEEN 1-3600 AND THE SECOND NUMBER SETS A DEFINITE TIMER OF 1000 SECODS. SO THE CAMP WILL RESPAWN EARLIEST AFTER 1000 SECONDS AND AT MAXIMUM AFTER 4600 SECONDS OR IF POINT 9. BELOW IS THE CASE.

////////////////////
//9. PAUSE DESPAWN, IF PLAYER IS TOO CLOSE TO THE CAMP
//////////////////////
WaitUntil {player distance (GetMarkerPos _mark) > _despanPauseProxy}; // (CHANGE FIGURES UNDER ITEM 1.1)IF THE PLAYER IS WITHIN xyz METERS CLOSE TO THE MAIN MARKER, THE SCRIPT WILL PAUSE AND WILL NOT DESPAWN. THE SCRIPT WILL PROCEED ONCE THE PLAYER IS FURTHER AWAY THAN 200 METERS.

///////////////////////////
//10. DESPAWN/DELETION/////
///////////////////////////
//- ANY SPAWNED OBJECT RECEIVES A REFERENCE (EG. _FIREPLACE) AND NEEDS TO BE DELETED AS SHOWN BELOW
deleteVehicle _fireplace;
deleteVehicle _itembox;
deleteVehicle _tent;
deleteVehicle _tent2;
deleteVehicle _tent3;
deleteVehicle _tent4;
deleteVehicle _Object1;
deleteVehicle _camonet;
deleteVehicle _camonet2;
deleteVehicle _Object2;
deleteVehicle _Object3;
deleteVehicle _Object4;
deleteVehicle _Object5;
deleteVehicle _Object6;
deleteVehicle _Object7;

//10.1 DELETES ITEMS THAT WHERE SPAWNED IN MULTIPLE BUILDING POSITIONS
{	deleteVehicle _x; } forEach _itemBoxArray1;
{	deleteVehicle _x; } forEach _itemBoxArray2;
{	deleteVehicle _x; } forEach _itemBoxArray3;

//10.1 DELEETES ALIVE AI FROM GROUP _bandits (NEEDS TO BE SET UP FOR ALL GROUPS OF AI)
if(isNil("_bandits"))exitWith{};
{
	if(vehicle _x != _x)then{deleteVehicle (vehicle _x);};
	deleteVehicle _x;
}forEach units _bandits; //EXECUTES DELETION FOR ALL UNITS OF SAID GROUP

//10.1 DELEETES ALIVE AI FROM GROUP _bandits
if(isNil("_bandits2"))exitWith{};
{
	if(vehicle _x != _x)then{deleteVehicle (vehicle _x);};
	deleteVehicle _x;
}forEach units _bandits2;

//10.2 DELETES DEAD AI
{ deleteVehicle _x; } forEach allDead;
//10.3 DELETS OBJECTS THAT MAY HAVE BEEN SPAWNED INTO SPAWNED STRUCTURES VIA RAVAGE LOOT MODULE
{ deleteVehicle _x; } forEach nearestObjects [getMarkerPos _mark,["WeaponHolder","GroundWeaponHolder"],550];
};

 

 

Script Dependencies:

Ravage mod is required to run this script you can find it here: LINK

 

CUP (if first version is used, what I recommend as there are more tents):

CUP: Terrain - Core, Maps, Units, Weapons (can  be subscribed to in the Steam Workshop)

 

Setting up the Script in the editor:

1. Start your mission via editor and place markers named:  mrkrA_1    mrkrA_2     mrkrA_3    mrkrA_4    mrkrA_5

2. To name a marker, add the above name into the Variable Names field like this:    mrkrA_1

3. Place your markers on flat ground to avoid issues with the object placement.

 

4. Note the following:

- place mrkrA_1 in the center of a 4000 meters radius and all other markers spread around that marker.

- why? The script will check a radius of 4000 meters around that marker (mrkrA_1) to see if the player is close. If not, the script will pause to safe performance.

 

5. Place your player and start your mission.

 

The script will now select one of the 5 markers randomly every 3600 seconds and will place the Camp, AI units and loot around this marker.

After 3600 seconds everything will be deleted and the script starts from the beginning. The script loops infinitely.

The script will only run, once you are within 4000 meters proximity of mrkrA_1, as mentioned above.

 

Personalize the script - (additional markers)

1. To place more markers, just add additional marker names under _mark = [.....]. in the script.

2. The last marker needs to end without comma "mrkrA_15"];.

Leaving a comma at the end of the array "mrkrA_15,"]; would not work.

3. Place the new markers on the map.

 

Adding weapons

To add your weapon classname into

_weaponArray = ["yourweaponclassname","yoursecondweaponclassname","yourlastweaponclassname"]; 

this will drop in the loot box.

 

Adding items

To add your item classnames into

_itemArray2 = ["youritemclassname","yourseconditemclassname","yourlastitemclassname"];

("_itemArray =."will spawn large amounts of ravage money into the main lootbox, hence you should not amend that one)

 

Add another category to items

To add another category of items  such as (silencers, optics etc.,.),

add your classnames into

_itemArray3 = ["youritemclassname","yourseconditemclassname","yourlastitemclassname"];

 

Add hand grenades, mines, explosives

To add your classname into

_explosivesArray = ["youritemclassname","yourseconditemclassname","yourlastitemclassname"];

 

Add or remove house/tent structures

_tents = [], _tents2 = [],_tents3 = [],_tents4 = [] are the arrays of possible buildings that can spawn.

Add your additional building classnames here. In these brackets e.g. _tents = ["Camp","Land_tent_east"];

Each array is linked to a different spawn point e.g. structures from the _tents array, will spawn in _tent.

I recommend having a different set of buildings in each category (_tents, _ tents2,....) else you will end up with two identical buildings next to each other in a camp which might look weird.

 

 

Using the script without Ravage mod

If you want to use this without the Ravage and CBA mod, delete all classnames that start with "rvg_".

 

Camps to despawn and respawn faster or slower

go to line 287 (Sleep (random 3600); Sleep 1000) and update the numbers to your liking. The first number will select a random amount of seconds (1-3600) and the second number is a actual valua (e.g. the script would pause for a random amount of seconds between 1-3600 seconds + a definitive 1000 seconds to despawn and respawn).

 

 

If you want to have multiple sets of camps spawned, do the following:

Copy & paste the file "banditcamp.sqf" and rename it to e.g. "banditcampB.sqf" in your mission folder.

[] execVM "banditcampB.sqf";  <--- place this text onto a new line into the init.sqf file in your mission folder.

in "banditcampB.sqf", change all the marker names under " _mark" and give it a new unique name such as "_mrkrB_1",_mrkrB_2",.....

place markers with those new names on the map.

banditcamp.sqf may have markers in the southern part of your map whilst banditcampB.sqf has its markers in the northern part, as an example.

===================================

Changelog

27.03.2018

- Updated the OP to hopefully add clear instruction on script usage (thanks @Gunter Severloh)

- updated the script to contain line-per-line explanation

- added CUP version as the structures fit better to the "camp" feeling

- added clean up code for loot able objects/furniture that are spawned into camp structures by the ravage loot module

- added range check for script to only run if player is within 4000 meters proximity of the markers

 

08.03.2018

- sorted the arrays and put them at one place on top (easier to enter your own buildings, tents, weapons or items from other mods)

- added a bigger variety of vanilla structures and weapons that may spawn (includes a chance to spawn working Car or Helicopter)

- random amount of enemy AI spawns and patrols now with random gear based on your ravage equipment module settings

- added a WaitUntil function to stop the camps from de-spawning if the player is within 200 meters of the current camp

- added some explanation on how to install and edit the script

- removed all dependencies other than CBA and Ravage

Im having, perhaps, a unique problem because I have no internet connection on the machine Im trying to get this script on.  Im having to copy the script to a text file on my mobile and transfer to the PC.  Im thinking some part of the script is getting broken in the conversion of text formats...I know its not ideal, but I have no alternative.  Because of this same problem it would be tedious and probably fruitless to try and give you a cooy of the “init.sqf” and “banditcamp.sqf” files Im using. 

 

Is there by any chance, a copy of the banditcamp.sqf WITHOUT the instructions I can try?  Otherwise, can you offer some insight on what MIGHT be wrong?  Ive created 5 markers named correctly and arranged as they should be with “mrkrA_1” in the center with the other 4 around it about 200m apart.  I dont get any errors when the mission loads but the camp doesnt spawn on any of the markers.  

 

Im also hoping Im putting the 2 .sqf files in the CORRECT “missions” folder.  Im assuming they go in: C:\Users\”username”\Documents\missions.  Is that correct?  I notice several other “missions” folders and folders with the same name as my mission name.  TIA!

Share this post


Link to post
Share on other sites

@catamaranman

 

Good morning!

 

it seems that u have put it the sqf into the general single player mission folder, (where all SP missions from eden editor are saved) instead of the actual mission folder. open the folder inside "missions" with your mission name (the one you have chosen when saving your mission) put the sqfs inside there.

 

else it should be possible to paste the scrip into a simple notepad alike mobile app and open it again on your pc, with the standard notepad.

 

btw i am soooo close to release a improved version of the banditcamp spawner with no requirement to set markers.. soon;)

  • Like 3

Share this post


Link to post
Share on other sites
21 hours ago, Vandeanson said:

Alright, to exclude all arma 3 vanilla weapons, use this array. I have exported this from the BI page and have not tested it yet, so it should work in theory, but is to be tested;)

 

  Reveal hidden contents


VD_WeaponArrayBlacklist = ["arifle_ARX_ghex_DMS_Pointer_Snds_Bipod_F",
"arifle_ARX_Viper_F",
"arifle_ARX_Viper_hex_F",
"arifle_CTAR_blk_F",
"arifle_CTAR_hex_F",
"arifle_CTAR_ghex_F",
"arifle_CTAR_GL_blk_F",
"arifle_CTAR_GL_hex_F",
"arifle_CTAR_GL_ghex_F",
"arifle_CTAR_blk_ACO_Pointer_F",
"arifle_CTAR_blk_Pointer_F",
"arifle_CTAR_blk_ACO_F",
"arifle_CTAR_GL_blk_ACO_F",
"arifle_CTAR_GL_blk_ARCO_Pointer_F",
"arifle_CTAR_blk_ARCO_Pointer_F",
"arifle_CTAR_blk_ACO_Pointer_Snds_F",
"arifle_CTAR_GL_blk_ACO_Pointer_Snds_F",
"arifle_CTAR_blk_ARCO_Pointer_Snds_F",
"arifle_CTAR_blk_ARCO_F",
"arifle_CTARS_blk_F",
"arifle_CTARS_hex_F",
"arifle_CTARS_ghex_F",
"arifle_CTARS_blk_Pointer_F",
"arifle_SPAR_01_blk_F",
"arifle_SPAR_01_khk_F",
"arifle_SPAR_01_snd_F",
"arifle_SPAR_01_GL_blk_F",
"arifle_SPAR_01_GL_khk_F",
"arifle_SPAR_01_GL_snd_F",
"arifle_SPAR_01_blk_ERCO_Pointer_F",
"arifle_SPAR_01_blk_ACO_Pointer_F",
"arifle_SPAR_01_GL_blk_ACO_Pointer_F",
"arifle_SPAR_01_GL_blk_ERCO_Pointer_F",
"arifle_SPAR_02_blk_F",
"arifle_SPAR_02_khk_F",
"arifle_SPAR_02_snd_F",
"arifle_SPAR_02_blk_Pointer_F",
"arifle_SPAR_02_blk_ERCO_Pointer_F",
"arifle_SPAR_03_blk_F",
"arifle_SPAR_03_khk_F",
"arifle_SPAR_03_snd_F",
"arifle_SPAR_03_blk_MOS_Pointer_Bipod_F",
"SMG_05_F",
"B_Patrol_Soldier_Leader_weapon_F",
"B_Patrol_Soldier_Operator_weapon_F",
"B_Patrol_Soldier_Marksman_weapon_F",
"B_Patrol_Soldier_Medic_weapon_F",
"B_Patrol_Soldier_Autorifleman_weapon_F",
"B_Patrol_Soldier_MachineGunner_weapon_F",
"B_Patrol_Soldier_HeavyGunner_weapon_F",
"B_Patrol_Soldier_Carrier_weapon_F",
"B_Patrol_Soldier_Specialist_weapon_F",
"B_Patrol_Soldier_Pistol_F",
"arifle_CTAR_blk_flash_F",
"arifle_CTAR_blk_aco_flash_F",
"arifle_CTAR_blk_arco_flash_F",
"arifle_CTARS_blk_flash_F",
"arifle_CTAR_GL_blk_aco_flash_F",
"arifle_CTAR_GL_blk_arco_flash_F",
"srifle_DMR_07_blk_F_arco_flash_F",
"SMG_02_flash_F",
"launch_MRAWS_olive_F",
"launch_MRAWS_olive_rail_F",
"launch_MRAWS_green_F",
"launch_MRAWS_green_rail_F",
"launch_MRAWS_sand_F",
"launch_MRAWS_sand_rail_F",
"launch_O_Vorona_brown_F",
"launch_O_Vorona_green_F"];

 

If anyone has the chance to test it before me, let me know=)

I will build in another line of code that will deal with the scenario, where only vanilla weapons should be used (eg. in that case the blacklist would empty the weaponarray, which needs to be undone)..

i tested this and i am pretty sure that i did not get the complete array FYI, some vanilla and dlc weaps still spawn. i have figured that with bis_fnc_baseweapon i can spawn base weapons from the array only, else you get too many fancy weapon spawns (with silencer and epic scopes..) for a survival scenario;)

Share this post


Link to post
Share on other sites
37 minutes ago, Vandeanson said:

@catamaranman

 

btw i am soooo close to release a improved version of the banditcamp spawner with no requirement to set markers.. soon;)

This is exactly what I am interested in :) 

  • Like 4

Share this post


Link to post
Share on other sites
2 hours ago, Vandeanson said:

scrip into a simple notepad

 

#JUST Say NO , to simple Notepads !    :torture:

  • Like 1

Share this post


Link to post
Share on other sites
2 hours ago, GEORGE FLOROS GR said:

 

#JUST Say NO , to simple Notepads !    :torture:

haha:)) well i know one android app that has some sime syntax highlighting but could not find any working with arma :))

  • Haha 1

Share this post


Link to post
Share on other sites

Holla all,

 

This is the new BC spawner:

Until i can properly update the OP:

- no more markers needed

- im using an own equipment script as the one from ravage used to spawn units without uniform quite often

- you can change some stuff under VD_Array.sqf, such as Custom Weapon lists, blacklist weapons that you dont want or add vests, backpacks, uniforms hats that you want to be spawned on bandits or in crates

- by default, the script selects random weapons from all available weapons. e.g. if you run vanilla arma, it will just include those weapons. if you have any mod active, these weapons will be included.

- this does not always work 100% properly because it sometimes does not spawn the graphics for a equpted weapon

- i would recomend applying a own custom weapon list (this will overwrite all other weapons).

- the script will spawn matching Magazines and weapon attachments automatically

- bandits have a low chance to spawn with weapon attachemetns on their weapons

- The object placement system is automated, hence it still might happen that two tents are too close together, but it should not happen often.

 

This made for SP and would need some tweaking for MP/coop, if anyone has input in that respect, i am happy to apply it ;)

 

 

 

Spoiler

while {true} do {

_VD_BCSpawn = [getPosATL player, VD_BC_CampSpawnMinDist, VD_BC_CampSpawnMaxDist, 0, 0, 0.9, 0] call BIS_fnc_findSafePos;
_fireplace = selectRandom VD_BCcampfire createVehicle _VD_BCSpawn;
sleep 1;

_tent1pos = [getPosATL _fireplace, 5, 7, 5, 0, 100, 0] call BIS_fnc_findSafePos;
_tent1 = selectRandom VD_BCtentsSmall createVehicle _tent1pos;
_tent1 setDir (random 360);
sleep 1;
_tent2pos = [getPosATL _fireplace, 5, 10, 5, 0, 100, 0] call BIS_fnc_findSafePos;
_tent2 = selectRandom VD_BCtentsSmall createVehicle _tent2pos;
_tent2 setDir (random 360);
sleep 1;
_tent3pos = [getPosATL _fireplace, 10, 30, 10, 0, 100, 0] call BIS_fnc_findSafePos;
_tent3 =  "Land_tent_east" createVehicle _tent3pos;
_tent3 setDir (random 360);
sleep 1;
_tent4pos = [getPosATL _fireplace, 10, 30, 10, 0, 100, 0] call BIS_fnc_findSafePos;
_tent4 = selectRandom VD_BCtentsBig createVehicle _tent4pos;
_tent4 setDir (random 360);
sleep 1;
_tent5pos = [getPosATL _fireplace, 10, 30, 10, 0, 100, 0] call BIS_fnc_findSafePos;
_tent5 = selectRandom VD_BCtentsBig createVehicle _tent5pos;
_tent5 setDir (random 360);
{_x allowDamage false;} foreach [_tent1,_tent2,_tent3,_tent4,_tent5,_fireplace];

sleep 0.3;

_tent3uildPos = _tent3 call BIS_fnc_buildingPositions;
_itembox1 = "Box_IND_Ammo_F" createVehicle selectRandom _tent3uildPos;
_itembox1 allowDamage false;
clearMagazineCargoGlobal _itembox1;
clearWeaponCargoGlobal _itembox1;
clearItemCargoGlobal _itembox1;
clearBackpackCargoGlobal _itembox1;
_weapon = [selectrandom VD_weaponArray] call BIS_fnc_baseWeapon;
_weapon1 = [selectrandom VD_weaponArray] call BIS_fnc_baseWeapon;
_itembox1 additemCargoGlobal [selectRandom VD_currencyArray, 50 +random 50];
_itembox1 additemCargoGlobal [selectRandom VD_itemArray1, 1 +random 1];
_itembox1 additemCargoGlobal [selectRandom VD_itemArray1, 1 +random 1];
_itembox1 addMagazineCargoGlobal [selectRandom VD_explosivesArray, 1 +random 2];
_itembox1 additemCargoGlobal [selectRandom VD_itemArray1, 1 +random 1];
_itembox1 additemCargoGlobal [selectRandom VD_medicalArray, 1 +random 1];
_itembox1 addItemCargoGlobal [_weapon call BIS_fnc_compatibleItems, 1];
_itembox1 addItemCargoGlobal [_weapon1 call BIS_fnc_compatibleItems, 1];
  _itembox1 addItemCargoGlobal [_weapon call BIS_fnc_compatibleItems, 1];
_itembox1 addItemCargoGlobal [_weapon1 call BIS_fnc_compatibleItems, 1];
_itembox1 addWeaponCargo [_weapon,1 +random 1];
_magazines = getArray (configFile >> "CfgWeapons" >> _weapon >> "magazines");
_mag = selectRandom _magazines;
_itembox1 addMagazineCargoGlobal [_mag, 2 +random 4];
_itembox1 addWeaponCargo [_weapon1,1 +random 1];
_magazines1 = getArray (configFile >> "CfgWeapons" >> _weapon1 >> "magazines");
_mag1 = selectRandom _magazines1;
_itembox1 addMagazineCargoGlobal [_mag1, 2 +random 4];

_tent4BuildPos = _tent4 call BIS_fnc_buildingPositions;
_itemBox2 = "Box_IND_Ammo_F" createVehicle selectRandom _tent4BuildPos;
_itemBox2 allowDamage false;
clearMagazineCargoGlobal _itemBox2;
clearWeaponCargoGlobal _itemBox2;
clearItemCargoGlobal _itemBox2;
clearBackpackCargoGlobal _itemBox2;
if (4 >= (random 10)) then {_itemBox2 addweaponCargoGlobal [selectrandom VD_weaponArray,1];};
if (4 >= (random 10)) then {_itemBox2 additemCargoGlobal [selectrandom VD_itemArray1,1];};
if (4 >= (random 10)) then {_itemBox2 additemCargoGlobal [selectrandom VD_itemArray1,1];};
if (4 >= (random 10)) then {_itemBox2 additemCargoGlobal [selectrandom VD_medicalArray,1];};
if (4 >= (random 10)) then {_itemBox2 addweaponCargoGlobal [selectrandom VD_weaponArray,1];};
if (4 >= (random 10)) then {_itemBox2 additemCargoGlobal [selectrandom VD_itemArray1,1];};
if (4 >= (random 10)) then {_itemBox2 additemCargoGlobal [selectrandom VD_itemArray1,1];};
if (4 >= (random 10)) then {_itemBox2 additemCargoGlobal [selectrandom VD_medicalArray,1];};

_tent3BuildPos = _tent5 call BIS_fnc_buildingPositions;
_itemBox3 = "Box_IND_Ammo_F" createVehicle selectRandom _tent3BuildPos;
_itemBox3 allowDamage false;
clearMagazineCargoGlobal _itemBox3;
clearWeaponCargoGlobal _itemBox3;
clearItemCargoGlobal _itemBox3;
clearBackpackCargoGlobal _itemBox3;
if (4 >= (random 10)) then {_itemBox3 addweaponCargoGlobal [[selectrandom VD_weaponArray] call BIS_fnc_baseWeapon,1];};
if (4 >= (random 10)) then {_itemBox3 additemCargoGlobal [selectrandom VD_itemArray1,1];};
if (4 >= (random 10)) then {_itemBox3 additemCargoGlobal [selectrandom VD_itemArray1,1];};
if (4 >= (random 10)) then {_itemBox3 additemCargoGlobal [selectrandom VD_medicalArray,1];};
if (4 >= (random 10)) then {_itemBox3 addweaponCargoGlobal [[selectrandom VD_weaponArray] call BIS_fnc_baseWeapon,1];};
if (4 >= (random 10)) then {_itemBox3 additemCargoGlobal [selectrandom VD_itemArray1,1];};
if (4 >= (random 10)) then {_itemBox3 additemCargoGlobal [selectrandom VD_itemArray1,1];};
if (4 >= (random 10)) then {_itemBox3 additemCargoGlobal [selectrandom VD_medicalArray,1];};

sleep 0.3;

_clutter1 = selectRandom VD_BCclutterBig createVehicle ([getPosATL _fireplace, 10, 35, 15, 0, 100, 0] call BIS_fnc_findSafePos);
_clutter2 = selectRandom VD_BCclutterBig createVehicle ([getPosATL _fireplace, 10, 35, 15, 0, 100, 0] call BIS_fnc_findSafePos);
_clutter3 = selectRandom VD_BCclutterBig createVehicle ([getPosATL _fireplace, 10, 35, 15, 0, 100, 0] call BIS_fnc_findSafePos);

sleep 0.3;

_clutter4 = selectRandom VD_BCclutterSmall createVehicle ([getPosATL _fireplace, 2, 15, 4, 0, 100, 0] call BIS_fnc_findSafePos);
sleep 0.3;
_clutter5 = selectRandom VD_BCclutterSmall createVehicle ([getPosATL _fireplace, 2, 15, 4, 0, 100, 0] call BIS_fnc_findSafePos);
sleep 0.3;
_clutter6 = selectRandom VD_BCclutterSmall createVehicle ([getPosATL _fireplace, 2, 15, 4, 0, 100, 0] call BIS_fnc_findSafePos);

sleep 0.3;

_clutter7 = selectRandom VD_BCclutterMedium createVehicle ([getPosATL _fireplace, 2, 15, 5, 0, 100, 0] call BIS_fnc_findSafePos);
sleep 0.3;
_clutter8 = selectRandom VD_BCclutterMedium createVehicle ([getPosATL _fireplace, 2, 15, 5, 0, 100, 0] call BIS_fnc_findSafePos);
sleep 0.3;
_clutter9 = selectRandom VD_BCclutterMedium createVehicle ([getPosATL _fireplace, 2, 15, 5, 0, 100, 0] call BIS_fnc_findSafePos);
{_x setDir (random 360)} foreach [_clutter1,_clutter2,_clutter3,_clutter4,_clutter5,_clutter6,_clutter7,_clutter8,_clutter9];

sleep 0.3;
_bandits1 = createGroup east;
_bandits2 = createGroup east;
_bandits3 = createGroup east;
_bandits4 = createGroup east;

{if (3 >= (random 10)) then {"B_G_Survivor_F" createUnit [([getPosATL _fireplace, 2, 15, 0, 0, 100, 0] call BIS_fnc_findSafePos), _x, "", 1, "private"];};"B_G_Survivor_F" createUnit [([getPosATL _fireplace, 2, 15, 0, 0, 100, 0] call BIS_fnc_findSafePos), _x, "", 1, "private"];} foreach [_bandits1, _bandits2,_bandits3,_bandits4];

{[_x] call VD_equipper;}forEach units _bandits1;
{[_x] call VD_equipper;}forEach units _bandits2;
{[_x] call VD_equipper;}forEach units _bandits3;
{[_x] call VD_equipper;}forEach units _bandits4;

{[_x,getpos _fireplace,5] call BIS_fnc_taskPatrol;}foreach [_bandits1, _bandits2];
{[_x, getPos _fireplace] call BIS_fnc_taskDefend;}foreach [_bandits3, _bandits4];

sleep VD_BC_CampUptimeFix;
sleep VD_BC_CampUptimeRnd;
waituntil {player distance _fireplace > VD_BC_DeletionSaveZone};

{deleteVehicle _x}forEach units _bandits1;
{deleteVehicle _x}forEach units _bandits2;
{deleteVehicle _x}forEach units _bandits3;
{deleteVehicle _x}forEach units _bandits4,

{deleteVehicle _x} foreach [_itembox1, _itembox2, _itembox3,_fireplace,_tent1,_tent1,_tent2,_tent3,_tent4,_tent5,_clutter1,_clutter2,_clutter3,_clutter4,_clutter5,_clutter6,_clutter7,_clutter8,_clutter9];

};

 

This BC_Array.sqf is needed too:

Spoiler


//Bandit Camp Spawned Settings:
VD_BC_CampUptimeFix = 3600;
VD_BC_CampUptimeRnd = 1000;
VD_BC_DeletionSaveZone = 300;
VD_BC_CampSpawnMinDist = 600;
VD_BC_CampSpawnMaxDist = 2000;

// Custom Weapolist or Blacklist
VD_weaponarraycustom = [];
VD_weaponarrayblacklist = [];

//Bandit Camp Spawned Objects and Structures
VD_BCclutterSmall = ["Land_Garbage_square5_F","Land_LuggageHeap_02_F","Land_CampingChair_V1_F","Land_WoodenLog_F","Axe_woodblock"];

VD_BCclutterBig = ["Pile_of_wood","Mass_grave","Land_Scrap_MRAP_01_F","Land_WoodenCart_F","Land_Wreck_T72_hull_F","Land_stand_meat_EP1","Land_ScrapHeap_2_F","TargetP_Inf2_Acc1_F","Land_ScrapHeap_1_F"];
VD_BCclutterMedium = ["Fort_Crate_wood","Land_Pallet_MilBoxes_F","Land_Sacks_heap_F","Land_Basket_F","Land_PaperBox_open_full_F","Land_Cages_F","Land_Sacks_goods_F","Land_WaterBarrel_F","Land_CanisterFuel_F","Wooden_barrel","Land_PaperBox_closed_F","Land_PaperBox_open_empty_F","Land_CanisterPlastic_F","Land_Bucket_clean_F","Land_MetalBarrel_F","Land_Sack_F","Land_WoodenCrate_01_stack_x3_F"];

VD_BCtentsSmall = ["Land_TentDome_F","Land_TentA_F"];
VD_BCtentsBig = ["Camp","Land_tent_east","Camp","Land_tent_east","Camp","Land_tent_east"];
VD_BCcampfire = ["Campfire_burning_F","MetalBarrel_burning_F"];

//Arrays for Items, weapons, equipment;
VD_currencyArray = ["rvg_money"];



VD_weaponArray = [];
_count = count VD_weaponarraycustom;
if (_count >= 1) then {VD_weaponArray append VD_weaponarraycustom;}
else {
_cfgWeapons = "true" configClasses (configFile >> "cfgWeapons");

{
	_weaponString = configName (_x);
	_parents = [_x,true] call BIS_fnc_returnParents;

	if ("Rifle" in _parents) then {
		VD_weaponArray append [_weaponString];
	};
  if ("Pistol" in _parents) then {
		VD_weaponArray append [_weaponString];
	};
} forEach _cfgWeapons;
VD_weaponarray = VD_weaponarray - VD_weaponarrayblacklist;
};


VD_itemArray1 = [
"rvg_plasticBottleEmpty",
 "rvg_canteenEmpty",
 "rvg_canOpener",
 "rvg_plasticBottle",
 "rvg_plasticBottlePurified",
 "rvg_spirit",
 "rvg_franta",
 "rvg_beans",
 "rvg_bacon",
 "rvg_milk",
 "rvg_rice",
 "rvg_rustyCan",
 "rvg_hose",
 "rvg_guttingKnife",
 "rvg_tire",
 "rvg_purificationTablets",
 "rvg_flare",
 "rvg_rustyCanEmpty",
 "rvg_beansEmpty",
 "rvg_baconEmpty",
 "rvg_spiritEmpty",
 "rvg_frantaEmpty",
 "rvg_rustyCanEmpty",
 "rvg_beansEmpty",
 "rvg_baconEmpty",
 "rvg_spiritEmpty",
 "rvg_frantaEmpty",
 "rvg_matches",
 "rvg_canisterFuel_Empty",
"rvg_canisterFuel",
 "rvg_Geiger",
 "rvg_docFolder",
 "rvg_toolkit",
 "rvg_antiRad",
 "rvg_sleepingBag_Blue",
 "rvg_foldedTent",
 "rvg_money",
 "rvg_notepad",
 "rvg_docFolder",
 "rvg_rustyCanEmpty"
];

VD_medicalArray =[
"rvg_antiRad",
"FirstAidKit",
"rvg_spirit",
"rvg_franta",
"rvg_beans",
"rvg_bacon",
"rvg_milk",
"rvg_rice",
"rvg_purificationTablets"];



VD_explosivesArray = [
"HandGrenade",
"SmokeShellBlue",
"SmokeShellGreen",
"SmokeShellOrange",
"SmokeShellPurple",
"SmokeShellRed",
"SmokeShell",
"SmokeShellYellow",
"DemoCharge_Remote_Mag",
"ClaymoreDirectionalMine_Remote_Mag",
"SatchelCharge_Remote_Mag",
"APERSTripMine_Wire_Mag",
"APERSMine_Range_Mag"
];

VD_headgearArray = ["H_Watchcap_camo","H_Bandanna_cbr","H_Booniehat_mcamo"];
VD_uniformArray = ["U_B_HeliPilotCoveralls","U_C_Poloshirt_tricolour","U_B_HeliPilotCoveralls","U_BG_Guerilla1_1","U_I_G_resistanceLeader_F"]; // add uniforms here
VD_vestArray = ["V_PlateCarrierIA1_dgtl","V_Chestrig_khk","V_PlateCarrierSpec_blk","V_TacVest_blk"];
VD_backpackArray = ["B_AssaultPack_blk","B_AssaultPack_rgr"];

VD_equipper = {
  _weapon = [selectrandom VD_weaponArray] call BIS_fnc_baseWeapon;
  _magazines = getArray (configFile >> "CfgWeapons" >> _weapon >> "magazines");
  _mag = selectRandom _magazines;
  _attarr = _weapon call BIS_fnc_compatibleItems;
    removeUniform _x;
  _x forceAddUniform selectRandom VD_uniformArray;

  for "_i" from 1 to 3 do {_x addItemToUniform _mag;};

  _x addItemToUniform selectRandom VD_medicalArray;
  for "_i" from 1 to 20 do {_x addItemToUniform selectRandom VD_currencyArray;};

  _x addWeapon _weapon;
	_x addPrimaryWeaponItem _mag;
if(1>=random 10) then{_x addPrimaryWeaponItem selectRandom _attarr;};
  _x addItemToUniform selectRandom VD_itemArray1;

  if(9>=random 10) then{
  _x addVest selectRandom VD_vestArray;
  _x addItemToVest selectRandom VD_itemArray1;
  _x addItemToVest selectRandom VD_itemArray1;};

  if(3>=random 10) then{
  _x addBackpack selectRandom VD_backpackArray;
  if(1>=random 10) then{_x addItemToBackpack selectRandom _attarr;};
    if(1>=random 10) then{_x addItemToBackpack selectRandom VD_explosivesArray;};};

  if(3>=random 10) then{
  _x addHeadgear selectRandom VD_headgearArray;};
};

 

And this is how your Init.sqf should look:

Spoiler



[] execVM "VD_Arrays.sqf";
[] execVM "VD_BCSpawner.sqf";

 

 

In case you want to spawn multiple camps, cust copy paste teh VD_BCSpawner.sqf file, rename the copies and update your init.sqf as per below examples:

Spoiler


[] execVM "VD_Arrays.sqf";
[] execVM "VD_BCSpawner.sqf";
[] execVM "VD_BCSpawner0.sqf";
[] execVM "VD_BCSpawner1.sqf";
[] execVM "VD_BCSpawner2.sqf";
[] execVM "VD_BCSpawner3.sqf";

 

 

 

  • Like 3
  • Thanks 2

Share this post


Link to post
Share on other sites

Oh wow, thanks Vandeanson! I was just adding your script to my mission when you posted that!

 

By the way, is there a way I can blacklist the spawner from spawning a camp in certain areas?

Edited by ContheJon

Share this post


Link to post
Share on other sites
58 minutes ago, ContheJon said:

Oh wow, thanks Vandeanson! I was just adding your script to my mission when you posted that!

 

By the way, is there a way I can blacklist the spawner from spawning a camp in certain areas?

hola!

 

yes thats possible with BIS_fnc_findSafePos, the parameter blacklistPos

 

blacklistPos (Optional): List of blacklisted areas in format [area1, area2, area3... areaN] (Default: []). Area could be one of:

Array - in format [topLeftCorner, bottomRightCorner] - top and bottom coordinates of blacklisted area

Object - trigger area

String - marker area

Location - location

Array - array in format [center, distance] or [center, [a, b, angle, rect]] or [center, [a, b, angle, rect, height]]

 

i dont have a working version yet though but will try to implement it asap

 

cheers

vd

 

  • Like 1
  • Thanks 1

Share this post


Link to post
Share on other sites

Oh sweet, thanks Vandeanson. I like the randomness, it's just I'm worried about them spawning in right on top of safe zones I've created.

Share this post


Link to post
Share on other sites
35 minutes ago, ContheJon said:

Oh sweet, thanks Vandeanson. I like the randomness, it's just I'm worried about them spawning in right on top of safe zones I've created.

 

yeah i was working on some systems to avoid that, however it would break the spawning and result in thousends of tents to spawn:))

but i think i will be able to do something with the optional parameters from the above function. 

  • Like 1

Share this post


Link to post
Share on other sites

Just tried out the new version, works well at first go! First time I've used a script not had an immediate error pop up! They spawned in the woods way out in the wilderness on Napf Winter Which was nice. Hopefully that'll make the woods slightly more threatening (unless someone makes a werewolf mod ;P)

Edited by ContheJon

Share this post


Link to post
Share on other sites
1 hour ago, ContheJon said:

Just tried out the new version, works well at first go! First time I've used a script not had an immediate error pop up! They spawned in the woods way out in the wilderness on Napf Winter Which was nice. Hopefully that'll make the woods slightly more threatening (unless someone makes a werewolf mod ;P)

good to hear:))

let me know if you notice any odd things!

 

yeah this is what i wanted to achieve, it ahould be worth for players to go and discover remote places:) there should always be the possibilty that something is out there.

 

got some stuff to finish but i want to add a spawner for smaller 1 tent camps and burried chets that can be found and such.

 

  • Like 2

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.

×