Jump to content

Recommended Posts

Posted

Is it possible to trigger an action when an Awacs detects bogeys? I would like to activate intercept flights when an Awacs spots intruders.

[sIGPIC][/sIGPIC]

Posted

As far as I know the only way to do this is to use lua scripting.

 

See: http://wiki.hoggit.us/view/DCS_func_getDetectedTargets

 

local awacs = Unit.getByName("AWACSPilot") -- this is the pilot name of the plane, not group name
local ctrl = awacs:getController()

-- it mentions on the wiki 'Applies only to a Unit Controller. Cannot be used at the group level.' so hence I'm using Unit:getController() rather than Group:getController() as it might not work with the group function.
local radarDetectedTargets = ctrl:getDetectedTargets(Conroller.Detection.Radar)

for i = 1, #radarDetectedTargets do
 local _target = radarDetectedTargets[i]
 _target.Object -- the target object
 _target.visible boolean, --the target is visible
 _target.type --the target type is known
 _target.distance --distance to the target is known
end

  • Like 1

Developer of Kaukasus Insurgency - a customizable Dynamic PvE Campaign with cloud hosting and stats tracking. (Alpha)

 

http://kaukasusinsurgency.com/

Posted

Given the size of the maps, there's nowhere an AWACS wouldn't see enemy aircraft. You might try a trigger zone attached to the AWACS and use a nominal distance where you feel the AWACS is in danger. You might also make an Escort flight for the AWACS with their response distance set to like 50 Miles or so.

[sIGPIC][/sIGPIC]

http://www.476vfightergroup.com/content.php

High Quality Aviation Photography For Personal Enjoyment And Editorial Use.

www.crosswindimages.com

Posted
As far as I know the only way to do this is to use lua scripting.

 

See: http://wiki.hoggit.us/view/DCS_func_getDetectedTargets

 

local awacs = Unit.getByName("AWACSPilot") -- this is the pilot name of the plane, not group name
local ctrl = awacs:getController()

-- it mentions on the wiki 'Applies only to a Unit Controller. Cannot be used at the group level.' so hence I'm using Unit:getController() rather than Group:getController() as it might not work with the group function.
local radarDetectedTargets = ctrl:getDetectedTargets(Conroller.Detection.Radar)

for i = 1, #radarDetectedTargets do
 local _target = radarDetectedTargets[i]
 _target.Object -- the target object
 _target.visible boolean, --the target is visible
 _target.type --the target type is known
 _target.distance --distance to the target is known
end

 

Thanks a lot, will explore that!

[sIGPIC][/sIGPIC]

Posted
Given the size of the maps, there's nowhere an AWACS wouldn't see enemy aircraft. You might try a trigger zone attached to the AWACS and use a nominal distance where you feel the AWACS is in danger. You might also make an Escort flight for the AWACS with their response distance set to like 50 Miles or so.

 

Yes the distance might be a challenge. Currenty I let the "invaders" come from behind the mountain rig between Tblisi and Beslan; if an Awacs would fly at a normal height above angels 20,

I guess you are right: no way they can approach undetected from the very start of the mission. I'll see, I can play a little with the script to tune this.

[sIGPIC][/sIGPIC]

Posted

You can use Moose and A2AGCI with borders. Really easy to set up.

And have a look in the playlist. Many tutorials on many functions and features.

Moose framework: https://forums.eagle.ru/showthread.php?t=138043

 

 

- Jack of many DCS modules, master of none.

- Personal wishlist: F-15A, F-4S Phantom II, JAS 39A Gripen, SAAB 35 Draken, F-104 Starfighter, Panavia Tornado IDS.

 

| Windows 11 | i5-12400 | 64Gb DDR4 | RTX 3080 | 2x M.2 | 27" 1440p | Rift CV1 | Thrustmaster Warthog HOTAS | MFG Crosswind pedals |

Posted

How to respawn groups with MOOSE?

 

Many thanks for all teh suggestions. I made a first mission using MOOSE (Caucasus map DCS 1.5.8), closely inspired by the demo mission and it all seems to work. What I didn't sort out is that I would like to generate Attackers continuously (well within certain limits) by respawning the attack groups. The mechanics of this elude me (they work perfectly for the GCI groups). I included the mission and the script, I paste the script here also:

 

-- Red

GCICAP_Red = AI_A2A_GCICAP:New( "EWR Red", "Intercept Red", "Red CAP", 2 )

GCICAP_Red:SetTacticalDisplay( true )

RedBorderZone = ZONE_POLYGON:New( "Red Border", GROUP:FindByName( "Red Border" ) )

GCICAP_Red:SetBorderZone( RedBorderZone )

GCICAP_Red:SetIntercept( 100 )

GCICAP_Red:SetDisengageRadius( 100000 )

GCICAP_Red:SetEngageRadius( 50000 )

GCICAP_Red:SetGciRadius( 100000 )

 

-- Blue

 

GCICAP_Blue = AI_A2A_GCICAP:New( "EWUS", "US Intercept" )

GCICAP_Blue:SetTacticalDisplay( true )

BlueBorderZone = ZONE_POLYGON:New( "Blue Border", GROUP:FindByName( "Blue Border" ) )

GCICAP_Blue:SetBorderZone( BlueBorderZone )

GCICAP_Blue:SetIntercept( 100 )

GCICAP_Blue:SetDisengageRadius( 100000 )

GCICAP_Blue:SetEngageRadius( 50000 )

GCICAP_Blue:SetGciRadius( 100000 )

GCICAP_Blue:SetDefaultFuelThreshold( 0.20, 0 )

GCICAP_Blue:SetDefaultCapLimit( 64 )

 

 

-- Blue Attack

 

local BlueSpawn1 = SPAWN:New( "SEADUS 1" ) local SpawnGroup = BlueSpawn1:Spawn()

local BlueSpawn2 = SPAWN:New( "SEADUS 2" ) local SpawnGroup = BlueSpawn2:Spawn()

local BlueSpawn3 = SPAWN:New( "SEADUS 3" ) local SpawnGroup = BlueSpawn3:Spawn()

local BlueSpawn4 = SPAWN:New( "Sweep US 1" ) local SpawnGroup = BlueSpawn4:Spawn()

local BlueSpawn5 = SPAWN:New( "Antiship US 1" ) local SpawnGroup = BlueSpawn5:Spawn()

 

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

 

How can I configure the Blue Attack groups to respawn at random intervals, so that I have many instances of them ? I want to use this mission as a basis for a multiplayer server by adding client planes, so I need the AI attackers to show up during the whole duration of the server run.

FT Red Alert AI.miz

FT Red Alert.lua

[sIGPIC][/sIGPIC]

Posted

Look into SpawnScheduled() and InitLimit()

 

Many thanks for all teh suggestions. I made a first mission using MOOSE (Caucasus map DCS 1.5.8), closely inspired by the demo mission and it all seems to work. What I didn't sort out is that I would like to generate Attackers continuously (well within certain limits) by respawning the attack groups. The mechanics of this elude me (they work perfectly for the GCI groups). I included the mission and the script, I paste the script here also:

 

-- Red

GCICAP_Red = AI_A2A_GCICAP:New( "EWR Red", "Intercept Red", "Red CAP", 2 )

GCICAP_Red:SetTacticalDisplay( true )

RedBorderZone = ZONE_POLYGON:New( "Red Border", GROUP:FindByName( "Red Border" ) )

GCICAP_Red:SetBorderZone( RedBorderZone )

GCICAP_Red:SetIntercept( 100 )

GCICAP_Red:SetDisengageRadius( 100000 )

GCICAP_Red:SetEngageRadius( 50000 )

GCICAP_Red:SetGciRadius( 100000 )

 

-- Blue

 

GCICAP_Blue = AI_A2A_GCICAP:New( "EWUS", "US Intercept" )

GCICAP_Blue:SetTacticalDisplay( true )

BlueBorderZone = ZONE_POLYGON:New( "Blue Border", GROUP:FindByName( "Blue Border" ) )

GCICAP_Blue:SetBorderZone( BlueBorderZone )

GCICAP_Blue:SetIntercept( 100 )

GCICAP_Blue:SetDisengageRadius( 100000 )

GCICAP_Blue:SetEngageRadius( 50000 )

GCICAP_Blue:SetGciRadius( 100000 )

GCICAP_Blue:SetDefaultFuelThreshold( 0.20, 0 )

GCICAP_Blue:SetDefaultCapLimit( 64 )

 

 

-- Blue Attack

 

local BlueSpawn1 = SPAWN:New( "SEADUS 1" ) local SpawnGroup = BlueSpawn1:Spawn()

local BlueSpawn2 = SPAWN:New( "SEADUS 2" ) local SpawnGroup = BlueSpawn2:Spawn()

local BlueSpawn3 = SPAWN:New( "SEADUS 3" ) local SpawnGroup = BlueSpawn3:Spawn()

local BlueSpawn4 = SPAWN:New( "Sweep US 1" ) local SpawnGroup = BlueSpawn4:Spawn()

local BlueSpawn5 = SPAWN:New( "Antiship US 1" ) local SpawnGroup = BlueSpawn5:Spawn()

 

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

 

How can I configure the Blue Attack groups to respawn at random intervals, so that I have many instances of them ? I want to use this mission as a basis for a multiplayer server by adding client planes, so I need the AI attackers to show up during the whole duration of the server run.

  • Like 1
Posted

Thanks Delta99, that did the trick! I changed the attack part with the following code, that I also borrowed from the MOOSE example file:

 

-- Blue attack

 

local Frequency = 600

 

BlueSpawn1 = SPAWN

:New( "SEADUS 1" )

:InitLimit( 4, 10 )

:SpawnScheduled( Frequency, 0.4 )

 

BlueSpawn2 = SPAWN

:New( "SEADUS 2" )

:InitLimit( 4, 10 )

:SpawnScheduled( Frequency, 0.4 )

 

BlueSpawn3 = SPAWN

:New( "SEADUS 3" )

:InitLimit( 4, 10 )

:SpawnScheduled( Frequency, 0.4 )

 

BlueSpawn4 = SPAWN

:New( "Sweep US 1" )

:InitLimit( 4, 10 )

:SpawnScheduled( Frequency, 0.4 )

 

BlueSpawn5 = SPAWN

:New( "Antiship US 1" )

:InitLimit( 4, 10 )

:InitRandomizeTemplate( { "SQ Blue Viggen AS", "SQ Blue Frogfoot AS", "SQ Blue Hornet AS" } )

:SpawnScheduled( Frequency, 0.4 )

 

[sIGPIC][/sIGPIC]

  • Recently Browsing   0 members

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