Jump to content

MOOSE - Mission Object Oriented Scripting Framework


Recommended Posts

Need help! Again!

 

Hello,

 

I am a beginner at scripting but I want to create a dynamic environment for myself and a couple of guys to fly in.

 

 

First of all I want:

- Abkhazian 1st Fighter Squadron based at Gudauta and equipped with 12 MiG-21Bis to conduct CAP all over Abkazhia with a 2-plane formation.

 

- The same squadron to scramble interceptors in pairs when the CAP is engaged or unavailable.

 

 

For this I tried the GCICAP scripts which I finally got working but they didn't have all the details in them that I wanted. So I am now trying the DISPATCHER instead. I looked at the example mission and modified the same script for my purpose.

 

It looks like this:

---

-- Name: GEORGIA_1994_AI_A2A_DISPATCHER

-- Author: Mats Hjorter

-- Date Created: 10 Oct 2018

 

 

-- Define a SET_GROUP object that builds a collection of groups that define the EWR network.

-- Here we build the network with all the groups that have a name starting with DF CCCP AWACS and DF CCCP EWR.

DetectionSetGroup = SET_GROUP:New()

DetectionSetGroup:FilterPrefixes( { "ABK EWR" } )

DetectionSetGroup:FilterStart()

 

Detection = DETECTION_AREAS:New( DetectionSetGroup, 30000 )

 

-- Setup the A2A dispatcher, and initialize it.

A2ADispatcher = AI_A2A_DISPATCHER:New( Detection )

 

-- Enable the tactical display panel.

A2ADispatcher:SetTacticalDisplay( true )

 

-- Initialize the dispatcher, setting up a border zone. This is a polygon,

-- which takes the waypoints of a late activated group with the name ABK Border as the boundaries of the border area.

-- Any enemy crossing this border will be engaged.

ABKBorderZone = ZONE_POLYGON:New( "ABK Border", GROUP:FindByName( "ABK Border" ) )

A2ADispatcher:SetBorderZone( ABKBorderZone )

 

-- 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.

A2ADispatcher:SetEngageRadius( 100000 )

 

-- Setup the squadrons.

A2ADispatcher:SetSquadron( "1ST", AIRBASE.Caucasus.Gudauta, { "ABK MIG-21" }, 12 )

 

-- Setup the overhead

A2ADispatcher:SetSquadronOverhead( "1ST", 1.2 )

 

-- Setup the Grouping

A2ADispatcher:SetSquadronGrouping( "1ST", 2 )

 

-- Setup the Takeoff methods

A2ADispatcher:SetSquadronTakeoff( "1ST", AI_A2A_Dispatcher.Takeoff.Hot )

 

-- Setup the Landing methods

A2ADispatcher:SetSquadronLandingAtEngineShutdown( "1ST" )

 

-- CAP Squadron execution.

CAPZoneEast = ZONE_POLYGON:New( "ABK Border", GROUP:FindByName( "ABK Border" ) )

A2ADispatcher:SetSquadronCap( "1ST", Abkhazia, 4000, 10000, 500, 600, 800, 900)

A2ADispatcher:SetSquadronCapInterval( "1ST", 2, 30, 180, 1 )

 

-- GCI Squadron execution.

A2ADispatcher:SetSquadronGci( "1ST", 900, 1200 )

 

The tactical panel shows that my test F-15s get detected but no MiGs spawn to intercept or to conduct CAP.

 

What have I missed?

 

Also: Is there a MOOSE equivalent to the Integrated Air Defense System or Smarter SAMs scripts? - I also would like all the SAMs to cooperate and give us a hard time!

 

Thankful for any help!

/Mats

GEORGIA_1994_AI_A2A_DISPATCHER.lua

GEORGIA_1994-09-25 .miz

Link to comment
Share on other sites

Hey guys wondering if someone can shed some light on my issue.

 

I've been banging my head to the wall trying to get the new Warehouse module working as described and I'm having no luck. I have even tried to set up a simple infantry self request with a single warehouse to make sure the feature is working and I'm stumped.

 

I'm a novice script writer at best and I'm sure it's something I'm doing wrong, but I just can't seem to troubleshoot it myself.

 

I've included the .lua file if anyone could take a few moments to check/test with their own quick mission setup. Note: I have the latest moose.lua and source code from the github site and I am loading the Moose.lua then my script lua file at mission start in the proper order.

 

Thanks!

You have a typo on line 17, you wrote resDetection instead of redDetection. I don´t think this is causing the problem you mention, but it will surely cause other problems, specially in line 23 when you call AI_A2A_Dispatcher:New(redDetection)

Intel i5-7600K @3,80 (4,9 OC) + Corsair Vengeance 16GB DDR4@3200 XMP 2.0 + Cooler Master Hyper 212 LED + Asus MAXIMUS IX HERO + Thermaltake Chaser A31 Snow Edition

