MOOSE - Mission Object Oriented Scripting Framework - Page 112 - ED Forums
 


Notices

Reply
 
Thread Tools Display Modes
Old 06-08-2018, 03:39 AM   #1111
Esper
Junior Member
 
Esper's Avatar
 
Join Date: Sep 2015
Location: Canada
Posts: 37
Default

Seen it happens here too.
__________________
Wow, such landing, much no gear, so slide...

T.16000M FCS HOTAS
Owned : Flaming Cliff 3 | Mig-21Bis | AJS-37 Viggen | F/A-18C
Wishlist : F-5E | F-14 | F-4 | Mi-24 | MiG-23 | F-15E
Dev. Wishlist : F-16 | Tornado | Mirage F1 | MiG-25 | F-104 | Étendard/Super Étendard | Saab 35 Draken
Esper is offline   Reply With Quote
Old 06-08-2018, 12:01 PM   #1112
Silvern
Member
 
Silvern's Avatar
 
Join Date: May 2016
Posts: 293
Default

Quote:
Originally Posted by Esper View Post
Seen it happens here too.
Did you manage to fix it?
Silvern is offline   Reply With Quote
Old 06-09-2018, 12:32 AM   #1113
Scifer
Junior Member
 
Join Date: Nov 2014
Posts: 17
Default

Quote:
Originally Posted by emolina View Post
I think that once you get the MOOSE version of a unit (UNIT:FindByName) you can then use the CONTROLLABLE:GetDetectedTargets function to find what the unit has detected because Units inherit from Controllable.

You can pass GetDetectedTargets a parameter to make it only return targets that are detected visually.
GetDetectedTargets returns nil when the unit is player-controlled.

I want to make a FAC Gazelle mission too. Please help.
Scifer is offline   Reply With Quote
Old 06-09-2018, 07:01 AM   #1114
funkyfranky
Senior Member
 
funkyfranky's Avatar
 
Join Date: Sep 2015
Location: Asgård
Posts: 1,606
Default

Quote:
Originally Posted by Scifer View Post
GetDetectedTargets returns nil when the unit is player-controlled.
I want to make a FAC Gazelle mission too. Please help.
It's not possible because a player controlled unit does not automatically detect targets. Only AI do. That's why the detection class is only working for AI units.

You might want to create an AI wingman how then detects the targets. There is also an escort class in MOOSE that does what you want
https://flightcontrol-master.github....on/Escort.html
__________________
Of all the things I've lost, I miss my mind the most. --- Mark Twain
i7-8700K | Asus GTX 1080 Ti Strix OC| 32 GB Ram 3200 MHz DDR-4| Win 10 64-bit | Asus Maximus Hero X | Samung EVO 960 Pro SSD | VKB Gunfighter Pro | MFG Crosswind | CV1
funkyfranky is offline   Reply With Quote
Old 06-09-2018, 08:12 PM   #1115
Delta99
Member
 
Delta99's Avatar
 
Join Date: Jan 2017
Posts: 248
Default

Quote:
Originally Posted by funkyfranky View Post
It's not possible because a player controlled unit does not automatically detect targets. Only AI do. That's why the detection class is only working for AI units.

You might want to create an AI wingman how then detects the targets. There is also an escort class in MOOSE that does what you want
https://flightcontrol-master.github....on/Escort.html
BUT, ED could potentially do this because they do it currently for FOW purposes. So it is modelled and done just not exposed via the same API call I guess. I think it is likely also that a player controlled unit is not technically a controllable (or is it)?
__________________
My Missions: Valley Patrol Mission :: Valley Escort Mission :: A2A Engagements
Delta99 is offline   Reply With Quote
Old 06-12-2018, 07:20 PM   #1116
Shadow.D.
Member
 
Join Date: Dec 2007
Location: United Kingdom
Posts: 260
Default

Hi guys, i have the following for setting up a basic EWR/GCI.


Code:
-- Define OPFOR EWR net
-- Object var name set as prefix within editor
OPFOR_EWRGroup = SET_GROUP:New()
OPFOR_EWRGroup:FilterPrefixes( { "EWRIRAN" } )
OPFOR_EWRGroup:FilterStart()

-- Define EWR group as monitored air space
OPFOR_AirSpace = DETECTION_AREAS:New( OPFOR_EWRGroup, 60000 )

-- Init A2A controller
OPFOR_A2A_Dispatcher = AI_A2A_DISPATCHER:New( OPFOR_AirSpace )

-- Debug -- Enable Tac Display
OPFOR_A2A_Dispatcher:SetTacticalDisplay( true )

-- Initialize the dispatcher, setting up a radius of 100km where any airborne friendly 
-- without an assignment within 100km radius from a detected target, will engage that target.
OPFOR_A2A_Dispatcher:SetEngageRadius()

-- Setup OPFOR sqn
OPFOR_A2A_Dispatcher:SetSquadron( "OPFOR_Bandar_Abbas", "Bandar Abbas Intl", { "IRANMIG21","IRANMIG29","IRANF5" }, 20 )
OPFOR_A2A_Dispatcher:SetSquadron( "OPFOR_Tunb_Island_AFB", "Tunb Island AFB", { "IRANMIG21","IRANF5" }, 20 )
OPFOR_A2A_Dispatcher:SetSquadron( "OPFOR_Lar_Airbase", "Lar Airbase", { "IRANMIG21","IRANMIG29","IRANF5" }, 20 )

