Jump to content

Recommended Posts

Alright, the original post should now be properly updated to actually make some sense. 

Please let me know if something is not clear.

I hope to being able to record and add a showcase video showing all the features at some point.

 

 

  • Like 1
  • Thanks 1

Share this post


Link to post
Share on other sites

Direct download of the script pack here:

 

https://drive.google.com/open?id=1GyR8WEeWKY_QIIAl1n3_auXruAJ0RaC8

Usage: download and copy into your mission folder.

If you already have a init.sqf, take over my init content and make sure its comes first (else ravage traders wont spawn properly)

 

Updates:

- Added Weapon and Equipment Arrays for CUP, RHS, WarfareThai, FrithRuins

- added VD_Settings.sqf for you to customize your script;)


/*
L O B B Y
Adjust your personal settings
*/

/*gemeral setings:*/
VD_AllowCUPFillerObjects = true; // CUP objects will be selected to build TC, BC SW compositions WIP

/*Basebuilding EDN Fortification*/
VD_EDN_AllowCUPModObjects = false; // enter - true - if you have the CUP - Core Mod active and want CUP Objects in your Base Builder Construction Plans. Select - false - if you do not have CUP - Core Mod active.
VD_EDN_MatboxAmount = 5;  // enter how many times the material box spawner should execute (each execution spawns 1 Material box in a house and 1 on the road)

//Bandit Camp Spawned Settings:
VD_BC_SpawnAtMarkers = false;
VD_BC_MrkrArray = ["VD_BC_Mrkr_1","VD_BC_Mrkr_2","VD_BC_Mrkr_3","VD_BC_Mrkr_4","VD_BC_Mrkr_5","VD_BC_Mrkr_6","VD_BC_Mrkr_7","VD_BC_Mrkr_8","VD_BC_Mrkr_9","VD_BC_Mrkr_10","VD_BC_Mrkr_11"];
VD_BC_CampSpawnAmount = 10;
VD_BC_CampUptimeFix = 3600;
VD_BC_CampUptimeRnd = (random 1000);
VD_BC_DeletionSaveZone = 300;
VD_BC_CampSpawnMinDist = 500;
VD_BC_CampSpawnMaxDist = 3000;
VD_BC_CampSpawnDistToHouses = 300;
VD_BC_CampSpawnDistToRoad = 100;

// Ship Wreck Spawn Settings
VD_SW_SpawnAtMarkers = true;
VD_SW_MrkrArray = ["VD_SW_Mrkr_1","VD_SW_Mrkr_2","VD_SW_Mrkr_3","VD_SW_Mrkr_4","VD_SW_Mrkr_5"];
VD_SW_WreckSpawnAmount = 5;
VD_SW_WreckSpawnMinDist = 900;
VD_SW_WreckSpawnMaxDist = 7000;

/*Trader Camp Spawner Settings*/
//add or remove markers here (one marker = TC refreshes at the same place)
VD_TC_MarkerArray = ["VD_TC_Mrkr_1","VD_TC_Mrkr_2","VD_TC_Mrkr_3","VD_TC_Mrkr_4"];

// Weapon Settings
//Set write TRUE if this mods weapons should be part of the loot table, write FALSE to exclude
VD_Allow_CUP_Weapons = true;
VD_Allow_NIARMS_Weapons = true;
VD_Allow_RHS_Weapons = true;
VD_Allow_WarfareThai_Weapons = false;

// Equipment settings
//Set write TRUE if this mods Equipment should be part of the loot table, write FALSE to exclude
VD_Allow_CUP_Equipment = true;
VD_Allow_RHS_Equipment = true;
VD_Allow_WarfareThai_Equipment = true;
VD_Allow_FrithsRuins_Equipment = true;

 

Enojy;)

  • Like 2
  • Thanks 2

Share this post


Link to post
Share on other sites

When you realize you no longer have to manually create your own bandit and trader camps

Image result for amazed meme

  • Haha 3

Share this post


Link to post
Share on other sites

@Vandeanson

For some reason i can't get your dynamic bandit script to work after following it step by step many times. I also can't get the init.sqf part to work for my mission since i get these errors saying "undefined variable" for many parts. I copied and pasted the script for that part into my empty init.sqf located in my new mission.

 

I am using cup terrains core and ravage as asked

Share this post


Link to post
Share on other sites
53 minutes ago, lv1234 said:

