Page MenuHomeFeedback Tracker

addMagazine command does not work in specific situation
Assigned, WishlistPublic

Description

It is not possible to add an AT missile with addmagazine command to a soldier that has an AT launcher but no backpack.

This must be due to the fact that addMagazine command is trying to add to player inventory (uniform/vest/backpack) and since the soldier doesn't have a backpack and since the AT missile doesn't fit inside vest/uniform the AT missile is not added at all. The expected behavior would be to add the missile to the AT launcher.

Details

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

Place a unit that doesn't have a backpack nor AT launcher. Start the mission and play that unit. Use debug console to execute following commands:

player addweapon "launch_titan_short_f";
player addmagazine "titan_at";

The addMagazine command doesn't add the AT missile to the AT launcher

Event Timeline

d3nn16 edited Steps To Reproduce. (Show Details)Sep 9 2013, 11:38 PM
d3nn16 edited Additional Information. (Show Details)
d3nn16 set Category to Scripting.
d3nn16 set Reproducibility to Always.
d3nn16 set Severity to None.
d3nn16 set Resolution to Open.
d3nn16 set Legacy ID to 36054151.May 7 2016, 4:38 PM

Confirmed.

This works:

player addbackpack "B_HuntingBackpack";
player addmagazine "titan_at";
player addweapon "launch_titan_short_f";
removebackpack player;

d3nn16 added a subscriber: d3nn16.May 7 2016, 4:38 PM

Thanks for workaround Killzone,

But I would expect the command to work even when the player had no backpack or a full backpack. Imagine the player does have a backpack but it's filled with other items. In this case the AT missile wouldn't fit inside and addmagazine command wouldn't work.

If it is hard to modify this command maybe add other commands like addMagazinePrimary / addmagazineSecondary / addMagazineHandgun. But I suppose this requires the weapon to be added first, and in turn this maybe implies the magazine would not be loaded into the weapon after it's added.

I think adding extra commands like "addMagazineToPrimaryWeapon" would be the best solution as it provides maximal flexibility and does not break existing content.

RTEK added a subscriber: RTEK.May 7 2016, 4:38 PM
RTEK added a comment.Apr 5 2014, 3:18 PM

Bohemia devs, why has this not been fixed yet?

I also think being able to have a command like addMagazineToPrimaryWeapon or addMagazineToWeapon [weaponName, magazineName] would be really beneficial.

dedmen added a subscriber: dedmen.Sep 13 2017, 4:24 PM

addWeaponItem.
Solved.

d3nn16 removed a subscriber: d3nn16.Dec 21 2020, 1:40 PM