Advertisement
BobTheHunted

Untitled

Jul 25th, 2018
285
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
SQF 2.53 KB | None | 0 0
  1. // nul = [Radius, [Object Type]] call BTH_fnc_ObjectToEditorMission
  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, []] call BTH_fnc_ObjectToEditorMission;
  5.  
  6. // Mission friendly version, markers for objects that can't be created in the editor:
  7. // Sphere = Fences and walls
  8. // Green Arrow = Trees and Bushes
  9. // Blue arrow = Rocks
  10. // Cyan arrow = Objects with parent "HIDE"
  11.  
  12. _SearchPosition = screenToWorld [0.5,0.5];
  13. _SearchRadius = _this select 0;
  14. _ObjectType = _this select 1;
  15.  
  16. _TerrainObjects = nearestTerrainObjects [_SearchPosition, _ObjectType, _SearchRadius, false, false];
  17. _TerrainWalls = nearestTerrainObjects [_SearchPosition, ["FENCE","WALL"], _SearchRadius, false, false];
  18. _TerrainTrees = nearestTerrainObjects [_SearchPosition, ["TREE","SMALL TREE","BUSH"], _SearchRadius, false, false];
  19. _TerrainRocks = nearestTerrainObjects [_SearchPosition, ["ROCK","ROCKS"], _SearchRadius, false, false];
  20. _TerrainHides = nearestTerrainObjects [_SearchPosition, ["HIDE"], _SearchRadius, false, false];
  21.  
  22. {
  23.     _type = typeOf _x;
  24.     _pos = ASLToAGL getPosASL _x;
  25.     _dir = getDir _x;
  26.     _obj = create3DENEntity ["Object",_type,_pos,true];
  27.     set3DENAttributes [[[_obj],"Rotation",[0,0,_dir]]];
  28.     set3DENAttributes [[[_obj],"Position",_pos]];
  29. } forEach _TerrainObjects;
  30.  
  31. sleep 1;
  32.  
  33. {
  34.     _typeW = "Sign_Sphere100cm_F";
  35.     _posW = ASLToAGL getPosASL _x;
  36.     _dirW = getDir _x;
  37.     _objW = create3DENEntity ["Object",_typeW,_posW,true];
  38.     set3DENAttributes [[[_objW],"Rotation",[0,0,_dirW]]];
  39.     set3DENAttributes [[[_objW],"Position",_posW]];
  40. } forEach _TerrainWalls;
  41.  
  42. sleep 1;
  43.  
  44. {
  45.     _typeT = "Sign_Arrow_Large_Green_F";
  46.     _posT = ASLToAGL getPosASL _x;
  47.     _dirT = getDir _x;
  48.     _objT = create3DENEntity ["Object",_typeT,_posT,true];
  49.     set3DENAttributes [[[_objT],"Rotation",[0,0,_dirT]]];
  50.     set3DENAttributes [[[_objT],"Position",_posT]];
  51. } forEach _TerrainTrees;
  52.  
  53. sleep 1;
  54.  
  55. {
  56.     _typeR = "Sign_Arrow_Blue_F";
  57.     _posR = ASLToAGL getPosASL _x;
  58.     _dirR = getDir _x;
  59.     _objR = create3DENEntity ["Object",_typeR,_posR,true];
  60.     set3DENAttributes [[[_objR],"Rotation",[0,0,_dirR]]];
  61.     set3DENAttributes [[[_objR],"Position",_posR]];
  62. } forEach _TerrainRocks;
  63.  
  64. sleep 1;
  65.  
  66. {
  67.     _typeH = "Sign_Arrow_Cyan_F";
  68.     _posH = ASLToAGL getPosASL _x;
  69.     _dirH = getDir _x;
  70.     _objH = create3DENEntity ["Object",_typeH,_posH,true];
  71.     set3DENAttributes [[[_objH],"Rotation",[0,0,_dirH]]];
  72.     set3DENAttributes [[[_objH],"Position",_posH]];
  73. } forEach _TerrainHides;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement