Page MenuHomeFeedback Tracker

forceWeaponFire/fire-commands dosent work to lay mines
New, WishlistPublic

Description

Cant get the forceWeaponFire-command to make AI place mines using e.g (while unit having the mine).
unitname forceWeaponFire ["DirectionalMineRemoteMuzzle", "DirectionalMineRemoteMuzzle"];

Used before this code, but it stopped working around last fall:
unitname fire ["DirectionalMineRemoteMuzzle", "DirectionalMineRemoteMuzzle", "ClaymoreDirectionalMine_Remote_Mag"];

Details

Legacy ID
2977105428
Severity
None
Resolution
Open
Reproducibility
Always
Category
Scripting
Steps To Reproduce

REPROCODE = {
_unit = _this;
_mineT = "APERSBoundingMine_Range_Mag";
_unit addmagazine _mineT;
_timeee = 0;
while {!(_mineT in (magazines _unit)) && {count (magazines _unit) > 0} && {_timeee < 5}} do {_timeee = _timeee + 1;_unit removeMagazine ((magazines _unit) call BIS_fnc_selectRandom); _unit addmagazine _mineT;};
sleep 1;
_muzz = "BoundingMineRangeMuzzle";
_unit forceWeaponFire [_muzz, _muzz];
};

Place the code init.sqf and use for AI unit with unitname SPAWN REPROCODE;

Event Timeline

SaOk edited Steps To Reproduce. (Show Details)Jun 4 2014, 10:34 PM
SaOk edited Additional Information. (Show Details)
SaOk set Category to Scripting.
SaOk set Reproducibility to Always.
SaOk set Severity to None.
SaOk set Resolution to Open.
SaOk set Legacy ID to 2977105428.May 7 2016, 6:43 PM
Bohemia added a subscriber: AD2001.Jun 4 2014, 10:34 PM
SaOk added a subscriber: SaOk.May 7 2016, 6:43 PM
SaOk added a comment.Jun 5 2014, 12:09 AM

Thanks, added the
_unit playActionNow "PutDown";
_unit selectWeapon _muzz;
before the
unitname fire...
and working now, but seems like still sometimes failing. Strange that thought I tested with the _unit selectWeapon _muzz; already before but not then working. The playactionnow have some role? Strange stuff.

It probably forces ai unit to leave rest state.