Jump to content
Sign in to follow this  
fawlty

Trigger Array question

Recommended Posts

Been using this

{deleteVehicle _x} forEach nearestObjects [junk_1, ["all"], 150]

for cleanup once leaving the area. The 150 is the radius in the trigger that everything gets deleted.

I'd like to change that so it's the trigger array instead (don't want drones or aircraft being deleted)

Share this post


Link to post
Share on other sites

Hover over the trigger's "On Activation" field and it'll give you some handy variables, one of which is thisList. But also, the ["all"] part could be better adjusted if you wanted to go that way instead. Look at https://community.bistudio.com/wiki/nearestObjects under Types and see the examples for it, because you can filter what you want that way too.

  • Like 1
  • Thanks 1

Share this post


Link to post
Share on other sites

I kind of worded that wrong. Is there a way of omitting something from that line

eg delete everything except aircraft when this trigger fires.

Share this post


Link to post
Share on other sites
1 hour ago, fawlty said:

This may look familiar to you Beno from a couple of years ago

 Was that something I wrote? 😂 If it was, I think I may have misused "filter out".

 

But if you want to actually filter out (i.e. ignore) air, you can do:

 

_arr = (nearestObjects [junk_1,["All"],150]) select {!(_x isKindOf "Air)};

 

That'll give you an array of everything except air. Hopefully that's correct, I've written this from my phone. 

  • Like 1

Share this post


Link to post
Share on other sites

Ahh you caught that

Was that something I wrote?😀

 

I think I'll pass on trying to get this to do what I want and work around it. I tried different ways of doing what you suggested but with my limited knowledge of this I can't get what I'm after.

Thanks anyway.

  • Haha 1

Share this post


Link to post
Share on other sites

Try it like this (plus, I did miss a " in my previous post):

_objectsToDelete = (nearestObjects [junk_1,[],150]) select {!(_x isKindOf "Air")};
{deleteVehicle _x} forEach _objectsToDelete;

That should remove anything that is a plane/helicopter/UAV.

  • Like 1
  • Thanks 1

Share this post


Link to post
Share on other sites

Ok Beno, that's got it.

Thanks for hanging in there, appreciate it.

Cheers...F

  • Like 2

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  

×