Jump to content
rick rawlings

I don't understand {deleteVehicle _x} forEach thislist

Recommended Posts

I am trying to clean up the base after everyone heads out for the mission to save on resources, so I thought I wanted to use

{deleteVehicle _x} forEach thislist

Putting that in a big trigger with a radio alpha activation does nothing (Condition:this). Putting it in a big trigger with a Player not present activation and then walking out of the area does nothing... Putting it with a anybody present activation and repeatable will delete vehicles but not the crew (expected) or troops that I order into the area (unexpected). It also does not delete editor placed objects either. So I clearly don't understand how it works or how to get the desired effect. Thank you for any help!

 

RR

Share this post


Link to post
Share on other sites
17 minutes ago, rick rawlings said:

I clearly don't understand how it works or how to get the desired effect.

 

Currently, it will delete every "vehicle" which satisfies the trigger's conditions. There are a number of "clean-up" scripts out there, might be worth checking them out.

  • Like 1

Share this post


Link to post
Share on other sites
4 minutes ago, HazJ said:

So it works? Radio Alpha means you need to trigger it manually via radio. Press 0-0-x...

https://community.bistudio.com/wiki/allMissionObjects

https://community.bistudio.com/wiki/vehicles

https://community.bistudio.com/wiki/crew

No, it did nothing! I made a big trigger that covered half the base, activation radio alpha, condition this and on activation the above code part and triggered it and nothing happened. I was expecting to be Thanos, but I guess I am short a few infinity stones...

Share this post


Link to post
Share on other sites

What is in the trigger? Vehicles, units, what?

{deleteVehicle _x;} forEach thislist; hintSilent str thislist;

What does it return?

  • Like 1

Share this post


Link to post
Share on other sites

Regarding your examples:

  • radio triggers return thisList null
  • any player not present returns thisList null
  • this example is working as intend and expected - anybody present deletes vehicles in the trigger
  • Like 1

Share this post


Link to post
Share on other sites

Thank you, I will look into that. If I just wanted to delete everything in an area after the players have left, is there an easy command for that?

 

Thanks again!

 

Share this post


Link to post
Share on other sites

thislist doesn't work with radio trigger. No chance neither in a deact field (any trigger), nor on act field of a non-presence trigger (what could be the array else than an empty one?)

 

A workaround is to "mark", I mean setVariable on each created object. For example {_x setVariable ["spawnedInBase",true]} forEach yourList you want to manage.

Then, you don't need a "thisList" anymore. Choose your trigger/waitUntil condition and {deleteVehicle _x} foreach (allUnits select {!isNil {_x getVariable "spawnedInBase"}});  // just an example with units.

 

Share this post


Link to post
Share on other sites
27 minutes ago, rick rawlings said:

Thank you, I will look into that. If I just wanted to delete everything in an area after the players have left, is there an easy command for that?

 

Thanks again!

 

 

//  {deleteVehicle _x} forEach (nearestObjects [triggerName,["All"],radius]);
//  So, for a trigger named "trigger_01" with a radius of 100 meters - 

{deleteVehicle _x} forEach (nearestObjects [trigger_01,["All"],100]);

 

  • Like 2
  • Thanks 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

×