TakeMagazine subtracts magazine from backpack but does not add to units inventory
|Affected ArmA II version:||1.60 BETA||First affected build:||Please Specify...|
|Reproduced by another DH user:||No||First affected ArmA II version:||1.60 BETA|
|I am using some Mods:||No||Single / Multi Player?:|
|I am using:||CO (OA+A2)||BIForumURL:|
|Reproducible for you:||Yes||NGUrl:|
|Related to content of DLC:||WIKIurl:|
Sometimes, takeMagazine will subtract the magazine from the cargo unit (in the repro, a backpack) but does not add it to the unit's inventory.
unit should receive magazine (in the repro, an NLAW missile) every time.
Please see attached mission
_Unit 2 (F2) has 2 NLAW missiles in his inventory. UNit 3 (F3 has a bcakpack with 2 NLAW missiles. An addEventHandler "fired" is attached to unit 2 and will check when he fires his NLAW for ammunition in his inventory. If there is no ammunition, he will look for ammunition in crates (and backpacks) within 50 m.
If found, he will move near the crate/backpack and use takeMagazine to obtain 1 NLAW missile._
1 - Load mission in editor (Utes)
2 - Order unit 2 to engage one of the BMP's. He will fire an NLAW and reload.
3 - Order him to fire at another BMP. His ammunition will be exhausted. (You can watch the script run and look for missiles in the chat window).
4 - He will move over to unit 3 and perform the 'gear' animation
5 - Check unit 2's ammo (press M and then look in his inventory) An NLAW missile should be in there, but most of the time it is not.
6 - Check unit 3's backpack. The NLAW should be removed.
7 - If unit 2 has reloaded correctly, then engage another BMP, then check his inventory after the script runs. The error will most likely have occurred.
I've checked the code in the script and it's clean - no errors or mistakes. (I hope)
You may need to try this a couple of times. Most of the time the error occurs, but once in a while it does not.
This works perfectly in 1.59 stable. The missile is moved from backpack to inventory every time. I've tested it in all sorts of situations and it's fine running in 1.59. I'm not sure which version of beta this first occurred in (sorry).
Changing the number of units with backpacks sometimes influences the result.
It also seems to me that the problem occurs more when the backpack only has one missile in it.
There is some code in the init line of the player:
grp1 = group this; grp1 setFormation "LINE"; grp1 setGroupId ["HellPatrol","GroupColor4"];
If you remove grp1 setGroupId ["HellPatrol","GroupColor4"];, sometimes it makes the transfer more reliable (but not perfect)! I'm not sure why, it could be unrelated...
Updated by Fireball about 4 years ago
- Status changed from New to Assigned
- Reproducible for you changed from No to Yes
Updated by Sickboy about 4 years ago
- First affected ArmA II version changed from Please select... to 1.60 BETA
Updated by Dwarden about 4 years ago
- Status changed from Assigned to Feedback
does this still happen with latest 1.60.86xxx beta builds ?
Updated by Das_Attorney about 4 years ago
Unfortunately, yes. Just tested on 86522 and still not working :(
Also - issue is a problem with ammo crates, not just backpacks. Was initially testing with backpacks so I didn't notice any issues with ammo crates at the time.
Updated by Dwarden about 4 years ago
- Assignee changed from Dwarden to Suma
- Target version changed from Upcoming version to 1.60 BETA
ok, this seems like 1.60 regression
Updated by Suma about 4 years ago
- Status changed from Assigned to Resolved
Missing "backpack" variable initialization in the action description. Fixed in 86566
Updated by Sickboy almost 4 years ago
Wow - You guys are the bomb! :)
Does this mean the fix is confirmed? Thanks!