AGM
AGM copied to clipboard
Any chance to lock the fire mode after change weapons?
Well,think not only myself have this issue,thought would be BIS' fault.
Everytime you change weapon from another one, the weapon in your hand would back to semi-auto mode,and you have to change to auto mode youself.Even you 've set it to auto mode before change,it would back to semi-auto again and you have to set it to auto mode again.
Don't know if AGM could to something to let the weapons remain its fire mode after change from another one?It does,it would be very useful.
its a BIS fault
No way to fix ?
Proof of concept, works, but it's not great code.
I should scan though the weapon mode/muzzle configs and do it correctly, this just brute forces through all modes until it finds the last one used.
[] spawn {
_weapons = [];
_modes = [];
_lastWeapon = "";
waitUntil {
_curWeapon = currentWeapon AGM_player;
if (_curWeapon != _lastWeapon) then {
if (_curWeapon in _weapons) then {
//switch to last mode
_index = _weapons find _curWeapon;
_lastMode = _modes select _index;
_modeFound = false;
systemChat format ["switch to last mode %1", _lastMode];
for "_index" from 0 to 16 do {
AGM_player action ["SWITCHWEAPON", AGM_player, AGM_player, _index];
systemChat format ["Trying Index %1 - %2", _index, currentWeaponMode AGM_player];
if ((currentWeaponMode AGM_player) == _lastMode) exitWith {_modeFound = true};
};
if (!_modeFound) then {
AGM_player action ["SWITCHWEAPON", AGM_player, AGM_player, 0];
};
} else {
//create new entry
systemChat format ["create new entry" ];
_weapons pushBack _curWeapon;
_modes pushBack [];
};
_lastWeapon = _curWeapon;
};
_index = _weapons find _curWeapon;
systemChat format ["Index: %1", _index];
_modes set [_index, (currentWeaponMode AGM_player)];
sleep 1;
false;
};
};