Advertisement
netripper

Panthera Fix Bugged Bridges

Jul 19th, 2014
275
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.27 KB | None | 0 0
  1. //////////////////////////
  2. // Author: Veshai / netripper
  3. //////////////////////////
  4. // Metal bridges on Panthera are bugged. Only some vehicles can drive over them.
  5. // You cannot walk over them and a lot of other vehicles are bugged.
  6. //
  7. // This script searches the area of the given location for objects with a diameter
  8. // of 39 meters and assumes those are the original bridge objects. It then places
  9. // a properly working bridge on top of each of those objects.
  10. // Map objects are classless, hence the check using diameter.
  11. //
  12. // Might not result in the prettiest look, but it works and saves a lot of adminwork.
  13. //////////////////////////
  14.  
  15. if (!isServer) exitWith {};
  16.  
  17. fnc_pantheraBridgeFix = {
  18. private ["_box", "_diameter", "_pos", "_newpos", "_obj", "_up"];
  19. diag_log format["fnc_pantheraBridgeFix - Fixing bridge at %1", _this];
  20. _up = false;
  21. {
  22. if (typeOf _x == "") then {
  23. _box = boundingBox _x;
  24. _diameter = round ((_box select 0) distance (_box select 1));
  25. diag_log format["fnc_pantheraBridgeFix - Object with diameter of %1 meters", _diameter];
  26. if (_diameter == 39) then {
  27. diag_log format["fnc_pantheraBridgeFix - Found bridge at %1, direction: %2, up: %3", getposatl _x, direction _x, _up];
  28. _pos = getPosATL _x;
  29. if (_up) then {
  30. _newpos = [_pos select 0, _pos select 1, (_pos select 2) - 0.2 + 0.01];
  31. } else {
  32. _newpos = [_pos select 0, _pos select 1, (_pos select 2) - 0.2];
  33. };
  34. _obj = createVehicle ["MAP_bridge_asf1_25", _newpos, [], 0, "CAN_COLLIDE"];
  35. _obj setVectorUp [0,0,1];
  36. _obj setDir (getDir _x);
  37. _obj setPosATL _newpos;
  38. _up = !_up;
  39. //_x setDamage 1;
  40. };
  41. };
  42. true;
  43. } count nearestObjects[_this select 0, [], _this select 1];
  44. };
  45.  
  46. // Fixing panthera bridges
  47. //[position of original bridge, search distance]
  48. [[4724.19, 2152.75, 3.1], 40] call fnc_pantheraBridgeFix;
  49. [[4467.81, 2592.61, 7.5], 40] call fnc_pantheraBridgeFix;
  50. [[3343.18, 3394.55, 7.3], 40] call fnc_pantheraBridgeFix;
  51. [[8105.18, 4936.79, 6.7], 40] call fnc_pantheraBridgeFix;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement