-
Notifications
You must be signed in to change notification settings - Fork 735
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
Conversation
Co-authored-by: Jouni Järvinen <[email protected]>
Absolutely, where is the PR!? 😂 |
// 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); }; |
addons/missile_clgp/CfgAmmo.hpp
Outdated
class ace_missileguidance { | ||
enabled = 2; | ||
minDeflection = 0.001; // Minium flap deflection for guidance | ||
maxDeflection = 0.001; // Maximum flap deflection for guidance |
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.
update for MG changes, eg:
pitchRate = 15; // replace minDeflection, maxDeflection, incDeflection
yawRate = 15;
defaultNavigationType = "Direct";
navigationTypes[] = { "Direct" };
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.
preferably put this guidance config into CfgMissileTypesNato.hpp
, but yeah this is required
addons/missile_clgp/CfgAmmo.hpp
Outdated
class ace_missileguidance { | ||
enabled = 2; | ||
minDeflection = 0.001; // Minium flap deflection for guidance | ||
maxDeflection = 0.001; // Maximum flap deflection for guidance |
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.
preferably put this guidance config into CfgMissileTypesNato.hpp
, but yeah this is required
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.
g2g, tested a previous version and guidance worked well. probably affected by #10715 but that will require a MG change, not relevant to this PR
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