Page MenuHomeFeedback Tracker

addweapon command with sidearms makes AI unable to holster sidearm
New, WishlistPublic

Description

Using addWeapon script command on an AI, only giving a sidearm, makes the unit unable to react to behaviour mods: safe and careless, the unit keeps it's sidearm in it's hand

I tried to give the unit a primary weapon and remove it right after, using the units Init field, or using sqs and sqf to create unit with the same Init field and it worked fine, but simply gearing up makes unit unable to holster all the way(init field, sqs or sqf.)
Using trigger or delayed script to remove the gun later, not in Init field still leads to the same bad result.

If you take an existing unit with sidearm(NATO Officer for example), and put into it's init field the command to remove it's primary weapon has a good result, AI holsters fine.

Details

Legacy ID
730230731
Severity
None
Resolution
Open
Reproducibility
Always
Operating System
Windows 7
Category
AI Issues
Steps To Reproduce

1st:
Put together a unit in the Virtual Arsenal, having only a sidearm and export it.

2nd:
Create a unit in editor, paste the exported script into the unit's Init field, and create a waypoint with "safe" or "careless" behaviour modes selected, or put the "setbehaviour" command into Init field for it.

3rd:
Run the mission and see the unit keeping his gun in hand

4th: (Solution)
Add commands to unit's Init field: this addweapon ""; this removeweapon primaryweapon this;
Now the unit should spawn unarmed, sidearm being in it's holster.

Additional Information

I'm running the Dev build, but I remember having this issue in the stable version too.

My first idea was it's reason is one of the mods, but tested vanilla too.

I wanted to create a random gear selecting script to make police officers have random loadout and look, but this bug makes them look stupid.

Edit:
Found a command on forums to solve this problem for me:
_unit action ['SwitchWeapon', _unit, _unit, 100];};
But I think it should work by itself.

Event Timeline

BRicsi01 edited Steps To Reproduce. (Show Details)Jan 8 2016, 9:46 PM
BRicsi01 edited Additional Information. (Show Details)
BRicsi01 set Category to AI Issues.
BRicsi01 set Reproducibility to Always.
BRicsi01 set Severity to None.
BRicsi01 set Resolution to Open.
BRicsi01 set Legacy ID to 730230731.May 8 2016, 1:27 PM
BRicsi01 updated the task description. (Show Details)Jul 4 2016, 11:51 PM
BRicsi01 edited Steps To Reproduce. (Show Details)
BRicsi01 edited Additional Information. (Show Details)
BRicsi01 set Operating System to Windows 7.
BRicsi01 edited Additional Information. (Show Details)Nov 15 2016, 8:29 PM