Jump to content

MOOSE - Mission Object Oriented Scripting Framework


Recommended Posts

@Delta99 yea, I'll keep fiddling with things and pop in the Discord if I can't make it happy. Thanks for all the quick responses to both you and Pikey! Seems like it's close, perhaps I just fat-fingered something or missed trying a combination of variables that I thought I experimented with.

 

For the time being, I'll comment out the cleanup line and just continue focusing on forcing the spawns.

 

EDIT:

Okay, I've made some progress...sort of...:lol:

Now DCS is hard locking at the point where the script files tries to load. I swapped the Mirages for Floggers for unrelated reasons. Attached .miz with the 30 second spawn test, the .lua and the log files from the crash if someone more familiar is interested in taking a look. I don't see it throwing any significant errors as far as I'm able to tell. Thanks for all your help so far gents!

 

Damn, you're having a rough day!! I don't see anything in the log even causing a crash. I don't see your mission script kicking off though either but maybe the crash happens before that.

 

Going to take your code above and slap the necessary stuff in the ME to see if it works. I know you've probably modified the code but what you originally posted should be VERY VERY VERY close to working if not work straight away.

 

You sure it isn't other scripts wigging out or mods?

Link to comment
Share on other sites

@Delta99 yea, I'll keep fiddling with things and pop in the Discord if I can't make it happy. Thanks for all the quick responses to both you and Pikey! Seems like it's close, perhaps I just fat-fingered something or missed trying a combination of variables that I thought I experimented with.

 

For the time being, I'll comment out the cleanup line and just continue focusing on forcing the spawns.

 

EDIT:

Okay, I've made some progress...sort of...:lol:

Now DCS is hard locking at the point where the script files tries to load. I swapped the Mirages for Floggers for unrelated reasons. Attached .miz with the 30 second spawn test, the .lua and the log files from the crash if someone more familiar is interested in taking a look. I don't see it throwing any significant errors as far as I'm able to tell. Thanks for all your help so far gents!

 

Thought it would be way easier to just try loading your mission and modify if needed.

 

BUT, I can't even load it in the ME. It crashes DCS. First time I can remember any mission crashed on attempting to load in the ME. It could be I don't have the mods you are using though.

 

What I was going to do is take your mission and strip it down to the bare essentials and see if this is a Moose issue or not.

Link to comment
Share on other sites

No mods loaded into the .miz itself; it's literally just the aircraft groups, four FARPs, and some of the built-in warehousing for transferring resources if flights land somewhere other than their home base...it's pretty much already the bare essentials as I was unfamiliar with MOOSE and wanted to be able to troubleshoot easily. I do have some modded objects installed but none are present in the mission. I'll try re-saving it with everything vanilla NTTR.

 

EDIT: Vanilla .miz attached. Saved in version 2.2.0.12448.295; identical CTD for me at 10 seconds when the mission .lua loads. The .lua attached in the previous post is current, or you can just change .miz to .zip and extract it from the directory.

 

No problems with loading MiST, CTLD, or CSAR...it's just when the mission .lua file loads. Title is obviously a work in progress...but all the good desert names have been taken. ;)

Operation SandpantsVANILLA.miz


Edited by feefifofum
Link to comment
Share on other sites

One change at a time buddy!

@Delta99 yea, I'll keep fiddling with things and pop in the Discord if I can't make it happy. Thanks for all the quick responses to both you and Pikey! Seems like it's close, perhaps I just fat-fingered something or missed trying a combination of variables that I thought I experimented with.

 

For the time being, I'll comment out the cleanup line and just continue focusing on forcing the spawns.

 

EDIT:

Okay, I've made some progress...sort of...:lol:

Now DCS is hard locking at the point where the script files tries to load. I swapped the Mirages for Floggers for unrelated reasons. Attached .miz with the 30 second spawn test, the .lua and the log files from the crash if someone more familiar is interested in taking a look. I don't see it throwing any significant errors as far as I'm able to tell. Thanks for all your help so far gents!

___________________________________________________________________________

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

Link to comment
Share on other sites

