-
Notifications
You must be signed in to change notification settings - Fork 740
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
Pike - Laser guided 40mm grenade #6731
Conversation
How did you test? |
Want to keep this around @PabstMirror? |
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.
Grammar/spelling fixes, spacing, and "Deffered" should be "Deferred".
// 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 |
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.
onFiredDeferred is just a copy of ace_missileguidance_fnc_onFired with slight changes to start and end
so I'd really like to just keep it unchanged
to make it easy as possible to migrate it to the missile guidance rework PR
[ _shooter, | ||
[_target, _targetPos, _launchPos], | ||
_seekerType, | ||
_attackProfile, | ||
_lockMode, | ||
_laserInfo | ||
], | ||
[ | ||
getNumber ( _config >> "minDeflection" ), | ||
getNumber ( _config >> "maxDeflection" ), | ||
getNumber ( _config >> "incDeflection" ) | ||
], | ||
[ | ||
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" ) | |
], | |
[ | |
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" ) | |
], | |
[ | |
getNumber ( _config >> "seekerAngle" ), | |
getNumber ( _config >> "seekerAccuracy" ), | |
getNumber ( _config >> "seekerMaxRange" ), | |
getNumber ( _config >> "seekerMinRange" ) | |
], | |
[diag_tickTime, [], [], _lastKnownPosState] | |
]; |
if ((getNumber (configFile >> "CfgAmmo" >> _ammo >> QUOTE(ADDON) >> "enabled")) != 2) exitWith { ERROR("not enabled=2"); [] }; | ||
|
||
// MissileGuidance is enabled for this shot | ||
TRACE_4("enabled",_shooter,_ammo,_projectile,typeOf _shooter); | ||
|
||
private _config = configFile >> "CfgAmmo" >> _ammo >> QUOTE(ADDON); | ||
|
||
private _target = _shooter getVariable [QGVAR(target), nil]; | ||
private _targetPos = _shooter getVariable [QGVAR(targetPosition), nil]; | ||
private _seekerType = _shooter getVariable [QGVAR(seekerType), nil]; | ||
private _attackProfile = _shooter getVariable [QGVAR(attackProfile), nil]; | ||
if ((getNumber (configFile >> "CfgAmmo" >> _ammo >> QUOTE(ADDON) >> "useModeForAttackProfile")) == 1) 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 ((getNumber (configFile >> "CfgAmmo" >> _ammo >> QUOTE(ADDON) >> "enabled")) != 2) exitWith { ERROR("not enabled=2"); [] }; | |
// MissileGuidance is enabled for this shot | |
TRACE_4("enabled",_shooter,_ammo,_projectile,typeOf _shooter); | |
private _config = configFile >> "CfgAmmo" >> _ammo >> QUOTE(ADDON); | |
private _target = _shooter getVariable [QGVAR(target), nil]; | |
private _targetPos = _shooter getVariable [QGVAR(targetPosition), nil]; | |
private _seekerType = _shooter getVariable [QGVAR(seekerType), nil]; | |
private _attackProfile = _shooter getVariable [QGVAR(attackProfile), nil]; | |
if ((getNumber (configFile >> "CfgAmmo" >> _ammo >> QUOTE(ADDON) >> "useModeForAttackProfile")) == 1) then { | |
private _config = configFile >> "CfgAmmo" >> _ammo >> QUOTE(ADDON); | |
if ((getNumber (_config >> "enabled")) != 2) exitWith { ERROR("not enabled=2"); [] }; | |
// MissileGuidance is enabled for this shot | |
TRACE_4("enabled",_shooter,_ammo,_projectile,typeOf _shooter); | |
private _target = _shooter getVariable [QGVAR(target), nil]; | |
private _targetPos = _shooter getVariable [QGVAR(targetPosition), nil]; | |
private _seekerType = _shooter getVariable [QGVAR(seekerType), nil]; | |
private _attackProfile = _shooter getVariable [QGVAR(attackProfile), nil]; | |
if ((getNumber (_config >> "useModeForAttackProfile")) == 1) then { |
* Args <Array> | ||
* | ||
* Example: | ||
* [player, "", "", "", "ACE_Javelin_FGM148", "", theMissile] call ace_missileguidance_fnc_onFiredDeffered |
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.
All instances of Deffered
should be Deferred
to be correct English.
// 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 + nil check is more expensive than the nil check alone ? The check is on a separate var as well.
if (_seekLastTargetPos && {!isNil "_target"}) then { | |
if (_seekLastTargetPos && !isNil "_target") then { |
Co-authored-by: Jouni Järvinen <[email protected]>
Co-authored-by: Jouni Järvinen <[email protected]>
https://en.wikipedia.org/wiki/Pike_(munition)
As far as I could tell, grenade launchers couldn't fire missiles, so I have to do the scripted ammo swap.
Model isn't great, but should be fine for the amount of time it's seen.
Still not positive on the flight characteristics, it should have a 2000m range
I'm not sure how to balance initial muzzle velocity, rocket impluse and burn time.
I also might adjust the attack profile to give it more of a ballistic arc