Jump to content
Grenadier ITF

detect object in cargo (ACE3)

Recommended Posts

Hi.

I would like to know if any of you know how to detect the objects in the cargo of a vehicle in ACE 3.
I know how to add them, ( call ace_cargo_fnc_addCargoItem ),

but not how to detect them (get)

 

Thank you.

Share this post


Link to post
Share on other sites
19 hours ago, Grenadier ITF said:

I know how to add them

So you already have a starting point where you could search

 

19 hours ago, Grenadier ITF said:

ace_cargo

The function is in ACE cargo. So we can go to the ACE github

https://github.com/acemod/ACE3

Then go to the cargo module

https://github.com/acemod/ACE3/tree/master/addons/cargo

And see what it does

https://github.com/acemod/ACE3/blob/master/addons/cargo/functions/fnc_addCargoItem.sqf#L25

Ah it calls loadItem, let's see what that does.

https://github.com/acemod/ACE3/blob/master/addons/cargo/functions/fnc_loadItem.sqf#L27

Oh it pushes the item into an array, that is stored on the vehicle with setVariable. That means we can also get that array!

 

Code even shows how to get it

https://github.com/acemod/ACE3/blob/master/addons/cargo/functions/fnc_loadItem.sqf#L26

We just need to replace the QGVAR macro which just adds prefix to variables.

 

End result:

 

_vehicle getVariable ["ace_cargo_loaded", []]

 

  • Like 3
  • Thanks 1

Share this post


Link to post
Share on other sites

Hi, guys  my problem i s similar. I try to make trigger as follow:
CONDITION: if box_01 is loaded to car_01;  //loaded via ACE3 command [object, vehicle] call ace_cargo_fnc_loadItem//

then
ON ACTIVATION: hint "The box is loaded into the car";

Could you give me an advice how how to correctly formulate this condition?

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

×