Geforce RTX 2060 6GB

SSD Samsung 850 EVO 500GB + HDD WDC WD500 500GB

Saitek X-52 Pro & Thrustmaster T.Flight Rudder Pedals & TrackIR 5 & Kingston HyperX Alloy FPS

Oh, yeah, also the Sony PlayStation 4 :happy:

Link to comment
Share on other sites

You have a typo on line 17, you wrote resDetection instead of redDetection. I don´t think this is causing the problem you mention, but it will surely cause other problems, specially in line 23 when you call AI_A2A_Dispatcher:New(redDetection)

 

Thanks polten. Fortunately I caught that typo as well and fixed it and my GCI setup is working great now.

 

Still not having any luck with the Warehouse feature however. I have pretty much copied the basic self request example in the moose documentation but nothing happens. The warehouse doesn't appear to do anything when I launch the mission. The example also states that the map should have a marker placed at the warehouse with the available assets but I'm not seeing that either.

 

If you need me to include a miz file along with the Warehouse test I can do that later when I get home from work.

 

Thanks for the reply!

 

 

EDIT: I just realized the .lua file i uploaded in my original post doesn't even have the warehouse scripting I was trying to implement (doi!). It seems I uploaded a previous version of my script so I'll have to re-post it with the correct file when I get home.


Edited by Vishari
Link to comment
Share on other sites

When are the luas internalized into the miz file? When I add them in the trigger menus or when I save the mission?

 

You have to save the mission file typically after adding them to the trigger menu. When you update your .lua mission file, just open the trigger, reselect the file and save. Usually its pointing right at the file already.

Link to comment
Share on other sites

it can be tricky IF you edit a lua file, then save it

What i tend to do to avoid errors/it not being updated is to

1. Quit ME go to main screen in dcs

2. Open miz file in winrar nav to l10n/Defaults drop the SAVED lua file in there

3. close winrar

4. Open ME in DCS and open the mission

 

These are steps I wouldn't recommend. See my previous post. Much more simple than this and a lot quicker. Easier for testing etc.

Link to comment
Share on other sites

Hi Mats

 

at line A2ADispatcher:SetSquadronTakeoff( "1ST", AI_A2A_Dispatcher.Takeoff.Hot )

it should be

A2ADispatcher:SetSquadronTakeoff( "1ST", AI_A2A_DISPATCHER.Takeoff.Hot )

 

dcs.log is your friend. Get used to looking at it whenever something is not working and it will likely point you to issues like this. The last couple of errors I see posted here were straight up syntax errors that will be easy to catch in dcs.log I would think.

Link to comment
Share on other sites

Hey Gents...

Lets say in this example I want to use a polygon to define the orbit instead of a Zone.

 

A2A_GCICAP_Red:SetSquadron( "TAB-1", AIRBASE.PersianGulf.Shiraz_International_Airport, { "TAB 1 F-5E", "TAB 1 F-7M", "TAB 1 F-14A", "TAB 1 MiG-29A" }, 24 )

A2A_GCICAP_Red:SetSquadronCap( "TAB-1", ZONE:New( "ORBIT_1" ), 4000, 10000, 500, 600, 800, 900 )

A2A_GCICAP_Red:SetSquadronCapInterval( "TAB-1", 1, 60, 1200, 1 ) -- Starts a 2 CAP after 300 and finishes after 1200 seconds.

 

Would the correct syntax be:

A2A_GCICAP_Red:SetSquadron( "TAB-1", AIRBASE.PersianGulf.Shiraz_International_Airport, { "TAB 1 F-5E", "TAB 1 F-7M", "TAB 1 F-14A", "TAB 1 MiG-29A" }, 24 )

 

A2A_GCICAP_Red:SetSquadronCap( "TAB-1", ZONE_POLYGON:New( "ORBIT_1", GROUP:FindByName( "Orbit 1" ) ), 4000, 10000, 500, 600, 800, 900 )

 

A2A_GCICAP_Red:SetSquadronCapInterval( "TAB-1", 1, 60, 1200, 1 ) -- Starts a 2 CAP after 300 and finishes after 1200 seconds.

 

 

???

[sIGPIC][/sIGPIC]

Primary Computer

ASUS Z390-P, i7-9700K CPU @ 5.0Ghz, 32GB Patriot Viper Steel DDR4 @ 3200Mhz, ZOTAC GeForce 1070 Ti AMP Extreme, Samsung 970 EVO M.2 NVMe drives (1Tb & 500 Gb), Windows 10 Professional, Thrustmaster Warthog HOTAS, Thrustmaster Warthog Stick, Thrustmaster Cougar Throttle, Cougar MFDs x3, Saitek Combat Rudder Pedals and TrackIR 5.

 

