Jump to content

MOOSE - Mission Object Oriented Scripting Framework


Recommended Posts

New updates have been released in 2.2.0.pre:

 

 

  • Fixed the Status Report format in TASK_A2G and TASK (acessible through the Mission Menu).
  • WARNING! Fixed the way functions can be called from waypoints. Modified the :TaskFunction() method in CONTROLLABLE! Cleaned up a lot of noisy code. Now it is very nice and clean. :TaskFunction gets now 2 parameters, the function in a string, and variable arguments, which are set to the CONTROLLABLE and given as variable parameters when the function gets called. I don't think anybody used this method yet in their code, so I don't think this is a (big) compatibility issue.
  • WARNING! Renamed method :RoutePointGround() of COORDINATE to :WaypointGround(). I don't think anybody used this method yet in their code, so I don't think this is a (big) compatibility issue.
  • WARNING! Renamed method :RoutePointAir() of COORDINATE to :WaypointAir(). I don't think anybody used this method yet in their code, so I don't think this is a (big) compatibility issue.
  • Added method :RouteGroundTo() in CONTROLLABLE to route ground groups towards various COORDINATEs.
  • Added method :RouteAirTo() in CONTROLLABLE to route air groups towards various COORDINATEs.
  • Modified the way :RouteTo() works. Much nicer code now.
  • Added REPORT in new Report.lua in Core.
  • Reworked DESIGNATE class... Improved performance, added a limit of maximum detections in scope, better distribution of targets and recces, menu system is much improved.
  • Optimized DETECTION_BASE and derived DETECTION_ classes in various ways.
  • Optimized MENU_COMMAND_GROUP to handle changing function and parameters without having to change the menu text!!!
  • Implemented nearest DESIGNATE distance, which is set by default to 12000 meters (both ground and air).
  • Added a maximum markings per designated target group in DESIGNATE. So not all FACs are occupied.
  • Optimized the designation report in DESIGNATE. Move the horizontal line.
  • Ensured in DESIGNATE that when targets are ordered to be smoke or designated, that this also will happen. Was issue with the scheduler, which got garbage collected before actually being executed, resulting in an obsolete schedule.
  • Fixed the TASKING, coordinates are now updated when enquiring a task report.

Some of these fixes will greatly improve your game play! Like the coordinates now being updated in the planned task reports.

 

You can download the latest release from: https://github.com/FlightControl-Master/MOOSE/releases

 

FC

[TABLE][sIGPIC][/sIGPIC]|

[/TABLE]

Link to comment
Share on other sites

Thanks Sven, integrated into my mission and hosting it on the server

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

Some more fixes, ensure you have the latest version.

 

Especially when using AI_GCICAP in DCS 2.1.1. in NTTR.

 

(DCS 2.1.1. behaves differently than DCS 1.5.7. on route point settings).

 

 

  • Fixed problem with waypoint actions for DCS world 2.1.1.8244. This version behaves differently than DCS world 1.5.7. in terms of waypoint actions for airborne units. Fixes had to be done in AI_A2A, AI_A2A_GCI, AI_A2A_CAP, AI_A2A_PATROL.
  • Fixed problem in SCHEDULERDISPATCHER with the GetClassNameAndID not existing for some objects.

 

 

You can download the latest release from: https://github.com/FlightControl-Master/MOOSE/releases

 

FC

[TABLE][sIGPIC][/sIGPIC]|

[/TABLE]

Link to comment
Share on other sites

I think I'm blind here. This code gives Index error on first line.

 

VehicleGroup = GROUP:FindByName( 'REDConvoy' )
local ToCoord = ZONE:New('SafePoint'):GetCoordinate()
VehicleGroup:RouteGroundTo(ToCoord, 11, 'Vee', 1)

 

Mission have a convoy of tanks "REDConvoy" and a Zone "SafePoint".

Gives error: attempt to index global 'GROUP' (a nil value)

Link to comment
Share on other sites

I think I'm blind here. This code gives Index error on first line.

 

VehicleGroup = GROUP:FindByName( 'REDConvoy' )
local ToCoord = ZONE:New('SafePoint'):GetCoordinate()
VehicleGroup:RouteGroundTo(ToCoord, 11, 'Vee', 1)

