Jump to content

Static Vehicle Spawn Positions


Judge Bread

Recommended Posts

Are u even using this script? This script lets u place vehicles of a specific type in a specific spot. If the server needs to spawn a dynamic vehicle it checks this list first then if available it spawns it at that location if not it moves on to something else random. Sounds like u might be looking to have a database event instead however that will check for a vehicle with the id u designate and if that vehicle is destroyed delete and respawn it. I can give u an SQL event later when I am at the computer if u like

Link to comment
Share on other sites

create a database event that runs daily with something like this... will create a vehicle at that location every restart just change the ori_dc3 to whatever u want and the [1,[22687.3,19239.3,0]] to wherever u want it spawned at.

 

this will delete the vehicle every restart as well however... so no loot will be able to be saved in it

DELETE FROM `object_data` WHERE `ObjectUID` = '0000500000431';
INSERT INTO `object_data` VALUES (NULL, '0000500000431', '13', 'ori_dc3', NOW(), NOW(),'0', '[1,[22687.3,19239.3,0]]', '[]', '[]', '0.3', '0.05');

you could change the delete statement to only delete it if the vehicle is destroyed...

 

DELETE FROM `object_data` WHERE `ObjectUID` = '0000500000431' AND 'Damage' like '%1.0%';
Link to comment
Share on other sites

 

create a database event that runs daily with something like this... will create a vehicle at that location every restart just change the ori_dc3 to whatever u want and the [1,[22687.3,19239.3,0]] to wherever u want it spawned at.

 

this will delete the vehicle every restart as well however... so no loot will be able to be saved in it

DELETE FROM `object_data` WHERE `ObjectUID` = '0000500000431';
INSERT INTO `object_data` VALUES (NULL, '0000500000431', '13', 'ori_dc3', NOW(), NOW(),'0', '[1,[22687.3,19239.3,0]]', '[]', '[]', '0.3', '0.05');

you could change the delete statement to only delete it if the vehicle is destroyed...

DELETE FROM `object_data` WHERE `ObjectUID` = '0000500000431' AND 'Damage' like '%1.0%';

Cheers dude, now sure that will do quite what i need, nice to keep that aside for future use  :)

I have tested this script but no custom vehicle spawn appears.

I have tested the script by popping some faulty code in and it throws up a fit. :P so i know its being called.

The vehicle just never appears.

No errrors, any ideas ?

 

Cheers

Link to comment
Share on other sites

This script only spawns a vehicle in that location if:

1) max vehicles > current vehicles on server

2) max of that vehicle type in dynamic_vehicle file has not been exceeded

Yes i could see that it will only spawn it basically as a dynamic static. There was some errors popping in my server RPT's. Took it out for the moment.

When i have the time i will post the errors.

 

Cheers

Link to comment
Share on other sites

  • 3 weeks later...

Looking for some assistance with this script. I'm running a dedicated server using the Napf map which unfortunately places planes in places where they cannot take off. I created the custom locations for the C130s in FS_StaticVehicleSpawnLocations.sqf

/*---------------------------------


Author: frodster / Judge Bread
Version: 1.0
Description:
Configurations for static vehicle spawning.

-- How To --
1. Add to or edit an existing location array or create your own.

2. If a new location array is required -
a) Use a unique name to avoid conflicts.
b) Add an entry to the StaticVehicleSpawnConfig in the format -
   ["VehicleClass", "LocationArrayName"]
Ensure your LocationArrayName is exactly the same as the name of your newly created location array (copy paste it to be sure).
E.g. ["C130J_US_EP1","C130JSpawnLocations"]

-- Note --
1. Locations provided below are for Taviana and they have not been tested with other maps (and hence are commented out). Please use your own set of coordinates that you know will work.
2. Coordinates can be in [x,y] format or [x,y,z] format. Only values used for vehicle spawning are x and y.
---------------------------------*/

/****    LOCATION CONFIGURATIONS START    ****/

// All land vehicles
LandSpawnLocations = [
];

// All Air vehicles
AirSpawnLocations = [
    //[16590,11435.5,0.001],                    // Dubovo Airfield
    //[8553.17,19658.6,0.001],        // North Kameni field
    //[13849.3,19445.4,0.001]            // Khotanovsk
];

// All Sea/Ship vehicles
SeaSpawnLocations = [
];

