Jump to content
Vectif

Disabling/damage any vehicle within trigger area

Recommended Posts

Hello!

I am trying to make a mission in which once a vehicle passes thru a certain trigger, a landmine/explosion goes off - but I don't want it to kill the players nor the vehicle, just cause them the inconvenience of being unable to move and then getting ambushed. I know I can name the vehicles and so on, but there's a lot of different vehicles that can be used optionally for this mission, so I wanna know if theres a way I can make it so that when any vehicle activates that trigger, it'll damage the vehicle within the trigger area.

I have everything for the trigger/effect/waypoints and all set up, I just can't find a way to detect what vehicle is going thru the trigger unless I specify it, to damage it, so no matter what vehicle a player chooses, that trigger will damage/disable it.
How would I go on about doing this?

 

Share this post


Link to post
Share on other sites

Bah, the trigger cond. should do the trick. How did you set your trigger?

Share this post


Link to post
Share on other sites
18 minutes ago, pierremgi said:

Bah, the trigger cond. should do the trick. How did you set your trigger?

7ZoQ4bM.png


Ignore the "rf" part - I was messing around making an asset remain hidden that shows up after they're ambushed. But other then that, I want that trigger to be activated when any BLUFOR/players in vehicle go thru that trigger in any vehicle, and then for whatever vehicle it is, for it to take an X amount of damage to disable it, without needing to specify or name every single vehicle and then make an array for all of them. So no matter what vehicle they take, the one that is within the trigger's area at the time of it's activation will take the damage.

So basically - how do I make the trigger detect the vehicle that is currently within it, in order to edit it's properties? e.g. it's damage, fuel, hitpoints, visibility, anything of the sort. Just that in this case, it's the damage in specific.

Share this post


Link to post
Share on other sites

trigger works with two specific variables thisTrigger (refers to the trigger itself) and thisList returning an array of objects matching the condition. But... these objects can be men (infantry) or vehicles (all types of locomotion), so if you pre-set BLUFOR present, thisList will return the units/vehicles, and inside the activation field, you'll get the array of units/vehicles which matched the condition. As trigger is by default checked every 0.5 sec,  thisList is a short list of "winners" entering within the same 0.5 sec.

You can test that with this condition:

this && {_x in vehicles} count thisList > 0   // that means BLUFOR present and thisList (blufor present) contains at least one vehicle. (That doesn't refer to the driver inside the vehicle)

 

On act field, now, this list contains at least one BLUE vehicle. If the trigger is not huge and few reasons for multiple entrance within 0.5 sec, then:

Usually you just have to pick it up by : thisList #0

As test:

hint typeOf (thisList #0)

Et voilà

 

The other way to proceed is an eventHandler handleDamage for your type of ammunition.

  • Thanks 1

Share this post


Link to post
Share on other sites
11 minutes ago, pierremgi said:

trigger works with two specific variables thisTrigger (refers to the trigger itself) and thisList returning an array of objects matching the condition. But... these objects can be men (infantry) or vehicles (all types of locomotion), so if you pre-set BLUFOR present, thisList will return the units/vehicles, and inside the activation field, you'll get the array of units/vehicles which matched the condition. As trigger is by default checked every 0.5 sec,  thisList is a short list of "winners" entering within the same 0.5 sec.

You can test that with this condition:

this && {_x in vehicles} count thisList > 0   // that means BLUFOR present and thisList (blufor present) contains at least one vehicle. (That doesn't refer to the driver inside the vehicle)

 

On act field, now, this list contains at least one BLUE vehicle. If the trigger is not huge and few reasons for multiple entrance within 0.5 sec, then:

Usually you just have to pick it up by : thisList #0

As test:

hint typeOf (thisList #0)

Et voilà

 

The other way to procced is an eventHandler handleDamage for your type of ammunition.


Thanks a lot for your help! This works like a charm and was exactly what I needed. Cheers!!!

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

×