SHARE
TWEET

Untitled

a guest Dec 2nd, 2019 90 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. systemChat "Game Init";
  2.  
  3. if (!isServer) exitWith {};
  4.  
  5. private ["_dummy","_dummyClassName","_carrierPartPos"];
  6.  
  7. _carrierParts = [
  8.     ["OPTRE_engine_left","EngL",0],
  9.     ["OPTRE_engine_right","EngR",0],
  10.     ["OPTRE_tail","Tail",0],
  11.     ["OPTRE_center","Centre",0],
  12.     ["OPTRE_center_nose","NoseCentre",0],
  13.     ["OPTRE_nose","Nose",0],
  14.     ["OPTRE_bridge","bridge",0],
  15.     ["OPTRE_slipdrive","slipdrive",180],
  16.     ["OPTRE_airlock_door","airlock1",90],
  17.     ["OPTRE_airlock_door","airlock2",90]
  18. ];
  19.  
  20. _shipBase = param [0, objNull];
  21.  
  22. {deleteVehicle _x; } forEach (_shipBase getVariable ["OPTRE_DrakeParts",[]]);
  23.  
  24. _shipBasePos = getposATL _shipBase;
  25. _carrierDir = getdir _shipBase;
  26. _carrierPos = getposATL _shipBase;
  27.  
  28. //private _carrierPitchBank = _shipBase call bis_fnc_getPitchBank;
  29. //_carrierPitchBank params [["_carrierPitch",0],["_carrierBank",0]]; // Does not work due to engines carrier must be flat.
  30.  
  31. _parts = [];
  32. {
  33.  
  34.     _dummy = createVehicle [(_x select 0), [0,0,0], [], _carrierDir, "CAN_COLLIDE"];
  35.     _dummy setDir (_carrierDir + (_x select 0));
  36.    
  37.     _carrierPartPos = _shipBase modelToWorldWorld (_shipBase selectionPosition (_x select 1));
  38.     _dummy setPosWorld _carrierPartPos;
  39.    
  40.     //[_dummy, _carrierPitch, _carrierBank] call bis_fnc_setPitchBank; // Does not work due to engines carrier must be flat.
  41.    
  42.     _parts pushBack _dummy;
  43.    
  44. } foreach _carrierParts;
  45.  
  46. from 0 to 112 do {
  47.  
  48.     if (_i < 10) then { // Numbers Bellow 10 need a 0 added to the name.
  49.         _memPointName = format ["Component0%1",_i];
  50.     } else { // Numbers above 9 do not.
  51.         _memPointName = format ["Component%1",_i];
  52.     };
  53.  
  54.     _dummy = createVehicle ["OPTRE_hallway_door_a", [0,0,0], [], _carrierDir, "CAN_COLLIDE"];
  55.     _dummy setDir _carrierDir;
  56.  
  57.     _carrierPartPos = _shipBase modelToWorldWorld (_shipBase selectionPosition _memPointName);
  58.     _dummy setPosWorld _carrierPartPos;
  59.  
  60.     _parts pushBack _dummy;
  61.  
  62. };
  63.  
  64. _shipBase setVariable ["OPTRE_DrakeParts", _parts, true];
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top