Jump to content

MOOSE - Mission Object Oriented Scripting Framework


Recommended Posts

I am glad all this conversation came up. The way I see it, this is a win win situation already. There is a lot of positive, useful and instructive information that came out already just out these posts alone.

Now if it moves forward and some of the ideas proposed come to light, that would be the cherry on top!!

 

Thanks for all the people keeping MOOSE alive!!

 

PS: thanks for the video Hardcard, this single most important part of it, IMO, the clarification that it takes a few minutes for intelligence to load!! There was no reference to that anywhere. And we are spoiled to expect instant results. Thanks again for the video

 

@Pikes. We are in the dark. Trying to follow any stray of light that we could find (LDT was that blinking spec of light) thanks for pointing a flash light at it and let us see that it is like trying to learn a complicated tool to work on a complicated machine (Moose) to make simple toys (spawn a tank). That was an eye opener, at least for me. We will still try to learn one way or the other.

 

I really hope some of the ideas proposed come true

 

Thanks


Edited by xXMustangXx
Link to comment
Share on other sites

SEAD evasion script

 

@Hardcard

 

 

I was wondering if you could share some insight on how the script works and how to employ HARMs against this script. The script is turning off the radar when it detects a HARM? Does the script detect MAVs and attempt to shot down? I also notice the mobile units like SA-15s and SA-19s will move.

 

 

 

Hit accuracy at long ranges with HARMs is about 25% if that. A long range shot will usually lose lock during the loft and fly 10s of miles past the site. I see this as being more realistic than without the script.

 

 

 

I'm trying to figure out how figure out use HARMs against longer range SAM sites like the SA-6 SA-10 and SA-11 sites. It seems that closer in is better as it gives the radar no time to turn off before the missile is on top of them.

 

 

Cheers

Link to comment
Share on other sites

Hello

There is a problem with

A2ADispatcher:SetSquadronCap("Vaziani", CAPZone_1, 4000, 10000, [color=Red]800[/color] ,900, 900, 1200, "RADIO")

It is set to fly a minimum of 800 km/h, AI units are on the fly only 250 km/h.

Yes there is a lot of slow planes around at the moment, I am aware. I think some of it is DCS as it's newish. But there are also contexts where it works if the values are OK, so not sure how else to reply except I'm looking at it.

___________________________________________________________________________

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

Link to comment
Share on other sites

@marginal

 

The script checks the weapon type used in SHOT events.

 

If it's an anti-radiation missile and the target belongs to a specified SAM site, the following randomizer kicks in, which generates a random chance of evasion, from 1 to 100:

 

local _evade = math.random (1,[color="Red"]100[/color]) [color="Blue"]--If you want to reduce the chance of evasion, set the second number to a value lower than 100[/color]

 

Mavericks aren't anti-radiation missiles, so the script will ignore them.

Link to comment
Share on other sites

Hi guys, I'm quite new to MOOSE and I'm building my first mission. I would like to know if it is possible to avoid to link mission script .lua without the "DoScriptFile", that I have to load everytime I change something in my code, in a more dynamic way.

Thanks for helping

Link to comment
Share on other sites

@Guzzo

 

You can load scripts dynamically by defining the script path.

 

For instance, let's say that you want to dynamically load both Moose.lua and a script that you're working on.

 

Create a new ME trigger, give it a DO SCRIPT action, declare the script path and then run assert for both script files:

 

missionScriptPath = "C:\\Users\\My_Username\\Desktop\\My_Mission\\" [color="Blue"]-- Files are located in Desktop, inside "My_Mission" folder. Don't forget to use \\[/color]
assert(loadfile(missionScriptPath.."[color="Red"]Moose.lua[/color]"))()
assert(loadfile(missionScriptPath.."[color="red"]My_Script.lua[/color]"))()

 

 

Any changes made to Moose.lua or My_Script.lua, will be applied every time you run that code, no need to load the files manually.


Edited by Hardcard
Link to comment
Share on other sites

@Guzzo

 

You can load scripts dynamically by defining the script path.

 

For instance, let's say that you want to dynamically load both Moose.lua and a script that you're working on.

 

Create a new ME trigger, give it a DO SCRIPT action, declare the script path and then run assert for both script files:

 

missionScriptPath = "C:\\Users\\My_Username\\Desktop\\My_Mission\\" [color="Blue"]-- Files are located in Desktop, inside "My_Mission" folder. Don't forget to use \\[/color]
assert(loadfile(missionScriptPath.."[color="Red"]Moose.lua[/color]"))()
assert(loadfile(missionScriptPath.."[color="red"]My_Script.lua[/color]"))()

 

 

Any changes made to Moose.lua or My_Script.lua, will be applied every time you run that code, no need to load the files manually.

 

 

 

OK, lets see if I understood...

 

...so, instead of:

 

trigger MISSION START / EMPTY / DO SCRIPT FILE moose.lua

trigger MISSION START / EMPTY / DO SCRIPT FILE My_script.lua

 

I can do:

trigger MISSION START / EMPTY / DO SCRIPT

 

missionScriptPath = "C:\\Users\\My_Username\\Desktop\\My_Mission\\" [color="Blue"]-- Files are located in Desktop, inside "My_Mission" folder. Don't forget to use \\[/color]
assert(loadfile(missionScriptPath.."[color="Red"]Moose.lua[/color]"))()
assert(loadfile(missionScriptPath.."[color="red"]My_Script.lua[/color]"))()

 

Thanks!!

Link to comment
Share on other sites

Help Request// Scoring // Dynamic SetDefaultTanker Dispatcher

 

Hello All!, first Thanks to FlightControl and all the people who help this proyect continue, is really funny to use and play with moose.

 

I'm starting to play with moose, and im trying to create a sandbox playground (probably a funny mp mission) but i encounter two problems that make my mission actually unplayable, and want to check if is me that dont know yet how to use or is a bug in moose/dcs. Hope someone can help me find out.

 

First problem is with the SCORING, my command center assign missions that one Detection EWR find, and automatically asign to a player, the score system seems to work, but when someone kill the mission target, the task seems to no succes complete and never grant the player witht the points. Also the command center task seems to say that the enemy pilot is dead but you can see the mission is not finished (also marked as obsolet and if you leave it disapear but never grant the points ) as you can see in this screenshot.

This make me think thaat the problem is with the task goal and not with the score, also if i disable the score system the task did not complete.

error2.png

 

Here the code for this part of the mission:

 

--CONFIGURACION SCORING
local Scoring = SCORING:New( "Scoring File" )
Scoring:SetScaleDestroyScore( 10 )
Scoring:SetScaleDestroyPenalty( 40 )
Scoring:SetMessagesToAll( true )
Scoring:SetMessagesHit( true )
Scoring:SetMessagesDestroy( true )

--Scoring.SetMessagesAddon(1)
--Scoring.SetMessagesZone(1)
--Scoring.SetMessagesToAll(1)
--local ScoringFirstMission = SCORING:New( "FirstMission" )
--local ScoringSecondMission = SCORING:New( "SecondMission" )
Scoring:ReportScoreAllSummary(PlayerGroup)
BASE:TraceOnOff(true)
BASE:TraceLevel(3)
BASE:TraceClass("TaskDispatcher")


--CONFIGURACION COMMAND CENTER Y MISSIONES BLUE
HQ = GROUP:FindByName( "HQ", "Bravo" )
CommandCenter = COMMANDCENTER:New( HQ, "Tactical AIR DEFENCE" )
CommandCenter:SetAutoAssignTasks( true )
Mission = MISSION:New( CommandCenter, "DEFCON", "CRITICAL", "Missions for defence air space", coalition.side.BLUE ):AddScoring(Scoring)
AttackGroups = SET_GROUP:New():FilterCoalitions( "blue" ):FilterPrefixes( "Attack" ):FilterStart()
EWRSet = SET_GROUP:New():FilterPrefixes( "USRADAR" ):FilterCoalitions("blue"):FilterStart()
--EWRSet2 = SET_GROUP:New():FilterPrefixes( "USRADAR" ):FilterCoalitions("blue"):FilterStart()
EWRDetection = DETECTION_AREAS:New( EWRSet, 30000 )
--
--EWRDetection:SetDebugModeON()
--
EWRDetection:SetFriendliesRange( 40000 )
EWRDetection:SetRefreshTimeInterval(30)
--EWRDetection2:SetAcceptRange( 110000 ) 
TaskDispatcher = TASK_A2A_DISPATCHER:New( Mission, AttackGroups, EWRDetection )



function TaskDispatcher:OnAfterAssign( From, Event, To, Task, TaskUnit, PlayerName )
 self:E( "I am in assigned ... 1" )
 Task:SetScoreOnProgress( PlayerName, 20, TaskUnit )
 Task:SetScoreOnSuccess( PlayerName, 100, TaskUnit )
 Task:SetScoreOnFail( PlayerName, -50, TaskUnit )
end

 

And here the error from dcs log for this functionality. This error when the mission is asigned

 

