Jump to content

Recommended Posts

Posted

Im looking for some help..well probably a lot of help. Here is what im trying to do. I have a group of A-10C's flying thru some canyons. Im trying to keep them below 300 AGL. I know this will take some use of flags, in which i hav been reading up on, but im still confused. What i want to happen is if they break the 300 AGL they Get a message to drop back below 300 AGL. If they fail to do so within 5 Seconds, it will activate an SA-15 which i have mounted on top of a mountain. I have a trigger zone in place that covers the area i want this to happen. Now i just have to setup all the flags and triggers.

 

Thank you for your help.

Posted

I think the altitude is in meters so I've been using this to determine a reasonable trigger value:

 

Altitude in Feet / 3.24 for example 500 ft ~ 154 m

So 300 ft would be ~ 93 m

 

For the trigger you could use a Switched Condition Trigger - so it enables then resets (it would warn each time the unit was above the stated altitude).

 

The trigger would look like this:

 

Trigger Name: 3 SWITCHED CONDITION (Check Altitude)

 

Conditions: UNIT's ALTITUDE HIGHER THAN (Player, 93)

UNIT IN ZONE (Alpha)

 

Actions: FLAG ON (1) - then test against this flag

F-15C-User-Bar-ACM.v2.jpg

MapleFlagMissions - Read Our Blog for Updates

Posted

You need to use SSE to get the result you want. I would suggest creating a lua script file that is continuously run to check for required conditions and either set a flag or output some text if the player gets too high.

 

First you need to get coordinates of the aircrafts and the trigger zone. Then you check each aircraft in turn to see if they are in the zone and if their AGL altitude is too high. The trigger containing the script should be continuous action type.

 

Here's an incomplete script for doing what you want. I don't know how to get the coordinates of a trigger zone so maybe someone else can help? The code can have some other problems also but the general idea how to do this should be clear (at least if you know something about programming).

 

 

local planes = {'pilot1', 'pilot2', 'pilot3'} --pilot names fort planes to be checked

-- local zonepos = ??? how to get coordinates for trigger zones set in ME?
zoneradius = 30000 -- the radius of the trigger zone

local violation = 0

for i = 1, #planes do  --run through the pilot name table
  id = unit.getByName(planes[i])
  pos = id:getPosition()
  distance = sqrt((pos.p.x - zonepos.x)^2 + (pos.p.z - zonepos.z)^2) 
  if distance > zoneradius then --check if the plane is inside the zone
     pos2d.x = pos.p.x      --convert Vec3 to Vec2
     pos2d.y = pos.p.z
     landheight = land.getHeight(pos2d)   -- get land height at aircraft location
     if pos.p.y - landheight > 300 then  --check if the plane is higher than 300m AGL
        violation = violation + 1
     end
  end
end

if violation > 0 then  
  trigger.setUserFlag(100, true)  -set flag 100 if there were violations
else
  trigger.setUserFlag(100, false)   
end

 

 

You could modify this code to check only one aircrafts altitude, create separate version for each airplane and then create triggers for every plane that checks the unit in zone condition before running the plane specific script. That will get you over the zone position problem but will need more work

DCS Finland: Suomalainen DCS yhteisö -- Finnish DCS community

--------------------------------------------------

SF Squadron

Posted

http://forums.eagle.ru/showthread.php?t=98599

Didn't you get an answer?

 

What's the unit (feet/meters) used?

I don't think you must make a script file. It should work as Sabre described, with a switched condition.

Strike Posture Set CAS Center of Excellence

Intel Core i5 4690k @4,6Ghz, Gigabyte GTX 970 OC, Gigabyte Z97-X, 16GB G Skill Sniper @2400, Samsung 860/850 EVO , Win 10 64 bits, Dual monitors 27"@144"Opentrack + TM Warthog + Saitek pro flight combat 

 

Posted

He wants to see if the plane is under 300 AGL, instead of 300 AMSL. This can't be done using just triggers. Otherwise it would go just like Sabre described.

DCS Finland: Suomalainen DCS yhteisö -- Finnish DCS community

--------------------------------------------------

SF Squadron

Posted

Bushmani

For the trigger zone check why not just use conditions on the pos.x, pos.z values from your script against a set of zone x&z constants. You could even place a list of rectangular x & z values in a table if you wanted more than. 1 zone.

 

Or for trigger position try

trigname = trigger.misc.getZone(triggerZoneName) 
trigpos = trigname.p
trigradius = trigname.radius

 

I thought the triggers were referenced to the ground.

triggers are altitudes = a.m.s.l.

  • Like 1

i7-7700K : 16Gb DDR4 2800 Mhz : Asus Mobo : 2TB HDD : Intel 520 SSD 240gb : RTX 2080ti: Win10 64pro : Dx10 : TrackiR4 : TM Warthog : ASUS ROG SWIFT PG348Q

Posted

If using circular zone you can see in ME exactly where your zone border is. But making it rectangular isn't too hard to imagine if you use the radius as a half length of the squares side. You would use then a condition

 

if pos.x > zonepos.x - zonerad and pos.x < zonepos.x + zonerad and pos.y > zonepos.y - zonerad and pos.y < zonepos.y + zonerad then
   ...
end

 

I suppose there's not much noticeable difference in execution speed? A square or rectangular zone check is faster to compute but I would think there's noticeable difference only if you are checking 20+ zones.

DCS Finland: Suomalainen DCS yhteisö -- Finnish DCS community

--------------------------------------------------

SF Squadron

  • 2 weeks later...
Posted
I think the altitude is in meters so I've been using this to determine a reasonable trigger value:

 

Altitude in Feet / 3.24 for example 500 ft ~ 154 m

So 300 ft would be ~ 93 m

 

For the trigger you could use a Switched Condition Trigger - so it enables then resets (it would warn each time the unit was above the stated altitude).

 

The trigger would look like this:

 

Trigger Name: 3 SWITCHED CONDITION (Check Altitude)

 

Conditions: UNIT's ALTITUDE HIGHER THAN (Player, 93)

UNIT IN ZONE (Alpha)

 

Actions: FLAG ON (1) - then test against this flag

 

From what i can tell now this works if the terrain doesnt force altitude changes. As were flying thru canyons going thru a mountain range it forces you up in altitude even though your below 300 AGL And the trigger from what i can tell works in MSL, not AGL

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...