Sandbird Posted October 27, 2014 Report Share Posted October 27, 2014 I am surprised noone else is bothered by this. It really bothered me that vehicles would spawn on top of each other when you buy a vehicle and another one is there. What does the fix do ? It will check if there is a safe location in a 60m radius to spawn the vehicle. If there is one, it will select it...otherwise worst case scenario, it reverts to the old location.. The fix is very easy. All you have to do is open \dayz_server\compile\server_publishVehicle2.sqf Find _uid = _worldspace call dayz_objectUID3; ABOVE it put : //Safe spawning of veh, not on top of eachother _position = _location findEmptyPosition [0,60,_class]; //60m radius if (count _position != 0) then { _safelocation = _position; }else{ //default spawner diag_log format["###### TRADER BUY VEH: NO SPACE, spawning dead center ######"]; _safelocation = _location; }; _worldspace = format["[%1,%2]", _dir,_safelocation]; _worldspace = call compile _worldspace; Find bellow: [_object,_uid,_characterID,_class,_dir,_location,_donotusekey,_activatingPlayer] spawn { In this array change _location to _safelocation. So it should look like: [_object,_uid,_characterID,_class,_dir, _safelocation,_donotusekey,_activatingPlayer] spawn { Dont forget to add "_position","_safelocation" at the top in the private array. What we did here: Insert the vehicle in the database with the new location Use the new location to spawn a vehicle If there is no available position withing 60m, then it will revert back to the old (on top of vehicles) position Sukkaed and Defent 2 Link to comment Share on other sites More sharing options...
lordgeorge Posted October 27, 2014 Report Share Posted October 27, 2014 I am surprised noone else is bothered by this. It really bothered me that vehicles would spawn on top of each other when you buy a vehicle and another one is there. What does the fix do ? It will check if there is a safe location in a 60m radius to spawn the vehicle. If there is one, it will select it...otherwise worst case scenario, it reverts to the old location.. The fix is very easy. All you have to do is open \dayz_server\compile\server_publishVehicle2.sqf Find _uid = _worldspace call dayz_objectUID3; Under it put : //Safe spawning of veh, not on top of eachother _position = _location findEmptyPosition [0,60,_class]; //60m radius...check if this vehicle can fit anywhere inside this area if (count _position != 0) then { _safelocation = _position; }else{ //default spawner diag_log format["###### TRADER BUY VEH: NO SPACE, spawning dead center ######"]; _safelocation = _location; }; _worldspace = format["[%1,%2]", _dir,_safelocation]; // Add the direction as well in the db cell Dont forget to add "_position","_safelocation" at the top in the private array. Very nice dude, that will come in handy :) I lowered the distance as i can imagine some players are going ot complain their vehilcle didnt spawn :P Many thanks Link to comment Share on other sites More sharing options...
Sandbird Posted October 27, 2014 Author Report Share Posted October 27, 2014 Yeah, it really depends on the map and how small is the trade area. I guess you could also send that value from the trade_any_vehicle.sqf file...so it depends on the trader. If its a big trader city,set it up to 40 or something, and if its a small one, to something less. This 'safe area' starts dead center in the helipad and expands to 60 right now...so plenty of space around it. I set it up high cause maybe you'll spawn 2-3 Chinooks...and they need space :P Link to comment Share on other sites More sharing options...
jahangir13 Posted October 27, 2014 Report Share Posted October 27, 2014 Maybe it makes sence if a new position (a bit further away) is needed, that the player gets an appropriate message. Link to comment Share on other sites More sharing options...
Sandbird Posted October 27, 2014 Author Report Share Posted October 27, 2014 Maybe it makes sence if a new position (a bit further away) is needed, that the player gets an appropriate message. I thought about that as well, but I didnt want to get into server->client message stuff cause i dont know what type of overwrites each person does. For example i am overwriting my trade_any_vehicle.sqf type of files, so i can do it...but maybe people use the default ones...or they dont know how to do it. This way its up to 'you' to do as you please. For example for my case i'll be changing the red arrow to something else...so it can be seen from where the player is...even if the 'supposed arrow' is behind a fence, but that's too technical for some people. Link to comment Share on other sites More sharing options...
Jey Posted October 27, 2014 Report Share Posted October 27, 2014 Woot, indeed easy fix and really nice. Btw, I have an epoch origins server and one of the two boat dealer is bugged: when buying from him the boats just fell in the water and then are moved a bit far away ( in the water or even on the ground). Any chance you know where is the handling code of that located? Or if anyone came accross this issue how did he solve it. Thx Link to comment Share on other sites More sharing options...
calamity Posted October 27, 2014 Report Share Posted October 27, 2014 thankz for this Sandbird..... Link to comment Share on other sites More sharing options...
FPGElliot Posted October 27, 2014 Report Share Posted October 27, 2014 It's good but, people should just move the vehicles xD (: Link to comment Share on other sites More sharing options...
MGT Posted October 27, 2014 Report Share Posted October 27, 2014 Nice Sandbird, nice! Link to comment Share on other sites More sharing options...
Sandbird Posted October 27, 2014 Author Report Share Posted October 27, 2014 It's good but, people should just move the vehicles xD (: Yeah but sometimes they dont...usually people tow the newly spawned vehicle to their base, forget to get in to update its location and then on restart...bam...the vehicle is in the helipad...blocking everything else. Btw i have to fix this as well....so you dont have to get in vehicle to update the location...also surprised this bug has been going on for ages now :P Link to comment Share on other sites More sharing options...
MGT Posted October 27, 2014 Report Share Posted October 27, 2014 Just tested it, doesn't work, bought 2 x mozzies they spawned on top of each other, then bought an Littlebird and it spawned on top of the mozzies. Link to comment Share on other sites More sharing options...
Sandbird Posted October 27, 2014 Author Report Share Posted October 27, 2014 Do you see ###### TRADER BUY VEH: NO SPACE, spawning dead center ###### in the log file ? Is _class defined a bit further up ? Is _worldspace value given to the SQL query bellow ? Are there any errors in the server's log file ? Try this for position, without the class. _position = _location findEmptyPosition [0,60]; Link to comment Share on other sites More sharing options...
MGT Posted October 27, 2014 Report Share Posted October 27, 2014 Do you see ###### TRADER BUY VEH: NO SPACE, spawning dead center ###### in the log file ? Is _class defined a bit further up ? Is _worldspace value given to the SQL query bellow ? Are there any errors in the server's log file ? Try this for position, without the class. _position = _location findEmptyPosition [0,60]; No to all of those, and ill test it on my dev server later and report back Link to comment Share on other sites More sharing options...
Sandbird Posted October 27, 2014 Author Report Share Posted October 27, 2014 oO no to class and the worldspace ? is your file a custome one ? mine too but I used the default .sqf file as a template to post this. Link to comment Share on other sites More sharing options...
MGT Posted October 27, 2014 Report Share Posted October 27, 2014 Some added weapons to AN2 and Littlebirds, but thats as far as customisation in that file goes. Link to comment Share on other sites More sharing options...
hansi Posted October 27, 2014 Report Share Posted October 27, 2014 Do you see ###### TRADER BUY VEH: NO SPACE, spawning dead center ###### in the log file ? Is _class defined a bit further up ? Is _worldspace value given to the SQL query bellow ? Are there any errors in the server's log file ? Try this for position, without the class. _position = _location findEmptyPosition [0,60]; hi, not working bought 3 SUV´s and they spawned on top of each other, no RPT errors or other entries cheers Link to comment Share on other sites More sharing options...
Sandbird Posted October 27, 2014 Author Report Share Posted October 27, 2014 hi, not working bought 3 SUV´s and they spawned on top of each other, no RPT errors or other entries cheers This is so weird, can you copy/paste here the 3 coordinates that are written for each vehicle in the database? Link to comment Share on other sites More sharing options...
hansi Posted October 27, 2014 Report Share Posted October 27, 2014 6252 1167111524070389 13 SUV_Camo_DZE4 2014-10-27 16:24:04 2014-10-27 16:31:11 8799 [289,[11671.1,15241.4,0]] [[[],[]],[[],[]],[[],[]]] [] 1 0 6253 1167111524070344 13 Lada1_DZE1 2014-10-27 16:24:28 2014-10-27 16:31:11 10858 [220,[11671.1,15247.7,0]] [[[],[]],[[],[]],[[],[]]] [] 1 0 6254 1167111524070349 13 Lada1_TK_CIV_EP1_DZE4 2014-10-27 16:25:52 2014-10-27 16:31:11 2206 [142,[11671.1,15247.7,0]] [[[],[]],[[],[]],[[],[]]] [] 1 0 6255 1167111524070342 13 Lada1_DZE1 2014-10-27 17:42:04 2014-10-27 17:42:15 6374 [288,[11674.2,15235.2,0]] [[[],[]],[[],[]],[[],[]]] [] 1 0 6256 11671115240701666 13 VWGolf_DZE1 2014-10-27 18:05:27 2014-10-27 18:05:27 7654 [209,[11674.2,15235.2,0]] [] [] 1 0 6252-6254 moved after restart cheers Link to comment Share on other sites More sharing options...
MG-Maximus Posted October 27, 2014 Report Share Posted October 27, 2014 Doesnt work for me either, even tried the without classs line :( Sorry i cant help out with the code.. Appreciate your attemp tho sandbird.. maybe its something little as you all know a comma can break a server XD Link to comment Share on other sites More sharing options...
Sandbird Posted October 27, 2014 Author Report Share Posted October 27, 2014 hmm ok, lets try something different.... Because from what i see dayz_objectUID3 depends on the _wordspace, i changed the function a bit.... Delete my fix first of all and put this: //Safe spawning of veh, not on top of eachother _position = _location findEmptyPosition [0,60,_class]; //60m radius if (count _position != 0) then { _safelocation = _position; }else{ //default spawner diag_log format["###### TRADER BUY VEH: NO SPACE, spawning dead center ######"]; _safelocation = _location; }; _worldspace = format["[%1,%2]", _dir,_safelocation]; _worldspace = call compile _worldspace; ABOVE line: _uid = _worldspace call dayz_objectUID3; Link to comment Share on other sites More sharing options...
hansi Posted October 27, 2014 Report Share Posted October 27, 2014 no the same problem 6257 116680152352067 13 MtvrRefuel_DZ 2014-10-27 18:23:08 2014-10-27 18:23:08 12246 [2,[11668,15235.2,0]] [] [] 1 0 6258 1166801523200340 13 V3S_Refuel_TK_GUE_EP1_DZ 2014-10-27 18:24:07 2014-10-27 18:24:07 10781 [217,[11668,15232,0]] [] [] 1 0 but now i have a error in RPT 18:24:06 File z\addons\dayz_server\compile\server_tradeObject.sqf, line 9 cheers Link to comment Share on other sites More sharing options...
MG-Maximus Posted October 27, 2014 Report Share Posted October 27, 2014 still not working for me :( . I have noticed that if u spawn 2 vehicles on top of each other and u shoot at them, one of them will move Link to comment Share on other sites More sharing options...
MG-Maximus Posted October 27, 2014 Report Share Posted October 27, 2014 or fly in the air... One thing to note tho is that i use config traders if that makes a difference? Link to comment Share on other sites More sharing options...
Sandbird Posted October 27, 2014 Author Report Share Posted October 27, 2014 OMG i am such an idiot....forgot one extra addition.....I am redoing the 1st post...refresh in 1 min. Link to comment Share on other sites More sharing options...
Tricks Posted November 5, 2014 Report Share Posted November 5, 2014 Is this working now? 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