• Tracker

    Spaces
    Browse
    Statistics
  • /
  • /General
  • /A3G-112
Back
1

[Bug] fire and doTarget commands malfunctioning with Underbarrel Grenade Launchers (UGL)

AI
1

State

Open
Issue key
A3G-112
Access
Public
Space
Arma 3
Project
General
Creator
soldierxxxx
Created
Oct 6, 2026
Views
5
Issue Type
Bug/Error
Section
Game Version
2.22 (Current Stable)
Was this also present in the previous version?
Yes, it was already present
Severity
It would be nice to fix this
Section
Operating System
Windows
Windows
Windows Version
Windows 10
Description

Description

There are two distinct critical issues when forcing an AI unit to use an Underbarrel Grenade Launcher (UGL) via scripting commands (fire and doTarget):

1. fire command (Double Consumption): The command consumes two rounds instead of one. It fires/consumes the round specified in the script, but simultaneously discharges and consumes whatever round is currently loaded in the UGL muzzle.

2. doTarget command (Targeting Failure): The command completely fails if non-lethal ammunition (e.g., Flares) is currently loaded in the UGL.

I've intentionally simplified the code used in the mission, to not clutter the script with other unnecessary functions.

For this test script works for units that have "EGLM" underbarrel launcher.

I'm attaching the test mission and also a video of the issue, so you can see what's happening.

Thanks for looking into this case.
====================================

Steps to reproduce
1) Unpack the mission from .rar and put it in profile missions

2) Open the attached mission in 3DEN and hit play

3) Observe the debug informations above each unit

4) Observe the behaviour of the unit targeting

5) Optionally check the code in init.sqf and read the notes in the mission editor

====================================

Detailed description of unit behaviour

A test mission was conducted using three AI units with different magazine configurations and behaviors.

Script in the mission makes all units fire twice. You can then observe the behavior of the commands.

Unit 1: Reloads UGL to Flares via script before firing

- 1st Shot (Flare loaded in UGL):

Ammo Consumption: Two Flare rounds are consumed (incorrect), Zero HE rounds consumed (correct).

Targeting: Unit DOES NOT target the object due to doTarget failing with non-lethal ammo active.

Visuals: The flare is visually fired but immediately hits the ground because targeting failed.

- 2nd Shot (Unit loaded an HE round in the meantime):

Ammo Consumption: One Flare round consumed (correct), One HE round consumed (incorrect).

Targeting: Unit targets correctly because lethal ammunition (HE) is now loaded.

Visuals: The flare is visually fired directly at the target (correct trajectory).

Unit 2: Has Flares added, does not manually change round in UGL

- 1st Shot (HE loaded in UGL):

Ammo Consumption: One Flare round consumed (correct), One HE round consumed (incorrect).

Targeting: Unit targets correctly (lethal HE is currently loaded).

Visuals: Flare is visually fired at the target (correct trajectory).

- 2nd Shot (Unit loaded another HE round in the meantime):

Ammo Consumption: One Flare round consumed (correct), One HE round consumed (incorrect).

Targeting: Unit targets correctly (lethal HE is loaded).

Visuals: Flare is visually fired at the target (correct trajectory).

Unit 3: Only 1x HE round in UGL (All other magazines removed via Arsenal)

- 1st Shot (HE loaded in UGL):

Ammo Consumption: Zero Flare rounds (correct), One HE round consumed (correct).

Targeting: Unit targets correctly.

Visuals: HE round is fired instead of the requested Flare. Note: Acceptable fallback behavior since requested ammo is missing.

- 2nd Shot (Completely out of ammo):

Ammo Consumption: No ammo consumed (correct).

Targeting & Visuals: Unit targets correctly, nothing is fired (correct).

====================================

Additional Observations & Technical Context

- Magazine Switching: When the script executes the fire command, the AI unit switches its currentMagazine to Flares (the requested ammunition) for a split second, even if an HE round was previously loaded.

- Targeting and Ammo Lethality Relationship:

If a unit runs out of HE rounds but still has Flares, executing the script causes doTarget to fail immediately. The flare ends up in the ground (matching Unit 1's first shot). This occurs whenever a Flare is loaded as the currentMagazine.

If an HE round is loaded as the currentMagazine, targeting works perfectly - even if it is an empty/spent round.

- Minor Engine Bug (magazinesAmmoFull): When includeEmpty is set to FALSE, the command ignores fired UGL rounds. A spent shell sitting in the chamber is still returned by this command. (Low priority, can be filtered via script).

- The issue might be present with all secondary muzzles, not just UGLs (not tested).

- When forceWeaponFire is used instead of fire, currently loaded round is fired and consumed, but cannot be used to fire flares as doTarget fails regardless. That's why currently fire must be used instead for AI to at least partially do what I want.

====================================

Expected Behavior

1. Targeting (doTarget): AI units must successfully lock onto objects via doTarget regardless of the ammunition type (lethal vs. non-lethal/flares/smokes) currently loaded or active in the UGL.

2. Ammo Economy (fire): The fire command should strictly consume exactly one round (the one specified in the command syntax). It should not force-discharge or double-consume the currently chambered round.

3. Optional: AI units should ideally not fire at all if they do not possess the specific ammunition requested by the fire command.

Video of the issue:
https://youtu.be/iVTl-dbqua0

Attachment1 file · visible to everyone

Test_UGL_Flares_VR.rar

4.7 KB

Reactions

Activity

    about 10 hours ago
  • soldierxxxx
    created issueabout 10 hours ago

You are not signed in. Please sign in to see more details and to reply.

State

Open
Issue key
A3G-112
Access
Public
Space
Arma 3
Project
General
Creator
soldierxxxx
Created
Oct 6, 2026
Views
5