Skip to content
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

Merged
merged 44 commits into from
Jan 13, 2025
Merged

Pike - Laser guided 40mm grenade #6731

merged 44 commits into from
Jan 13, 2025

Conversation

PabstMirror
Copy link
Contributor

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

@PabstMirror PabstMirror added the kind/enhancement Release Notes: **IMPROVED:** label Dec 14, 2018
@PabstMirror PabstMirror added this to the Ongoing milestone Dec 14, 2018
@dedmen
Copy link
Contributor

dedmen commented Dec 14, 2018

As far as I could tell, grenade launchers couldn't fire missiles

How did you test?

@PabstMirror
Copy link
Contributor Author

Changing ammo = QGVAR(ammo_rocket);
When loading the GL into the weapon it swaps to the rocket launcher animation, even though I have the rifle still selected. currentWeapon player = "arifle_MX_GL_ACO_F"

20181214113031_1

It's kinda funny because you can still fire like this (it goes straight up)

@jonpas
Copy link
Member

jonpas commented Sep 11, 2023

Want to keep this around @PabstMirror?

@PabstMirror PabstMirror added kind/feature Release Notes: **ADDED:** and removed kind/enhancement Release Notes: **IMPROVED:** labels Oct 15, 2023
@PabstMirror PabstMirror changed the title WIP: Pike - (laser guided 40mm grenade) Pike - (laser guided 40mm grenade) Oct 15, 2023
@PabstMirror PabstMirror changed the title Pike - (laser guided 40mm grenade) Pike - laser guided 40mm grenade Oct 15, 2023
Copy link
Contributor

@rautamiekka rautamiekka left a 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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// 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

Copy link
Contributor Author

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

Comment on lines 87 to 106
[ _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]
];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
[ _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]
];

addons/pike/CfgAmmo.hpp Outdated Show resolved Hide resolved
Comment on lines 23 to 34
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 {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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
Copy link
Contributor

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 {
Copy link
Contributor

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.

Suggested change
if (_seekLastTargetPos && {!isNil "_target"}) then {
if (_seekLastTargetPos && !isNil "_target") then {

addons/pike/functions/fnc_ammoFired.sqf Outdated Show resolved Hide resolved
addons/pike/functions/fnc_ammoFired.sqf Outdated Show resolved Hide resolved
@LinkIsGrim LinkIsGrim modified the milestones: Ongoing, 3.18.2 Jan 13, 2025
@LinkIsGrim LinkIsGrim changed the title Pike - laser guided 40mm grenade Pike - Laser guided 40mm grenade Jan 13, 2025
@LinkIsGrim LinkIsGrim merged commit 5c6b7c1 into master Jan 13, 2025
7 checks passed
@LinkIsGrim LinkIsGrim deleted the pike branch January 13, 2025 21:08
PlayerBotPro pushed a commit to PlayerBotPro/ACE3 that referenced this pull request Jan 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature Release Notes: **ADDED:**
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants