Jump to content
  • 0

Customised Enhanced Spawn Select - Arrays Issue


js2k6

Question

Hi everyone, 

 

I have been working on modifying ebay's enhanced spawn select for one of my overpoch servers.

And I was working on a randomiser for the loadouts, after much playing around and help from ebay. 

http://opendayz.net/threads/release-ess-enhanced-spawn-selection.19998/ 

 

I came up with something that works. (kinda. for some people)

Now this works every single time without fail for me, and also for one of my friends.

admittedly we both have pretty high spec machines. overclocked i7s, SSDs etc... 

 

and our dedicated server machine is also quite decent. 4/8HT core e3-xeon, 16gb ram, SSD etc. 

even with all our different scripts, wai, dzms and 40 players our server fps stays above 5. 

so i'm thinking it isn't server load.

 

but for many of our players, if they select any class that uses these arrays,

they spawn in with the default mags, backpack. plain survivor skin.

 

I tried this on the mrs' pc, which is my old amd hexcore from 5 years ago, 

and 2/5 spawns on her pc, spawned with default mags only. 

 

Now i'm wondering is this script taking too long to load for someone with a slower cpu? is it due to slower hdd read times? 

 

 

I've put this in the mission pbo, so that way it randomises each spawn. 

if i put it in server pbo it only randomises once per restart and all players get the same kit every time they spawn. which isn't how i want the script to function. 

 

is there possibly another way i can write this that would cause it to work 100% of the time? 

 

here is an example snippet from my variables.sqf. 

StartBackpacks = ["DZ_TerminalPack_EP1","DZ_CompactPack_EP1","DZ_TK_Assault_Pack_EP1","DZ_Czech_Vest_Puch","DZ_GunBag_EP1"];
GoodBackpacks = ["DZ_LargeGunBag_EP1","DZ_Backpack_EP1","DZ_CivilBackpack_EP1"];
StartPistols = ["RH_g17","RH_Deagle","vil_USP45SD","RH_m93r","RH_g18","RH_bull","RH_mk2","RH_Deagleg","RH_Deaglem","RH_anac","RH_python","RH_p226","RH_p38","RH_ppk","RH_tt33","RH_m9","Vil_PYA","vil_USP45","RH_browninghp"];
SDPistols = ["vil_USP45SD","MakarovSD","RH_g17sd","vil_apssd","vil_USPSD","RH_m9csd","RH_m1911sd","RH_uspsd","RH_mk22vsd"];
WestWeps = ["FHQ_ACR_BLK_CCO_GL","FHQ_ACR_WDL_G33","FHQ_ACR_WDL_HAMR_F","vil_HK416_EOT","FHQ_ACR_SNW_HWS","FHQ_ACR_BLK_HAMR_SD","RH_hk416seotech","RH_hk417sdeotech","RH_hk417acog","SCAR_L_CQC_EGLM_Holo","FN_FAL","RH_sc2aim"];
EastWeps = ["vil_G36KSKES","vil_G36KSK","vil_G3an","vil_AEK2","vil_AEK_GL","vil_AG3EOT","vil_Abakan_P29","vil_Abakan","vil_AK_74m_EOT"];
StalkerSkins = ["gsc_eco_stalker_mask_fred","gsc_eco_stalker_head_fred","gsc_eco_stalker_mask_camo","gsc_eco_stalker_head_camo1","gsc_eco_stalker_mask_duty","gsc_eco_stalker_head_duty","gsc_eco_stalker_mask_neutral","gsc_eco_stalker_head_neutral"];

_stalker = StalkerSkins call BIS_fnc_selectRandom;
_startBP = StartBackpacks call BIS_fnc_selectRandom;
_goodBP = GoodBackpacks call BIS_fnc_selectRandom;
_startPis = StartPistols call BIS_fnc_selectRandom;
_startPammo = getArray (configFile >> "CfgWeapons" >> _startPis >> "magazines") select 0;
_SDPis = SDPistols call BIS_fnc_selectRandom;
_SDPammo = getArray (configFile >> "CfgWeapons" >> _SDPis >> "magazines") select 0;
_Wweps = WestWeps call BIS_fnc_selectRandom;
_Wmags = getArray (configFile >> "CfgWeapons" >> _Wweps >> "magazines") select 0;
_Eweps = EastWeps call BIS_fnc_selectRandom;
_Emags = getArray (configFile >> "CfgWeapons" >> _Eweps >> "magazines") select 0;

