KoffeinFlummi / AGM

Authentic Gameplay Modification for A3 | THIS PROJECT IS NO LONGER BEING WORKED ON. ALL ISSUES AND PULL REQUESTS WILL BE IGNORED.
Other
125 stars 84 forks source link

Bug Report: Hand Flares #2197

Open JamesTheClarke opened 9 years ago

JamesTheClarke commented 9 years ago

Issue description:

The hand flares cause an issue when cycling through grenades. Once the hand flare is reached during the cycle one won't be able to cycle any further through grenades. It is kinda stuck in place and one is forces to get rid of RGO grenades in order to reach smoke grenades.

commy2 commented 9 years ago

I can't reproduce that issue. As what Class did you spawn?

Possibly related to https://github.com/KoffeinFlummi/AGM/issues/2184

rlex commented 9 years ago

Btw, i have similar problem, but with different grenades (from AGM). I had 2x Fakel, probably, and 5x RGD from RHS. Can't cycle them. Will try to check.

JamesTheClarke commented 9 years ago

As far as I can tell it has to do with compatibility issue introcuded by elements of RHS in combination with AGM. Issue is persistent with various classes, although we use our own loadouts setup with F3 Framework (if you need I can list you the class names of all gear).

The handflares make cycling through grenades get stuck. Cycling without handflares makes the agm picture inaccurate, e.g. if you cycle through the small picture shows an RGO grenade but you end up throwing a smoke grenade or chem light. If need be I can provide screenshots of this.

I can confirm that several classes can throw one extra RGO grenade that they should have in the first place. Maybe that's what's making the picture cycling look "off" by one item.

milliwar commented 9 years ago

Arma 3 version: 1.40.129533 (stable branch)

No mods were active at the time of testing.

  1. Open editor, drop any unit. I used NATO rifleman (B_Soldier_F).
  2. Check unit inventory and see that he's got two RGO grenades (magazine class HandGrenade).
    • player ammo "HandGrenadeMuzzle" returns 1
    • "HandGrenade" in magazines player returns TRUE
  3. Open the debug console and run player removeMagazine "HandGrenade".
    • player ammo "HandGrenadeMuzzle" returns 0
    • "HandGrenade" in magazines player returns TRUE
    • There is still one RGO grenade in the unit's inventory, but it cannot be selected with the Cycle throwables key.
  4. Run player removeMagazine "HandGrenade" a second time.
    • player ammo "HandGrenadeMuzzle" returns 0
    • "HandGrenade" in magazines player returns FALSE
    • There are no RGO grenades in the unit's inventory.
  5. Run player addMagazine "HandGrenade".
    • player ammo "HandGrenadeMuzzle" returns 1
    • "HandGrenade" in magazines player returns TRUE
    • There is a single RGO grenade in the unit's inventory and it can be selected.
  6. Now that situation is "normal", run player addMagazine "HandGrenade".
    • player ammo "HandGrenadeMuzzle" returns 1
    • "HandGrenade" in magazines player returns TRUE
    • There is a single RGO grenade in the unit's inventory and it can be selected.
  7. Run player removeMagazines "HandGrenade" (NOTE removeMagazines).
    • player ammo "HandGrenadeMuzzle" returns 0
    • "HandGrenade" in magazines player returns FALSE
    • There are no RGO grenades in the unit's inventory.
  8. Run player addMagazine "HandGrenade" again.
    • player ammo "HandGrenadeMuzzle" returns 1
    • "HandGrenade" in magazines player returns TRUE
    • There are two RGO grenades in the unit's inventory, Arma's GUI displays their count correctly, and both can be selected and used.
commy2 commented 9 years ago

So basically "HandGrenade" in magazines player is broken, because the muzzle is loaded without having a grenade in the inventory. That's what I figured in my testings too.

This bug is also the reason for https://github.com/KoffeinFlummi/AGM/issues/2184 If you spawn with a unit set up to have a full inventory the grenade IS selectable. And the inventory displays it at 0. Reason seems to be that the spare barrel takes away so much space. Therefore #2184 should be reproducable even without grenade select, by starting the game with agm_overheating, but without agm_weaponselect.

commy2 commented 9 years ago

I don't see how that connects to Handflares though, yet.

milliwar commented 9 years ago

I don't think the handflares are an issue. I can easily reproduce the issue described by @JamesTheClarke by using removeMagazines and addMagazine with at least all RHS's Russian grenades. AGM's grenade hint goes out of sync and RHS's RGD grenades become unselectable.

I should have stated this in my previous comment, but I figured it was clear the issue was reproducible even without AGM and RHS. Unless I've missed something, it seems that removeMagazines works differently (i.e. breaks the inventory and AGM's grenade hint) than calling removeMagazine multiple times.

milliwar commented 9 years ago

Cycling without handflares makes the agm picture inaccurate, e.g. if you cycle through the small picture shows an RGO grenade but you end up throwing a smoke grenade or chem light.

The way I interpreted this decription was that cycling grenades does not get stuck, it goes out of sync. If this is an incorrect interpretation, my previous comment is probably incorrect.

commy2 commented 9 years ago

Hmm. I missed that.

We neither use removeMagazine, nor removeMagazines, but removeItem. Maybe it has the same issue.

https://github.com/KoffeinFlummi/AGM/blob/master/AGM_WeaponSelect/functions/fn_setNextGrenadeMuzzle.sqf#L67-L100

I still think the underlying issue is the broken, inaccessable magazine in the throw muzzle though.

bux commented 9 years ago

https://community.bistudio.com/wiki/removeMagazine

Note: You may create invalid combinations with this function. When doing so, application behaviour is undefined.

The same goes for removeMagazines