Mission have a convoy of tanks "REDConvoy" and a Zone "SafePoint".

Gives error: attempt to index global 'GROUP' (a nil value)

 

 

Your Moose.lua file is not correctly loaded. Check if MOOSE is loaded.

 

Ensure you set a trigger at mission start, loading Moose.lua in a DO SCRIPT.

[TABLE][sIGPIC][/sIGPIC]|

[/TABLE]

Link to comment
Share on other sites

Thanks to all

 

Before I go away a few days, allow me this.

 

WP_20170815_17_17_59_Pro.jpg

 

Got this little object in a box a few weeks ago delivered at my home.

Was thinking what would be the best way to say thanks, and decided to say

 

Thanks to all the users and the contributors!

Most of you knew about my situation, and you stayed and supported the project. It kept me busy while recovering from a severe illness.

 

You guys are amazing.

thank you!

Sven

 

Just an open question, what do I need to do with this object?

Is it a trophy that is sent around year by year?


Edited by FlightControl

[TABLE][sIGPIC][/sIGPIC]|

[/TABLE]

Link to comment
Share on other sites

Yep. More or less. The idea is to honor a member of the community for his/her contribution each year and initiate a poll for the community to vote. Then send it to the "winner".

Have a look at the original nomination thread to get an idea.

 

https://forums.eagle.ru/showthread.php?t=187597

Shagrat

 

- Flying Sims since 1984 -:pilotfly:

Win 10 | i5 10600K@4.1GHz | 64GB | GeForce RTX 3090 - Asus VG34VQL1B  | TrackIR5 | Simshaker & Jetseat | VPForce Rhino Base & VIRPIL T50 CM2 Stick on 200mm curved extension | VIRPIL T50 CM2 Throttle | VPC Rotor TCS Plus/Apache64 Grip | MFG Crosswind Rudder Pedals | WW Top Gun MIP | a hand made AHCP | 2x Elgato StreamDeck (Buttons galore)

Link to comment
Share on other sites

Is there any chance someone could have a little check of this basic template? I seem to be having issues with groups despawning.

 

Some groups despawn fine, others seem to just land and shutdown but remain on the airfield. Sometimes in their original 2 ship, others seem to detatch into singles but again remain on the airfield. Inevitably this leads eventually to the runway becoming blocked with the dodgy AI pathfinding.

 

As far as i can see, it should be set to despawn when the groups are near the airfield.

 

Might be worth noting, i was testing and running on 10x time compression, as it seems to take a while for the problem to start.

 

Here are the two mission files i'm running for the two areas.

 

 

-- 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( { "DF CCCP EWR" } )

DetectionSetGroup:FilterStart()

 

Detection = DETECTION_AREAS:New( DetectionSetGroup, 30000 )

 

-- Setup the A2A dispatcher, and initialize it.

A2ADispatcher = AI_A2A_DISPATCHER:New( Detection )

 

-- Setup the border zone.

-- In this case the border is a POLYGON,

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

-- Any enemy crossing this border will be engaged.

CCCPBorderZone = ZONE_POLYGON:New( "CCCP Border", GROUP:FindByName( "CCCP Border" ) )

A2ADispatcher:SetBorderZone( CCCPBorderZone )

 

A2ADispatcher:SetTacticalDisplay( true )

 

-- Setup the squadrons.

 

A2ADispatcher:SetSquadron( "Gudauta", AIRBASE.Caucasus.Gudauta, { "SQ CCCP MIG-21" } )

A2ADispatcher:SetSquadronTakeoffFromParkingHot( "Gudauta" )

A2ADispatcher:SetSquadronLandingAtRunway( "Gudauta" )

 

A2ADispatcher:SetSquadronGci( "Gudauta", 1000, 1500 )

 

CAPZoneAbk = ZONE_POLYGON:New( "CAP Zone Abk", GROUP:FindByName( "CAP Zone Abk" ) )

A2ADispatcher:SetSquadronCap( "Gudauta", CAPZoneAbk, 4000, 10000, 600, 800, 800, 1200 )

A2ADispatcher:SetSquadronCapInterval( "Gudauta", 2, 10, 30, 1 )