@Vandeanson

For some reason i can't get your dynamic bandit script to work after following it step by step many times. I also can't get the init.sqf part to work for my mission since i get these errors saying "undefined variable" for many parts. I copied and pasted the script for that part into my empty init.sqf located in my new mission.

 

I am using cup terrains core and ravage as asked

Can you try it with my new direct link? just download and copy paste the content into your mission folder (unzip it first tho).

 

https://drive.google.com/open?id=1GyR8WEeWKY_QIIAl1n3_auXruAJ0RaC8

Share this post


Link to post
Share on other sites

ups one more note: the script collection as per Download, needs at least one Equipment mod and one weapon mod active (Friths Ruins, RHS, NIARMS, CUP, WarfareThai)

I got tired yesterday and cba to add a fall back vanilla array for weapons and items ;) will add soon tho.

 

Also @lv1234 can you tell me what variablesa re undefined as per error message? it tells you the problematic variable like this #_Variablename and it also tells you what line of what script it has an issue with.

 

Generally, make sure the Init.sqf is updated correctly and you have the VD_Arrays.sqf, the VD_EDN_Functions.sqf, VD_BCSpawnerMrkr.sqf and VD_BCSpawner.sqf file in your mission folder

 

Note: i slightly corrected the Init.sqf content of the instructions (VD_TCSpawner.sqf was spawned with some delay, that should not be!)

Also Note: the direct download link contains some updates and I would use this only. will replace the step by step guide and just let you guys DL the folder to avoid issues soon.

Share this post


Link to post
Share on other sites

 

OP updated with direct download and up to date user guide. I hope this is much much clearer and easier to use than the previous instructions!

 

  • Like 3
  • Thanks 1

Share this post


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

ups one more note: the script collection as per Download, needs at least one Equipment mod and one weapon mod active (Friths Ruins, RHS, NIARMS, CUP, WarfareThai)

I got tired yesterday and cba to add a fall back vanilla array for weapons and items ;) will add soon tho.

 

Also @lv1234 can you tell me what variablesa re undefined as per error message? it tells you the problematic variable like this #_Variablename and it also tells you what line of what script it has an issue with.

 

Generally, make sure the Init.sqf is updated correctly and you have the VD_Arrays.sqf, the VD_EDN_Functions.sqf, VD_BCSpawnerMrkr.sqf and VD_BCSpawner.sqf file in your mission folder

 

Note: i slightly corrected the Init.sqf content of the instructions (VD_TCSpawner.sqf was spawned with some delay, that should not be!)

Also Note: the direct download link contains some updates and I would use this only. will replace the step by step guide and just let you guys DL the folder to avoid issues soon.

Ok it seems that after installing all of the required VD files that you stated, everything works. Though I'm still getting error messages relating to the bandit camps about bandits not having certain weapons and uniforms. This causes them to be either naked in their underwear, unarmed, or both. Only weapon mod i'm using is CUP weapons and Iron front lite

 

Also will your dynamic spawn camp (no markers) try to stay away from manually placed settlements and away from the dybamic bandit camps with markers?

Share this post


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

Ok it seems that after installing all of the required VD files that you stated, everything works. Though I'm still getting error messages relating to the bandit camps about bandits not having certain weapons and uniforms. This causes them to be either naked in their underwear, unarmed, or both. Only weapon mod i'm using is CUP weapons and Iron front lite

 

Also will your dynamic spawn camp (no markers) try to stay away from manually placed settlements and away from the dybamic bandit camps with markers?

hola! what equipment pools do you have enabled under VD_Settings.sqf? if cup you need cup units mod (not sure if i forgot to add that Info). right now, until i add Vanilla assets, u need atleast one equipmemt mod and one weapon mod installed (friths ruins, cup weapons or cup units, rhs usa and russia, warefare thai, niarms)

iron Front lite is not yet supported but will add it later.

