Lua Condition- If Destroyed In A Area
Posted: Sat May 22, 2021 12:26 pm
Hi folks
I was wondering if its possible to set a condition of where a unit is destroyed, I have some Backfires that are participating in a carrier strike, I want the player to score if they are destroyed on their airfield rather than in the air.
I have had a look and wondered if theres a way to set a condition whereby the scoring is only allowed if the unit is within XYZ?
I have looked at the LUA script
local u = side:unitsInArea({Area = { 'RP-5094', 'RP-5095', 'RP-5096', 'RP-5097'}, TargetFilter = { TargetType = 'Aircraft'} })
But I dont think that would work TBH because its to do with side contacts, I think what I need is something that references where the unit is if that makes sense?
Or alternatively another easier way to score it, I did consider just having the player score for damaging the Large Parking Spot that only bombers can be parked on but then they would score damaging empty parking stands.
Anyone any thoughts?
Regards
Butch
I was wondering if its possible to set a condition of where a unit is destroyed, I have some Backfires that are participating in a carrier strike, I want the player to score if they are destroyed on their airfield rather than in the air.
I have had a look and wondered if theres a way to set a condition whereby the scoring is only allowed if the unit is within XYZ?
I have looked at the LUA script
local u = side:unitsInArea({Area = { 'RP-5094', 'RP-5095', 'RP-5096', 'RP-5097'}, TargetFilter = { TargetType = 'Aircraft'} })
But I dont think that would work TBH because its to do with side contacts, I think what I need is something that references where the unit is if that makes sense?
Or alternatively another easier way to score it, I did consider just having the player score for damaging the Large Parking Spot that only bombers can be parked on but then they would score damaging empty parking stands.
Anyone any thoughts?
Regards
Butch