A2ADispatcher:SetSquadronGrouping( "Gudauta", 2 )

 

 

 

-- 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( { "DF RUS EWR" } )

DetectionSetGroup:FilterStart()

 

Detection = DETECTION_AREAS:New( DetectionSetGroup, 30000 )

 

-- Setup the A2A dispatcher, and initialize it.

A2ADispatcher = AI_A2A_DISPATCHER:New( Detection )

 

-- Setup the border zone.

-- In this case the border is a POLYGON,

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

-- Any enemy crossing this border will be engaged.

RUSBorderZone = ZONE_POLYGON:New( "RUS Border", GROUP:FindByName( "RUS Border" ) )

A2ADispatcher:SetBorderZone( RUSBorderZone )

 

A2ADispatcher:SetTacticalDisplay( true )

 

-- Setup the squadrons.

 

A2ADispatcher:SetSquadron( "Mozdok", AIRBASE.Caucasus.Mozdok, { "SQ RUS SU-27" } )

A2ADispatcher:SetSquadronTakeoffFromParkingHot( "Mozdok" )

A2ADispatcher:SetSquadronLandingNearAirbase( "Mozdok" )

 

A2ADispatcher:SetSquadron( "Maykop_Khanskaya", AIRBASE.Caucasus.Maykop_Khanskaya, { "SQ RUS SU-27" } )

A2ADispatcher:SetSquadronTakeoffFromParkingHot( "Maykop_Khanskaya" )

A2ADispatcher:SetSquadronLandingNearAirbase( "Maykop_Khanskaya" )

 

A2ADispatcher:SetSquadronGci( "Mozdok", 1000, 1500 )

A2ADispatcher:SetSquadronGci( "Maykop_Khanskaya", 1000, 1500 )

 

CAPZoneRusEast = ZONE_POLYGON:New( "CAP Zone Rus East", GROUP:FindByName( "CAP Zone Rus East" ) )

A2ADispatcher:SetSquadronCap( "Mozdok", CAPZoneRusEast, 4000, 10000, 600, 800, 800, 1200 )

A2ADispatcher:SetSquadronCapInterval( "Mozdok", 1, 10, 30, 1 )

A2ADispatcher:SetSquadronGrouping( "Mozdok", 2 )

 

CAPZoneRusWest = ZONE_POLYGON:New( "CAP Zone Rus West", GROUP:FindByName( "CAP Zone Rus West" ) )

A2ADispatcher:SetSquadronCap( "Maykop_Khanskaya", CAPZoneRusWest, 4000, 10000, 600, 800, 800, 1200 )

A2ADispatcher:SetSquadronCapInterval( "Maykop_Khanskaya", 1, 10, 30, 1 )

A2ADispatcher:SetSquadronGrouping( "Maykop_Khanskaya", 2 )

TemplateBuildNew.miz


Edited by Shadow.D.
Link to comment
Share on other sites

Hi Shadow, there is a known issue with some of the planes just landing and not de-spawning. The root cause will be somewhere hidden in the logic. I'll find it but I just need to look for it or discover what isn't working properly. It will take time to find the cause.

 

Just use the modules as they are great. As time goes fine tuning will happen.

 

Thank you for reporting.

 

FC

[TABLE][sIGPIC][/sIGPIC]|

[/TABLE]

Link to comment
Share on other sites

Is there a module or a way to check an airfield for idle aircraft and remove them? that could be run once in a while.

 

+1 good idea

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

Aye it's been core to Moose for many months. Depending if you want it as part of your SPAWNed aircraft then it's :InitCleanup(number of seconds at idle) http://flightcontrol-master.github.io/MOOSE/Documentation/Spawn.html##(SPAWN).InitCleanUp

 

There is also an entire cleanup class http://flightcontrol-master.github.io/MOOSE/Documentation/CleanUp.html

 

I'd suggest looking through those help files to get an idea what it can do.

 

Is there a module or a way to check an airfield for idle aircraft and remove them? that could be run once in a while.

___________________________________________________________________________

SIMPLE SCENERY SAVING * SIMPLE GROUP SAVING * SIMPLE STATIC SAVING *

Link to comment
Share on other sites

Spending hours making a missions just to fly it by myself is counter productive. I will already know the mission too well to enjoy it.