// Specific C130J_US_EP1 spawn locations.
C130JSpawnLocations = [
    [14468.9,17081.6,0],    // NW end North East Airfield
    [16748.6,18776.7,0],    // Surefeld Island
    [3930.01,4314.07,0],    // S end of South West Airfield
    [12349.9,9656.32,0],    // Liestal
    [7161.7,13601.9,0],        // Kleine Egg
    [6752.52,15622.9,0],    // Seltisberg
    [6060.92,13323.1,0],    // Neue Welt
    [4054.7,14243.1,0],        // Bubendorf
    [1972.95,11111.4,0],    // Hindelbank
    [2566.53,10429.7,0],    // Ittingen
    [4269.85,6950.69,0],    // SE of Worb
    [4955.81,6146.06,0],    // NW of Buckten
    [5890.62,5731.84,0],    // E of Buckten
    [6022.37,8232.43,0],    // S of Signau
    [6658.38,10795.3,0],    // E of Muttenz
    [7162.08,12928.3,0],    // Cholholtz
    [8261.61,13976.2,0],    // E of Trueb
    [8634.73,14601.2,0],    // Treubsal
    [10481.9,15161.1,0],    // Ruemlingen
    [15038.5,13949.9,0]        // Luzern
];

// 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)
];

/****    LOCATION CONFIGURATIONS END    ****/

My problem is that once I package this into my server pbo, myself and players attempting to connect are stuck at waiting to authenticate and cannot move onward. There are no errors listed in the rpt.

 

Suggestions? Thanks!

Link to comment
Share on other sites

This does not work for me I get an error in the RPT:

 

15:54:55 File z\addons\dayz_server\FS_SpawnVehicles\FS_StaticVehicleSpawnLocations.sqf, line 91
15:54:55 "Res3tting B!S effects..."
15:54:55 "Static Vehicle Spawn: ERROR: StaticVehicleSpawnConfig missing. Please check the Locations file."
15:54:55 Error in expression <
private ["_name","_found"];
_name = _x select 1;
_found = false;
{	
private ["_>
15:54:55   Error position: <select 1;
_found = false;
{	
private ["_>
15:54:55   Error select: Type String, expected Array,Config entry
15:54:55 File z\addons\dayz_server\FS_SpawnVehicles\FS_SpawnVehicles.sqf, line 380
Link to comment
Share on other sites

This code will spawn 2 vehicles at the nwaf, edit it to your liking and BOOM vehicles spawn in the same position each restart.

 

Vroom vroom.

 

 

if (isServer) then {
private ["_object","_uniqueid"];

_vehicle_9998 = objNull;
if (true) then
{
  _this = createVehicle ["MH6J_DZ", [4828.4443, 9768.4717], [], 0, "CAN_COLLIDE"];
  _vehicle_9998 = _this;
  _this setDir -210.79807;
  _this setPos [4828.4443, 9768.4717];
  _object setVariable ["MalSar",1,true];
  _uniqueid = str(round(random 999999));
  _object setVariable ["ObjectID", _uniqueid, true];
  _object setVariable ["ObjectUID", _uniqueid, true];
};

_vehicle_9999 = objNull;
if (true) then
{
  _this = createVehicle ["SUV_TK_CIV_EP1", [4819.5127, 9761.2656, 3.0517578e-005], [], 0, "CAN_COLLIDE"];
  _vehicle_9999 = _this;
  _this setDir -208.42464;
  _this setPos [4819.5127, 9761.2656, 3.0517578e-005];
  _object setVariable ["MalSar",1,true];
  _uniqueid = str(round(random 999999));
  _object setVariable ["ObjectID", _uniqueid, true];
  _object setVariable ["ObjectUID", _uniqueid, true];
};

};

Link to comment
Share on other sites

  • 1 month later...

 

_nil = [] execVM "\z\addo>

 0:32:05   Error Undefined variable in expression: _handle
 0:32:05 File mpmissions\__cur_mp.Tavi\init.sqf, line 105
 0:32:05 Error in expression <pawnCompiles.sqf";
waitUntil{scriptDone _handle};
};
 
 
_nil = [] execVM "\z\addo>
 0:32:05   Error position: <_handle};
};

 

Someone help?

Link to comment
Share on other sites

  • 3 weeks later...

Hey guys trying to get this to work, I am getting this error in my RPT:

22:32:05   Error Undefined variable in expression: _handle
22:32:05 File mpmissions\dayz_epoch_11.Chernarus\init.sqf, line 98
22:32:05 Error in expression <pawnCompiles.sqf";
waitUntil{scriptDone _handle};
};
_nil = [] execVM "\z\addons>

 

Here is my init.sqf part:

 

if (isServer) then {
	call compile preprocessFileLineNumbers "\z\addons\dayz_server\missions\DayZ_Epoch_11.Chernarus\dynamic_vehicle.sqf";
    if (true) then {
        private "_handle";
        _handle = [] execVM "\z\addons\dayz_server\Scripts\FS_SpawnVehicles\FS_StaticVehicleSpawnCompiles.sqf";
        waitUntil{scriptDone _handle};
    };
	_nil = [] execVM "\z\addons\dayz_server\missions\DayZ_Epoch_11.Chernarus\mission.sqf";
	_serverMonitor = 	[] execVM "Functions\server_monitor.sqf";
};
 

 

