ACE3
ACE3 copied to clipboard
Common - Use gesture events to determine if player unit is reloading
When merged this pull request will:
- Improve reload mutex by using new GestureX eventhandlers and weaponState command.
- Close #8356.
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.
This breaks https://github.com/IDI-Systems/acre2/pull/1031 by removing ace_common_isReloading
Please don't force push changes, it makes it incredibly hard to review or update reviews based on latest changes.
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?
Maybe better suited to CBA since it's used in both ACE and ACRE?
Commands are now available in current Arma patch.
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?
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
Back to WIP it is.
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.
Moved to 2.18 commands (getUnitMovesInfo)
https://discord.com/channels/105462288051380224/108187245529268224/1244681061535973457
Need to test how the new EH works, gonna be a bit.
discord.com/channels/105462288051380224/108187245529268224/1244681061535973457
Thanks, I hate it.
I'm just here to make more problems lol
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.