-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add spawn destroyer module * Wait for the preplace mode to end in scheduled env * Replace dialog with preplace mode and draw lines * Fix arrow * Added USS Liberty icon * Add comments for the drawings * Set correct bounding box values * Adds drawArrow3D and drawRectangle3D
- Loading branch information
Showing
14 changed files
with
194 additions
and
11 deletions.
There are no files selected for viewing
Binary file added
BIN
+2.83 KB
@AresModAchillesExpansion/addons/data_f_achilles/icons/icon_liberty.paa
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
44 changes: 44 additions & 0 deletions
44
@AresModAchillesExpansion/addons/functions_f_achilles/functions/common/fn_drawArrow3D.sqf
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,44 @@ | ||
/* | ||
Author: Kex | ||
Description: | ||
Draws an arrow on the local machine | ||
Intended to be used within the code of an onEachFrame event handler | ||
Parameters: | ||
ARRAY - The base position of the arrow | ||
ARRAY - The direction vector | ||
ARRAY - The up vector | ||
SCALAR - (Default: DEFAULT_BASE_LENGTH) of the base | ||
SCALAR - (Default: DEFAULT_ARROW_LENGTH) Length of the arrow | ||
SCALAR - (Default: DEFAULT_ARROW_WIDTH) Width of the arrow | ||
ARRAY - (Default: DEFAULT_LINE_RGBA) The color of the lines based on RGBA | ||
Returns: | ||
Nothing | ||
*/ | ||
|
||
#define DEFAULT_BASE_LENGTH 30 | ||
#define DEFAULT_ARROW_LENGTH 10 | ||
#define DEFAULT_ARROW_WIDTH 20 | ||
#define DEFAULT_LINE_RGBA [1,1,0,1] | ||
|
||
params | ||
[ | ||
"_basePos", | ||
"_vecDir", | ||
"_vecUp", | ||
["_baseLength", DEFAULT_BASE_LENGTH, [0]], | ||
["_arrowLength", DEFAULT_ARROW_LENGTH, [0]], | ||
["_arrowWidth", DEFAULT_ARROW_WIDTH, [0]], | ||
["_rgba", DEFAULT_LINE_RGBA, [[]], 4] | ||
]; | ||
|
||
private _halfArrowWidth = _arrowWidth/2; | ||
private _baseMinusArrowLength = _baseLength - _arrowLength; | ||
// correct order for a right-handed coordinate system, where _vecDir is x, _vecPerp is y and _vecUp is z | ||
private _vecPerp = _vecUp vectorCrossProduct _vecDir; | ||
// draw projection of the bounding box on the model XY plane | ||
drawLine3D [_basePos, _basePos vectorAdd (_vecDir vectorMultiply _baseLength), _rgba]; | ||
drawLine3D [_basePos vectorAdd (_vecDir vectorMultiply _baseLength), _basePos vectorAdd (_vecDir vectorMultiply _baseMinusArrowLength) vectorAdd (_vecPerp vectorMultiply _halfArrowWidth), _rgba]; | ||
drawLine3D [_basePos vectorAdd (_vecDir vectorMultiply _baseLength), _basePos vectorAdd (_vecDir vectorMultiply _baseMinusArrowLength) vectorAdd (_vecPerp vectorMultiply -_halfArrowWidth), _rgba]; |
40 changes: 40 additions & 0 deletions
40
...sModAchillesExpansion/addons/functions_f_achilles/functions/common/fn_drawRectangle3D.sqf
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,40 @@ | ||
/* | ||
Author: Kex | ||
Description: | ||
Draws a rectangle on the local machine | ||
Intended to be used within the code of an onEachFrame event handler | ||
Parameters: | ||
ARRAY - The center position of the rectangle | ||
ARRAY - The direction vector | ||
ARRAY - The up vector | ||
SCALAR - The length of the rectangle in vector dir direction | ||
SCALAR - The length of the rectangle in the perpendicular direction | ||
ARRAY - (Default: DEFAULT_LINE_RGBA) The color of the lines based on RGBA | ||
Returns: | ||
Nothing | ||
*/ | ||
|
||
#define DEFAULT_LINE_RGBA [1,1,0,1] | ||
|
||
params | ||
[ | ||
"_centerPos", | ||
"_vecDir", | ||
"_vecUp", | ||
"_len_x", | ||
"_len_y", | ||
["_rgba", DEFAULT_LINE_RGBA, [[]], 4] | ||
]; | ||
|
||
private _half_len_x = _len_x/2; | ||
private _half_len_y = _len_y/2; | ||
// correct order for a right-handed coordinate system, where _vecDir is x, _vecPerp is y and _vecUp is z | ||
private _vecPerp = _vecUp vectorCrossProduct _vecDir; | ||
// draw projection of the bounding box on the model XY plane | ||
drawLine3D [_centerPos vectorAdd (_vecDir vectorMultiply _half_len_x) vectorAdd (_vecPerp vectorMultiply _half_len_y), _centerPos vectorAdd (_vecDir vectorMultiply _half_len_x) vectorAdd (_vecPerp vectorMultiply -_half_len_y), _rgba]; | ||
drawLine3D [_centerPos vectorAdd (_vecDir vectorMultiply -_half_len_x) vectorAdd (_vecPerp vectorMultiply _half_len_y), _centerPos vectorAdd (_vecDir vectorMultiply -_half_len_x) vectorAdd (_vecPerp vectorMultiply -_half_len_y), _rgba]; | ||
drawLine3D [_centerPos vectorAdd (_vecDir vectorMultiply _half_len_x) vectorAdd (_vecPerp vectorMultiply _half_len_y), _centerPos vectorAdd (_vecDir vectorMultiply -_half_len_x) vectorAdd (_vecPerp vectorMultiply _half_len_y), _rgba]; | ||
drawLine3D [_centerPos vectorAdd (_vecDir vectorMultiply _half_len_x) vectorAdd (_vecPerp vectorMultiply -_half_len_y), _centerPos vectorAdd (_vecDir vectorMultiply -_half_len_x) vectorAdd (_vecPerp vectorMultiply -_half_len_y), _rgba]; |
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
39 changes: 30 additions & 9 deletions
39
@AresModAchillesExpansion/addons/modules_f_achilles/Spawn/functions/fn_SpawnCarrier.sqf
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
47 changes: 47 additions & 0 deletions
47
@AresModAchillesExpansion/addons/modules_f_achilles/Spawn/functions/fn_SpawnDestroyer.sqf
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,47 @@ | ||
#include "\achilles\modules_f_ares\module_header.hpp" | ||
|
||
#define BOUNDING_BOX_LENGTH 222.22 | ||
#define BOUNDING_BOX_WIDTH 44.4438 | ||
|
||
// draw the location for the preplace mode | ||
[ | ||
"Achilles_id_drawBoatLocation", | ||
"onEachFrame", | ||
{ | ||
params ["_logic"]; | ||
// model position shifted by +5 m in Z direction in order to prevent intersections with the water surface | ||
private _pos = ASLToAGL getPosASL _logic vectorAdd [0,0,5]; | ||
// get basis vectors for the model XY plane | ||
private _vecDir = vectorDir _logic; | ||
_vecDir set [2, 0]; | ||
_vecDir = vectorNormalized _vecDir; | ||
// draw projection of the bounding box on the model XY plane | ||
[_pos, _vecDir, [0,0,1], BOUNDING_BOX_LENGTH, BOUNDING_BOX_WIDTH] call Achilles_fnc_drawRectangle3D; | ||
// draw an arrow for the heading on the model XY plane | ||
[_pos, _vecDir vectorMultiply -1, [0,0,1]] call Achilles_fnc_drawArrow3D; | ||
}, | ||
[_logic] | ||
] call BIS_fnc_addStackedEventHandler; | ||
|
||
// start preplace mode | ||
[_logic] call Achilles_fnc_PreplaceMode; | ||
|
||
// delete the drawings | ||
["Achilles_id_drawBoatLocation", "onEachFrame"] call BIS_fnc_removeStackedEventHandler; | ||
|
||
if (isNull _logic) exitWith {}; | ||
|
||
// spawn the acual boat | ||
[[getPosATL _logic, getDir _logic], | ||
{ | ||
params ["_posATL", "_dir"]; | ||
private _destroyer = createVehicle ["Land_Destroyer_01_base_F",[-300,-300,0],[],0,"CAN_COLLIDE"]; | ||
_destroyer setPosATL _posATL; | ||
_destroyer setVectorDirAndUp [[sin _dir, cos _dir, 0], [0,0,1]]; | ||
[_destroyer] remoteExecCall ["BIS_fnc_Destroyer01Init", 0, _destroyer]; | ||
{_x addCuratorEditableObjects [[_destroyer], false]} forEach allCurators; | ||
// delete old carrier parts | ||
{deleteVehicle _x} forEach (nearestObjects [[-300,-300,0], ["Land_Destroyer_01_Boat_Rack_01_Base_F","Land_Destroyer_01_hull_base_F","ShipFlag_US_F"], 300, true]); | ||
}, 2] call Achilles_fnc_spawn; | ||
|
||
#include "\achilles\modules_f_ares\module_footer.hpp" |
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.