// preset classes follow this format
// [Name, Skin, Magazines, Weapons, Backpack, Backpack Magazines, Backpack Weapons, DL, HL] 
presetClasses = [
["Survivor","Survivor2_DZ",[_startPammo,_startPammo,"ItemBandage","ItemPainkiller"],[_startPis,"ItemHatchet_DZE","ItemKnife"],_startBP,[],[],0,0],
["Soldier","Graves_Light_DZ",[_startPammo,_startPammo,_startPammo],[_startPis],_startBP,[],[],0,0],
["Sniper","GUE_Soldier_Sniper_DZ",[_SDPammo,_SDPammo,_SDPammo],[_SDPis],_startBP,[],[],0,0],
["Stalker",_stalker,[_startPammo,_startPammo],[_startPis],_startBP,[],[],0,0],
// humanity based loadouts
["- Bandit -","Bandit2_DZ",[_SDPammo,_SDPammo,_Emags,_Emags,"ItemMorphine"],["ItemKnife","ItemHatchet_DZE",_SDPis,_Eweps],_goodBP,[],[],0,-7500],
["- Hero -","Soldier_Sniper_PMC_DZ",[_SDPammo,_SDPammo,_Wmags,_Wmags,"ItemMorphine"],["ItemKnife","ItemHatchet_DZE",_SDPis,_Wweps],_goodBP,[],[],0,7500],

My theory is, that due to the config files for overwatch+epoch containing so many items, the getArray to get the mag class names is what is causing this problem. 

 

I'm still kind of noob when it comes to scripting for arma, so i'm probably wrong. 

any help would be greatly appreciated. 

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

  • 0

tried something a little different. 

not using bis_fnc_selectrandom any longer

 

created a new file, call it just after custom variables.

private ["_pistol","_pist","_pistmags","_StartBackpacks","_startBP","_foodlist","_food","_drinklist","_drink"];

_StartBackpacks = ["DZ_TerminalPack_EP1","DZ_CompactPack_EP1","DZ_TK_Assault_Pack_EP1","DZ_Czech_Vest_Puch","DZ_GunBag_EP1"];

_drinklist = ["ItemSodaCoke","ItemSodaPepsi","ItemSodaMdew","ItemSodaMtngreen","ItemSodaR4z0r","ItemSodaClays","ItemSodaSmasht","ItemSodaDrwaste","ItemSodaLvg","ItemSodaMzly","ItemSodaRabbit","ItemWaterbottleBoiled"];
_foodlist = ["FoodCanBakedBeans","FoodCanSardines","FoodCanFrankBeans","FoodCanPasta","FoodCanGriff","FoodCanBoneboy","FoodCanCorn","FoodCanCurgon","FoodCanDemon","FoodCanFraggleos","FoodCanHerpy","FoodCanOrlok","FoodCanPowell","FoodCanTylers"]; 

_pistol = ["RH_g17","RH_Deagle","vil_USP45SD","RH_m93r","RH_g18","RH_bull","RH_mk2","RH_Deagleg","RH_Deaglem","RH_anac","RH_python","RH_p226","RH_p38","RH_ppk","RH_tt33","RH_m9","Vil_PYA","vil_USP45","RH_browninghp"];
_pist = _pistol select (floor (random (count _pistol)));
_pistmags = getArray (configFile >> "CfgWeapons" >> _pist >> "magazines") select 0;

_startBP = _StartBackpacks select (floor (random (count _StartBackpacks)));
_food = _foodlist select (floor (random (count _foodlist)));
_drink = _drinklist select (floor (random (count _drinklist)));

DefaultMagazines = ["ItemBandage","ItemBandage","ItemPainkiller",_drink,_food,_pistmags,_pistmags]; 
DefaultWeapons = ["ItemMap","ItemCompass","ItemToolbox","ItemRadio",_pist,"ItemHatchet_DZE"]; 
DefaultBackpack = _startBP;

And now it seems to be working for our test group. 

including people who were having issues before! :) 

 

maybe it was bis_fnc_selectrandom?  not sure. 

 

are there any better ways i could write this up? 

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
  • Advertisement
  • Discord

×
×
  • Create New...