I am not sure what this error means....  :blink:

Link to comment
Share on other sites

  • 1 month later...

First thanks a lot for sharing this Judge Bread!

This is exactly what i'm searching for..

 

the vehicles are spawning fine at my custom locations, but not saving to the hive...my object_data stays empty :/

Do you have an idea what  may has gone wrong here?

There are no errors in hiveExt or server log..

Link to comment
Share on other sites

  • 3 months later...

Great script.   I'm using it on Epoch 1.0.5.1, Overwatch 0.2.5, Origins 1.7.9.5 (Overpochins) but had to make one change.... I was getting the error 

 

20:22:30 Error in expression <s select _index;
_itemType = _itemTypes select _index;
_veh addMagazineCargoGlob>
20:22:30   Error position: <select _index;
_veh addMagazineCargoGlob>
20:22:30   Error Zero divisor
20:22:30 File z\addons\dayz_server\FS_SpawnVehicles\FS_SpawnVehicles.sqf, line 320
20:22:30 Error in expression <s select _index;
_itemType = _itemTypes select _index;
_veh addMagazineCargoGlob>

 

in my aram2oaserver.rpt.  By commenting out line 321 in FS_SpawnVehicles.sqf (_veh addMagazineCargoGlobal [_itemType,1];), it now runs error free.  Is there something else that should be fixed so that it can run without that line commented out?  I'm guessing that it is preventing loot from spawning in vehicles.

 

Thanks,

Bob

Link to comment
Share on other sites

  • 2 weeks later...

I'm noticing that most of the vehicles are clustered around the larger cities on the larger island.   Almost no vehicles are spawning on the smaller island.  This has happened multiple times since I've been emptying the objects table to see if the spawn distribution changes.   It doesn't appear to change much.  

 

Recently, I've reduced my max vehicles to 200.  The count in dymanic_vehicles.sqf total to 372 (147 unique vehicles).  Could it be because I have too big a delta between max vehicles and the total in dymanic_vehicles.sqf?  What is the relationship between the two?  Does the dynamic_vehicles count always have to be larger than the max vehicles?  If the numbers are closer together, will I get a more even spawning of vehicles across the map?  Or is it possible to use a randomization function to select the next spawn location?  It almost looks like it just goes down the list and if it hits the max vehicles before it runs out of coords, the coords in the lower part of the list will never receive spawned vehicles.  Seems like random location selections from the list would be more appropriate.

 

Update... in looking at the distribution of vehicles on the map, it looked like it wasn't using the entire map area.  In comparing with one of my older server configurations, I modified dayz_MapArea from the default of 10000 to 20000.  I also notice that the dayz_minpos and dayz_maxpos are both 26000 so I'm thinking that I could set dayz_MapArea to 26000, too.  I'm going to give it a try.

Link to comment
Share on other sites

  • 2 weeks later...

Anyone have a spawn list for DayZ Epoch Origins?

 

 

 

 

Thank you.

here are the origins vehicles.... should be all of them

 

["ori_ZAZ968M",5],
["ori_taviander",5],
["ori_buchanka",5],
["ori_m3",5],
["ori_maniac",5],
["ori_KaTransp",5],
["ori_ScrapRaft"5],
["CH53_DZE",5],
["ori_submarine",5], 
["sigisolda1",5], 
["sigisolda1",5], 
["sigisolda1",5],
["ORI_gunship_helicopter",5], 
["ori_pragaCopter_yellow",5], 
["vil_ori_autogyro",5], 
["ori_poldek_black",5], 
["ori_vil_lada_2105_rust",5], 
["ori_transit",5], 
["ori_originsmod_pickupoldfuel",5], 
["ori_vil_originsmod_lublin_truck",5], 
["ori_excavator",5], 
["ori_vil_originsmod_truck_civ",5], 
["ori_poldek_black",5], 
["ori_survivorBus",5], 
["SUV_MG_Ori",5], 
["ori_ScrapBuggy",5], 
["ori_rth_originsmod_bathmobile",5], 
["ori_dc3",5], 
["ori_p85_originsmod_cucv_pickup",5],
["rth_scrapapc",5],
["rth_scrapbuggy",5],
["rth_scrapbus",5],
["rth_amphicar",5],
["rth_raft_small",5],
["rth_raft",5],
["rth_copter_yellow",5],
["rth_copter_green",5]

 

or do you mean the weapon /loot spawns ?

Link to comment
Share on other sites

  • 7 months later...

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement
  • Discord

×
×
  • Create New...