Judge Bread Posted February 3, 2014 Report Share Posted February 3, 2014 Static Vehicle Spawn Positions Current version: 1.0 Information: I have been developing a system to allow server admins to dictate where certain types of vehicles spawn at specific positions on the map. This is to cope with the spawning of vehicles in places that cause them to be unusable. An example of this is the C130J_US_EP1 spawning in the middle of a forest or on the side of a mountain where there isn't enough room to actually take off. This system does not replace the dynamic vehicle spawning system developed by the Epoch developers but simply adds a step in the process to check for a static spawn position as set up by the server admin before using the dynamic spawn system. This is my first such release and although I have tested it thoroughly, I do advise you to test it on your test systems before deploying it to live. The system was tested on Taviana and thus you will need to modify the spawn locations for your own map. The file to edit your spawn locations is FS_StaticVehicleSpawnLocations.sqf. Bugs and feedback to enhance the system is welcome but please make sure you clearly state them with reasoning. The attached zip file contains all the files required, information about the system and a set of the following detailed instructions. Installation: Server: - Open the server_monitor.sqf found in the system directory. - Find these lines (yours might look different depending on the epoch version you have). // spawn_vehicles _vehLimit = MaxVehicleLimit - _totalvehicles; if(_vehLimit > 0) then { diag_log ("HIVE: Spawning # of Vehicles: " + str(_vehLimit)); for "_x" from 1 to _vehLimit do { [] spawn spawn_vehicles; }; } else { diag_log "HIVE: Vehicle Spawn limit reached!"; }; - Change to this // spawn_vehicles _vehLimit = MaxVehicleLimit - _totalvehicles; if(_vehLimit > 0) then { diag_log ("HIVE: Spawning # of Vehicles: " + str(_vehLimit)); if (DZE_FS_UseStaticVehicleSpawn) then { [_vehLimit] spawn fs_spawnVehicles; } else { for "_x" from 1 to _vehLimit do { [] spawn spawn_vehicles; }; }; } else { diag_log "HIVE: Vehicle Spawn limit reached!"; }; - Extract the FS_SpawnVehiclesV1.zip archive in the root directory of your server. You should now have a folder called FS_SpawnVehicles in your root directory. - The files in this folder will manage the spawning of new vehicles for the server if 'DZE_FS_UseStaticVehicleSpawn' is true. Mission: - Global variable DZE_FS_UseStaticVehicleSpawn (true/false) can be used to state if static vehicle spawning should be used or not. (Default: false). Add this along with all other global variables DZE_FS_UseStaticVehicleSpawn = true; - In the mission's init.sqf file under this //Compile vehicle configs call compile preprocessFileLineNumbers "\z\addons\dayz_server\missions\DayZ_Epoch_13.Tavi\dynamic_vehicle.sqf"; Add this if (true) then { private "_handle"; _handle = [] execVM "\z\addons\dayz_server\FS_SpawnVehicles\FS_StaticVehicleSpawnCompiles.sqf"; waitUntil{scriptDone _handle}; }; Configuration: - Open the FS_SpawnVehicles folder. - Open FS_StaticVehicleSpawnLocations.sqf. - This file contains the configurations for the system. - You can configure it in two ways. 1) Simply add to the existing configuration. 2) Create your own configuration. 1) Using existing configurations: - In FS_StaticVehicleSpawnLocations.sqf you will find the 3 pre-defined location arrays LandSpawnLocations, AirSpawnLocations and SeaSpawnLocations. DO NOT DELETE THESE. - Simply, add position (x,y) or positionATL (x,y,z) arrays (e.g. [x,y,z]) to the relevant location array you want to modify. Only x and y coordinates are used in the spawn process. 2) Creating custom configurations: - Create a new Location Array with a unique name. I have used 'C130JSpawnLocations' as an example. Note: following example is already present in the file therefore do not replicate it instead make your own. e.g. C130JSpawnLocations = [ [16590,11435.5,0.001], [7540.4,7783.1,0.001], [10416.6,17588.1,0.002], [10060.83,18570.948,0] ]; - To configure a vehicle to use the newly created location array, it must be added to the StaticVehicleSpawnConfig. - The StaticVehicleSpawnConfig is a simple array and works like a look up table. It itself consists of arrays that have two strings that make up the configuration. - The first element/string of the configuration is the vehicle class that will make use of the newly created location array. - The second is the exact name of the newly created location array. - The first and second element should be added like this: ["VehicleClass","LocationArrayName"] - Add the location array name exactly as created (copy-paste it to make sure it is exact). Add all new configurations above the LandVehicle, Air and Sea configurations. This will ensure it gets checked and used before getting picked up by the Land/Air/Ship configurations. e.g. StaticVehicleSpawnConfig = [ ["C130J_US_EP1","C130JSpawnLocations"], // C130J_US_EP1 Static Spawn Config <-- NEWLY ADDED CONFIGURATION ["LandVehicle","LandSpawnLocations"], // All Land Vehicles (Do not remove) ["Air","AirSpawnLocations"], // All Air Vehicles (Do not remove) ["Ship","SeaSpawnLocations"] // All Sea Vehicles (Do not remove) ]; - The example shows that the "C130JSpawnLocations" array will be used for the "C130J_US_EP1" vehicle class. Now when the server starts it will attempt to use the above locations and configuration to find a suitable position for the vehicle. If it is unable to then it will fall back to using the dynamic spawn system. EDIT (15/06/2014) => DOWNLOAD LINK FIXED. LAST TESTED WITH VERSION 1.0.4FS_SpawnVehicles.zip Friendly, Deathcall, SchwEde and 3 others 6 Link to comment Share on other sites More sharing options...
Judge Bread Posted February 3, 2014 Author Report Share Posted February 3, 2014 Locked for future use. Link to comment Share on other sites More sharing options...
insertcoins Posted February 3, 2014 Report Share Posted February 3, 2014 Man this script is a godsent! Thanks! Link to comment Share on other sites More sharing options...
Judge Bread Posted February 3, 2014 Author Report Share Posted February 3, 2014 Man this script is a godsent! Thanks! it isn't.. its Judgesent :P Link to comment Share on other sites More sharing options...
insertcoins Posted February 3, 2014 Report Share Posted February 3, 2014 it isn't.. its Judgesent :P Pff, mister "I am the law!" ;) Link to comment Share on other sites More sharing options...
player2 Posted May 21, 2014 Report Share Posted May 21, 2014 Attachment no longer works ^_^ Link to comment Share on other sites More sharing options...
Loudless Posted June 9, 2014 Report Share Posted June 9, 2014 Has someone the Download for the script ? Link to comment Share on other sites More sharing options...
Friendly Posted June 10, 2014 Report Share Posted June 10, 2014 pls fix download! Link to comment Share on other sites More sharing options...
Friendly Posted June 16, 2014 Report Share Posted June 16, 2014 Thanks for fixing the download :) Link to comment Share on other sites More sharing options...
calamity Posted June 16, 2014 Report Share Posted June 16, 2014 marked for install Link to comment Share on other sites More sharing options...
Deathcall Posted June 16, 2014 Report Share Posted June 16, 2014 Thank you kindly for fixing the link! Link to comment Share on other sites More sharing options...
Tricks Posted July 6, 2014 Report Share Posted July 6, 2014 Does this work for 1.0.5.1?? Link to comment Share on other sites More sharing options...
Tricks Posted July 6, 2014 Report Share Posted July 6, 2014 Silly question maybe but this would go in the same folder as my dayz_server.pbo? Link to comment Share on other sites More sharing options...
Meowzors Posted July 12, 2014 Report Share Posted July 12, 2014 Previous post recanted... In order for this to work do the static spawned vehicles have to be on the dynamic list? I am seeing that the vehicles are not spawning majority of the time Link to comment Share on other sites More sharing options...
pestis Posted August 24, 2014 Report Share Posted August 24, 2014 script works beautifully on my server. Only question i would ask is is there a way to specify the direction that the vehicles are pointing in when they spawn? i've got some planes set to static spawn for the convenience of fresh spawns getting around the large map, but sometime the planes spawn point off in a direct from which there isnt enough space to taxi back onto the runways Link to comment Share on other sites More sharing options...
HellWalker Posted September 12, 2014 Report Share Posted September 12, 2014 Is there anyone using this with Epoch 1.0.5.1 ? Link to comment Share on other sites More sharing options...
Meowzors Posted September 12, 2014 Report Share Posted September 12, 2014 Yep, I use it to place AN2's on runways and the DC3 on sector B Link to comment Share on other sites More sharing options...
HellWalker Posted September 12, 2014 Report Share Posted September 12, 2014 Yep, I use it to place AN2's on runways and the DC3 on sector B Did you do anything different from the tutorial? Because i've done this a couple of times, but the vehicles don't spawn in the coords i'm using. Link to comment Share on other sites More sharing options...
HellWalker Posted September 13, 2014 Report Share Posted September 13, 2014 The vehicle spawn is working for me.. But I'm getting this spam in the rpt error... 19:58:25 Error in expression <s select _index; _itemType = _itemTypes select _index; }; [_veh,[_dir,_objPos> 19:58:25 Error position: <select _index; }; [_veh,[_dir,_objPos> 19:58:25 Error Zero divisor 19:58:25 File z\addons\dayz_server\FS_SpawnVehicles\FS_SpawnVehicles.sqf, line 320 How can i solve this? I didn't changed anything in this file. Link to comment Share on other sites More sharing options...
calamity Posted September 29, 2014 Report Share Posted September 29, 2014 Locked for future use. this is not working.. should ALL "air" spawn near the defined coords ?? do I have to define whats "AIR" or should it know whats air ?? like 1 jet spawned at airfield coord the rest out in the woods. /**** LOCATION CONFIGURATIONS START ****/ // All land vehicles LandSpawnLocations = [ ]; // All Air vehicles AirSpawnLocations = [ [14696.3,16683.7,0], // awols [4682.77,4593.8,0.001], // hero field [18388.4,2269.16,0.001] // south af ]; // All Sea/Ship vehicles SeaSpawnLocations = [ ]; // Specific C130J_US_EP1 spawn locations. C130JSpawnLocations = [ //[14696.3,16683.7,0.001], // Dubovo Airfield //[4682.77,4593.8,0] // Yaroslav airport ]; // Static Vehicle Configurations. // Vehicle Class (as string), Vehicle spawn location array name (as string) StaticVehicleSpawnConfig = [ //["C130J_US_EP1","C130JSpawnLocations"], // C130J_US_EP1 Static Spawn Config ["LandVehicle","LandSpawnLocations"], // All Land Vehicles (Do not remove) ["Air","AirSpawnLocations"], // All Air Vehicles (Do not remove) ["Ship","SeaSpawnLocations"] // All Sea Vehicles (Do not remove) ]; Link to comment Share on other sites More sharing options...
Meowzors Posted September 30, 2014 Report Share Posted September 30, 2014 It will place helis and planes at the coords u enter first then once u run ou of coords it will move on to random coords. Planes and helis are defined as "air vehicles". U don't have to define them Link to comment Share on other sites More sharing options...
calamity Posted September 30, 2014 Report Share Posted September 30, 2014 It will place helis and planes at the coords u enter first then once u run ou of coords it will move on to random coords. Planes and helis are defined as "air vehicles". U don't have to define them so If I have 20 planes spawning I need to set 20 coords ?? Link to comment Share on other sites More sharing options...
Meowzors Posted September 30, 2014 Report Share Posted September 30, 2014 If u want them all in set locations yes Link to comment Share on other sites More sharing options...
calamity Posted September 30, 2014 Report Share Posted September 30, 2014 If u want them all in set locations yes Ok thankz for the help.... Link to comment Share on other sites More sharing options...
lordgeorge Posted September 30, 2014 Report Share Posted September 30, 2014 I have been looking around and had a few attempts myself of keeping dynamic spawns but having custom static spawn locations for vehicles on restart. Mainly for anyone who donates enough to get the perk as a thankyou. I can get the vehicle to spawn on server start but as soon as you get inside it is removed. From what i can see the vehicle has no ID so the DB has a fit and deletes it. Anyone got any ideas ? Cheers Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now