Jump to content

Recommended Posts

Holy Moly, a plane has been shoot down and we need to recover the flight recorder!!,,

 

so I  made a trigger with the condition :
({_x isKindOf "rhs_flightrecorder"} count thisList) > 0
and it works if I spawn a rhs_flightrecorder in the area, but if I pick it up and go in the trigger and drop it nothing happens.
I also tried a box using:

{_x =="rhs_flightrecorder"} count ItemCargo FLR_box >0 

how do i detect the flight recorder?
thx.

Share this post


Link to post
Share on other sites

When you carry it into the area and drop it onto the ground, and this goes from anything being moved from an inventory to the ground (at least, I can't think of anything that wouldn't do this), the item gets placed into a "GroundWeaponHolder" object. You can test this yourself by pointing your cursor/weapon at the object you just dropped, bring up the debug menu, and put this into one of the "Watch" boxes:

typeOf cursorObject

So the "GroundWeaponHolder" acts as a container for the object. So you need to search for any "GroundWeaponHolder" that are in the trigger, then check to see if there's a "rhs_flightrecorder" in their inventory. BUT, it seems like triggers don't get triggered by a "GroundWeaponHolder". So you need to get a bit creative:

_radius = selectMax ((triggerArea thisTrigger) select [0,2]);
_holders = (nearestObjects [getPos thisTrigger,["GroundWeaponHolder"],_radius]) select {_x inArea thisTrigger};
({(((getItemCargo _x) select 0) select 0) == "rhs_item_flightrecorder"} count _holders) > 0

Put that into the trigger's "Condition" field and it should detect when someone has placed a flight recorder onto the ground from their inventory.

  • Like 5

Share this post


Link to post
Share on other sites

but there seems to be something i'm not getting,
how do i detect it in a box or backpack?
i tried:
({_x == "rhs_flightrecorder"} count ItemCargo box_1) > 0
as a condition on a trigger, but it does not trigger when i put it in.
if i use >> hint str getItemCargo box_1;

i get >> [["rhs_item_flightrecorder"],[1]]
 

Share this post


Link to post
Share on other sites
On 2/13/2021 at 3:22 AM, _-xXShArK_OGXx-_ said:

but there seems to be something i'm not getting,
how do i detect it in a box or backpack?
i tried:
({_x == "rhs_flightrecorder"} count ItemCargo box_1) > 0
as a condition on a trigger, but it does not trigger when i put it in.
if i use >> hint str getItemCargo box_1;

i get >> [["rhs_item_flightrecorder"],[1]]
 

LOL!!! looking for the wrong class name is not the way to make it work 😉 
Got it now,, thx 
({_x =="rhs_item_flightrecorder"} count ItemCargo box_1) > 0


Solved

  • Haha 1

Share this post


Link to post
Share on other sites
7 hours ago, _-xXShArK_OGXx-_ said:

LOL!!! looking for the wrong class name is not the way to make it work 😉 

Haha yes, caught me out for a little bit too 😁

  • Haha 1

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

×