2020-04-26 13:25:44.213 INFO    SCRIPTING: 136338(142566)/I:                       MISSION00618.AddTask({[1]===> Adding TASK ,[TaskName]=ENGAGE.001,[MissionName]=DEFCON,})
2020-04-26 13:25:44.217 INFO    SCRIPTING: 136338(141896)/I:                       MISSION00618.AddTask({[1]===> Adding TASK ,[TaskName]=ENGAGE.001,[MissionName]=DEFCON,})
2020-04-26 13:25:49.214 INFO    SCRIPTING: 135348(135451)/I:                 COMMANDCENTER00569.AssignTask(Assigning task ENGAGE.001 using auto assign method 2 to Attack #005 with task priority 99780)
2020-04-26 13:25:49.214 INFO    SCRIPTING: 136211(137608)/I:                       MISSION00618.SetGroupAssigned(Mission DEFCON is assigned to Attack #005)
2020-04-26 13:25:50.312 INFO    SCRIPTING:     26(    -1)/E:           TASK_A2A_DISPATCHER00628.function(I am in assigned ... 1)
2020-04-26 13:25:50.315 INFO    SCRIPTING: Error in FSM_PROCESS call handler:[string "C:\Users\ccz\AppData\Local\Temp\DCS\/~mis0000297F.lua"]:142039: attempt to call method 'SelectAction' (a nil value)
2020-04-26 13:25:50.315 INFO    SCRIPTING: stack traceback:
[string "C:\Users\ccz\AppData\Local\Temp\DCS\/~mis0000297F.lua"]:23027: in function 'SelectAction'
[string "C:\Users\ccz\AppData\Local\Temp\DCS\/~mis0000297F.lua"]:142039: in function <[string "C:\Users\ccz\AppData\Local\Temp\DCS\/~mis0000297F.lua"]:142036>
(tail call): ?
[C]: in function 'xpcall'
[string "C:\Users\ccz\AppData\Local\Temp\DCS\/~mis0000297F.lua"]:23040: in function '_call_handler'
[string "C:\Users\ccz\AppData\Local\Temp\DCS\/~mis0000297F.lua"]:22678: in function <[string "C:\Users\ccz\AppData\Local\Temp\DCS\/~mis0000297F.lua"]:22644>
(tail call): ?
[string "C:\Users\ccz\AppData\Local\Temp\DCS\/~mis0000297F.lua"]:22729: in function <[string "C:\Users\ccz\AppData\Local\Temp\DCS\/~mis0000297F.lua"]:22644>
(tail call): ?
[C]: in function 'xpcall'
[string "C:\Users\ccz\AppData\Local\Temp\DCS\/~mis0000297F.lua"]:5826: in function <[string "C:\Users\ccz\AppData\Local\Temp\DCS\/~mis0000297F.lua"]:5770>
2020-04-26 13:25:53.163 INFO    Lua: Lua CPU usage: metric: average mission execution: 9.9282 %

 

 

and this when you leave the mission after the target is kill (several minutes later when you see its not complete and no points)

 

2020-04-26 13:28:45.269 INFO    SCRIPTING: 136357(141815)/I:                       MISSION00618.RemoveTask({[1]=<== Removing TASK ,[TaskName]=ENGAGE.001,[MissionName]=DEFCON,})
2020-04-26 13:28:48.292 INFO    Lua: Lua CPU usage: metric: average mission execution: 11.0775 %

 

I try with and without the statement TaskDispatcher:OnAfterAssign without luck.

 

----------

 

And the other thing i have problems with is , i assign a tanker for the CGI/CAP dispatcher with SetDefaultTanker but my tankers are spawned by something like this.

 

TANKERRU = SPAWN:New( "TNKRU" )
 :InitLimit( 1, 0 )
 :InitRepeatOnEngineShutDown()
 :OnSpawnGroup(
    function( SpawnGroup1 )
      SpawnGroup1:E( "I am spawned TNKRU" )
      A2ADispatchered:SetDefaultTanker( TANKERRU )
    end 
    )

 

TANKERRU = SPAWN:New( "TNKRU" )
 :InitLimit( 1, 0 )
 :InitRepeatOnEngineShutDown()
 :OnSpawnGroup(
    function( SpawnGroup1 )
      SpawnGroup1:E( "I am spawned TNKRU" )
      A2ADispatchered:SetDefaultTanker( "TNKRU" )
    end 
    )

 

TANKERRU:SpawnScheduled( 1200, .5 )

 

But they never use this tanker, if i set manually to a ME tanked, and never get killed/respawned it works, but never work for moose spawned Tankers, can i make this part of code dynamic so that when a tanker get killed and new one spawned this new tanker get assigned as default tanker for the Dispatcher(CGI/CAP) ?

 

 

Sorry for big post :D was working on this mission for several days and stuck on this.

 

Thanks in advance and again thanks to all who help maintain this comunity!

 

 

-Edited to add the scoring code


Edited by teqqra
Link to comment
Share on other sites

Found more enabling trace

 

2020-04-26 18:56:20.334 INFO    SCRIPTING:  22842( 22646)/F:               TASK_A2A_ENGAGE01939.can({[1]=Assigned,[2]={[map]={[Assigned]=*,},},})
2020-04-26 18:56:20.334 INFO    SCRIPTING:  23273( 22734)/T:               TASK_A2A_ENGAGE01939.*** FSM ***    onafter *** Assigned --> Goal --> Assigned *** Task: ENGAGE.001
2020-04-26 18:56:20.334 INFO    SCRIPTING:  22754(142260)/T:               TASK_A2A_ENGAGE01939.Delayed Event: Goal
2020-04-26 18:56:20.334 INFO    SCRIPTING:   5526( 22760)/F:                     SCHEDULER01940.Schedule({[1]=10,})
2020-04-26 18:56:20.334 INFO    SCRIPTING:   5527( 22760)/T:                     SCHEDULER01940.{[1]={[1]=Goal,},}
2020-04-26 18:56:20.334 INFO    SCRIPTING:   5534( 22760)/F:                     SCHEDULER01940.Schedule({[1]=Schedule :,[2]=TASK_A2A_ENGAGE1939,[3]=table: 0000022AD230C8E0,[4]=10,})
2020-04-26 18:56:20.338 INFO    SCRIPTING:   5696(  5540)/F:            SCHEDULEDISPATCHER00002.AddSchedule({[1]={[MasterObject]={[current]=Assigned,[MenuPlanned]={[table: 0000022C1DCABB00]={[MenuTag]=Tasking,[Group]={[Attribute]={[AIR_OTHER]=Air_OtherAir,[AIR_TRANSPORTHELO]=Air_TransportHelo,[GROUND_APC]=Ground_APC,[AIR_FIGHTER]=Air_Fighter,[NAVAL_WARSHIP]=Naval_WarShip,[AIR_UAV]=Air_UAV,[AIR_BOMBER]=Air_Bomber,[GROUND_SAM]=Ground_SAM,[AIR_ATTACKHELO]=Air_AttackHelo,[GROUND_AAA]=Ground_AAA,[GROUND_INFANTRY]=Ground_Infantry,[AIR_TRANSPORTPLANE]=Air_TransportPlane,[AIR_AWACS]=Air_AWACS,[NAVAL_UNARMEDSHIP]=Naval_UnarmedShip,[NAVAL_OTHER]=Naval_OtherNaval,[GROUND_ARTILLERY]=Ground_Artillery,[GROUND_TANK]=Ground_Tank,[GROUND_TRAIN]=Ground_Train,[GROUND_EWR]=Ground_EWR,[GROUND_OTHER]=Ground_OtherGround,[NAVAL_AIRCRAFTCARRIER]=Naval_AircraftCarrier,[NAVAL_ARMEDSHIP]=Naval_ArmedShip,[AIR_TANKER]=Air_Tanker,[GROUND_TRUCK]=Ground_Truck,[OTHER_UNKNOWN]=Other_Unknown,},[Takeoff]={[Air]=1,[Hot]=3,[Runway]=2,[Cold]=4,},[GroupName]=Attack #005,[ClassName]=GROUP,},[MenuStamp]=185.7,[MenuSet]=true,[GroupID]=57,[ClassName]=MENU_GROUP_DELAYED,[MenuPath]={[1]=Command Center [Tactical AIR DEFENCE],[2]=Mission "DEFCON (CRITICAL)",[3]=Join Planned Task,},[MenuCount]=1,},},[TaskControlMenu]={[Menus]={[Control Task]={[MenuTag]=Tasking,[Menus]={[Flash Task Details]={[MenuTag]=Tasking,[Group]=,[MenuPath]={[1]=Task ENGAGE.001 control,[2]=Control Task,[3]=Flash Task Details,},[ClassName]=MENU_GROUP_COMMAND,[MenuStamp]=10.1,[GroupID]=57,},[stop Flash Task Details]={[MenuTag]=Tasking,[Group]=,[MenuPath]={[1]=Task ENGAGE.001 control,[2]=Control Task,[3]=Stop Flash Task Details,},[MenuStamp]=185.7,[ClassName]=MENU_GROUP_COMMAND,[CommandMenuArguments]={[1]=,[2]=,[n]=3,},[GroupID]=57,},[Report Task Details]={[MenuTag]=Tasking,[Group]=,[MenuStamp]=185.7,[MenuPath]={[1]=Task ENGAGE.001 control,[2]=Control Task,[3]=Report Task Details,},[CommandMenuArguments]={[1]=,[2]=,[n]=2,},[ClassName]=MENU_GROUP_COMMAND,[GroupID]=57,},[Mark Task Location on Map]={[MenuTag]=Tasking,[Group]=,[MenuStamp]=185.7,[MenuPath]={[1]=Task ENGAGE.001 control,[2]=Control Task,[3]=Mark Task Location on Map,},[CommandMenuArguments]={[1]=,[2]=,[n]=2,},[ClassName]=MENU_GROUP_COMMAND,[GroupID]=57,},[Abort Task]={[MenuTag]=Tasking,[Group]=,[MenuPath]={[1]=Task ENGAGE.001 control,[2]=Control Task,[3]=Abort Task,},[MenuStamp]=185.7,[ClassName]=MENU_GROUP_COMMAND,[CommandMenuArguments]={[1]=,[2]=,[n]=2,},[GroupID]=57,},},[Group]=,[MenuStamp]=185.7,[GroupID]=57,[ClassName]=MENU_GROUP,[MenuPath]={[1]=Task ENGAGE.001 control,[2]=Control Task,},[MenuCount]=5,},},[Group]=,[MenuPath]={[1]=Task ENGAGE.001 control,},[GroupID]=57,[ClassName]=MENU_GROUP,[MenuCount]=1,},[FlashTaskScheduleID]=87#TASK_A2A_ENGAGE#000001939,[FsmTemplate]={[_StartState]=Planned,[current]=Planned,[ClassName]=FSM_PROCESS,},[FlashTaskStatus]=true,[Dispatcher]={[current]=Started,[Detection]={[current]=Detecting,[_FlareDetectedUnits]=false,[DetectedItemMax]=1,[FriendliesRange]=40000,[DetectedItemCount]=0,[DetectionRun]=1,[DetectedObjectsIdentified]={},[DetectRadar]=true,[DetectionCount]=1,[_SmokeDetectedUnits]=false,[_SmokeDetectedZones]=false,[ClassName]=DETECTION_AREAS,[DetectionZoneRange]=30000,[_FlareDetectedZones]=false,[_BoundDetectedZones]=false,[RefreshTimeInterval]=30,},[ClassName]=TASK_A2A_DISPATCHER,[Tasks]={[1]=,},[sweepZones]={},[Mission]={[MissionBriefing]=Missions for defence air space,[MissionStatus]=PENDING,[AssignedGroups]={[Attack #005]=,},[MissionPriority]=CRITICAL,[Name]=DEFCON,[MissionMenu]={[Group]=,[GroupID]=57,[ClassName]=MENU_GROUP,[MenuPath]={[1]=Command Center [Tactical AIR DEFENCE],[2]=Mission "DEFCON (CRITICAL)",},[MenuCount]=5,},[Tasks]={[ENGAGE.001]=,},[CommandCenter]={[Missions]={[table: 0000022AA4A22530]=,},[AutoAssignMethods]={[Distance]=2,[Random]=1,[Priority]=3,},[CommandCenterPositionable]={[Attribute]={[AIR_OTHER]=Air_OtherAir,[AIR_TRANSPORTHELO]=Air_TransportHelo,[GROUND_APC]=Ground_APC,[AIR_FIGHTER]=Air_Fighter,[NAVAL_WARSHIP]=Naval_WarShip,[AIR_UAV]=Air_UAV,[AIR_BOMBER]=Air_Bomber,[GRO
2020-04-26 18:56:20.338 INFO    SCRIPTING:   5704(  5540)/T:            SCHEDULEDISPATCHER00002.Adding schedule #415 CallID=415#TASK_A2A_ENGAGE#000001939
2020-04-26 18:56:20.338 INFO    SCRIPTING:   5715(  5540)/F:            SCHEDULEDISPATCHER00002.AddSchedule({[MasterObject]=table: 0000022AD230C8E0,[CallID]=415#TASK_A2A_ENGAGE#000001939,[ObjectScheduler]=table: 0000022B50943720,})
2020-04-26 18:56:20.338 INFO    SCRIPTING:   5767(  5540)/T:            SCHEDULEDISPATCHER00002.{[Arguments]={[1]=Goal,},[Randomize]=0,[start]=10.1,[startTime]=203,[Repeat]=0,}
2020-04-26 18:56:20.341 INFO    SCRIPTING:   5888(  5864)/F:            SCHEDULEDISPATCHER00002.Start({[start]=415#TASK_A2A_ENGAGE#000001939,[scheduler]={[MasterObject]={[current]=Assigned,[MenuPlanned]={[table: 0000022C1DCABB00]={[MenuTag]=Tasking,[Group]={[Attribute]={[AIR_OTHER]=Air_OtherAir,[AIR_TRANSPORTHELO]=Air_TransportHelo,[GROUND_APC]=Ground_APC,[AIR_FIGHTER]=Air_Fighter,[NAVAL_WARSHIP]=Naval_WarShip,[AIR_UAV]=Air_UAV,[AIR_BOMBER]=Air_Bomber,[GROUND_SAM]=Ground_SAM,[AIR_ATTACKHELO]=Air_AttackHelo,[GROUND_AAA]=Ground_AAA,[GROUND_INFANTRY]=Ground_Infantry,[AIR_TRANSPORTPLANE]=Air_TransportPlane,[AIR_AWACS]=Air_AWACS,[NAVAL_UNARMEDSHIP]=Naval_UnarmedShip,[NAVAL_OTHER]=Naval_OtherNaval,[GROUND_ARTILLERY]=Ground_Artillery,[GROUND_TANK]=Ground_Tank,[GROUND_TRAIN]=Ground_Train,[GROUND_EWR]=Ground_EWR,[GROUND_OTHER]=Ground_OtherGround,[NAVAL_AIRCRAFTCARRIER]=Naval_AircraftCarrier,[NAVAL_ARMEDSHIP]=Naval_ArmedShip,[AIR_TANKER]=Air_Tanker,[GROUND_TRUCK]=Ground_Truck,[OTHER_UNKNOWN]=Other_Unknown,},[Takeoff]={[Air]=1,[Hot]=3,[Runway]=2,[Cold]=4,},[GroupName]=Attack #005,[ClassName]=GROUP,},[MenuStamp]=185.7,[MenuSet]=true,[GroupID]=57,[ClassName]=MENU_GROUP_DELAYED,[MenuPath]={[1]=Command Center [Tactical AIR DEFENCE],[2]=Mission "DEFCON (CRITICAL)",[3]=Join Planned Task,},[MenuCount]=1,},},[TaskControlMenu]={[Menus]={[Control Task]={[MenuTag]=Tasking,[Menus]={[Flash Task Details]={[MenuTag]=Tasking,[Group]=,[MenuPath]={[1]=Task ENGAGE.001 control,[2]=Control Task,[3]=Flash Task Details,},[ClassName]=MENU_GROUP_COMMAND,[MenuStamp]=10.1,[GroupID]=57,},[stop Flash Task Details]={[MenuTag]=Tasking,[Group]=,[MenuPath]={[1]=Task ENGAGE.001 control,[2]=Control Task,[3]=Stop Flash Task Details,},[MenuStamp]=185.7,[ClassName]=MENU_GROUP_COMMAND,[CommandMenuArguments]={[1]=,[2]=,[n]=3,},[GroupID]=57,},[Report Task Details]={[MenuTag]=Tasking,[Group]=,[MenuStamp]=185.7,[MenuPath]={[1]=Task ENGAGE.001 control,[2]=Control Task,[3]=Report Task Details,},[CommandMenuArguments]={[1]=,[2]=,[n]=2,},[ClassName]=MENU_GROUP_COMMAND,[GroupID]=57,},[Mark Task Location on Map]={[MenuTag]=Tasking,[Group]=,[MenuStamp]=185.7,[MenuPath]={[1]=Task ENGAGE.001 control,[2]=Control Task,[3]=Mark Task Location on Map,},[CommandMenuArguments]={[1]=,[2]=,[n]=2,},[ClassName]=MENU_GROUP_COMMAND,[GroupID]=57,},[Abort Task]={[MenuTag]=Tasking,[Group]=,[MenuPath]={[1]=Task ENGAGE.001 control,[2]=Control Task,[3]=Abort Task,},[MenuStamp]=185.7,[ClassName]=MENU_GROUP_COMMAND,[CommandMenuArguments]={[1]=,[2]=,[n]=2,},[GroupID]=57,},},[Group]=,[MenuStamp]=185.7,[GroupID]=57,[ClassName]=MENU_GROUP,[MenuPath]={[1]=Task ENGAGE.001 control,[2]=Control Task,},[MenuCount]=5,},},[Group]=,[MenuPath]={[1]=Task ENGAGE.001 control,},[GroupID]=57,[ClassName]=MENU_GROUP,[MenuCount]=1,},[FlashTaskScheduleID]=87#TASK_A2A_ENGAGE#000001939,[FsmTemplate]={[_StartState]=Planned,[current]=Planned,[ClassName]=FSM_PROCESS,},[FlashTaskStatus]=true,[Dispatcher]={[current]=Started,[Detection]={[current]=Detecting,[_FlareDetectedUnits]=false,[DetectedItemMax]=1,[FriendliesRange]=40000,[DetectedItemCount]=0,[DetectionRun]=1,[DetectedObjectsIdentified]={},[DetectRadar]=true,[DetectionCount]=1,[_SmokeDetectedUnits]=false,[_SmokeDetectedZones]=false,[ClassName]=DETECTION_AREAS,[DetectionZoneRange]=30000,[_FlareDetectedZones]=false,[_BoundDetectedZones]=false,[RefreshTimeInterval]=30,},[ClassName]=TASK_A2A_DISPATCHER,[Tasks]={[1]=,},[sweepZones]={},[Mission]={[MissionBriefing]=Missions for defence air space,[MissionStatus]=PENDING,[AssignedGroups]={[Attack #005]=,},[MissionPriority]=CRITICAL,[Name]=DEFCON,[MissionMenu]={[Group]=,[GroupID]=57,[ClassName]=MENU_GROUP,[MenuPath]={[1]=Command Center [Tactical AIR DEFENCE],[2]=Mission "DEFCON (CRITICAL)",},[MenuCount]=5,},[Tasks]={[ENGAGE.001]=,},[CommandCenter]={[Missions]={[table: 0000022AA4A22530]=,},[AutoAssignMethods]={[Distance]=2,[Random]=1,[Priority]=3,},[CommandCenterPositionable]={[Attribute]={[AIR_OTHER]=Air_OtherAir,[AIR_TRANSPORTHELO]=Air_TransportHelo,[GROUND_APC]=Ground_APC,[AIR_FIGHTER]=Air_Fighter,[NAVAL_WARSHIP]=Naval_WarShip,[AIR_U
2020-04-26 18:56:20.341 INFO    SCRIPTING:   5906(  5864)/T:            SCHEDULEDISPATCHER00002.Starting scheduledispatcher Call ID=415#TASK_A2A_ENGAGE#000001939 ==> Schedule ID=207
2020-04-26 18:56:20.341 INFO    SCRIPTING:  22762(142260)/T:               TASK_A2A_ENGAGE01939.NEGATIVE Event Goal delayed by 10.0 sec SCHEDULED with CallID=415#TASK_A2A_ENGAGE#000001939
2020-04-26 18:56:20.341 INFO    SCRIPTING:  22774(142260)/T:               TASK_A2A_ENGAGE01939.{[CallID]=415#TASK_A2A_ENGAGE#000001939,}
2020-04-26 18:56:20.341 INFO    SCRIPTING:  23273( 22739)/T:               TASK_A2A_ENGAGE01939.*** FSM ***    onenter *** Assigned --> Goal --> Assigned *** Task: ENGAGE.001
2020-04-26 18:56:20.341 INFO    SCRIPTING:  23273( 22743)/T:               TASK_A2A_ENGAGE01939.*** FSM ***    onstate *** Assigned --> Goal --> Assigned *** Task: ENGAGE.001
2020-04-26 18:56:20.342 INFO    SCRIPTING:   5841(  5841)/F:            SCHEDULEDISPATCHER00002.function({[CurrentTime]=193,[scheduleID]=230,[Master]=table: 0000022AD230C8E0,[stop]=0,[Randomize]=0,[start]=10.1,[startTime]=182.9,[CallID]=379#TASK_A2A_ENGAGE#000001939,[Repeat]=0,})
2020-04-26 18:56:20.345 INFO    SCRIPTING:   5924(  5851)/F:            SCHEDULEDISPATCHER00002.Stop({[stop]=379#TASK_A2A_ENGAGE#000001939,[scheduler]={[MasterObject]={[current]=Assigned,[MenuPlanned]={[table: 0000022C1DCABB00]={[MenuTag]=Tasking,[Group]={[Attribute]={[AIR_OTHER]=Air_OtherAir,[AIR_TRANSPORTHELO]=Air_TransportHelo,[GROUND_APC]=Ground_APC,[AIR_FIGHTER]=Air_Fighter,[NAVAL_WARSHIP]=Naval_WarShip,[AIR_UAV]=Air_UAV,[AIR_BOMBER]=Air_Bomber,[GROUND_SAM]=Ground_SAM,[AIR_ATTACKHELO]=Air_AttackHelo,[GROUND_AAA]=Ground_AAA,[GROUND_INFANTRY]=Ground_Infantry,[AIR_TRANSPORTPLANE]=Air_TransportPlane,[AIR_AWACS]=Air_AWACS,[NAVAL_UNARMEDSHIP]=Naval_UnarmedShip,[NAVAL_OTHER]=Naval_OtherNaval,[GROUND_ARTILLERY]=Ground_Artillery,[GROUND_TANK]=Ground_Tank,[GROUND_TRAIN]=Ground_Train,[GROUND_EWR]=Ground_EWR,[GROUND_OTHER]=Ground_OtherGround,[NAVAL_AIRCRAFTCARRIER]=Naval_AircraftCarrier,[NAVAL_ARMEDSHIP]=Naval_ArmedShip,[AIR_TANKER]=Air_Tanker,[GROUND_TRUCK]=Ground_Truck,[OTHER_UNKNOWN]=Other_Unknown,},[Takeoff]={[Air]=1,[Hot]=3,[Runway]=2,[Cold]=4,},[GroupName]=Attack #005,[ClassName]=GROUP,},[MenuStamp]=185.7,[MenuSet]=true,[GroupID]=57,[ClassName]=MENU_GROUP_DELAYED,[MenuPath]={[1]=Command Center [Tactical AIR DEFENCE],[2]=Mission "DEFCON (CRITICAL)",[3]=Join Planned Task,},[MenuCount]=1,},},[TaskControlMenu]={[Menus]={[Control Task]={[MenuTag]=Tasking,[Menus]={[Flash Task Details]={[MenuTag]=Tasking,[Group]=,[MenuPath]={[1]=Task ENGAGE.001 control,[2]=Control Task,[3]=Flash Task Details,},[ClassName]=MENU_GROUP_COMMAND,[MenuStamp]=10.1,[GroupID]=57,},[stop Flash Task Details]={[MenuTag]=Tasking,[Group]=,[MenuPath]={[1]=Task ENGAGE.001 control,[2]=Control Task,[3]=Stop Flash Task Details,},[MenuStamp]=185.7,[ClassName]=MENU_GROUP_COMMAND,[CommandMenuArguments]={[1]=,[2]=,[n]=3,},[GroupID]=57,},[Report Task Details]={[MenuTag]=Tasking,[Group]=,[MenuStamp]=185.7,[MenuPath]={[1]=Task ENGAGE.001 control,[2]=Control Task,[3]=Report Task Details,},[CommandMenuArguments]={[1]=,[2]=,[n]=2,},[ClassName]=MENU_GROUP_COMMAND,[GroupID]=57,},[Mark Task Location on Map]={[MenuTag]=Tasking,[Group]=,[MenuStamp]=185.7,[MenuPath]={[1]=Task ENGAGE.001 control,[2]=Control Task,[3]=Mark Task Location on Map,},[CommandMenuArguments]={[1]=,[2]=,[n]=2,},[ClassName]=MENU_GROUP_COMMAND,[GroupID]=57,},[Abort Task]={[MenuTag]=Tasking,[Group]=,[MenuPath]={[1]=Task ENGAGE.001 control,[2]=Control Task,[3]=Abort Task,},[MenuStamp]=185.7,[ClassName]=MENU_GROUP_COMMAND,[CommandMenuArguments]={[1]=,[2]=,[n]=2,},[GroupID]=57,},},[Group]=,[MenuStamp]=185.7,[GroupID]=57,[ClassName]=MENU_GROUP,[MenuPath]={[1]=Task ENGAGE.001 control,[2]=Control Task,},[MenuCount]=5,},},[Group]=,[MenuPath]={[1]=Task ENGAGE.001 control,},[GroupID]=57,[ClassName]=MENU_GROUP,[MenuCount]=1,},[FlashTaskScheduleID]=87#TASK_A2A_ENGAGE#000001939,[FsmTemplate]={[_StartState]=Planned,[current]=Planned,[ClassName]=FSM_PROCESS,},[FlashTaskStatus]=true,[Dispatcher]={[current]=Started,[Detection]={[current]=Detecting,[_FlareDetectedUnits]=false,[DetectedItemMax]=1,[FriendliesRange]=40000,[DetectedItemCount]=0,[DetectionRun]=1,[DetectedObjectsIdentified]={},[DetectRadar]=true,[DetectionCount]=1,[_SmokeDetectedUnits]=false,[_SmokeDetectedZones]=false,[ClassName]=DETECTION_AREAS,[DetectionZoneRange]=30000,[_FlareDetectedZones]=false,[_BoundDetectedZones]=false,[RefreshTimeInterval]=30,},[ClassName]=TASK_A2A_DISPATCHER,[Tasks]={[1]=,},[sweepZones]={},[Mission]={[MissionBriefing]=Missions for defence air space,[MissionStatus]=PENDING,[AssignedGroups]={[Attack #005]=,},[MissionPriority]=CRITICAL,[Name]=DEFCON,[MissionMenu]={[Group]=,[GroupID]=57,[ClassName]=MENU_GROUP,[MenuPath]={[1]=Command Center [Tactical AIR DEFENCE],[2]=Mission "DEFCON (CRITICAL)",},[MenuCount]=5,},[Tasks]={[ENGAGE.001]=,},[CommandCenter]={[Missions]={[table: 0000022AA4A22530]=,},[AutoAssignMethods]={[Distance]=2,[Random]=1,[Priority]=3,},[CommandCenterPositionable]={[Attribute]={[AIR_OTHER]=Air_OtherAir,[AIR_TRANSPORTHELO]=Air_TransportHelo,[GROUND_APC]=Ground_APC,[AIR_FIGHTER]=Air_Fighter,[NAVAL_WARSHIP]=Naval_WarShip,[AIR_UAV
2020-04-26 18:56:20.345 INFO    SCRIPTING:   5933(  5851)/T:            SCHEDULEDISPATCHER00002.scheduledispatcher stopping scheduler CallID=379#TASK_A2A_ENGAGE#000001939, ScheduleID=230

 

But cant understand at this level :O Thanks!

Link to comment
Share on other sites

I have been able to get the Reaper drone to lase and mark targets with no issue. I am interested in making a ground attack mission with moving tanks and want to know is there a way to get the Reaper to follow a moving enemy ground unit? If I choose orbit only Circle and Racetrack are available and eventually the enemy move out of the area covered by the orbit. Any assistance is appreciated.

Link to comment
Share on other sites

@teqqra

On the tanker...You so nearly did it yourself great :)

 

You have the solution but put the spawn object instead of what the argument needs, which is a string with the group name.

 

You have TANKERRU, which you defined as the object that holds the SPAWN data, what you wanted was the SPAWNs returned GROUP.name:

 

:OnSpawnGroup(function(grp)
A2A_Dispatcherred:SetDefaultTanker(grp:GetName())
end)

 

___________________________________________________________________________

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

Link to comment
Share on other sites

@teqqra

On the tanker...You so nearly did it yourself great :)

 

You have the solution but put the spawn object instead of what the argument needs, which is a string with the group name.

 

You have TANKERRU, which you defined as the object that holds the SPAWN data, what you wanted was the SPAWNs returned GROUP.name:

 

:OnSpawnGroup(function(grp)
A2A_Dispatcherred:SetDefaultTanker(grp:GetName())
end)

 

 

 

Thanks Pikey! will try it! Thanks also to Hardcard, will try to connect to discord soon.

 

yes seems the problem with task already reported in moose github,https://github.com/FlightControl-Master/MOOSE/issues/1312

 

Br,

Link to comment
Share on other sites

@teqqra

 

Looks like an FSM error, you'll have a much better chance of finding a solution in MOOSE Discord.

 

 

@FALT691

 

You should be able to get the coordinates of the moving units periodically, then task the drone to orbit there.

 

 

 

 

 

 

@Hardcard, yes but how do you do that? I understand what to do but an new to scripting and need help.

Link to comment
Share on other sites

@FALT691

 

Check the MOOSE documentation.

 

You'll need a scheduler , the coordinates of the moving unit, the orbit task and a task execution command

 

 

These are the basic pieces of the puzzle, try to put them together in a script, this is a great way of learning.

 

 

 

 

I appreciate your response but after looking at those links I am more confused than ever. If there was an example of how to do this I could figure it out, thanks again for responding.

Link to comment
Share on other sites

I appreciate your response but after looking at those links I am more confused than ever. If there was an example of how to do this I could figure it out, thanks again for responding.

 

Following Hardcard directions is easy to get it:

local Predator = UNIT:FindByName("drone")  

local TestScheduler = SCHEDULER:New( nil, 
 function()
 local Coordinate = UNIT:FindByName("enemy"):GetVec2()
 local DCSTask = Predator:TaskOrbitCircleAtVec2(Coordinate, 2500, 40)
 Predator:PushTask(DCSTask, 1)
 end, {}, 1, 5
)

PC: i7-13700K - MSI RTX 4080 Gaming X Trio - 32GB DDR5 6200 - VPC MongoosT-50CM3 - VKB GF pro - MFG Crosswind - Msi MPG321UR-QD + Acer XB271HU - TrackIR5 - Rift S

Link to comment
Share on other sites

@Hardcard

 

Thanks for the explaination. I use AI tornados equipped with ALARMs. Should I add those to the list of missles detected by the MOOSE.lua?

 

 

if SEADWeaponName == "KH-58" or SEADWeaponName == "KH-25MPU" or SEADWeaponName == "AGM-88" or SEADWeaponName == "KH-31A" or SEADWeaponName == "KH-31P" then

Link to comment
Share on other sites

@marginal

I already added ALARMs when I partially fixed the old MOOSE code, I think you're using an obsolete version of Moose.lua, make sure you're using the one included in the latest release.

 

The new check looks like this:

 

if SEADWeaponName == "weapons.missiles.X_58" [color=blue]--Kh-58U anti-radiation missiles fired[/color]
   or 
   SEADWeaponName == "weapons.missiles.Kh25MP_PRGS1VP" [color=blue]--Kh-25MP anti-radiation missiles fired[/color]
   or
   SEADWeaponName == "weapons.missiles.X_25MP" [color=blue]--Kh-25MPU anti-radiation missiles fired[/color]
   or
   SEADWeaponName == "weapons.missiles.X_28" [color=blue]--Kh-28 anti-radiation missiles fired[/color]
   or
   SEADWeaponName == "weapons.missiles.X_31P" [color=blue]--Kh-31P anti-radiation missiles fired[/color]
   or
   SEADWeaponName == "weapons.missiles.AGM_45A" [color=blue]--AGM-45A anti-radiation missiles fired[/color]
   or
   SEADWeaponName == "weapons.missiles.AGM_45" [color=blue]--AGM-45B anti-radiation missiles fired[/color]
   or
   SEADWeaponName == "weapons.missiles.AGM_88" [color=blue]--AGM-88C anti-radiation missiles fired[/color]
   or
   SEADWeaponName == "weapons.missiles.AGM_122" [color=blue]--AGM-122 Sidearm anti-radiation missiles fired[/color]
   or
    SEADWeaponName == "weapons.missiles.ALARM" [color=Blue]--ALARM anti-radiation missiles fired[/color]

 

 

 

 

Now that I think of it, I made this list before the JF-17 came out, so the LD-10 isn't included.

 

I don't know if we should include it, though, since it can be fired in passive mode...


Edited by Hardcard
Link to comment
Share on other sites

New to MOOSE, index global error?

 

Hi, just starting out in MOOSE and ran my first few debugs, I notice this error with the demo RANGE script.

attempt to index global 'RANGE' (a nil value)

I understand the concept of local versus global methods and variables, is this a MOOSE error or DCS one?

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