Jump to content
Sign in to follow this  
AgentRev

Accessing and removing inventory items by ID

Recommended Posts

Hey y'all,

I am currently making a selling system, so that players can sell things directly from their inventory in exchange for money in my custom mission. However, I noticed that there are no functions to access or remove inventory items via unique IDs instead of class names. This is kind of an issue, since I want to remove items based on their location in the player's inventory (e.g. uniform, vest, backpack) and also based on the ammo count in case of magazines, but all the remove functions do not allow for such flexibility. I'm kind of surprised that nothing like has been implemented, let alone proposed before.

Therefore, I have opened a feedback report explaining the situation, as well as example functions that could be implemented to fulfill this need: http://feedback.arma3.com/view.php?id=12782

The proposal also specifies a function to retrieve the magazine(s) and accessories of a weapon that is stored in the backpack.

So, if you could vote, it would be really appreciated. I think this can benefit many coders if implemented. Thanks!

Share this post


Link to post
Share on other sites

Arma isn't a commerce game so there's no need for a removeSpecificItemFromSpecificSlot type commands. Heck we don't even have any "inventory items" yet anyway and there's no "money" in Arma. Individual soldiers don't buy and sell ammo on the battlefield so a military sandbox wouldn't require such features. Maybe a "money" item for specOps to trade for a civilian's silence. Or claim forms to give to farmers to reimburse for damage to their property. That would be realistic I guess. I totally get why you want it, but I'd prefer the game be finished before catering to RPG style engine features. :)

You can check that a specific classname is within a specific container (Does the player have a FirstAid kit in his Uniform?) and if so remove that item. It shouldn't matter where it's removed from if it's the same class of item.

It's super unlikely that such features would be added less than a month away from release after the final beta patch and days before release code freeze, but good luck all the same. :)

Share this post


Link to post
Share on other sites
Heck we don't even have any "inventory items" yet anyway and there's no "money" in Arma. Individual soldiers don't buy and sell ammo on the battlefield so a military sandbox wouldn't require such features.

By inventory items I mean any object that is located in inventory containers, like the uniform, vest, and backpack. The "money" is all in my mission, which already contains a complete buying system for players. I want to add a selling system, but that's not the sole reason why I would like to see such functions implemented.

You can check that a specific classname is within a specific container (Does the player have a FirstAid kit in his Uniform?) and if so remove that item. It shouldn't matter where it's removed from if it's the same class of item.

The main issue is not really about where the item is removed from, but rather with magazines. There are no set of functions that would allow me to remove a magazine based on how much ammo is left inside, which could be achieved with ID-based inventory functions. In fact, there are many other problems related to scripted interactions with magazines in general.

Individual soldiers don't buy and sell ammo on the battlefield so a military sandbox wouldn't require such features.

Please bear in mind that not everyone plays the game strictly as a military simulator, thanks to the amazing capabilities and flexibility of the engine. My example is just to provide a meaningful explanation of implementation details.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×