Jump to content

Dayz style heli crash sites


Richie

Recommended Posts

11 minutes ago, Alex_ said:

 

its as simple as drag and drop into the @epochhive addons folder right? because i did that and still didn't work.

Our server is running on Altis. I changed only loot table and this:

_spawnCenter = [14939.9, 15083.3, 0]; //Center of your map (usually in mission.sqm)
_max = 14500; // maximum distance from the center position (Number) in meters

Link to comment
Share on other sites

You got a typo in your loot table.

There is a "," missing before "Chainsaw".

Also i would put a:

diag_log "Helicrashsites loaded..";

in the last line of the helicrash script.

So you can see in your Server RPT logs that this script is loaded succesfully.

__________________________________________________________________

Note:

Also a good way to get the center:

_spawnCenter = getArray(configFile >> "CfgWorlds" >> worldName >> "centerPosition");

This solution works only if the mapcreator added the center position.

__________________________________________________________________

This works always:

_size = getNumber (configFile >> "CfgWorlds" >> worldName >> "MapSize");

_spawncenter = [_size/2,_size/2,];

More portable if you want that script running on different maps.

Link to comment
Share on other sites

20 minutes ago, Kenobi said:

Our server is running on Altis. I changed only loot table and this:

_spawnCenter = [14939.9, 15083.3, 0]; //Center of your map (usually in mission.sqm)
_max = 14500; // maximum distance from the center position (Number) in meters

Same i only edited the center, max, and loot table.

 

Thanks so much! it fixed my problem.

 

Link to comment
Share on other sites

22 minutes ago, Alex_ said:

Okay now for some reason the helis are spawning on top of each other.

 

Increase the _max value or decrease the number of crash sites, it could be that it isn't finding enough suitable locations so they dupe, either that or you've made other changes that have broken it.

Link to comment
Share on other sites

On 3/27/2016 at 4:50 PM, Richie said:

 

Increase the _max value or decrease the number of crash sites, it could be that it isn't finding enough suitable locations so they dupe, either that or you've made other changes that have broken it.

this is what i gave right now and its still spawning on each other 

 

_spawnCenter = [14939.9, 0.0534991, 15083.3]; //Center of your map (usually in mission.sqm)
_min = 100; // minimum distance from the center position (Number) in meters
_max = 14500; // maximum distance from the center position (Number) in meters
_mindist = 100; // minimum distance from the nearest object (Number) in meters, ie. spawn at least this distance away from anything within x meters..
//Low _mindist means helicrashes could spawn near towns or in forests.. higher the number it would be spawning in an open field etc
_water = 0; // water mode 0: cannot be in water , 1: can either be in water or not , 2: must be in water
_shoremode = 0; // 0: does not have to be at a shore , 1: must be at a shore

 

Link to comment
Share on other sites

5 hours ago, rvg?! said:

paste the whole file on pastebin. If i am in a good mood later i ll add a debug mode for the script and maybe richie will update the original file.

Okay, but im not home right now. I'll post once im back home.

Link to comment
Share on other sites

  • 4 weeks later...

Is this still working on the newest Epoch? I just tried adding it to my server and I see this line in the log:

20:20:18 F:\esseker_test\Server\@EpochHive\addons\helicrash.pbo - unknown

But no other indication that it's loading. I added "diag_log "Helicrashsites loaded..";" before the "call vSpawnCrashes;" but I am not getting that in my log. Here's my HeliCrashes.sqf, with a center for Esseker:

Spoiler

private ["_crashNum","_lootNum","_loot","_coords"];
/////////////////////////////////////
//      Function file for UKGZ	   //
//        Created by: Richie       //
//  Modded by:  Vampire & xBowBii  //
/////////////////////////////////////
// Number of Crashes
_crashNum = 5;

// Number of Loot Piles
_lootNum = 4;

_loot = [
	"ItemCompass","ItemGPS","ItemWatch","FAK","Rangefinder","Binocular","NVG_EPOCH","acc_flashlight","acc_pointer_IR",
	"20Rnd_762x51_Mag","SniperRifleAmmo_5Rnd_127x108_Mag","srifle_DMR_02_F","M14_EPOCH","7Rnd_408_Mag","ItemDocument","CircuitParts",
	"VehicleRepair","Towelette","HotColdPacks","lighter_epoch","ItemSodaOrangeSherbet","ItemSodaAlpineDude",
	"ItemLockbox","ItemBattery","jerrycan_epoch","JackKit","AKM_EPOCH","sr25_epoch","Rifle_arifle_Katiba_F","Rifle_arifle_MX_GL_F",
	"Rifle_l85a2_epoch","m4a3_EPOCH","Rifle_m16_EPOCH","Rifle_arifle_Mk20_F","RifleAmmo_30Rnd_556x45_Stanag","30Rnd_762x39_Mag","30Rnd_556x45_Stanag","MachinegunAmmo_200Rnd_65x39_cased_Box","arifle_MX_SW_F",
	"hgun_P07_F","30Rnd_9x21_Mag","optic_Arco","optic_MRCO","optic_Holosight","EnergyPack",
	"SatchelCharge_Remote_Mag","SLAMDirectionalMine_Wire_Mag","B_AssaultPack_cbr","B_Carryall_khk",
	"B_FieldPack_cbr","B_Kitbag_sgg","U_O_CombatUniform_ocamo","U_O_PilotCoveralls","MaleUniforms_OG_Guerilla","U_CamoRed_uniform","V_1_EPOCH","V_26_EPOCH","V_38_EPOCH","H_6_EPOCH","H_23_EPOCH",
	"H_98_EPOCH"
];

_spawnCenter = [6140,5941,0]; //Center of your map (usually in mission.sqm)
_min = 0; // minimum distance from the center position (Number) in meters
_max = 8000; // maximum distance from the center position (Number) in meters
_mindist = 10; // minimum distance from the nearest object (Number) in meters, ie. spawn at least this distance away from anything within x meters..
//Low _mindist means helicrashes could spawn near towns or in forests.. higher the number it would be spawning in an open field etc
_water = 0; // water mode 0: cannot be in water , 1: can either be in water or not , 2: must be in water
_shoremode = 0; // 0: does not have to be at a shore , 1: must be at a shore

vSpawnCrashes = {
	for "_j" from 1 to _crashNum do {
		_posOfCrash = [_spawnCenter,_min,_max,_mindist,_water,20,_shoremode] call BIS_fnc_findSafePos; // find a random loc
		_helicopters = ["Land_UWreck_Heli_Attack_02_F","Land_Wreck_Heli_Attack_01_F"]; //Add Heli classnames here
		_element = _helicopters call BIS_fnc_SelectRandom;
		_vehHeli = _element createVehicle [0,0,0];
		_burnthefucker = "test_EmptyObjectForFireBig" createVehicle (position _vehHeli);  _burnthefucker attachto [_vehHeli, [0,0,-1]];  
		_vehHeli setposATL [(_posOfCrash) select 0,(_posOfCrash) select 1,0];
		_vehHeli setVariable ["LAST_CHECK", (diag_tickTime + 14400)];
				
		for "_i" from 1 to _lootNum do {
			_crate0 = createVehicle ["weaponHolderSimulated", _vehHeli modelToWorld [(random 10) - 3, (random 10) - 4, 0], [], 0, "CAN_COLLIDE"];
			_crate1 = createVehicle ["weaponHolderSimulated", _vehHeli modelToWorld [(random 10) - 3, (random 10) - 4, 0], [], 0, "CAN_COLLIDE"];
			
			_item = _loot call BIS_fnc_selectRandom;
			switch (true) do
			{
				case (isClass (configFile >> "CfgWeapons" >> _item)): {
					_kindOf = [(configFile >> "CfgWeapons" >> _item),true] call BIS_fnc_returnParents;
					if ("ItemCore" in _kindOf) then {
						// Min 1, Max 2
						_crate0 addItemCargoGlobal [_item,(floor(random(2)))+1];
						_crate1 addItemCargoGlobal [_item,(floor(random(2)))+1];
					} else {
						// One Weapon, Three Mags
						_crate0 addWeaponCargoGlobal [_item,1];
						_crate1 addWeaponCargoGlobal [_item,1];
						
						_cAmmo = [] + getArray (configFile >> "cfgWeapons" >> _item >> "magazines");
						{
							if (isClass(configFile >> "CfgPricing" >> _x)) exitWith {
								_crate0 addMagazineCargoGlobal [_x,3];
								_crate1 addMagazineCargoGlobal [_x,3];
							};
						} forEach _cAmmo;
					};
				};
				case (isClass (configFile >> "cfgMagazines" >> _item)): {
					// Min 1, Max 3
					_crate0 addMagazineCargoGlobal [_item,(floor(random(3)))+1];
					_crate1 addMagazineCargoGlobal [_item,(floor(random(3)))+1];
				};
				case ((getText(configFile >> "cfgVehicles" >> _item >>  "vehicleClass")) == "Backpacks"): {
					// One Bag
					_crate0 addBackpackCargoGlobal [_item,1];
					_crate1 addBackpackCargoGlobal [_item,1];
				};
			};
			_crate0 setPos [(getPos _crate0 select 0) +5, (getPos _crate0 select 1), 0];
			_crate1 setPos [(getPos _crate1 select 0) -10, (getPos _crate1 select 1), 0];
			_crate0 setVariable ["LAST_CHECK", (diag_tickTime + 14400)];
			_crate1 setVariable ["LAST_CHECK", (diag_tickTime + 14400)];
			_cutter0 = "Land_ClutterCutter_medium_F" createVehicle (getpos _crate0);
			_cutter1 = "Land_ClutterCutter_medium_F" createVehicle (getpos _crate1);
			_cutter0 setVariable ["LAST_CHECK", (diag_tickTime + 14400)];
			_cutter1 setVariable ["LAST_CHECK", (diag_tickTime + 14400)];

			
		};
	};
};
diag_log "Helicrashsites loaded..";
call vSpawnCrashes;

 

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement
×
×
  • Create New...