Jump to content
Sign in to follow this  
david-grylls

Disable/Destroy Vehicles using a Trigger

Recommended Posts

Hi Forum People!

 

Recently I have been trying to destroy a flying plane (driven by AI) using a trigger. The aim is to have the AI driven plane enter a trigger and become disabled or destroyed however not removed from the map. I have tried multiple commands, none of which are working.

 

Here is what my code in the trigger looks like right now;

On Act:
this setDamage 1;

However when I try to use this in a trigger (Set to activation BLUFOR and triggered by Detection of Blufor), the plane continues to fly through ignoring the trigger. 

I have also attempted to empty the fuel of the jet but that too fails to work.

 

Does anyone know how to disable or destroy a jet mid-air?

 

Thanks guys!

- D.G

Share this post


Link to post
Share on other sites

Okay...maybe you should have searched for this as there is tons of results...

1. Name your plane something with no spaces. (E.g. badguy)

2. In your trigger, put: badguy setdamage 1;

3. Too easy...

Honestly, I don't even know why people ignore the search tab. -_-

Take a look at this, you won't regret it: https://community.bistudio.com/wiki/Category:Scripting_Commands_Arma_3

Share this post


Link to post
Share on other sites

The trigger doesn't know what object you want to refer to, when you use "this".

 

"This" only works in the init-box of the unit itself. So you need to name the airplane (double click on it and type in the name box) and replace "this" in the trigger with the unit's/object's name.

 

myUnluckyPlane setDamage 1;

 

 

Edit: I was too slow ^_^

Share this post


Link to post
Share on other sites

Okay...maybe you should have searched for this as there is tons of results...

1. Name your plane something with no spaces. (E.g. badguy)

2. In your trigger, put: badguy setdamage 1;

3. Too easy...

Honestly, I don't even know why people ignore the search tab. -_-

Take a look at this, you won't regret it: https://community.bistudio.com/wiki/Category:Scripting_Commands_Arma_3

 

 

The trigger doesn't know what object you want to refer to, when you use "this".

 

"This" only works in the init-box of the unit itself. So you need to name the airplane (double click on it and type in the name box) and replace "this" in the trigger with the unit's/object's name.

 

myUnluckyPlane setDamage 1;

 

 

Edit: I was too slow ^_^

 

Already done this, I've spent 2 hours searching google endlessly for a result. I named my plane 'planeBLUFOR' and added to the trigger 'planeBLUFOR setDamage 1;'

 

I'm a half decent scripter for ArmA with over 150+ hours in helping people make missions. I've never had this issue before as it seems to work perfectly fine with ground units. 

Share this post


Link to post
Share on other sites

Your trigger condition makes no sense. "Activated by Blufor" and "Detected by Blufor" is a weird condition (no idea if units are able to detect themselves). Just set it to "Anybody", and add this to the condition field:

this AND myUnluckyplane in thislist

For a more authentic (well, at least somewhat) way to eliminate a unit you could use BIS_fnc_neutralizeUnit.

 

Edit: Just tested this, working fine.

 

KTHcPei.jpg

 

Cheers

  • Like 1

Share this post


Link to post
Share on other sites

Your trigger condition makes no sense. "Activated by Blufor" and "Detected by Blufor" is a weird condition (no idea if units are able to detect themselves). Just set it to "Anybody", and add this to the condition field:

this AND myUnluckyplane in thislist

For a more authentic (well, at least somewhat) way to eliminate a unit you could use BIS_fnc_neutralizeUnit.

 

Cheers

 

Activated by Blufor is just the option in the drop down box in 'ACTIVATION' and Detected by Blufor shouldn't effect the outcome regardless as I have tried with it not altered. Also your suggestion of adding the 'this AND planeBLUFOR in thislist' did work for a ground unit however not with the plane. 

Share this post


Link to post
Share on other sites

Activated by blufor means that there has to be a blufor unit in the trigger area for the trigger to check its condition.

Are you sure this is the case when the plane is in the trigger area? Otherwise nothing would happen.

Did you try setting the trigger activation to anybody?

Otherwise there's somethings off, no idea. Working fine here, just tested it with any type of unit, no matter if sea, land or flying air units.

 

Cheers.

Share this post


Link to post
Share on other sites

Activated by blufor means that there has to be a blufor unit in the trigger area for the trigger to check its condition.

Are you sure this is the case when the plane is in the trigger area? Otherwise nothing would happen.

Did you try setting the trigger activation to anybody?

Otherwise there's somethings off, no idea. Working fine here, just tested it with any type of unit, no matter if sea, land or flying air units.

 

Cheers.

It's a Blufor plane in the area so I'm assuming the trigger would fire when the Blufor plane enters. 

 

Edit: Found the issue, turns out the plane was passing through the trigger too fast as my trigger was too small (150x1000) It was passing through the trigger too quickly. I have extended the trigger size and all seems to work fine. Thanks for your help regardless grumpy old man. Much appreciated. 

 

Cheers, D.G

Share this post


Link to post
Share on other sites

Activated by Blufor is just the option in the drop down box in 'ACTIVATION' and Detected by Blufor shouldn't effect the outcome regardless as I have tried with it not altered. Also your suggestion of adding the 'this AND planeBLUFOR in thislist' did work for a ground unit however not with the plane.

Ok, I just tried exactly what I did and its clearly what Old Man said. -_-

Change your "Detected by BLUFOR" to "PRESENT". The reason why the planes not exploding, is because the trigger will only detect ground units. Again, set it to present and it will be all good.

Second of all, there are differences between conditions and activations. Conditions in triggers act like knowsAbout, it takes time for it to detect someone of that side in the trigger. If its set to present, the condition will rely on the next condition below and will be a.k.a. "true", unless a custom condition is mentioned below.

Activation is what side it wants to detect that enters the trigger.

Again, leave as "PRESENT". (The devs should rid the detection mechanism, its just useless in some cases)

I cannot help you any further as this is the best info you can get...

Share this post


Link to post
Share on other sites

Ok, I just tried exactly what I did and its clearly what Old Man said. -_-

Change your "Detected by BLUFOR" to "PRESENT". The reason why the planes not exploding, is because the trigger will only detect ground units. Again, set it to present and it will be all good.

Second of all, there are differences between conditions and activations. Conditions in triggers act like knowsAbout, it takes time for it to detect someone of that side in the trigger. If its set to present, the condition will rely on the next condition below and will be a.k.a. "true", unless a custom condition is mentioned below.

Activation is what side it wants to detect that enters the trigger.

Again, leave as "PRESENT". (The devs should rid the detection mechanism, its just useless in some cases)

I cannot help you any further as this is the best info you can get...

Ah, thank you for your clarification but as I said in my last post, I found the issue. Thanks for your generous help anyway!

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  

×