-={TAC}=-DCS Server

Gigabyte GA-Z68XP-UD3, i7-3770K CPU @ 3.90GHz, 32GB G.SKILL Ripjaws DDR3 @ 1600Mhz, ZOTAC GeForce® GTX 970.

Link to comment
Share on other sites

These are steps I wouldn't recommend. See my previous post. Much more simple than this and a lot quicker. Easier for testing etc.

 

 

the reload method you suggest does not work 100% of the time

the one i suggested does

METAR weather for DCS World missions

 

Guide to help out new DCS MOOSE Users -> HERE

Havoc Company Dedicated server info Connect IP: 94.23.215.203

SRS enabled - freqs - Main = 243, A2A = 244, A2G = 245

Please contact me HERE if you have any server feedback or METAR issues/requests

Link to comment
Share on other sites

Ok,

 

So I spent the day playing with the RAT function and came up with a question...

 

Is there a way to control the Timing of when different aircraft spawn? I would like to vary the rate that different aircraft spawn so the ratio of 737s to A320 looks correct.

[sIGPIC][/sIGPIC]

Primary Computer

ASUS Z390-P, i7-9700K CPU @ 5.0Ghz, 32GB Patriot Viper Steel DDR4 @ 3200Mhz, ZOTAC GeForce 1070 Ti AMP Extreme, Samsung 970 EVO M.2 NVMe drives (1Tb & 500 Gb), Windows 10 Professional, Thrustmaster Warthog HOTAS, Thrustmaster Warthog Stick, Thrustmaster Cougar Throttle, Cougar MFDs x3, Saitek Combat Rudder Pedals and TrackIR 5.

 

-={TAC}=-DCS Server

Gigabyte GA-Z68XP-UD3, i7-3770K CPU @ 3.90GHz, 32GB G.SKILL Ripjaws DDR3 @ 1600Mhz, ZOTAC GeForce® GTX 970.

Link to comment
Share on other sites

view?usp=sharing I'm getting this message from Eclipse LDT when I try to Moose 2.4.3 Source Framework.

 

<<An Internal error occured during :"Build Modules".

Build Modules

Build Modules

Build Modules

Build Modules>>>>

 

Would you know why?


Edited by rooster328
link not showing
Link to comment
Share on other sites

Is there a way to control the Timing of when different aircraft spawn? I would like to vary the rate that different aircraft spawn so the ratio of 737s to A320 looks correct.

Hi, check out the :SetSpawnDelay(delay) and :SetSpawnInterval(interval) functions. They allow you to delay the first spawning and adjust the intervall between spawns.

A warrior's mission is to foster the success of others.

i9-12900K | MSI RTX 3080Ti Suprim X | 128 GB Ram 3200 MHz DDR-4 | MSI MPG Edge Z690 | Samung EVO 980 Pro SSD | Virpil Stick, Throttle and Collective | MFG Crosswind | HP Reverb G2

RAT - On the Range - Rescue Helo - Recovery Tanker - Warehouse - Airboss

Link to comment
Share on other sites

Hi, check out the :SetSpawnDelay(delay) and :SetSpawnInterval(interval) functions. They allow you to delay the first spawning and adjust the intervall between spawns.

 

Hey Funkyfranky can ya take a look at this?

 

https://forums.eagle.ru/showpost.php?p=3654182&postcount=1284

[sIGPIC][/sIGPIC]

Primary Computer

ASUS Z390-P, i7-9700K CPU @ 5.0Ghz, 32GB Patriot Viper Steel DDR4 @ 3200Mhz, ZOTAC GeForce 1070 Ti AMP Extreme, Samsung 970 EVO M.2 NVMe drives (1Tb & 500 Gb), Windows 10 Professional, Thrustmaster Warthog HOTAS, Thrustmaster Warthog Stick, Thrustmaster Cougar Throttle, Cougar MFDs x3, Saitek Combat Rudder Pedals and TrackIR 5.

 

-={TAC}=-DCS Server

Gigabyte GA-Z68XP-UD3, i7-3770K CPU @ 3.90GHz, 32GB G.SKILL Ripjaws DDR3 @ 1600Mhz, ZOTAC GeForce® GTX 970.

Link to comment
Share on other sites

That looks correct. Did it work?

 

Hey Gents...

Lets say in this example I want to use a polygon to define the orbit instead of a Zone.

 

A2A_GCICAP_Red:SetSquadron( "TAB-1", AIRBASE.PersianGulf.Shiraz_International_Airport, { "TAB 1 F-5E", "TAB 1 F-7M", "TAB 1 F-14A", "TAB 1 MiG-29A" }, 24 )

A2A_GCICAP_Red:SetSquadronCap( "TAB-1", ZONE:New( "ORBIT_1" ), 4000, 10000, 500, 600, 800, 900 )

