Howdy guys, I'm not sure if I should be posting this this soon as I'm not convinced I'm 100% done with it, but I think nonetheless it'll work. This is one I've been trying to tweak and get right for a while now. What this mod does is it gives server owners the ability to configure several things within the guts of the player_spawnCheck.SQF file in \z\dayz_code\compiles folder. The idea is to trim up and improve some of the loot and zed spawn characteristics to help with realism. On my servers, I grew tired of having to drive a vehicle off a good distance, then jump out on foot, to trigger spawn (loot in particular). I've re-written some of the code in here to make it possible to have both loot and zed spawn more naturally while in any kind of vehicle making it more possible to drive up to a location and have loot piles waiting.
Also included is the guts of a previous modification I wrote for preventing loot and zed from spawning in pre-defined areas. I will include all of the instructions for it in here as well.
On to the mod.
Step 1) Modify Init.SQF
This ought to be already located within the \dayz_server\MPMissions\xxx folder for your server.
The first chunk of code to put in here is all of the configuration options. This can be placed really anywhere in the init.SQF file but I prefer to place it below everything else for cleanliness. So, tack this chunk at the end of the file:
As you can see, there's a lot of variables I've made that can be adjusted. The defined variables I've cut/pasted are the ones I use on both of my servers. I've made comments next to each one to help explain what they do (and remind myself, too) but I'll give a further explanation here:
dayz_DisableGlobalZedSpawn -- Pretty much self-explanatory. This simple flag, when set to true, will hinder any zed from spawning. Handy for testing such as grabbing precise X/Y coordinates to create no loot/zed spawn areas. Default is false.
dayz_LootZedSpawn_DisableDynamicLootSpawn -- true or false -- default is false. If set to true, no loot will spawn dynamically. This is only set to false if used in conjunction with pre-spawning of all loot on the entire server (which I've not included in this post; I may change my mind if anyone asks for it).
dayz_LootZedSpawn_MaxWeaponHolders -- I'm still not sure what this does, but since I run the clients a little harder on my machines, I decided to double this value from the default of 80 to 160.
dayz_LootZedSpawn_SpawnZedRadius -- The radius that zed will spawn from the center point/exact position of a building or other structure that's compelling the zed spawn. Default is 30.
dayz_LootZedSpawn_MaxSpawnRange -- This is the range, in meters, from the client player's current position (when the "tick" has hit to run loot/zed spawn) that the routine will search for structures/buildings that can pop loot piles and/or zed up. Default is 200 but I've set mine to 325. One can experiment and set it up further but I believe it will produce an FPS drop progressively. I've experimented with this one as high as 500 and wound up settling at 325. Things to take into account are the maximum number of zed agents a client's PC is responsible for spawning. I believe the createVehicle and createAgents are what drops the FPS on certain machines so the further this is placed, especially when running in densely populated areas like towns, the more a precipitous drop in FPS player machines might experience.
dayz_LootZedSpawn_MaxGroundVehicleSpeed -- This value determines the maximum speed any ground vehicle (car, truck, bike, etc) a player can be cruising in that will run the loot and zed spawn routine. Above this figure, nothing will spawn until said vehicle has slowed down below. DayZ default I believe is 25kph but I've set mine up to 80. Again, like maxspawnrange, this can have an affect on player's FPS.
dayz_LootZedSpawn_MaxAirVehicleSpeed -- This value determines the max speed in kph an air vehicle (plane/chopper) the loot and zed spawn routine will run. Anything above, like maxgroundvehiclespeed above this, will not run the routine. There is no default for this so I've set mine to 125. This one is worth experimenting with as going too fast in a chopper fly-over of a town with this value set very high may load a player's PC up attempting to spawn loot and zed that may never be encountered. So, my thinking on this is is to keep it reasonably low to help spawn get going while coming into an area that the chopper may land in shortly.
dayz_LootZedSpawn_MaxAirVehicleAltitude -- This one coincides with maxairvehiclespeed -- the maximum TERRAIN altitude in meters that the spawn routine will run for an air vehicle. There is no default so I've experimented and set mine to 80. When setting this variable and the one above it, consider the hypothetical use of a chopper or fly over an area and take note of the chopper's speed and altitude that seems reasonable for spawn to start occurring.
dayz_LootZedSpawn_ExcludePlanes -- True or false, this will or won't exclude planes from running the spawn routine. Doing a fly-over in a slow plane, like the AN-2 cargo plane, may not warrant loot/zed spawn, but for those that use the Osprey may want it.
dayz_LootZedSpawn_MaxLootSpawnDistance -- A more specific trim to maximum spawn range chance. If we don't want loot piles to spawn all the way out the same range that we want zed to spawn (maxspawnrange), then we can use a smaller number here to reduce player PC load and FPS drop. I use 200 meters on my boxes. Default is 125.
dayz_LootZedSpawn_MinLootSpawnDistance -- The opposite end of the same coin from the variable above -- the minimum distance away a player must be from a precise loot pile position for the spawn routine to run in that spot. Default is 30, but I like doing 10 meters. An example: consider if a person is in a ground vehicle driving up to the very edge of a building that he or she is expecting loot to spawn in -- if the spawn routine hasn't run by the time he's parked, and he's under the default of 30 meters from the loot pile spots in that building, then nothing will appear.
dayz_LootZedSpawn_LootRespawnTimer -- Loot pile respawn timer in seconds - default is 900 seconds (or 15 minutes). This determines how long a loot pile will be "tagged" and excluded from concurrent loot spawn routines. I prefer to set mine up anywhere from 45 minutes (2700 seconds) to 1 hour (3600 seconds) to prohibit constant loot mining of a particular building. It compels players to explore more ground before coming back to the same spot over and over.
dayz_LootZedSpawn_PermanentLoot -- True or false, this sets a particular loot pile spot in a building or structure to produce loot one time. Set to true, lootrespawntimer is disregarded. By default, it's set to false, but if you want a more ultra-realistic feel, where loot never respawns in the same spot twice, then set this to true.
(continued on second page)
Also included is the guts of a previous modification I wrote for preventing loot and zed from spawning in pre-defined areas. I will include all of the instructions for it in here as well.
On to the mod.
Step 1) Modify Init.SQF
This ought to be already located within the \dayz_server\MPMissions\xxx folder for your server.
The first chunk of code to put in here is all of the configuration options. This can be placed really anywhere in the init.SQF file but I prefer to place it below everything else for cleanliness. So, tack this chunk at the end of the file:
Code:
// Spawn Loot/Zed Parameters - ^bdc - Player_SpawnCheck.SQF modifications
dayz_DisableGlobalZedSpawn = false; // Global flag to enable/disable ALL zed spawn on map
dayz_LootZedSpawn_DisableDynamicLootSpawn = false; // (default: false) - Disables dynamically spawned loot from client machines
dayz_LootZedSpawn_MaxWeaponHolders = 160; // (default: 80) - maximum number of "weapon holders" for each client (replaces dayz_maxmaxweaponholders)
dayz_LootZedSpawn_SpawnZedRadius = 30; // (default: 30) - maximum radius from center of building/object to spawn zed
dayz_LootZedSpawn_MaxSpawnRange = 325; // (default: 200) - max global range (radius in meters) from player of any loot/zed spawn (nearby buildings check)
dayz_LootZedSpawn_MaxGroundVehicleSpeed = 80; // max speed of ground vehicle (player in) that will generate loot/zed spawn
dayz_LootZedSpawn_MaxAirVehicleSpeed = 125; // max speed of air vehicle (player in) that will generate loot/zed spawn
dayz_LootZedSpawn_MaxAirVehicleAltitude = 80; // max terrain altitude (meters) of air vehicle (player in) that will generate loot/zed spawn
dayz_LootZedSpawn_ExcludePlanes = true; // Exclude loot/zed spawn triggered by player while in a plane
dayz_LootZedSpawn_MaxLootSpawnDistance = 200; // (default: 125) - maximum loot spawn distance from player for loot
dayz_LootZedSpawn_MinLootSpawnDistance = 10; // (default: 30) - minimum loot spawn distance from player for loot
dayz_LootZedSpawn_LootRespawnTimer = 2700; // Time in seconds until respawn of loot in a given building (default: 900 for 15 minutes) - Works if permanentloot set false
dayz_LootZedSpawn_PermanentLoot = false; // Enable/disable permanent loot (default: false) - if true, loot spawns once at building and remains permanently until server reset
As you can see, there's a lot of variables I've made that can be adjusted. The defined variables I've cut/pasted are the ones I use on both of my servers. I've made comments next to each one to help explain what they do (and remind myself, too) but I'll give a further explanation here:
dayz_DisableGlobalZedSpawn -- Pretty much self-explanatory. This simple flag, when set to true, will hinder any zed from spawning. Handy for testing such as grabbing precise X/Y coordinates to create no loot/zed spawn areas. Default is false.
dayz_LootZedSpawn_DisableDynamicLootSpawn -- true or false -- default is false. If set to true, no loot will spawn dynamically. This is only set to false if used in conjunction with pre-spawning of all loot on the entire server (which I've not included in this post; I may change my mind if anyone asks for it).
dayz_LootZedSpawn_MaxWeaponHolders -- I'm still not sure what this does, but since I run the clients a little harder on my machines, I decided to double this value from the default of 80 to 160.
dayz_LootZedSpawn_SpawnZedRadius -- The radius that zed will spawn from the center point/exact position of a building or other structure that's compelling the zed spawn. Default is 30.
dayz_LootZedSpawn_MaxSpawnRange -- This is the range, in meters, from the client player's current position (when the "tick" has hit to run loot/zed spawn) that the routine will search for structures/buildings that can pop loot piles and/or zed up. Default is 200 but I've set mine to 325. One can experiment and set it up further but I believe it will produce an FPS drop progressively. I've experimented with this one as high as 500 and wound up settling at 325. Things to take into account are the maximum number of zed agents a client's PC is responsible for spawning. I believe the createVehicle and createAgents are what drops the FPS on certain machines so the further this is placed, especially when running in densely populated areas like towns, the more a precipitous drop in FPS player machines might experience.
dayz_LootZedSpawn_MaxGroundVehicleSpeed -- This value determines the maximum speed any ground vehicle (car, truck, bike, etc) a player can be cruising in that will run the loot and zed spawn routine. Above this figure, nothing will spawn until said vehicle has slowed down below. DayZ default I believe is 25kph but I've set mine up to 80. Again, like maxspawnrange, this can have an affect on player's FPS.
dayz_LootZedSpawn_MaxAirVehicleSpeed -- This value determines the max speed in kph an air vehicle (plane/chopper) the loot and zed spawn routine will run. Anything above, like maxgroundvehiclespeed above this, will not run the routine. There is no default for this so I've set mine to 125. This one is worth experimenting with as going too fast in a chopper fly-over of a town with this value set very high may load a player's PC up attempting to spawn loot and zed that may never be encountered. So, my thinking on this is is to keep it reasonably low to help spawn get going while coming into an area that the chopper may land in shortly.
dayz_LootZedSpawn_MaxAirVehicleAltitude -- This one coincides with maxairvehiclespeed -- the maximum TERRAIN altitude in meters that the spawn routine will run for an air vehicle. There is no default so I've experimented and set mine to 80. When setting this variable and the one above it, consider the hypothetical use of a chopper or fly over an area and take note of the chopper's speed and altitude that seems reasonable for spawn to start occurring.
dayz_LootZedSpawn_ExcludePlanes -- True or false, this will or won't exclude planes from running the spawn routine. Doing a fly-over in a slow plane, like the AN-2 cargo plane, may not warrant loot/zed spawn, but for those that use the Osprey may want it.
dayz_LootZedSpawn_MaxLootSpawnDistance -- A more specific trim to maximum spawn range chance. If we don't want loot piles to spawn all the way out the same range that we want zed to spawn (maxspawnrange), then we can use a smaller number here to reduce player PC load and FPS drop. I use 200 meters on my boxes. Default is 125.
dayz_LootZedSpawn_MinLootSpawnDistance -- The opposite end of the same coin from the variable above -- the minimum distance away a player must be from a precise loot pile position for the spawn routine to run in that spot. Default is 30, but I like doing 10 meters. An example: consider if a person is in a ground vehicle driving up to the very edge of a building that he or she is expecting loot to spawn in -- if the spawn routine hasn't run by the time he's parked, and he's under the default of 30 meters from the loot pile spots in that building, then nothing will appear.
dayz_LootZedSpawn_LootRespawnTimer -- Loot pile respawn timer in seconds - default is 900 seconds (or 15 minutes). This determines how long a loot pile will be "tagged" and excluded from concurrent loot spawn routines. I prefer to set mine up anywhere from 45 minutes (2700 seconds) to 1 hour (3600 seconds) to prohibit constant loot mining of a particular building. It compels players to explore more ground before coming back to the same spot over and over.
dayz_LootZedSpawn_PermanentLoot -- True or false, this sets a particular loot pile spot in a building or structure to produce loot one time. Set to true, lootrespawntimer is disregarded. By default, it's set to false, but if you want a more ultra-realistic feel, where loot never respawns in the same spot twice, then set this to true.
(continued on second page)