thanks for the answers guys, sad the event is bugged :(

 

I also wanted to use the ZoneCaptureCoalition Class but i've seen on the Documentation that it's WIP and it can't find the class when declaring the variable so I deducted that it was still WIP ;)

 

But i have another question :D When using the MissileTrainer class can we disable it if the target and/or the unit firing the missile are in a particular zone ? Would be great but it doesn't seem to be an option right now.

Link to comment
Share on other sites

:lol: Sorry, once I get going things get a little manic. I just realized my resource system was a no-go with with Mirages, because the hostile airfield would suck up all the player Mirages as they take over airbases; but the minutia of how the thing is actually going to run shouldn't be of concern.

 

Where we are right now, is that aircraft groups, all named appropriately in the both the .miz and the .lua, are not spawning. The .miz crashes to desktop at 10 seconds, precisely when the DO SCRIPT FILE loads OpSandpants30TEST.lua as posted in post #950

 

MOOSE loads in a MISSION START type trigger.

 

MiST loads at 1 second.

 

CTLD loads at 3 seconds.

 

CSAR loads at 5 seconds.

 

At 10 seconds, OpSandpants30TEST.lua loads and DCS locks up followed by a CTD as soon as you click.

Link to comment
Share on other sites

:lol: Sorry, once I get going things get a little manic. I just realized my resource system was a no-go with with Mirages, because the hostile airfield would suck up all the player Mirages as they take over airbases; but the minutia of how the thing is actually going to run shouldn't be of concern.

 

Where we are right now, is that aircraft groups, all named appropriately in the both the .miz and the .lua, are not spawning. The .miz crashes to desktop at 10 seconds, precisely when the DO SCRIPT FILE loads OpSandpants30TEST.lua as posted in post #950

 

MOOSE loads in a MISSION START type trigger.

 

MiST loads at 1 second.

 

CTLD loads at 3 seconds.

 

CSAR loads at 5 seconds.

 

At 10 seconds, OpSandpants30TEST.lua loads and DCS locks up followed by a CTD as soon as you click.

 

Can you disable MIST, CTLD and CSAR and just load Moose to test? That was the first thing I was going to do but couldn't even open in the ME!! Which is very odd to begin with.

 

What version of DCS BTW?

Link to comment
Share on other sites

Guys i've been seen lines like this in my logs :

01213.545 INFO    SCRIPTING:   5486(    13)/E:               EVENT00000.onEvent({[1]="S_EVENT_PLAYER_ENTER_UNIT",[2]={["IniUnit"]={["ClientAlive2"]=false,["ClientBriefing"]="",["ClassName"]="CLIENT",["AliveCheckScheduler"]={["SchedulerObject"]=,["MasterObject"]=,["ClassName"]="SCHEDULER",["Schedules"]={[1]="1#CLIENT#000000344",},},["ClientAlive"]=false,["Messages"]={},["MessageSwitch"]=true,["ClientTransport"]=false,["_Tasks"]={},["ONBOARDSIDE"]={["BACK"]=3,["FRONT"]=4,["RIGHT"]=2,["NONE"]=0,["LEFT"]=1,},["ClientBriefingShown"]=false,["_Menus"]={},["ClientName"]="Pilot #013",},["IniPlayerName"]="Nouveau Surnom",["initiator"]={["id_"]=16796160,},["id"]=19,["IniTypeName"]="Su-33",["IniObjectCategory"]=1,["IniUnitName"]="Pilot #013",["IniCategory"]=0,["IniCoalition"]=1,["time"]=32450.013,["IniDCSGroup"]={["id_"]=57,},["IniDCSUnitName"]="Pilot #013",["IniDCSUnit"]=,["IniDCSGroupName"]="Requin",},[3]="Pilot #013",[5]=1,})

 
01213.546 INFO    SCRIPTING:   8835(  9238)/E:            DATABASE00003.AddPlayer({[1]="Add player for unit:",[2]="Pilot #013",[3]="Nouveau Surnom",})

 

Wouldn't this be what we need to know when a player is entering an aircraft ?

Link to comment
Share on other sites

Can you disable MIST, CTLD and CSAR and just load Moose to test? That was the first thing I was going to do but couldn't even open in the ME!! Which is very odd to begin with.

 

What version of DCS BTW?

 

DCS version # is 2.2.0.12448.295 per both autoupdate.cfg and the in-game splash screen. Mission is in NTTR. MOOSE version is 2.2 patch 6

 

See if the "vanilla" version I posted in post #953 loads for you? I should note, though, that no modded objects have ever been present (and it turns out I didn't even have any mods enabled apart from some custom keybinds for the Warthog)

 

I've tried removing MiST, CSAR, CTLD but get the same result - DCS hard locks and crashes to desktop at 10 seconds when I load Op Sandpants30TEST which you can find in post #950

 

I'm going to try a DCS repair for laughs, though I have had no other issues running and building/editing complex missions with MiST/CSAR/CTLD and a host of built-in GUI triggers..

 

EDIT: Ran a repair, no change.


Edited by feefifofum
Link to comment
Share on other sites

Guys i've been seen lines like this in my logs :

01213.545 INFO    SCRIPTING:   5486(    13)/E:               EVENT00000.onEvent({[1]="S_EVENT_PLAYER_ENTER_UNIT",[2]={["IniUnit"]={["ClientAlive2"]=false,["ClientBriefing"]="",["ClassName"]="CLIENT",["AliveCheckScheduler"]={["SchedulerObject"]=,["MasterObject"]=,["ClassName"]="SCHEDULER",["Schedules"]={[1]="1#CLIENT#000000344",},},["ClientAlive"]=false,["Messages"]={},["MessageSwitch"]=true,["ClientTransport"]=false,["_Tasks"]={},["ONBOARDSIDE"]={["BACK"]=3,["FRONT"]=4,["RIGHT"]=2,["NONE"]=0,["LEFT"]=1,},["ClientBriefingShown"]=false,["_Menus"]={},["ClientName"]="Pilot #013",},["IniPlayerName"]="Nouveau Surnom",["initiator"]={["id_"]=16796160,},["id"]=19,["IniTypeName"]="Su-33",["IniObjectCategory"]=1,["IniUnitName"]="Pilot #013",["IniCategory"]=0,["IniCoalition"]=1,["time"]=32450.013,["IniDCSGroup"]={["id_"]=57,},["IniDCSUnitName"]="Pilot #013",["IniDCSUnit"]=,["IniDCSGroupName"]="Requin",},[3]="Pilot #013",[5]=1,})

 
01213.546 INFO    SCRIPTING:   8835(  9238)/E:            DATABASE00003.AddPlayer({[1]="Add player for unit:",[2]="Pilot #013",[3]="Nouveau Surnom",})

 

Wouldn't this be what we need to know when a player is entering an aircraft ?

 

Those are from Moose. It is what FC uses. It is currently not working in MP in some situations from what I understand.

Link to comment
Share on other sites

Hi, is it possible to use the AI_A2A_DISPATCHER but spawn the aircraft in the air in a zone instead of at an airfield?

 

Also, is it possible to use the AI_CAS script in a similar way where aircraft are spawned continuously at an airfield or zone? Kind of like a CAS version of the AI_A2A_DISPATCHER.

 

Thanks.

Link to comment
Share on other sites

you can spawn above an airfield with

:SetDefaultTakeoffInAirAltitude( 1500 )

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

  • 4 weeks later...

MOOSE doesn't works for me since a few days (i think the last patch). Is it only me or do some others notice this too?

 

EDIT: nvm it still works. Eclipse Editor didn't save content of the script files for some reason.


Edited by The_Dan
Link to comment
Share on other sites

I have a new problem. If i add a A2G_Task, everything is fine. But if i add 2 tasks, i won't get task reports. I can still subscribe to the task and get now informations. But if i'm not subscribed, nothing wil show.

 

 

--Funktionen

function Spawn_JTAC(Gruppe, Zonen, JTACS )

for i=1, 24 do

if Gruppe:IsCompletelyInZone( Zonen ) then

local JTAC = JTACS:Spawn()

return i

end

end

end

 

HQ = GROUP:FindByName("HQ")

CommandCenter = COMMANDCENTER:New(HQ, "Overlord")

Spieler = SET_GROUP:New():FilterPrefixes("Spieler"):FilterStart()

--SpielerCAS = GROUP:FindByName("Spieler A-10C ")

 

Mission_Gali = MISSION:New(CommandCenter,"Gali","Easy","Our ground forces try to capture Gali. Multiple groups of hostile gound forces have been locatet in the area around the city.",coalition.side.BLUE):AddScoring(Punkte)

 

GaliKampfzonen = {ZONE:New("KampfzoneGali 01"),ZONE:New("KampfzoneGali 02"),ZONE:New("KampfzoneGali 03"),ZONE:New("KampfzoneGali 04"),ZONE:New("KampfzoneGali 05"),ZONE:New("KampfzoneGali 06"),ZONE:New("KampfzoneGali 07"),ZONE:New("KampfzoneGali 08"),ZONE:New("KampfzoneGali 09"),ZONE:New("KampfzoneGali 10"),ZONE:New("KampfzoneGali 11"),ZONE:New("KampfzoneGali 12"),ZONE:New("KampfzoneGali 13"),ZONE:New("KampfzoneGali 14"),ZONE:New("KampfzoneGali 15"),ZONE:New("KampfzoneGali 16"),ZONE:New("KampfzoneGali 17"),ZONE:New("KampfzoneGali 18"),ZONE:New("KampfzoneGali 19"),ZONE:New("KampfzoneGali 20"),ZONE:New("KampfzoneGali 21"),ZONE:New("KampfzoneGali 22"),ZONE:New("KampfzoneGali 23"),ZONE:New("KampfzoneGali 24")}

 

Kampfgruppen = {"Kampfgruppe A", "Kampfgruppe B"}

AAgruppenMobil = {"Gruppe AAmob A", "Gruppe AAmob B", "Gruppe AAmob C"}

JTACsGali = {SPAWN:New("KampfGali JTAC A 01"), SPAWN:New("KampfGali JTAC A 02"), SPAWN:New("KampfGali JTAC A 03"), SPAWN:New("KampfGali JTAC A 04"), SPAWN:New("KampfGali JTAC A 05"), SPAWN:New("KampfGali JTAC A 06"), SPAWN:New("KampfGali JTAC A 07"), SPAWN:New("KampfGali JTAC A 08"), SPAWN:New("KampfGali JTAC A 09"), SPAWN:New("KampfGali JTAC A 10"), SPAWN:New("KampfGali JTAC A 11"), SPAWN:New("KampfGali JTAC A 12"), SPAWN:New("KampfGali JTAC A 13"), SPAWN:New("KampfGali JTAC A 14"), SPAWN:New("KampfGali JTAC A 15"), SPAWN:New("KampfGali JTAC A 16"), SPAWN:New("KampfGali JTAC A 17"), SPAWN:New("KampfGali JTAC A 18"), SPAWN:New("KampfGali JTAC A 19"), SPAWN:New("KampfGali JTAC A 20"), SPAWN:New("KampfGali JTAC A 21"), SPAWN:New("KampfGali JTAC A 22"), SPAWN:New("KampfGali JTAC A 23"), SPAWN:New("KampfGali JTAC A 24")}

 

Gali_Kampfgruppe_Spawn = SPAWN:New("KampfgruppeGali")

:InitRandomizeTemplate(Kampfgruppen)

:InitRandomizeUnits(true,200,0)

:InitRandomizeZones(GaliKampfzonen)

 

Gali_Kampfgruppe = Gali_Kampfgruppe_Spawn:Spawn()

Gali_Zonenummer = Spawn_JTAC(Gali_Kampfgruppe, GaliKampfzonen, JTACsGali)

Ziele_BAI_Kampfgruppe = SET_UNIT:New():FilterPrefixes("KampfgruppeGali"):FilterStart()

Gali_TaskBAI = TASK_A2G_BAI:New(Mission_Gali, Spieler, "BAI.01", Ziele_BAI_Kampfgruppe, "Weaken the hostile ground forces that defend the area around Gali") -- if i add only one of the tasks it is fine, both will not work in the task reports

 

Gali_KampfgruppeMobil_Spawn = SPAWN:New("GaliMobil")

:InitRandomizeTemplate(Kampfgruppen)

 

Gali_KampfgruppeMobil = Gali_KampfgruppeMobil_Spawn:Spawn()

Ziele_BAI_mob = SET_UNIT:New():FilterPrefixes("GaliMobil"):FilterStart()

Gali_TaskBAI_mob = TASK_A2G_BAI:New(Mission_Gali, Spieler, "BAI.02 (targets moving)", Ziele_BAI_mob, "Weaken the hostile ground forces moving to Gali.")

 

Link to comment
Share on other sites

What the ***? Forum did not get my post 3 times, nice....

 

 

And again *sigh*

 

 

I wanted to create a zone capture mission just like CAZ-001 but it does not work, because the classes and methods for Zone_Capturing are missing in the newest Moose.lua - If i use the one from the example mission everything works fine.

 

Is this intended? Were the methods and classes removed?

 

BR,

kreisch


Edited by kreisch
Link to comment
Share on other sites

Hey guys,

 

I have also a problem, might be obvious.

 

To make it short (my original post is gone...):

 

I created a mission including zones to capture.

I orientated myself at the example mission CAZ-001.

 

This mission runs well, without problems.

If I do exactly the same in my mission, using the newest Moose.lua nothing works and I get a nullpointer as soon as the line "ZoneCaptureCoalition = ZONE_CAPTURE_COALITION:New( CaptureZone, coalition.side.RED ) " is read.

 

When I change my newest Moose.lua (Which is downloaded from the official source) against the one included in the mission CAZ-001 everything works fine!

 

I just compared both and the classes and methods refering to Zone_Capture are completely missing.

 

Have they gone on purpose?

Am I doing something wrong?

Link to comment
Share on other sites

I think perhaps the ZONE CAPTURE functionality is part of a beta release so it might not be in the latest stable release that you are looking at.

 

Hey guys,

 

I have also a problem, might be obvious.

 

To make it short (my original post is gone...):

 

I created a mission including zones to capture.

I orientated myself at the example mission CAZ-001.

 

This mission runs well, without problems.

If I do exactly the same in my mission, using the newest Moose.lua nothing works and I get a nullpointer as soon as the line "ZoneCaptureCoalition = ZONE_CAPTURE_COALITION:New( CaptureZone, coalition.side.RED ) " is read.

 

When I change my newest Moose.lua (Which is downloaded from the official source) against the one included in the mission CAZ-001 everything works fine!

 

I just compared both and the classes and methods refering to Zone_Capture are completely missing.

 

Have they gone on purpose?

Am I doing something wrong?

Link to comment
Share on other sites

Okay I really did not want to spam, now I see more than one post of me 0o strange...

 

Anyway : okay, thanks. In this case I will see if I can subscribe to a beta stream if available and build my own moose.lua.

 

Gesendet von meinem F5121 mit Tapatalk

 

 

Edit: And I have new questions:

 

Can someone help me running a function from a different script inside of Moose?

What I want to do is using the Dismounts Script to add Units to freshly spawned group.

What I tried was the following:

" RussianConvoyNorth1 = SPAWN:New( "Warg" ):InitLimit( 5, 10 ):SpawnScheduled( 30, 0 )

AddDismounts(RussianConvoyNorth1:GetFirstAliveGroup():GetName(), "Rifle")"

 

But obviously that does not work from my mission.lua


Edited by kreisch
Link to comment
Share on other sites

Yeah I know that, but I'm looking to spawn the aircraft away from an airfield. I feel like this could open up many opportunities for missions if it is possible.

 

No you cannot do that right now with dispatcher

 

You can spawn aircraft where ever you want with spawn method tho

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

Okay I really did not want to spam, now I see more than one post of me 0o strange...

 

Anyway : okay, thanks. In this case I will see if I can subscribe to a beta stream if available and build my own moose.lua.

 

Gesendet von meinem F5121 mit Tapatalk

 

 

Edit: And I have new questions:

 

Can someone help me running a function from a different script inside of Moose?

What I want to do is using the Dismounts Script to add Units to freshly spawned group.

What I tried was the following:

" RussianConvoyNorth1 = SPAWN:New( "Warg" ):InitLimit( 5, 10 ):SpawnScheduled( 30, 0 )

AddDismounts(RussianConvoyNorth1:GetFirstAliveGroup():GetName(), "Rifle")"

 

But obviously that does not work from my mission.lua

 

There is a SpawnFromUnit in Moose, i think you can simply use that. As for using a different script, load the main script file after the MOOSE.lua on mission start and you can add the code lines in your mission script along with the MOOSE code.

For scheduled spawning without additional scripts, this needs some extra work. I've done this with the scheduler before:

 

 

function GruppeMitJTACundAA_B(Gruppe, AA, Zonen, JTACS)

local Gruppe_ = Gruppe:Spawn()

local AA_ = AA:SpawnFromUnit(Gruppe_)

for i=1, 20 do

if Gruppe_:IsCompletelyInZone( Zonen ) then

local Gali_Verteidigung_JTAC = JTACS:Spawn()

end

end

end

 

--later:

Ochamchira_Aussenposten_Spawn = SCHEDULER:New(nil, GruppeMitJTACundAA_B, {Ochamchira_Aussenposten, Ochamchira_Aussenposten_AA, Zonen_OchamchiraAussenposten, Ochamchira_Aussenposten_JTAC}, 8,950)

 

 

 

This get's scheduled spawning with a spawn from unit, i will try to post a few code lines with the important stuff only, that you can modify to your needs:

 

 

 

function SpawnGroupWithDismount(TransportingGroup, DismountedGroup)

local TransportingGroup_ = TransportingGroup:Spawn()

local AA_ = DismountedGroup:SpawnFromUnit(TransportingGroup)

end

-- Create the spawn objects here

--Then create an scheduler which spawns the groups scheduled, look at the documentation of scheduler to understand (e.g. what is nil can be a usefull condition that has to be true to run the scheduled function)

SpawnAGroupWithDismountinGroupSheduled = SCHEDULER:New(nil, SpawnGroupWithDismount, {aTransportingGroup, aDismountedGroup}, 10, 120)

-- should wörk didn't test

 

 

That get's both groups spawned at the same time. I think you intent to unload the transported group at a specific waypoint or condition. I think this is possible with a similar approach, with SpawnFromUnit.


Edited by The_Dan
Link to comment
Share on other sites

Problem using the AI_A2A_GCICAP function

 

I am trying to use the AI_A2A_GCICAP function to generate a simple air-to-air training mission. The idea is for the player to select the Target Type (easy, medium, or hard) via a radio option. Have that selection captured as a variable which is then passed to the function to activate the appropriate plane type.

 

Using text outputs, I can see that the variable is being captured correctly but no planes ever spawn. When hard coding a specific plane group name, the function works so am confused why the variable is not.

 

This is my first attempt at using the MOOSE framework so any suggestions or insight would be greatly appreciated.

 

I have attached the mission for reference. It does require the NTTR map and either the F-15C or F-5E module.

NTTR_Training_RangeV6.miz

Link to comment
Share on other sites

I don't see your mission in this .miz? Are you doing everything through a trigger (ie. your code is part of the inline trigger?). I only opened this up on my desktop. I didn't load it in DCS as of yet.

 

I am trying to use the AI_A2A_GCICAP function to generate a simple air-to-air training mission. The idea is for the player to select the Target Type (easy, medium, or hard) via a radio option. Have that selection captured as a variable which is then passed to the function to activate the appropriate plane type.

 

Using text outputs, I can see that the variable is being captured correctly but no planes ever spawn. When hard coding a specific plane group name, the function works so am confused why the variable is not.

 

This is my first attempt at using the MOOSE framework so any suggestions or insight would be greatly appreciated.

 

I have attached the mission for reference. It does require the NTTR map and either the F-15C or F-5E module.

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