Jump to content
Sign in to follow this  
TheJay

Vehicle Cargo

Recommended Posts

I'm trying find what kind of weapons and magazines are in a vehicles cargo compartment. These are weapons and magazines that players have placed into the vehicle.

When using weapons it only returns the vehicles weapons. Same thing happens with magazines, it just returns the ammo for the vehicle weapons. Or in the case of ammo boxes both commands returns empty arrays.

Does anyone know of a way to find the contents of a vehicles cargo space?

Share this post


Link to post
Share on other sites

Unfortunately, I don't think you can. You can clear it and set it, but not get it.

There are many "set" commands in ArmA scripting which have no corresponding "get" command, which is quite odd given that it is the easy part to do.

Some examples: request on bug tracker

Share this post


Link to post
Share on other sites

If you really need to, you could some kind of brute force test:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

dummyUnit action ["TAKEMAGAZINE", vehicle, "pipebomb"];

if (count magazines dummyUnit > 0) then {<add information to an array of known mags being carried by vehicle>};

<delete mags/weapons carried by dummyUnit>

<repeat for all known mag/weapon types>

<replace weapons to the vehicle>

Problems:

- unpredictable delays caused by dummyUnit doing animations (seems gl can't takeMagazine or takeWeapon)

- need to check every possible weapon/mag type

- complicated script for simple task

- probably very slow

I've also tried the using weaponsPool, but it does not seem to update during the mission...

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  

×