I need to grab this thought and say something. This was the exact reason I hated the ME and mission design, it destroyed my immersion. But this is also the EXACT reason why I learned MOOSE, because I could make a mission I did not know what was going to happen in.

 

The secret to good mission design (amongst many other things) is replayability and good, but managed random events/placement. Having an engine randomly position a random unit, with a random course achieves that, and MOOSE is one of those tools (amongst others) that can be used to achieve it more easily than just the ME, or pure scripting.

 

The challenge is to make "random" not too much so the replayability then fits the basic structure of the mission and doesn't break what you need the AI to do, but the human can react and perform enough to overcome such randomness.

 

Or a simple example, you want random air defences. You create a template of choices in it, that template needs to be realistic, you don't want a SA-3, SA-6 template with an SA-10 or SA-15 in it. There comes your experience as a deisgner and an understanding of military assets and their relative performance both in real life AND their adjusted performance in the game.

  • Like 1

___________________________________________________________________________

SIMPLE SCENERY SAVING * SIMPLE GROUP SAVING * SIMPLE STATIC SAVING *

Link to comment
Share on other sites

CLEANUP_AIRBASE? Just not sure if I built this functionality in the module.

If not, it is a good idea to have this function included.

 

Look guys. Am right now away from home.

When I get back, which is in a week, I can look at this issue. This can be fixed.

 

Hope you understand.


Edited by FlightControl

[TABLE][sIGPIC][/sIGPIC]|

[/TABLE]

Link to comment
Share on other sites

Hey FlightControl and the Moose guys.

 

I have a knoob question.

 

I have Moose working, and when I load my mission lua file at mission start, the items begin spawning immediately.

 

I want to control them and have them spawn according to triggers.

 

What's the simplest approach here?

 

I tried calling the second line in a trigger DO SCRIPT but it didn't work.

 

Thanks,

 

lua contents:

 

Spawn_Vehicle_Limited_Scheduled_RandomizeRoute = SPAWN:New( "Spawn Vehicle 1" ):InitLimit( 4, 20 ):SpawnScheduled( 10, 0 )

 

Spawn_Group_1 = Spawn_Vehicle_Limited_Scheduled_RandomizeRoute:Spawn()

 

/Fargo007


Edited by fargo007

 

Banner EDForum2020.jpg

Have fun. Don't suck. Kill bad guys. 👍

https://discord.gg/blacksharkden/

Link to comment
Share on other sites

Instead of do script file

use

do script

then copy paste in the first line into it

In the condition column use a flag value

then set that flag somewhere else and hey presto the code will execute

 

Type (ONCE) Condition ( Flag X = 1 ) Action Do script (paste your first line into text)

 

x = choose your own number


Edited by Johnny_Rico

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

Thank you, I started with a fresh mission and have this generally working.

 

When I enter a trigger zone, a flag gets set, and the units start spawning.

 

I need to figure out how to get them to stop spawning though. Once that code gets switched on, it keeps running. Resetting the flag with a different trigger doesn't stop it.


Edited by fargo007

 

Banner EDForum2020.jpg

Have fun. Don't suck. Kill bad guys. 👍

https://discord.gg/blacksharkden/

Link to comment
Share on other sites

I have been playing with the following, just to create some ai flights to test my air defenses:-

 

BlueSpawn1 = SPAWN
 :New( "RT NATO 1" )
 :InitLimit( 2, 10 )
 :InitRandomizeTemplate( { "SQ NATO F-15C", "SQ NATO F/A-18", "SQ NATO F-16C" } )
 :InitRandomizeRoute( 0, 0, 30000 )
 --:InitDelayOn()
 :SpawnScheduled( Frequency, 0.4 )

I have been running this just on a Do Script trigger.

 

Is there something within MOOSE that i can insert into that script call, to allow me to randomise the number of flight members. I currently have the aircraft templates set with just one aircraft, but ideally would like to be able to place just the one template aircraft in the editor, then let the script define how many are spawned in a flight, from a single ship up to a four ship.

 

I am looking through the documentation to sort this out, but figured i would post here incase it was something quick.

 

Thanks in advance for any help.


Edited by Shadow.D.
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...