-- Setup the Takeoff methods
OPFOR_A2A_Dispatcher:SetSquadronTakeoffFromParkingHot( "OPFOR_Bandar_Abbas" )
OPFOR_A2A_Dispatcher:SetSquadronTakeoffFromParkingHot( "OPFOR_Tunb_Island_AFB" )
OPFOR_A2A_Dispatcher:SetSquadronTakeoffFromParkingHot( "OPFOR_Lar_Airbase" )

-- Setup the Landing methods
OPFOR_A2A_Dispatcher:SetSquadronLandingAtEngineShutdown( "OPFOR_Bandar_Abbas" )
OPFOR_A2A_Dispatcher:SetSquadronLandingAtEngineShutdown( "OPFOR_Tunb_Island_AFB" )
OPFOR_A2A_Dispatcher:SetSquadronLandingAtEngineShutdown( "OPFOR_Lar_Airbase" )

-- GCI Squadron execution.
OPFOR_A2A_Dispatcher:SetSquadronGci( "OPFOR_Bandar_Abbas", 900, 1200 )
OPFOR_A2A_Dispatcher:SetSquadronGci( "OPFOR_Tunb_Island_AFB", 900, 1200 )
OPFOR_A2A_Dispatcher:SetSquadronGci( "OPFOR_Lar_Airbase", 900, 1200 )
Is it possible to add defined cap zones into this? So i could access the squadrons and ewr detection, but have seperate cap flights that spawn then patrol a defined area, then engage based on the detection zone.


I'm still trying to learn MOOSE atm and am generally copy pasting code fragments and seeing what works.

Last edited by Shadow.D.; 06-12-2018 at 08:06 PM.
Shadow.D. is offline   Reply With Quote
Old 06-13-2018, 12:07 PM   #1117
kaymelkan
Junior Member
 
kaymelkan's Avatar
 
Join Date: Nov 2016
Location: Lausanne, Switzerland
Posts: 19
Default

Quote:
Originally Posted by Shadow.D. View Post
Is it possible to add defined cap zones into this? So i could access the squadrons and ewr detection, but have seperate cap flights that spawn then patrol a defined area, then engage based on the detection zone.
Yes you can do so pretty easily by defining CAP Zone(s) and assigning units from templates you defined before or even new ones. Note that MOOSE will be assigning interception tasks smartly, for example GCI will not takeoff if a CAP is already airborne and in range to deal with the threat.

Code:
-- Setup CAP Zone: put an airborne unit late activated named "IRCAP West" or whatever you want in your ME and draw a zone with waypoints.
IRCAPWEST = ZONE_POLYGON:New( "IRCAP West", GROUP:FindByName( "IRCAP West" ) )

-- CAP Parameters: setup your CAP, for example:
OPFOR_A2A_Dispatcher:SetSquadronCap( "OPFOR_Bandar_Abbas", IRCAPWEST, 2000, 10000, 600, 800, 800, 1200, "BARO" )
-- Here I basically say: I want a CAP composed of planes of OPFOR_Bandar_Abbas squadron template in the IRCAPWEST, minAlt 2000m maxAlt 10'000m patrolMinSpeed 600kmh patrolMaxSpeed 800 kmh interceptMinSpeed 800kmh interceptMaxSpeed 1200hmh altType Barometric.

-- Then I setup the CAP interval, here I say that I want a max of two CAPs in the zone then I setup the minimum and maximum time boundary in seconds when a new CAP will be spawned with 50%  chance. Note this line is optional, default maxCap is 1.
OPFOR_A2A_Dispatcher:SetSquadronCapInterval( "OPFOR_Bandar_Abbas", 2, 180, 600, 0.5 )
Check https://flightcontrol-master.github....ispatcher.html for detailed description of every function and parameters, tutorials and video playlist. This module is very well documented thanks to FlightControl and the Moose team
kaymelkan is offline   Reply With Quote
Old 06-13-2018, 02:55 PM   #1118
Shadow.D.
Member
 
Join Date: Dec 2007
Location: United Kingdom
Posts: 260
Default

Thanks alot kaymelkan.


Yeah i'm reading through documentation when i need something specific, then looking at the template missions for each case which i think i might need to use. Its just the putting it all together part that is catching me out.
Shadow.D. is offline   Reply With Quote
Old 06-13-2018, 03:30 PM   #1119
Shadow.D.
Member
 
Join Date: Dec 2007
Location: United Kingdom
Posts: 260
Default

Follow up question for anyone, does the amount of EWR units defined in the array, affect peformance in anyway?


i.e is MOOSE doing more calculations if i have 8 EWR units as opposed to 2.
Shadow.D. is offline   Reply With Quote
Old 06-13-2018, 05:48 PM   #1120
kaymelkan
Junior Member
 
kaymelkan's Avatar
 
Join Date: Nov 2016
Location: Lausanne, Switzerland
Posts: 19
Default

It certainly will because it requires more computational power I guess.
Although I found it is quite negligible.

Go to your DCS.log, it should display how much CPU scripting is using in %. Note that this is a relative number so it can get high if you run the mission for a too short period of time, especially if you have a lot of units spawning at the beginning (like RAT does).

I use RAT (quite heavily), AI2ADispatch & Spawn, and performance are not affected throughout the mission. At launch I may have a long freeze when RAT spawns all the traffic but mainly because I am running on HDD and textures take time to load.

Last edited by kaymelkan; 06-13-2018 at 05:52 PM.
kaymelkan is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT. The time now is 02:25 PM. vBulletin Skin by ForumMonkeys. Powered by vBulletin®.
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.