the BC will check for near houses (the config file parent "house" any street (nearroads) and and the tent type that is spawned in my camps. if your placed settlements has none of those objects, the camps might spawn near or on top of it. we can however add another condition, if you tell me what objects u use for your manually placed settlements.

Share this post


Link to post
Share on other sites

sure, just exclude the following .sqfs from excecution by adding // in front of it

 

 

if (!isserver) exitWith {}; execVM "VD_Settings.sqf";

execVM "VD_Arrays.sqf";

execvm "VD_EDN_Functions.sqf";

execVM "VD_TCSpawner.sqf"; sleep 2;

//execvm "VD_EDN_BlueprintArray.sqf";

for "_i" from 1 to VD_SW_WreckSpawnAmount do {execvm "VD_SWSpawnerMrkr.sqf"; sleep 2;}; sleep 2;

if (VD_BC_SpawnAtMarkers) then {for "_i" from 1 to VD_BC_CampSpawnAmount do {execVM "VD_BCSpawnerMrkr.sqf";sleep 2;};};

if (!VD_BC_SpawnAtMarkers) then {for "_i" from 1 to VD_BC_CampSpawnAmount do {execVM "VD_BCSpawner.sqf"; sleep 10;};}; sleep 2; //execvm "VD_EDN_BlueprintArray.sqf";

// for "_i" from 1 to VD_EDN_MatboxAmount do {execvm "VD_EDN_MaterialSpawner.sqf"; sleep 2;}; sleep 2;// for "_i" from 1 to VD_EDN_MatboxAmount do {execvm "VD_EDN_MaterialSpawnerInHouse.sqf"; sleep 2;}; execVM "VD_NR_Spawner.sqf";

  • Thanks 1

Share this post


Link to post
Share on other sites

@Vandeanson Hey, so I noticed that the AI spawned for the bandit camps are using the "Guard" waypoints but I'm not seeing the creation of any guard points by the BCSpawner. Of course this leads to AI sometimes just deciding to wander off and do whatever. imo it'd be better to use a series of Search and Destroys or Move waypoints with a cycle waypoint at the end or if you want them to sit still than just a Hold waypoint as those wouldn't require the messing about with creating (and having to remove) guard points and making sure bandits stay at the correct guard point. I'm not the best scripter though so maybe you've already got it all setup and I'm just blind.

Share this post


Link to post
Share on other sites
On 9/11/2018 at 11:44 PM, Vandeanson said:

hola! what equipment pools do you have enabled under VD_Settings.sqf? if cup you need cup units mod (not sure if i forgot to add that Info). right now, until i add Vanilla assets, u need atleast one equipmemt mod and one weapon mod installed (friths ruins, cup weapons or cup units, rhs usa and russia, warefare thai, niarms)

iron Front lite is not yet supported but will add it later.

the BC will check for near houses (the config file parent "house" any street (nearroads) and and the tent type that is spawned in my camps. if your placed settlements has none of those objects, the camps might spawn near or on top of it. we can however add another condition, if you tell me what objects u use for your manually placed settlements.

My manually created survivor camps have generic houses here and there. However, the manual camp implementation will just consist of a campfire and ai's surrounding it

Share this post


Link to post
Share on other sites
14 hours ago, Eogos said:

@Vandeanson Hey, so I noticed that the AI spawned for the bandit camps are using the "Guard" waypoints but I'm not seeing the creation of any guard points by the BCSpawner. Of course this leads to AI sometimes just deciding to wander off and do whatever. imo it'd be better to use a series of Search and Destroys or Move waypoints with a cycle waypoint at the end or if you want them to sit still than just a Hold waypoint as those wouldn't require the messing about with creating (and having to remove) guard points and making sure bandits stay at the correct guard point. I'm not the best scripter though so maybe you've already got it all setup and I'm just blind.

currently i am using the bis fnc for task defend and task patrol, if you obselve that they wander off too much its possible to shorten the distance between waypoints if there is odd baehaviour anyway and they just run away too far,i can also provide a solution with a own function that addas SAD waypoints. this was thr original version btw

Share this post


Link to post
Share on other sites
11 hours ago, lv1234 said:

My manually created survivor camps have generic houses here and there. However, the manual camp implementation will just consist of a campfire and ai's surrounding it

so you could add a condition that ensures that the BC is not placed near a camp fire for example, same as i do it with cities, tents and roads in the BC script

Share this post


Link to post
Share on other sites
On 5/3/2018 at 1:46 PM, Vandeanson said:

Quick showcase video:

 

Hello there Vandeanson !

 

I was looking at the videos that you were trying to search  the spawned stuff.

 

In order to test everything easier there is the @mcc mod

also @ares mod

just beware of this mod because for some reasons it's giving automatically a requirement to this mod , so if you use ares keep a back up and finally i'ts good to have enable and add everything to zeus .

 

To add everything in Zeus , include in your init.sqf the following:

 

//________________	add to Zeus	________________

[] spawn {
  while {true} do {
 if (isServer) then {
 {
  _x addCuratorEditableObjects [allUnits,true];
  _x addCuratorEditableObjects [vehicles,true];
  _x addCuratorEditableObjects [allMissionObjects "All",true];
 } forEach allCurators;            
};
  sleep 10;
  };
};

 

Every time that i 'm using doing something i 'm using also @mcc and adding everything to zeus , this way , creating will be much easier !

 

See you and keep up the Good work !

 

  • Like 1

Share this post


Link to post
Share on other sites

Hey Vandeanson - liking the direction of the scripts. I am not actually able to get this working however. Whenever I try to use the scripts I get tons of cycling errors as it tries to spawn BC. The errors fly by so quickly I can't tell you a list of line numbers but it seems to constantly refer to the fireplace; suggests there isn't one spawned. I've enabled automatic spawning based on location to player over using markers. Could this be the problem? Is that functionality working? I have the grabbed that latest version of the files (90% sure).

 

However, there's a strange dependency on the EDN_Functions. The VD_Equipper is part of that file. Could you break out the equipper from the EDN code please? 

 

I also noticed the launchers arrays aren't used. Or if they are I can't find their use...

 

 

Share this post


Link to post
Share on other sites

I have it working now. Needed to create a SW spawner for when you do not want to use pre-designated markers. The _mag errors are now the only issue; Multiple RHS not in cfg weapons seems to be the cause. I do not know what the equivalent of a try/catch is in C but maybe you could suppress the error logs and send them to the server diag log instead? 

 

One other thing I do notice is the BC spawns group up a bit. Noticing multiple camps all spawning within a couple dozen metres of each other; kind of neat as it looks like a commune. I suspect this is not intentional. Maybe each loop through the spawner should append/remove the location of each camp to an array in order to blacklist spawning near one of those existing camps? BIS_fnc_findSafePlace does have a param for blacklisting. I poked around to see if I could find simple way of appending/removing items into a Blacklist array but as of yet no joy.

 

Anyway, this set of scripts are really nice! 

Share this post


Link to post
Share on other sites
On 9/14/2018 at 8:03 AM, Vandeanson said:

so you could add a condition that ensures that the BC is not placed near a camp fire for example, same as i do it with cities, tents and roads in the BC script

Take it back both my bandit and trader camps will consist of houses that are already placed there or are manually placed there by me. Will your dynamic camps stay away from those or try to spawn away from those?

Share this post


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

I have it working now. Needed to create a SW spawner for when you do not want to use pre-designated markers. The _mag errors are now the only issue; Multiple RHS not in cfg weapons seems to be the cause. I do not know what the equivalent of a try/catch is in C but maybe you could suppress the error logs and send them to the server diag log instead? 

 

One other thing I do notice is the BC spawns group up a bit. Noticing multiple camps all spawning within a couple dozen metres of each other; kind of neat as it looks like a commune. I suspect this is not intentional. Maybe each loop through the spawner should append/remove the location of each camp to an array in order to blacklist spawning near one of those existing camps? BIS_fnc_findSafePlace does have a param for blacklisting. I poked around to see if I could find simple way of appending/removing items into a Blacklist array but as of yet no joy.

 

Anyway, this set of scripts are really nice! 

hola! i guess i need to implement an option to select what feature one wants to spawn or not spawn.

 

yeah since i have quite a couple of criterias where the camps can not spawn, sometimes there are only a few options left so all spawn close. i though about blacklisting it too but do not know yet how to enter an area or distance from a position into that blacklist param. i did actually add a requirement that the camps can not be near one of the tents (tentname) that are

spawned for each BC, maybe this needs some more tweaking. i do not recall the distance at the moment.

 

with regards to the _mag issue, i am aware of it but do not have a better solution for RHS at the moment, i am fetching the matching magazines arrays from config files and i assume that the problem lies here. ideally i might find another solution how to find magazines that match the respective weapon. open to hear if others have a solution here!

 

and thanks for testing and commenting;)

will try to improve the scripts once back from holidays:)

  • Thanks 1

