-
Notifications
You must be signed in to change notification settings - Fork 737
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Missile Guidance - Add Copperhead M712 #8210
base: master
Are you sure you want to change the base?
Conversation
Co-authored-by: Jouni Järvinen <[email protected]>
Absolutely, where is the PR!? 😂 |
// If we didn't get a target, try to fall back on tab locking | ||
if (isNil "_target") then { | ||
if (!isPlayer _shooter) then { | ||
// This was an AI shot, lets still guide it on the AI target |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// This was an AI shot, lets still guide it on the AI target | |
// This was an AI shot, let's still guide it on the AI target |
// Array for seek last target position | ||
private _seekLastTargetPos = (getNumber ( _config >> "seekLastTargetPos")) == 1; | ||
private _lastKnownPosState = [_seekLastTargetPos]; | ||
if (_seekLastTargetPos && {!isNil "_target"}) then { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Surely the lazy eval doesn't save anything with such a cheap check (on another var, no less) ?
if (_seekLastTargetPos && {!isNil "_target"}) then { | |
if (_seekLastTargetPos && !isNil "_target") then { |
[ _shooter, | ||
[_target, _targetPos, _launchPos], | ||
_seekerType, | ||
_attackProfile, | ||
_lockMode, | ||
_laserInfo | ||
], | ||
[ | ||
getNumber ( _config >> "minDeflection" ), | ||
getNumber ( _config >> "maxDeflection" ), | ||
getNumber ( _config >> "incDeflection" ), // not used? | ||
1 == getNumber ( _config >> "useVanillaDeflection" ) | ||
], | ||
[ | ||
getNumber ( _config >> "seekerAngle" ), | ||
getNumber ( _config >> "seekerAccuracy" ), | ||
getNumber ( _config >> "seekerMaxRange" ), | ||
getNumber ( _config >> "seekerMinRange" ) | ||
], | ||
[ diag_tickTime, [], [], _lastKnownPosState ] | ||
]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[ _shooter, | |
[_target, _targetPos, _launchPos], | |
_seekerType, | |
_attackProfile, | |
_lockMode, | |
_laserInfo | |
], | |
[ | |
getNumber ( _config >> "minDeflection" ), | |
getNumber ( _config >> "maxDeflection" ), | |
getNumber ( _config >> "incDeflection" ), // not used? | |
1 == getNumber ( _config >> "useVanillaDeflection" ) | |
], | |
[ | |
getNumber ( _config >> "seekerAngle" ), | |
getNumber ( _config >> "seekerAccuracy" ), | |
getNumber ( _config >> "seekerMaxRange" ), | |
getNumber ( _config >> "seekerMinRange" ) | |
], | |
[ diag_tickTime, [], [], _lastKnownPosState ] | |
]; | |
[ _shooter, | |
[_target, _targetPos, _launchPos], | |
_seekerType, | |
_attackProfile, | |
_lockMode, | |
_laserInfo | |
], | |
[ | |
getNumber ( _config >> "minDeflection" ), | |
getNumber ( _config >> "maxDeflection" ), | |
getNumber ( _config >> "incDeflection" ), // not used? | |
1 == getNumber ( _config >> "useVanillaDeflection" ) | |
], | |
[ | |
getNumber ( _config >> "seekerAngle" ), | |
getNumber ( _config >> "seekerAccuracy" ), | |
getNumber ( _config >> "seekerMaxRange" ), | |
getNumber ( _config >> "seekerMinRange" ) | |
], | |
[ diag_tickTime, [], [], _lastKnownPosState ] | |
]; |
private _vehicle = _display getVariable "vehicle"; | ||
private _settings = _display getVariable "settings"; | ||
TRACE_3("Unload",_exitCode,_vehicle,_settings); | ||
if ((!alive _vehicle) || {_settings isEqualTo []}) exitWith { ERROR_2("unloaded with bad input %1-%2",_vehicle,_settings); }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Surely the lazy eval doesn't save anything with such a cheap check ?
if ((!alive _vehicle) || {_settings isEqualTo []}) exitWith { ERROR_2("unloaded with bad input %1-%2",_vehicle,_settings); }; | |
if ((!alive _vehicle) || _settings isEqualTo []) exitWith { ERROR_2("unloaded with bad input %1-%2",_vehicle,_settings); }; |
&& {alive _vehicle} | ||
&& { | ||
private _hasCopperheadAmmo = false; | ||
{ | ||
_x params ["_xMag", "_xTurret", "_xAmmo"]; | ||
if ((_xTurret isEqualTo [0]) && {_xAmmo > 0} && {_xMag == "ace_1rnd_155mm_m712"}) exitWith { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Surely the lazy eval don't save anything with such cheap checks ?
&& {alive _vehicle} | |
&& { | |
private _hasCopperheadAmmo = false; | |
{ | |
_x params ["_xMag", "_xTurret", "_xAmmo"]; | |
if ((_xTurret isEqualTo [0]) && {_xAmmo > 0} && {_xMag == "ace_1rnd_155mm_m712"}) exitWith { | |
&& alive _vehicle | |
&& { | |
private _hasCopperheadAmmo = false; | |
{ | |
_x params ["_xMag", "_xTurret", "_xAmmo"]; | |
if ((_xTurret isEqualTo [0]) && _xAmmo > 0 && {_xMag == "ace_1rnd_155mm_m712"}) exitWith { |
if (_seekerTargetPos isEqualTo [0,0,0]) then { | ||
// no target | ||
_aimASL = _projectilePos vectorAdd _projectileVelocity; | ||
if (_isFalling && {!_trajectoryBallistic}) then { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Surely the lazy eval doesn't save anything with such a cheap check ?
if (_isFalling && {!_trajectoryBallistic}) then { | |
if (_isFalling && !_trajectoryBallistic) then { |
addons/clgp/XEH_postInit.sqf
Outdated
["turret", { | ||
params ["_player", "_turret"]; | ||
private _veh = vehicle _player; | ||
if (currentWeapon _veh == "mortar_155mm_AMOS") then { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (currentWeapon _veh == "mortar_155mm_AMOS") then { | |
if (currentWeapon _veh isEqualTo "mortar_155mm_AMOS") then { |
If currentWeapon
always returns the correct casing.
addons/clgp/XEH_postInit.sqf
Outdated
TRACE_3("turret",_player,_turret,typeOf vehicle _player); | ||
if (_turret isNotEqualTo [0]) exitWith {}; | ||
private _vehicle = vehicle _player; | ||
if ((!alive _player) || {!alive _vehicle} || {_vehicle getVariable [QGVAR(copperhead_actionHandled), false]}) exitWith { TRACE_1("exit",_vehicle); }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Surely the lazy eval doesn't save anything with such a cheap check ?
if ((!alive _player) || {!alive _vehicle} || {_vehicle getVariable [QGVAR(copperhead_actionHandled), false]}) exitWith { TRACE_1("exit",_vehicle); }; | |
if ((!alive _player) || !alive _vehicle || {_vehicle getVariable [QGVAR(copperhead_actionHandled), false]}) exitWith { TRACE_1("exit",_vehicle); }; |
// Changing path without active feedback causes problems on current missile guidance | ||
// probably due to poor vector change in ace_missileguidance_fnc_guidancePFH, disable for now | ||
private _trajectoryShaped = false; | ||
// private _trajectoryShaped = _trajectorySetting >= 3; // 1-2 is ballisitic, 3-8 is shaped |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// private _trajectoryShaped = _trajectorySetting >= 3; // 1-2 is ballisitic, 3-8 is shaped | |
// private _trajectoryShaped = _trajectorySetting >= 3; // 1-2 is ballistic, 3-8 is shaped |
@@ -0,0 +1,12 @@ | |||
#define COMPONENT clgp | |||
#define COMPONENT_BEAUTIFIED Cannon Launched Guided Projectiles |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#define COMPONENT_BEAUTIFIED Cannon Launched Guided Projectiles | |
#define COMPONENT_BEAUTIFIED Cannon-Launched Guided Projectiles |
Laser guided artillery round
Adds capability to missile guidance:
setMissileTargetPos
ToDo:
Hoping to use some of this as a basis for more clgp/gravity bombs