mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Moved getTurretDirection to common.
Tweak creation of action (fucking actions?!) :( :( :(
This commit is contained in:
parent
c83e602028
commit
596854a264
@ -92,6 +92,7 @@ PREP(getTurretIndex);
|
|||||||
PREP(getTurrets);
|
PREP(getTurrets);
|
||||||
PREP(getTurretsFFV);
|
PREP(getTurretsFFV);
|
||||||
PREP(getTurretsOther);
|
PREP(getTurretsOther);
|
||||||
|
PREP(getTurretDirection);
|
||||||
PREP(getUavControlPosition);
|
PREP(getUavControlPosition);
|
||||||
PREP(getVehicleCargo);
|
PREP(getVehicleCargo);
|
||||||
PREP(getVehicleCodriver);
|
PREP(getVehicleCodriver);
|
||||||
|
37
addons/common/functions/fnc_getTurretDirection.sqf
Normal file
37
addons/common/functions/fnc_getTurretDirection.sqf
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
/*
|
||||||
|
* Author: jaynus
|
||||||
|
*
|
||||||
|
* Get the absolute turret direction for FOV/PIP turret.
|
||||||
|
*
|
||||||
|
* Argument:
|
||||||
|
* 0: Vehicle (Object)
|
||||||
|
* 1: Turret Position
|
||||||
|
*
|
||||||
|
* Return value:
|
||||||
|
* [position, direction]
|
||||||
|
*/
|
||||||
|
#include "script_component.hpp"
|
||||||
|
|
||||||
|
EXPLODE_2_PVT(_this,_vehicle,_position);
|
||||||
|
private ["_turrets", "_turret", "_config", "_turret", "_povPos", "_povDir", "_gunBeginPos", "_gunEndPos", "_pov"];
|
||||||
|
|
||||||
|
_turret = [_vehicle, _position] call CBA_fnc_getTurret;
|
||||||
|
_pov = getText (_turret >> "memoryPointGunnerOptics");
|
||||||
|
_gunBeg = getText (_turret >> "gunBeg");
|
||||||
|
_gunEnd = getText (_turret >> "gunEnd");
|
||||||
|
TRACE_3("", _pov, _gunBeg, _gunEnd);
|
||||||
|
|
||||||
|
// Pull the PIP pov or barrel direction, depending on how the model is set up
|
||||||
|
_povPos = ATLtoASL ( _vehicle modelToWorld (_vehicle selectionPosition _pov ) );
|
||||||
|
_povDir = [0,0,0];
|
||||||
|
|
||||||
|
if(_pov == "pip0_pos") then {
|
||||||
|
_pipDir = ATLtoASL ( _vehicle modelToWorld (_vehicle selectionPosition "pip0_dir" ) );
|
||||||
|
_povDir = [_povPos, _pipDir] call BIS_fnc_vectorDiff;
|
||||||
|
} else {
|
||||||
|
_gunBeginPos = ATLtoASL ( _vehicle modelToWorld (_vehicle selectionPosition _gunBeg ) );
|
||||||
|
_gunEndPos = ATLtoASL ( _vehicle modelToWorld (_vehicle selectionPosition _gunEnd ) );
|
||||||
|
_povDir = [_gunEndPos, _gunBeginPos] call BIS_fnc_vectorDiff;
|
||||||
|
};
|
||||||
|
|
||||||
|
[_povPos, _povDir]
|
@ -13,7 +13,7 @@ class Extended_PostInit_EventHandlers {
|
|||||||
class Extended_GetIn_EventHandlers {
|
class Extended_GetIn_EventHandlers {
|
||||||
class B_Heli_Attack_01_F {
|
class B_Heli_Attack_01_F {
|
||||||
class ADDON {
|
class ADDON {
|
||||||
getIn = QUOTE(_this call FUNC(onGetin));
|
clientGetIn = QUOTE(_this call FUNC(onGetIn));
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
@ -21,7 +21,7 @@ class Extended_GetIn_EventHandlers {
|
|||||||
class Extended_GetOut_EventHandlers {
|
class Extended_GetOut_EventHandlers {
|
||||||
class B_Heli_Attack_01_F {
|
class B_Heli_Attack_01_F {
|
||||||
class ADDON {
|
class ADDON {
|
||||||
getOut = QUOTE(_this call FUNC(onGetout));
|
clientGetOut = QUOTE(_this call FUNC(onGetOut));
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
@ -33,26 +33,9 @@ FUNC(laserHudDesignatePFH) = {
|
|||||||
|
|
||||||
// Retrieve the gunner and turret memory point information
|
// Retrieve the gunner and turret memory point information
|
||||||
_gunnerInfo = [_vehicle, _weapon] call CBA_fnc_getFirer;
|
_gunnerInfo = [_vehicle, _weapon] call CBA_fnc_getFirer;
|
||||||
|
_turretInfo = [_vehicle, _gunnerInfo select 1] call EFUNC(common,getTurretDirection);
|
||||||
_turret = [_vehicle, _gunnerInfo select 1] call CBA_fnc_getTurret;
|
_povPos = _turretInfo select 0;
|
||||||
_pov = getText (_turret >> "memoryPointGunnerOptics");
|
_povDir = _turretInfo select 1;
|
||||||
_gunBeg = getText (_turret >> "gunBeg");
|
|
||||||
_gunEnd = getText (_turret >> "gunEnd");
|
|
||||||
TRACE_3("", _pov, _gunBeg, _gunEnd);
|
|
||||||
|
|
||||||
// Pull the PIP pov or barrel direction, depending on how the model is set up
|
|
||||||
_povPos = ATLtoASL ( _vehicle modelToWorld (_vehicle selectionPosition _pov ) );
|
|
||||||
_povDir = [0,0,0];
|
|
||||||
if(_pov == "pip0_pos") then {
|
|
||||||
_pipDir = ATLtoASL ( _vehicle modelToWorld (_vehicle selectionPosition "pip0_dir" ) );
|
|
||||||
_povDir = [_povPos, _pipDir] call BIS_fnc_vectorDiff;
|
|
||||||
} else {
|
|
||||||
_gunBeginPos = ATLtoASL ( _vehicle modelToWorld (_vehicle selectionPosition _gunBeg ) );
|
|
||||||
_gunEndPos = ATLtoASL ( _vehicle modelToWorld (_vehicle selectionPosition _gunEnd ) );
|
|
||||||
_povDir = [_gunEndPos, _gunBeginPos] call BIS_fnc_vectorDiff;
|
|
||||||
};
|
|
||||||
|
|
||||||
TRACE_4("", _povDir, _povPos, _gunBeginPos, _gunEndPos);
|
|
||||||
|
|
||||||
_result = [_povPos, _povDir] call EFUNC(laser,shootCone);
|
_result = [_povPos, _povDir] call EFUNC(laser,shootCone);
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#define DEBUG_MODE_FULL
|
//#define DEBUG_MODE_FULL
|
||||||
#include "script_component.hpp"
|
#include "script_component.hpp"
|
||||||
// TODO: we should do this differently eventually
|
// TODO: we should do this differently eventually
|
||||||
private["_onActionId", "_offActionId"];
|
private["_onActionId", "_offActionId"];
|
||||||
|
Loading…
Reference in New Issue
Block a user