Share this post


Link to post
Share on other sites
4 hours ago, lv1234 said:

Take it back both my bandit and trader camps will consist of houses that are already placed there or are manually placed there by me. Will your dynamic camps stay away from those or try to spawn away from those?

jep there is a min distance from any  object that has "house" in its config file Parents, its pretty much all the houses i believe;)

Share this post


Link to post
Share on other sites

Updated the To Do section of the original post fyi:

 

To Do's:

- fix problem that causes errors when trying to spawn magazines for some mod weapons (RHS/Warfarethai)

- improve function that checks if any TC or BC or SW has already spawned nearby to avoid multiple camps spawn near each other

- test distance checks for spawners in general to see if they are not too restrictive (camps may end up not finding a place to spawn

- fix camp object placement to avoid objects getting stuck on each other 

- fix TC friendly AI spawner

  • Like 2

Share this post


Link to post
Share on other sites

@Vandeanson don't forget about adding a SW spawner for when you don't want to use markers. I copied/edited your SW spawner to do this. However, it may be better to create a generic script for TC, BC and SW which handles setting the POSes based on a true/false check instead. Then you wouldn't need to duplicate the files.

 

Spoiler

//VANDEANSONS DYNAMIC SHIPWRECK SPAWNER
//AUGUST 3, 2018
//VERSION 2.0
//DEPENDENCIES: RAVAGE & CBA IF YOU WANT TO USE THE RAVAGE LOOT FUNCTION



_VD_SW_wreckpos = [getPosATL player, VD_SW_WreckSpawnMinDist, VD_SW_WreckSpawnMaxDist, 5, 0, 100, 1, [], []] call BIS_fnc_findSafePos;
_VD_SW_wreck = VD_SWwrecks call BIS_fnc_selectRandom createVehicle _VD_SW_wreckpos;
_VD_SW_wreck allowDamage false;
_VD_SW_wreck setDir (random 359);

//4.2 LOOTBOX THAT YOU WANT TO LOOT FOR FANCY STUFF! NOTES BELOW:
sleep 0.2;

_itembox1 = "Box_IND_Ammo_F" createVehicle ([getPosATL _VD_SW_wreck, 15, 30, 5, 0, 0.9, 1, [], []] call BIS_fnc_findSafePos);
_itembox1 allowDamage false;
clearMagazineCargoGlobal _itembox1;
clearWeaponCargoGlobal _itembox1;
clearItemCargoGlobal _itembox1;
clearBackpackCargoGlobal _itembox1;
_weapon = selectrandom VD_WeaponArrayRifles;
_weapon1 = selectrandom VD_WeaponArrayRifles;
_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 [_weapon 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];


/////4.3 Ambient or lootable props (if ravage mod is active) selection and spawn point relative to _mark
sleep 0.3;
    _pos1 = [getPosATL _VD_SW_wreck, 10, 25, 2, 0, 0.9, 0] call BIS_fnc_findSafePos;
    _object1 = VD_SWwreckClutter call BIS_fnc_selectRandom createVehicle ([getPosATL _VD_SW_wreck, 10, 25, 2, 0, 100, 0] call BIS_fnc_findSafePos);
    _object1 allowDamage false;
    _object1 setDir (random 359);


    _pos2 = [getPosATL _VD_SW_wreck, 10, 25, 2, 0, 0.9, 0] call BIS_fnc_findSafePos;
    _object2 = VD_SWwreckClutter call BIS_fnc_selectRandom createVehicle _pos2;
    _object2 allowDamage false;
    _object2 setDir (random 359);

    _pos3 = [getPosATL _VD_SW_wreck, 10, 25, 2, 0, 0.9, 0] call BIS_fnc_findSafePos;
    _object3 = VD_SWwreckClutter call BIS_fnc_selectRandom createVehicle _pos3;
    _object3 allowDamage false;
    _object3 setDir (random 359);

    _pos4 = [getPosATL _VD_SW_wreck, 10, 25, 2, 0, 0.9, 0] call BIS_fnc_findSafePos;
    _object4 = VD_SWwreckClutter call BIS_fnc_selectRandom createVehicle _pos4;
    _object4 allowDamage false;
    _object4 setDir (random 359);

    _pos5 = [getPosATL _VD_SW_wreck, 10, 25, 2, 0, 0.9, 0] call BIS_fnc_findSafePos;
    _object5 = VD_SWwreckClutter call BIS_fnc_selectRandom createVehicle _pos5;
    _object5 allowDamage false;
    _object5 setDir (random 359);

    _pos6 = [getPosATL _VD_SW_wreck, 10, 25, 2, 0, 0.9, 0] call BIS_fnc_findSafePos;
    _object6 = VD_SWwreckClutter call BIS_fnc_selectRandom createVehicle _pos6;
    _object6 allowDamage false;
    _object6 setDir (random 359);

    _pos7 = [getPosATL _VD_SW_wreck, 5, 20, 2, 0, 100, 0] call BIS_fnc_findSafePos;
    _object7 = VD_SWwreckClutter call BIS_fnc_selectRandom createVehicle _pos7;
    _object7 allowDamage false;
    _object7 setDir (random 359);

{_x setVectorUp surfaceNormal position _x} foreach [_itembox1,_VD_SW_wreck,_object1,_object2,_object3,_object4,_object5,_object6,_object7];

Sleep (random VD_BC_CampUptimeRnd);Sleep VD_BC_CampUptimeFix;
WaitUntil {player distance (GetPos _VD_SW_wreck) > VD_BC_DeletionSaveZone};
{deleteVehicle _x} foreach [_itembox1,_VD_SW_wreck,_object1,_object2,_object3,_object4,_object5,_object6,_object7];
VD_SW_MrkrArray = VD_SW_MrkrArray + [_VD_SW_wreckpos];

execVM "VD_SWSpawner.sqf";

 

 

  • Like 2

Share this post


Link to post
Share on other sites

@Vandeanson I've done some more performance testing. I've found inserting sleep doesn't really help. However, as I'm using CUP+RHS+NIArms weapons the script has a lot of data to crunch; those arrays are huge! My current theory, and as I've tested so far is that when the script tries to assign mags the actual cfgWeapons lookup hasn't finished and therefore the array is empty. This sets off a cascade of mag failures. This doesn't seem to be an issue for the SW spawner as often and I suspect this is because there simply fewer iterations to go through before assigning cargo.

 

What I've done is insert waitUntil calls for each of the cfgWeapons lookups. Tested a bunch of times and so far I'm not seeing the errors. I added this all magazine lookups for the equipper function. 

 

For example: 

_magazines = getArray (configFile >> "CfgWeapons" >> _weapon >> "magazines");
waituntil {(count _magazines) > 0};
_mag = selectRandom _magazines;

As you can see there's a loop happening which doesn't proceed until the _magazines loop is not empty. Hope this helps! 

 

Also, as a performance request, it'd be nice if you disabled simulation on all the spawned AI (except the No Rest group for obvious reasons) until a player was within a certain range. This would help keep frames up for MP even with a large number of camps spawned.

  • Like 1
  • Thanks 1

Share this post


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

@Vandeanson I've done some more performance testing. I've found inserting sleep doesn't really help. However, as I'm using CUP+RHS+NIArms weapons the script has a lot of data to crunch; those arrays are huge! My current theory, and as I've tested so far is that when the script tries to assign mags the actual cfgWeapons lookup hasn't finished and therefore the array is empty. This sets off a cascade of mag failures. This doesn't seem to be an issue for the SW spawner as often and I suspect this is because there simply fewer iterations to go through before assigning cargo.

 

What I've done is insert waitUntil calls for each of the cfgWeapons lookups. Tested a bunch of times and so far I'm not seeing the errors. I added this all magazine lookups for the equipper function. 

 

For example: 


_magazines = getArray (configFile >> "CfgWeapons" >> _weapon >> "magazines");
waituntil {(count _magazines) > 0};
_mag = selectRandom _magazines;

As you can see there's a loop happening which doesn't proceed until the _magazines loop is not empty. Hope this helps! 

 

Also, as a performance request, it'd be nice if you disabled simulation on all the spawned AI (except the No Rest group for obvious reasons) until a player was within a certain range. This would help keep frames up for MP even with a large number of camps spawned.

Aaww nice man, i like it and will implement it asap! thanks a ton!

nice idea on the AI - will do that indeed! I once thought about only spawning them in once the player is close but that conflicts with the respawn timer - will look into it, at least disabling the simulation should be easy.

Also, I will do a distance check for marker placed camps, to only spawn in once the player is close to the selected marker. no need to have camps up at a marker 4km away from the player=)

 

thanks a ton for your throughout testing and happy to receive any  feedback;)

cheers

vd

Share this post


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

×