Jump to content
Cigs4

Detect grenades with trigger

Recommended Posts

Hello, guys!

I really need your help, I'm stuck in this for a few days. Here is the thing: 

I'm trying to iniciate a fire in a warehouse with an incendiary grenade from ACE or RHS. But the trigger did not recognize the classname of it, or any other class of names that I tryed. I made a trigger 10x10x5 and I want the condition for that trigger to fire is the presence of one of those incendiary grenades. That's it. Classnames as follows:

"rhssaf_mag_brz_m88"
"rhs_mag_an_m14_th3"
"ACE_M14"

I'll appreciate any help provided. Thanks.

Share this post


Link to post
Share on other sites
_classnames = ["rhssaf_magazine_rhssaf_mag_brz_m88", "rhs_magazine_rhs_mag_an_m14_th3", "ACE_M14"];
true && (thisList findIf {_obj = _x; _classnames findIf {typeOf _obj == _x} > -1 } > -1)

not tested

  • Like 1

Share this post


Link to post
Share on other sites

OK, thank you very much! I will test as soon as possible.

Share this post


Link to post
Share on other sites

Unfortunately did not work... the trigger does not recognize the grenades.

But thanks for the try.

If anyone else could help, I'll really apreciate, thanks.

Share this post


Link to post
Share on other sites

maybe the classnames are different if a grenade is on ground but idk.

you could diag_log the classnames by using typeOf on nearest objects after throwing such grenade. that way u can verify the classnames

Share this post


Link to post
Share on other sites

Just try with the ammo classes:

 

Trigger cond = TRUE  (just for the area)

trigger on act:

0 = thistrigger spawn {
   waitUntil { {_x inArea _this} count (getpos _this nearObjects ["rhs_ammo_an_m14_th3",200]) > 0 };
hint "ok"
};

 

Works also with  "rhssaf_ammo_brz_m88"

Code is just an example with nearObjects (radius 200m but condition must comply also with the trigger area).

 

 

  • Like 2

Share this post


Link to post
Share on other sites

Thank you very much, pierremgi. Works just fine.

 

It's a pitty that I could not find the ammo class for the ACE_M14. 

 

👍
 

Share this post


Link to post
Share on other sites

Thank you, Dedmen! 👍

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

×