ACE3 icon indicating copy to clipboard operation
ACE3 copied to clipboard

Common - Use gesture events to determine if player unit is reloading

Open LinkIsGrim opened this issue 3 years ago • 16 comments

When merged this pull request will:

  • Improve reload mutex by using new GestureX eventhandlers and weaponState command.
  • Close #8356.

LinkIsGrim avatar Sep 08 '21 12:09 LinkIsGrim

Maybe better to use weaponState's magazineReloadPhase value instead of isReloading var. Also if we ever need reload event magazineReloadPhase can be used in CBA player EH for it. Tag #8356.

Dystopian avatar Sep 08 '21 13:09 Dystopian

This breaks https://github.com/IDI-Systems/acre2/pull/1031 by removing ace_common_isReloading

veteran29 avatar Sep 08 '21 14:09 veteran29

Please don't force push changes, it makes it incredibly hard to review or update reviews based on latest changes.

jonpas avatar Sep 08 '21 15:09 jonpas

This breaks IDI-Systems/acre2#1031 by removing ace_common_isReloading

We can always update ACRE2 as well if this gets removed. I don't think it was considered public API anyway?

jonpas avatar Sep 12 '21 18:09 jonpas

Maybe better suited to CBA since it's used in both ACE and ACRE?

Cyruz143 avatar Oct 07 '21 14:10 Cyruz143

Commands are now available in current Arma patch.

LinkIsGrim avatar Dec 17 '21 10:12 LinkIsGrim

I haven't had issues reported on community testing with this, but I understand it's a bit sneakier with any bugs that might show up. Can I get another set of eyes on this?

LinkIsGrim avatar Mar 09 '22 04:03 LinkIsGrim

Not working for me, not sure if something changed in 2.08? Place "Heavy Gunner" in editor diag_log text format ["Gesture changed: %2 - %3", _unit, _gesture, (weaponState ACE_Player)];

Gesture changed: gesturereloadmmg02 - ["MMG_02_sand_RCO_LP_F","MMG_02_sand_RCO_LP_F","manual","130Rnd_338_Mag",130,0,0]
Gesture changed: aidlpercmstpsraswrfldnon_g01_player - ["MMG_02_sand_RCO_LP_F","MMG_02_sand_RCO_LP_F","manual","130Rnd_338_Mag",130,0,0]
Gesture changed: gesturereloadpistol - ["hgun_P07_F","hgun_P07_F","Single","16Rnd_9x21_Mag",17,0,0]

Reloading big gun and pistol both fail to trigger the mutex, it seems like weaponState # 6 is 0 at time the gesture event runs

PabstMirror avatar Mar 09 '22 05:03 PabstMirror

Back to WIP it is.

LinkIsGrim avatar Mar 09 '22 05:03 LinkIsGrim

weaponState is not viable for this (unless we use a PFH and just do GVAR(isReloading) = ((weaponState ACE_Player) select 6) > 0 constantly), so this is the best we can get if we want to drop the loadout event.

addUserActionEventHandler doesn't handle the scroll wheel or switching ammo, so that's out of the question too.

LinkIsGrim avatar Jul 08 '23 22:07 LinkIsGrim

Moved to 2.18 commands (getUnitMovesInfo)

LinkIsGrim avatar May 23 '24 20:05 LinkIsGrim

https://discord.com/channels/105462288051380224/108187245529268224/1244681061535973457

johnb432 avatar May 27 '24 18:05 johnb432

Need to test how the new EH works, gonna be a bit.

LinkIsGrim avatar May 28 '24 19:05 LinkIsGrim

discord.com/channels/105462288051380224/108187245529268224/1244681061535973457

Thanks, I hate it.

I'm just here to make more problems lol

hypoxia125 avatar May 30 '24 05:05 hypoxia125

If it works as advertised it'll be a more reliable solution. This PR already needs 2.18 anyway.

I just didn't want to rewrite again.

LinkIsGrim avatar May 30 '24 17:05 LinkIsGrim