A2A_GCICAP_Red:SetSquadronCapInterval( "TAB-1", 1, 60, 1200, 1 ) -- Starts a 2 CAP after 300 and finishes after 1200 seconds.

 

Would the correct syntax be:

A2A_GCICAP_Red:SetSquadron( "TAB-1", AIRBASE.PersianGulf.Shiraz_International_Airport, { "TAB 1 F-5E", "TAB 1 F-7M", "TAB 1 F-14A", "TAB 1 MiG-29A" }, 24 )

 

A2A_GCICAP_Red:SetSquadronCap( "TAB-1", ZONE_POLYGON:New( "ORBIT_1", GROUP:FindByName( "Orbit 1" ) ), 4000, 10000, 500, 600, 800, 900 )

 

A2A_GCICAP_Red:SetSquadronCapInterval( "TAB-1", 1, 60, 1200, 1 ) -- Starts a 2 CAP after 300 and finishes after 1200 seconds.

 

 

???

Link to comment
Share on other sites

Small feedback question, how do you guys like the cargo stuff?

 

 

https://flightcontrol-master.github.io/MOOSE_DOCS_DEVELOP/Moose_Cargo.html

[TABLE][sIGPIC][/sIGPIC]|

[/TABLE]

Link to comment
Share on other sites

It’s awesome. I hope to have my mission out using it at some point. But haven’t had a lot of time to work on it and finish it.

 

Small feedback question, how do you guys like the cargo stuff?

 

 

https://flightcontrol-master.github.io/MOOSE_DOCS_DEVELOP/Moose_Cargo.html

Link to comment
Share on other sites

Small feedback question, how do you guys like the cargo stuff?

 

 

https://flightcontrol-master.github.io/MOOSE_DOCS_DEVELOP/Moose_Cargo.html

 

 

I'm starting to mess with it (I'm the one with the weird UH-1H problem :) ) and actually just came looking in this thread to see if there was a right way to have an AI helo RTB and land/shutdown after moving its cargo.

 

 

The first thing I tried was this, which had some unexpected results. What seems to happen is that the original group is deleted and a new group is spawned in the home zone, and the new group does go and land at the FARP.

 

 

function heloDispatcher:OnAfterHome(From,Event,To,CarrierGroup,Coordinate,Speed,Height,PickupZone)
   self:Stop()
   CarrierGroup:RouteRTB( AIRBASE:FindByName("FARPDallas") )
 end

Rather than try to debug what's happening there and hack something together that's wrong, is there documentation for the right way to release a group from cargo dispatcher duties? :)

Link to comment
Share on other sites

I believe that is standard behavior for using RouteRTB. There is nothing to make a group go land at an airbase otherwise. There have been a lot of attempts to do this but none work. Airframes only like landing at their original airbase or their destination airbase that is setup in the ME.

 

I'm starting to mess with it (I'm the one with the weird UH-1H problem :) ) and actually just came looking in this thread to see if there was a right way to have an AI helo RTB and land/shutdown after moving its cargo.

 

 

The first thing I tried was this, which had some unexpected results. What seems to happen is that the original group is deleted and a new group is spawned in the home zone, and the new group does go and land at the FARP.

 

 

function heloDispatcher:OnAfterHome(From,Event,To,CarrierGroup,Coordinate,Speed,Height,PickupZone)
   self:Stop()
   CarrierGroup:RouteRTB( AIRBASE:FindByName("FARPDallas") )
 end

Rather than try to debug what's happening there and hack something together that's wrong, is there documentation for the right way to release a group from cargo dispatcher duties? :)

Link to comment
Share on other sites

I believe that is standard behavior for using RouteRTB. There is nothing to make a group go land at an airbase otherwise. There have been a lot of attempts to do this but none work. Airframes only like landing at their original airbase or their destination airbase that is setup in the ME.

 

 

The FARP actually is its original airbase, but what was weird was that the group was deleted and respawned (or maybe teleported? the log showed it being re-registered).

 

 

What's the right way to disassociate a cargo vehicle group from a dispatcher if you want the group to be done transporting cargo?

Link to comment
Share on other sites

The FARP actually is its original airbase, but what was weird was that the group was deleted and respawned (or maybe teleported? the log showed it being re-registered).

 

 

What's the right way to disassociate a cargo vehicle group from a dispatcher if you want the group to be done transporting cargo?

 

Typically you don't need to as that is what it is doing by going to its "Home" location that you designated. Unfortunately they won't shut down engines so will just sit there forever until they run out of fuel (maybe).

 

I suppose you can stop the dispatcher but not sure that is really necessary.

 

As I said the only way to do that RouteRTB is by spawning a new aircraft in place of the current one. So this is an ugly work-around but the only way to do it as far as I am aware.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

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