Advertisement
BobTheHunted

Arma 3 Convert Terrain Objects into 3DEN Objects

Sep 1st, 2017
382
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
SQF 1.12 KB | None | 0 0
  1. // nul = [Radius, Object Type] execVM "ObjectToEditor.sqf";
  2. // Radius: Number - Determines how far to search for terrain objects
  3. // Object Type: Array - Determines what type of objects to search for, use [] for all objects
  4. // Example: nul = [25, []] execVM "ObjectToEditor.sqf";
  5.  
  6. _SearchPosition = screenToWorld [0.5,0.5];
  7. _SearchRadius = _this select 0;
  8. _ObjectType = _this select 1;
  9.  
  10. _TerrainObjects = nearestTerrainObjects [_SearchPosition, _ObjectType, _SearchRadius, false, false];
  11. _TerrainWalls = nearestTerrainObjects [_SearchPosition, ["WALL"], _SearchRadius, false, false];
  12.  
  13. {
  14.     _type = typeOf _x;
  15.     _pos = ASLToAGL getPosASL _x;
  16.     _dir = getDir _x;
  17.     _obj = create3DENEntity ["Object",_type,_pos,true];
  18.     set3DENAttributes [[[_obj],"Rotation",[0,0,_dir]]];
  19.     set3DENAttributes [[[_obj],"Position",_pos]];
  20. } forEach _TerrainObjects;
  21.  
  22. sleep 1;
  23.  
  24. {
  25.     _typeW = "Sign_Sphere200cm_F";
  26.     _posW = ASLToAGL getPosASL _x;
  27.     _dirW = getDir _x;
  28.     _objW = create3DENEntity ["Object",_typeW,_posW,true];
  29.     set3DENAttributes [[[_objW],"Rotation",[0,0,_dirW]]];
  30.     set3DENAttributes [[[_objW],"Position",_posW]];
  31. } forEach _TerrainWalls;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement