-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinit.sqf
67 lines (52 loc) · 1.75 KB
/
init.sqf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
private _radius = 2;
private _misplacedObjects = [];
private _blacklistedObjects = ["flush_light_yellow_f.p3d", "obstacle_saddle_f.p3d"];
private _world = worldName;
private _size = worldSize;
_roads = [_size / 2, _size / 2] nearRoads _size;
private _getObjectHeight = {
params ["_object"];
private _bbr = boundingBoxReal _object;
private _p1 = _bbr select 0;
private _p2 = _bbr select 1;
private _maxHeight = abs ((_p2 select 2) - (_p1 select 2));
_maxHeight;
};
{
private _road = _x;
private _position = position _road;
private _objects = (nearestObjects [_position, [], _radius]) - _roads;
{
private _object = _x;
private _objectInfo = getModelInfo _object;
private _objectFile = _objectInfo select 0;
private _isBlacklistedObject = _objectFile in _blacklistedObjects;
if (!_isBlacklistedObject) then {
_misplacedObjects pushBackUnique _x;
};
} forEach _objects;
} forEach _roads;
_cam = "camera" camCreate (position player);
_cam cameraEffect ["INTERNAL", "BACK"];
showCinemaBorder false;
{
private _object = _x;
private _objectInfo = getModelInfo _object;
private _objectFile = _objectInfo select 0;
private _objectHeight = [_object] call _getObjectHeight;
private _position = position _object;
private _marker = createMarker [str _object, _position];
_marker setMarkerShape "ICON";
_marker setMarkerType "hd_dot";
_cam camSetTarget _object;
_cam camSetRelPos [0, 0, _objectHeight + 20];
_cam camCommit 0;
private _text = format ["Object: %1\nPosition: %2", _objectFile, _position];
titleText [_text, "PLAIN"];
sleep 1;
private _filename = format ["%1\%2_%3.png", _world, _position select 0, _position select 1];
screenshot _filename;
sleep 1;
} forEach _misplacedObjects;
_cam cameraEffect ["terminate","back"];
camDestroy _cam;