Jump to content
  • 0
Sign in to follow this  
Cyrus

Static Crates Random loot

Question

Im looking for an easy, effective way to randomize loot (weapons, ammo, toolbelt items, food, meds and building supplies) in static crate. I have a placed crate already and populated with stuff but i would like to have this random on spawn. Also i would like to know how to have this crate stay for 2 hours then destroy and respawn 15 min later. This is what my customLootCrate.sqf looks like :

Spoiler
Quote

if (isServer) then {
        _vehicle_9090 = objNull;
        if (true) then
        {
          _this = createVehicle ["USSpecialWeaponsBox", [4434.3223, 10632.069, 0], [], 0, "CAN_COLLIDE"];
          _vehicle_9090 = _this;
          _this setDir -182.5;
                  _vehicle_9090 setVariable ["ObjectID","1",true];
                  _vehicle_9090 setVariable ["permaLoot",true];

          clearWeaponCargoGlobal _this;
          clearMagazineCargoGlobal _this;

        

          _this addWeaponCargoGlobal ["BAF_LRR_scoped",2]; //
        
          _this addWeaponCargoGlobal ["DMR_DZ",1];
          _this addWeaponCargoGlobal ["[M24_des_EP1",2];
          _this addWeaponCargoGlobal ["[FNFAL_DZ",2];
          _this addWeaponCargoGlobal ["[Mk48_CCO_DZ",2];
          _this addWeaponCargoGlobal ["[M240_DZ",2];
          _this addWeaponCargoGlobal ["[G17_FL_DZ",2];
          _this addWeaponCargoGlobal ["[M9_SD_DZ",2];
          
          _this addMagazineCargoGlobal ["20Rnd_762x51_DMR",20];
          _this addMagazineCargoGlobal ["5Rnd_762x51_M24",20];
          _this addMagazineCargoGlobal ["20Rnd_762x51_FNFAL",20];
          _this addMagazineCargoGlobal ["100Rnd_762x54_PK",20];
          _this addMagazineCargoGlobal ["100Rnd_762x51_M240",20];
          _this addMagazineCargoGlobal ["17Rnd_9x19_glock17",20];
          _this addMagazineCargoGlobal ["15Rnd_9x19_M9SD",20];

      
          _this addWeaponCargoGlobal ["ItemToolbox",5];
          _this addWeaponCargoGlobal ["ItemCrowbar",5];
          _this addWeaponCargoGlobal ["ItemEtool",5];
          _this addWeaponCargoGlobal ["Binocular_Vector",5];
          _this addWeaponCargoGlobal ["ItemGPS",5];
          _this addWeaponCargoGlobal ["ItemHatchet",5];
          _this addWeaponCargoGlobal ["NVGoggles",5];
          
          _this addMagazineCargoGlobal ["ItemLockbox",2];
          _this addMagazineCargoGlobal ["ItemPole",20];
          _this addMagazineCargoGlobal ["ItemComboLock",2];
          _this addMagazineCargoGlobal ["ItemGenerator",3];
          _this addMagazineCargoGlobal ["ItemVault",2];
          _this addMagazineCargoGlobal ["ItemCorrugated",20];
          _this addMagazineCargoGlobal ["plot_pole_kit",2];
          _this addMagazineCargoGlobal ["ItemWire",10];
          _this addMagazineCargoGlobal ["ItemTankTrap",10];
          _this addMagazineCargoGlobal ["ItemSandbag",10];
          _this addMagazineCargoGlobal ["CinderBlocks",40];
          _this addMagazineCargoGlobal ["MortarBucket",20];
  
          
          _this addMagazineCargoGlobal ["ItemBloodbag",5];
          _this addMagazineCargoGlobal ["ItemEpinephrine",5];
          _this addMagazineCargoGlobal ["ItemMorphine",5];
          _this addMagazineCargoGlobal ["ItemPainkiller",5];
          _this addMagazineCargoGlobal ["ItemAntibiotic",5];
          _this addMagazineCargoGlobal ["ItemBandage",5];
          _this addMagazineCargoGlobal ["ItemSeaBassCooked",10];
          _this addMagazineCargoGlobal ["ItemTunaCooked",10];
          _this addMagazineCargoGlobal ["ItemSodaR4z0r",5];
          _this addMagazineCargoGlobal ["ItemSodaMdew",5];
          _this addMagazineCargoGlobal ["ItemSodaOrangeSherbet",5];
          _this addMagazineCargoGlobal ["ItemSodaRbull",5];
          _this addMagazineCargoGlobal ["PartEngine",5];
          _this addMagazineCargoGlobal ["PartVRotor",5];
          _this addMagazineCargoGlobal ["PartGlass",5];
          _this addMagazineCargoGlobal ["PartWheel",5];
          _this addMagazineCargoGlobal ["PartGeneric",5];
          _this addMagazineCargoGlobal ["ItemJerrycan",5];
          
          _this setPos [4434.3223, 10632.069, 0];
 
        };
};

Thanks for any help in advance.

 

Share this post


Link to post
Share on other sites

12 answers to this question

Recommended Posts

  • 0

Setup arrays and pick a random item from it. You can use the BIS_fnc_selectRandom function to do that: https://community.bistudio.com/wiki/BIS_fnc_selectRandom

_someWeaponArray = [
	"DMR_DZ",
	"M24_des_EP1",
	"FNFAL_DZ",
	"Mk48_CCO_DZ",
	"M240_DZ",
	"G17_FL_DZ",
	"M9_SD_DZ"
];

//Pick 1 random item from it
_randomWeapon = _someWeaponArray call BIS_fnc_selectRandom;

//Optionally remove it from the array afterwards
_someWeaponArray = _someWeaponArray - [_randomWeapon];

 

Share this post


Link to post
Share on other sites
  • 0
25 minutes ago, DAmNRelentless said:

Setup arrays and pick a random item from it. You can use the BIS_fnc_selectRandom function to do that: https://community.bistudio.com/wiki/BIS_fnc_selectRandom

_someWeaponArray = [
	"DMR_DZ",
	"M24_des_EP1",
	"FNFAL_DZ",
	"Mk48_CCO_DZ",
	"M240_DZ",
	"G17_FL_DZ",
	"M9_SD_DZ"
];

//Pick 1 random item from it
_randomWeapon = _someWeaponArray call BIS_fnc_selectRandom;

//Optionally remove it from the array afterwards
_someWeaponArray = _someWeaponArray - [_randomWeapon];

 

@DAmNRelentless Thanks for the reply. That makes sense. for arguments sake if i want to populate the crate with multiple random items from the same array to i just specify the amount like this? :

_randomWeapon = [_someWeaponArray,10] call BIS_fnc_selectRandom;

Essentially requesting 10 random weapons from the array?

Share this post


Link to post
Share on other sites
  • 0

@Cyrus I don't think that would work since it's not matching the function's syntax anymore. But due to the fact that different amounts of items are stored in a array as well, you could pick a random array.

_someWeaponArray = [
	["DMR_DZ",2],
	["M24_des_EP1,4]",
	["FNFAL_DZ",2],
	["Mk48_CCO_DZ",1],
	["M240_DZ,1"],
	["G17_FL_DZ",5],
	["M9_SD_DZ",5]
];

//Pick 1 random item array from it format: ["weapon",amount]
//Keep in mind that it's saved as array this time
_randomWeapon = _someWeaponArray call BIS_fnc_selectRandom;

//Optionally remove it from the array afterwards
//You don't need to set it as array now. Since it is already an array, you can just do
_someWeaponArray = _someWeaponArray - _randomWeapon;

//Adding the item to the crate if it's already set up
//the variable is enough because it's already an array
_this addWeaponCargoGlobal _randomWeapon;

Now to not do this everytime, you could specify how many items from which arrays are picked. There can't be duplicate ones since the code is already removing the _randomWeapon from the origin array.

Spoiler
_someWeaponArray = [
	["DMR_DZ",2],
	["M24_des_EP1,4]",
	["FNFAL_DZ",2],
	["Mk48_CCO_DZ",1],
	["M240_DZ,1"],
	["G17_FL_DZ",5],
	["M9_SD_DZ",5]
];

//Always pick 3 items from an array
_itemCounter = 0;
while {_itemCounter < 3} do {
	_randomWeapon = _someWeaponArray call BIS_fnc_selectRandom;
	_someWeaponArray = _someWeaponArray - _randomWeapon;
	_crate addWeaponCargoGlobal _randomWeapon; //store you crate in a variable, don't know if _this could also be the itemCounter cause it's in an if-statement
	_itemCounter = _itemCounter + 1;
};

//Always pick an amount depending on the array size
//If you array has 5 items, it will pick 1 from it, if it has 10 items it will pick 2 for it (adjustable by changing the 5)
_itemCounter = 0;
while {_itemCounter < (round(count _someWeaponArray / 5))} do {
	_randomWeapon = _someWeaponArray call BIS_fnc_selectRandom;
	_someWeaponArray = _someWeaponArray - _randomWeapon;
	_crate addWeaponCargoGlobal _randomWeapon;
	_itemCounter = _itemCounter + 1;
};

 

 

Share this post


Link to post
Share on other sites
  • 0
1 hour ago, DAmNRelentless said:

@Cyrus I don't think that would work since it's not matching the function's syntax anymore. But due to the fact that different amounts of items are stored in a array as well, you could pick a random array.

_someWeaponArray = [
	["DMR_DZ",2],
	["M24_des_EP1,4]",
	["FNFAL_DZ",2],
	["Mk48_CCO_DZ",1],
	["M240_DZ,1"],
	["G17_FL_DZ",5],
	["M9_SD_DZ",5]
];

//Pick 1 random item array from it format: ["weapon",amount]
//Keep in mind that it's saved as array this time
_randomWeapon = _someWeaponArray call BIS_fnc_selectRandom;

//Optionally remove it from the array afterwards
//You don't need to set it as array now. Since it is already an array, you can just do
_someWeaponArray = _someWeaponArray - _randomWeapon;

//Adding the item to the crate if it's already set up
//the variable is enough because it's already an array
_this addWeaponCargoGlobal _randomWeapon;

Now to not do this everytime, you could specify how many items from which arrays are picked. There can't be duplicate ones since the code is already removing the _randomWeapon from the origin array.

  Reveal hidden contents

_someWeaponArray = [
	["DMR_DZ",2],
	["M24_des_EP1,4]",
	["FNFAL_DZ",2],
	["Mk48_CCO_DZ",1],
	["M240_DZ,1"],
	["G17_FL_DZ",5],
	["M9_SD_DZ",5]
];

//Always pick 3 items from an array
_itemCounter = 0;
while {_itemCounter < 3} do {
	_randomWeapon = _someWeaponArray call BIS_fnc_selectRandom;
	_someWeaponArray = _someWeaponArray - _randomWeapon;
	_crate addWeaponCargoGlobal _randomWeapon; //store you crate in a variable, don't know if _this could also be the itemCounter cause it's in an if-statement
	_itemCounter = _itemCounter + 1;
};

//Always pick an amount depending on the array size
//If you array has 5 items, it will pick 1 from it, if it has 10 items it will pick 2 for it (adjustable by changing the 5)
_itemCounter = 0;
while {_itemCounter < (round(count _someWeaponArray / 5))} do {
	_randomWeapon = _someWeaponArray call BIS_fnc_selectRandom;
	_someWeaponArray = _someWeaponArray - _randomWeapon;
	_crate addWeaponCargoGlobal _randomWeapon;
	_itemCounter = _itemCounter + 1;
};

 

 

@DAmNRelentless Thank you, logically that makes a lot more sense. I will play around with this method and see what i come up with.

 

EDIT : for the sake of argument, pairing weapons with their respective ammo would not work seeing as the _this addWeaponCargoGlobal would require a weapon and _this addMagazineCargoGlobal would require a magazine? Something like this? 

_weaponAmmoArray =
		  [
		  [["BAF_LRR_scoped",2],["5Rnd_86x70_L115A1", 20]],
		  [["DMR_DZ",1],["20Rnd_762x51_DMR",20]],
		  [["FN_FAL_ANPVS4_DZE",2],["20Rnd_762x51_FNFAL",20]],
		  [["Mk48_CCO_DZ",2],["100Rnd_762x54_PK",20]],
		  [["M240_DZ",2],["100Rnd_762x51_M240",20]],
		  [["G17_FL_DZ",2],["17Rnd_9x19_glock17",20]],
		  [["M9_SD_DZ",2],["15Rnd_9x19_M9SD",20]]
		  ];
		  
		  _rngAmmoWeaponPairSelect    = _weaponAmmoArray call BIS_fnc_selectRandom;
		  _this addWeaponCargoGlobal _rngAmmoWeaponPairSelect;

The aim is to return a random weapon, with a random amount of its respective ammo?

Share this post


Link to post
Share on other sites
  • 0

That's fairly easy to do aswell. Returning a weapon works just like I mentioned before. To get its respective ammo, you can random select with a multidimensional array and store it into different variables. I guess by "random amount of its respective ammo" you mean an amount between 0 and the amount you set in your array.

Spoiler
_weaponAmmoArray = [
	[["BAF_LRR_scoped",2],["5Rnd_86x70_L115A1", 20]],
	[["DMR_DZ",1],["20Rnd_762x51_DMR",20]],
	[["FN_FAL_ANPVS4_DZE",2],["20Rnd_762x51_FNFAL",20]],
	[["Mk48_CCO_DZ",2],["100Rnd_762x54_PK",20]],
	[["M240_DZ",2],["100Rnd_762x51_M240",20]],
	[["G17_FL_DZ",2],["17Rnd_9x19_glock17",20]],
	[["M9_SD_DZ",2],["15Rnd_9x19_M9SD",20]]
];


//Pick random weapon with ammo
_weaponWithAmmo = _weaponAmmoArray call BIS_fnc_selectRandom;


//Optionally remove it from array to prevent double pick
_weaponAmmoArray = _weaponAmmoArray - _weaponWithAmmo;


//Storing weapon and ammo into different variables
_weapon = _weaponWithAmmo select 0;
_ammo	= _weaponWithAmmo select 1;


//Random amount of respective ammo
_randomAmmo = round(random(_ammo select 1));


//Replacing maximum ammo amount with random ammo amount
_ammo set[1,_randomAmmo];


//Fill crate
_crate addWeaponCargoGlobal _weapon;
_crate addWeaponCargoGlobal _ammo;

 

 

Share this post


Link to post
Share on other sites
  • 0
5 minutes ago, DAmNRelentless said:

That's fairly easy to do aswell. Returning a weapon works just like I mentioned before. To get its respective ammo, you can random select with a multidimensional array and store it into different variables. I guess by "random amount of its respective ammo" you mean an amount between 0 and the amount you set in your array.

  Hide contents

_weaponAmmoArray = [
	[["BAF_LRR_scoped",2],["5Rnd_86x70_L115A1", 20]],
	[["DMR_DZ",1],["20Rnd_762x51_DMR",20]],
	[["FN_FAL_ANPVS4_DZE",2],["20Rnd_762x51_FNFAL",20]],
	[["Mk48_CCO_DZ",2],["100Rnd_762x54_PK",20]],
	[["M240_DZ",2],["100Rnd_762x51_M240",20]],
	[["G17_FL_DZ",2],["17Rnd_9x19_glock17",20]],
	[["M9_SD_DZ",2],["15Rnd_9x19_M9SD",20]]
];


//Pick random weapon with ammo
_weaponWithAmmo = _weaponAmmoArray call BIS_fnc_selectRandom;


//Optionally remove it from array to prevent double pick
_weaponAmmoArray = _weaponAmmoArray - _weaponWithAmmo;


//Storing weapon and ammo into different variables
_weapon = _weaponWithAmmo select 0;
_ammo	= _weaponWithAmmo select 1;


//Random amount of respective ammo
_randomAmmo = round(random(_ammo select 1));


//Replacing maximum ammo amount with random ammo amount
_ammo set[1,_randomAmmo];


//Fill crate
_crate addWeaponCargoGlobal _weapon;
_crate addWeaponCargoGlobal _ammo;

 

 

Very nice, I learn more everyday. this scripting is really versatile. BTW this is what i was looking at in the past couple of min. Would this work ? Instead of multiple iterations i use a loop with a counter?

_weaponsArray = [["BAF_LRR_scoped",2],["DMR_DZ",1],["FN_FAL_ANPVS4_DZE",2],["Mk48_CCO_DZ",2],["M240_DZ",2],["G17_FL_DZ",2],["M9_SD_DZ",2]]
		  _ammoArray	= [["20Rnd_762x51_DMR",20],["5Rnd_86x70_L115A1", 20],["20Rnd_762x51_FNFAL",20],["100Rnd_762x54_PK",20],["100Rnd_762x51_M240",20],["17Rnd_9x19_glock17",20],["15Rnd_9x19_M9SD",20]]
		  
		  
		  
		  _rngWeaponSelect = _weaponsArray call BIS_fnc_selectRandom;
		  
		  _rngAmmoSelec    = _ammoArray call BIS_fnc_selectRandom;
		  
		  _wepCount = 0;
		  
		  _ammoCount = 0;
		  
		  //Adding weapons to the crate with a loop statement
		  while {_wepCount != 7} do
			{
				_this addWeaponCargoGlobal _rngWeaponSelect;
				_wepCount = _Wepcount + 1
			}
		  
		  while {_ammoCount != 7} do
		  {
				_this addMagazineCargoGlobal _rngAmmoSelect;
				_ammoCount = _ammoCount + 1;
		  }

 

Share this post


Link to post
Share on other sites
  • 0

That would work but you don't get the respective ammo to the weapon. It's just a random weapon + a random ammo type. Also you don't have a random magazine number and you have to care about the right array order.

Why don't you simply use the code I gave you?

Share this post


Link to post
Share on other sites
  • 0

@DAmNRelentless I will definitely be using your code, i was just curious at the possibilities of generating randoms from arrays. I more familiar with python and C#. Probably why i find SQF interesting. With practice im learning to change my mindset in terms of more effecting coding essentially improving across the board. I really appreciate the help that you are offering though

Share this post


Link to post
Share on other sites
  • 0

Quick question.. When creating the crate this is the default script for it :

_this = createVehicle ["USSpecialWeaponsBox", [4434.3223, 10632.069, 0], [], 0, "CAN_COLLIDE"];

Can i change it to this, to tie in with your method?

_ammoCrate = createVehicle ["USSpecialWeaponsBox", [4434.3223, 10632.069, 0], [], 0, "CAN_COLLIDE"];

and then fill _ammoCrate by calling globals like this?

 


_buildArray   = [["ItemLockbox",2],["ItemPole",20],["ItemComboLock",2],["ItemGenerator",3],["ItemVault",2],["ItemCorrugated",20],["plot_pole_kit",2],["ItemWire",10,["ItemTankTrap",10],["ItemSandbag",10],["CinderBlocks",40],["MortarBucket",20]];

_rngBuildSelect  = _buildArray call BIS_fnc_selectRandom;

_ammoCrate addMagazineCargoGlobal _rngBuildSelect;	

 

Share this post


Link to post
Share on other sites
  • 0

Will you please have a look and see if this will do what I am trying to achieve? And if the syntax is correct? I'm only applying what I have learned from the info you have given me.

Spoiler
if (isServer) then {

_vehicle_9090 = objNull;
     if (true) then {
          _ammoCrate = createVehicle ["USSpecialWeaponsBox", [4434.3223, 10632.069, 0], [], 0, "CAN_COLLIDE"];
          _vehicle_9090 = _ammoCrate;
          _ammoCrate setDir -182.5;
                  _vehicle_9090 setVariable ["ObjectID","1",true];
                  _vehicle_9090 setVariable ["permaLoot",true];

          clearWeaponCargoGlobal _ammoCrate;
          clearMagazineCargoGlobal _ammoCrate;


//Classed Arrays	  
		  _toolArray       = [["ItemToolbox",5],["ItemCrowbar",5],["ItemEtool",5],["Binocular_Vector",5],["ItemGPS",5],["ItemHatchet",5],["NVGoggles",5]];
		  _buildArray      = [["ItemLockbox",2],["ItemPole",20],["ItemComboLock",2],["ItemGenerator",3],["ItemVault",2],["ItemCorrugated",20],["plot_pole_kit",2],["ItemWire",10],["ItemTankTrap",10],["ItemSandbag",10],["CinderBlocks",40],["MortarBucket",20]];
		  _medArray        = [["ItemBloodbag",5],["ItemEpinephrine",5],["ItemMorphine",5],["ItemPainkiller",5],["ItemAntibiotic",5],["ItemBandage",5]];
		  _foodArray	   = [["ItemSeaBassCooked",10],["ItemTunaCooked",10],["ItemSodaR4z0r",5],["ItemSodaMdew",5],["ItemSodaOrangeSherbet",5],["ItemSodaRbull",5]];
		  _vehprtArray     = [["PartEngine",5],["PartVRotor",5],["PartGlass",5],["PartWheel",5],["PartGeneric",5]["ItemJerrycan",5]];
 		  _weaponAmmoArray = [[["BAF_LRR_scoped",2],["5Rnd_86x70_L115A1", 20]],[["DMR_DZ",1],["20Rnd_762x51_DMR",20]],[["FN_FAL_ANPVS4_DZE",2],["20Rnd_762x51_FNFAL",20]],[["Mk48_CCO_DZ",2],["100Rnd_762x54_PK",20]],[["M240_DZ",2],["100Rnd_762x51_M240",20]],[["G17_FL_DZ",2],["17Rnd_9x19_glock17",20]],[["M9_SD_DZ",2],["15Rnd_9x19_M9SD",20]]];
		 
		  
//Random Item selection weapons and ammo in a multidimentional array		  
		 _rngWepAmmoSelect = _weaponAmmoArray call BIS_fnc_selectRandom;
		
//Filling the crate		
		//Weapons
		_wepCounter = 0;
		while {_wepCounter < 7} do {
            _weapon = _rngWepAmmoSelect select 0;
            _wepSelect = _wepSelect - _weapon;
            _ammoCrate addWeaponCargoGlobal _weapon;
			_wepCounter = _wepCounter + 1;
		};
                               
		//Ammo
		_ammoCounter = 0;
		while {_ammoCounter < 7} do {
			_ammo	= _rngWepAmmoSelect select 1;
			//Random amount of respective ammo
			_rngAmmo = round(random(_ammo select 1));
			//Replace max ammo amount with random amount
			_ammo set[1,_rngAmmo];
			_ammoSelect = _ammoSelect - _ammo;
			_ammoCrate addMagazineCargoGlobal _ammo;
			_ammoCounter = _ammoCounter + 1;
		};

		//Toolbelt items. 7 total yields 3 random items
		_toolCounter = 0;
		while {_toolCounter < (round(count _toolArray / 2))} do {
			_rngToolSelect    = _toolArray call BIS_fnc_selectRandom;
			_toolSelect 	  = _toolSelect - _rngToolSelect;
			_ammoCrate addWeaponCargoGlobal _rngToolSelect;
			_toolCounter      = _toolCounter + 1;                                    
		};
                                          
		//Medical Supplies. 6 total yields 3 random items
		_medCounter = 0;
		while {_medCounter < (round(count _medArray / 2))} do {
			_rngMedSelect     = _medArray call BIS_fnc_selectRandom;
			_medSelect		  = _medSelect - _rngMedSelect;
			_ammoCrate addMagazineCargoGlobal _rngMedSelect;
			_toolCounter	  = _toolCounter + 1;
		};
		//Building Materials. 12 total yields 6 random items.
		_buildCounter = 0;
		while {_buildCounter < (round(count _buildArray /2))} do {
			_rngBuildSelect   = _buildArray call BIS_fnc_selectRandom;
			_buildSelect 	  = _buildSelect - _rngBuildSelect;
			_ammoCrate addMagazineCargoGlobal _rngBuildSelect;
			_buildCounter 	  = _buildCounter + 1;
		};
		
		//Food Supplies. 6 total yields 3 random items.
		_foodCounter = 0;
		while {_foodCounter < (round(count _foodArray /2))} do {
			_rngFoodSelect	   = _foodArray call BIS_fnc_selectRandom;
			_foodSelect		   = _foodSelect - _rngFoodSelect;
			_ammoCrate addMagazineCargoGlobal _rngFoodSelect;
			_foodCounter 	   = _foodCounter + 1;
			};
			
		//Vehicle Parts. 6 total yields 3 random items.
		_vehprtCounter = 0;
		while {_vehprtCounter < (round(count _vehprtArray /2))} do {
			_rngVehprtSelect  = _vehprtArray call BIS_fnc_selectRandom;
			_vehprtSelect	  = _vehprtSelect - _rngVehprtSelect;
			_ammoCrate addMagazineCargoGlobal _rngVehprtSelect;
			_vehprtCounter	  = _vehprtCounter + 1;
		};
		
		
    
	_ammoCrate setPos [4434.3223, 10632.069, 0];
		  
     };
};	

 

 

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

  • Similar Content

    • By Bloodthirsty
      Hey I just need some files for this server, any and all you guys can come up with and think it deserve post that shit in chat rn. I want to see some crazy ideas and additions if you got em :) Lets see what you guys can come up with

    • By Efixea
      I have a server i started not too long ago hosted by GTX. I had InfiSTAR installed by the support and server was working decent. After  EPOCH updated to 1.1 my server does not have loot in any building. Very few containers spawn with anything usefull in them....Furniture in houses and loot piles will have generic loot like moist towlettes and paint or minimal building supplies.
      I do not see blue tarps on the map anymore and cargo with loot spawns maybe 3 or 4 in an entire day of the server being up and running.
      No AI spawns in any area of map at any time of the day.  Have been playing over a week now and nothing spawns anywhere.
      and it NEVER stops raining.
       
      I am VERY noob when it comes to adding scripts or mods to servers myself. I played an Arma 2 server about 2 years ago and learned a bit about this stuff. since then i have been re-learing everything.
      the only thing i have installed is Zombies and Demons. Nothing else has been changed or edited by me.
       
      Is there anything i can edit myself to change any of this?  should i have the server reinstalled?
    • By Cyrus
      I found this on another forum, but seeing as I am truly dedicated to this one, I thought I'd share what i have found concerning the question I see a lot of people ask regarding default loadouts for everyone, including respawns and new players to the server. Its customizable with current 1.0.6.2 class IDs.
      Unpack dayz_server.pbo and navigate to the compiles folder. Open the file named server_playerlogin.sqf. Find the follow block of code :
      _config = (configFile >> "CfgSurvival" >> "Inventory" >> "Default"); _mags = getArray (_config >> "magazines"); _wpns = getArray (_config >> "weapons"); _bcpk = getText (_config >> "backpack"); _randomSpot = true; _key = format["CHILD:203:%1:%2:%3:",_charID,[_wpns,_mags],[_bcpk,[],[]]]; _key call server_hiveWrite; and comment this out by adding /* */ to the top and bottom of this code block. Like this 
      /* _config = (configFile >> "CfgSurvival" >> "Inventory" >> "Default"); _mags = getArray (_config >> "magazines"); _wpns = getArray (_config >> "weapons"); _bcpk = getText (_config >> "backpack"); _randomSpot = true; _key = format["CHILD:203:%1:%2:%3:",_charID,[_wpns,_mags],[_bcpk,[],[]]]; _key call server_hiveWrite; */ Then directly underneath this paste the following and configure to your liking. I have tried this and it works.  To understand the logic, it is pointless to add a custom sqf in the mission folder, whether it be inside the init.sqf or a "exeVM" or a "call" method pointing to another custom sqf file seeing as the init is processed before server_playerlogin.sqf. 
      _randomSpot = true; _inventory = [["ItemFlashlight","ItemMap","ItemGPS","NVGoggles","AK_74"],["ItemBandage","ItemPainkiller","30Rnd_545x39_AK"]]; _backpack = ["DZ_ALICE_Pack_EP1",[],[]]; _key = format["CHILD:203:%1:%2:%3:",_charID,_inventory,_backpack]; _key call server_hiveWrite; Here is a list of most of the class ID's currently being used. Not all of them are there, but for this purpose you will find it more than adequate.
      https://forums.dayz.com/topic/137361-dayz-chernarus-class-ids/ 
      Finally we can now lay this beast to rest. Hope this will help many solve their default loadouts. I can recommend <ESSV3>  by @ebayShopperif you need more than a single loadout for all spawns.
    • By Cyrus
      I have been finding that some people on my server has been losing base walls and floors even though DZE_godmodebase = true; , it has no effect on anything built inside the plot radius. So i have come to the conclusion that base items might receive damage on age and this ultimately being removed by server cleanup script. So my question is if I drop this event below will that stop me and others from losing base walls and floor? Or at the minimum update it without any cinder wall items?
      like this  and set damage to 0.001:
       
  • Advertisement
  • Supporters
  • Discord

×
×
  • Create New...