-
Notifications
You must be signed in to change notification settings - Fork 150
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add buildingPos dummy object (#1138)
* add buildingPos dummy object * update model, editor group * CfgPatches and author config entry * delete animations * add objects to zeus * Change texture to `#(argb,8,8,3)color(0,0,0,0,co)` * add CBA_fnc_buildingPositions
- Loading branch information
Showing
7 changed files
with
96 additions
and
1 deletion.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
class CfgAddons { | ||
class PreloadAddons { | ||
class CBA { | ||
list[] = {QUOTE(ADDON)}; | ||
}; | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
#include "script_component.hpp" | ||
/* ---------------------------------------------------------------------------- | ||
Function: CBA_fnc_buildingPositions | ||
Description: | ||
Reports positions of the building including nearby custom building positions. | ||
Parameters: | ||
0: _building - The building. <OBJECT> | ||
1: _max - Maximum number of positions. (optional, default: all) <NUMBER> | ||
Example: | ||
(begin example) | ||
[_building, _maxNumberOfPositions] call CBA_fnc_buildingPositions | ||
(end) | ||
Returns: | ||
Available building positions including custom positions <ARRAY <PosAGL>> | ||
Author: | ||
commy2 | ||
---------------------------------------------------------------------------- */ | ||
|
||
params [["_building", objNull, [objNull]], ["_max", -1, [0]]]; | ||
|
||
private _availablePositions = _building buildingPos -1; | ||
|
||
// add nearby custom building positions | ||
(0 boundingBoxReal _building) params ["_pos1", "_pos2", "_diameter"]; | ||
_pos1 params ["_x1", "_y1", "_z1"]; | ||
_pos2 params ["_x2", "_y2", "_z2"]; | ||
|
||
private _polygonTop = [ | ||
[_x1, _y1, 0], | ||
[_x2, _y1, 0], | ||
[_x2, _y2, 0], | ||
[_x1, _y2, 0] | ||
]; | ||
|
||
private _polygonSide = [ | ||
[_x1, _z1, 0], | ||
[_x2, _z1, 0], | ||
[_x2, _z2, 0], | ||
[_x1, _z2, 0] | ||
]; | ||
|
||
private _customPositions = nearestObjects [_building, ["CBA_buildingPos"], _diameter, true] apply { | ||
_x buildingPos 0 | ||
} select { | ||
private _customPositionTop = _building worldToModel _x; | ||
private _customPositionSide = +_customPositionTop; | ||
_customPositionSide pushBack (_customPositionSide deleteAt 1); // swap y and z | ||
|
||
_customPositionTop inPolygon _polygonTop && _customPositionSide inPolygon _polygonSide | ||
}; | ||
|
||
_availablePositions append _customPositions; | ||
|
||
if (_max >= 0) then { | ||
_availablePositions resize (_max min count _availablePositions); | ||
}; | ||
|
||
_availablePositions |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters