Jump to content

MOOSE - Mission Object Oriented Scripting Framework


Recommended Posts

Hello,

i started using the TASK_A2G_DISPATCHER Class.

CommandCenter works and gives tasks.

i read there should be a player menu in comms menu to setup type of coordinates and other player related settings. this menu doesn't come up for me. is there anything i have to do to make this menu work? what i need is to change coordinates to LLDMS.

Thanks

 

Edit: Found the answer myself. need to wait for the Command Center to start before joining a slot


Edited by mono6020
Link to comment
Share on other sites

Hello,

i started using the TASK_A2G_DISPATCHER Class.

CommandCenter works and gives tasks.

i read there should be a player menu in comms menu to setup type of coordinates and other player related settings. this menu doesn't come up for me. is there anything i have to do to make this menu work? what i need is to change coordinates to LLDMS.

Thanks

 

Edit: Found the answer myself. need to wait for the Command Center to start before joining a slot

 

Sometimes its also a matter of joining a spectator slot then a real slot or changing slots.

Link to comment
Share on other sites

I am still not able to get the AirBoss working.

 

I changed the script and it doesn't show any errors in the log, yet the Airboss menu is still not showing in the F10 menu. I made a very basic Airboss script (two lines) and still no F10 menu. The only thing I can think of is the moose version, but I updated the dev file tonight and it said it was updated 2 hours ago.

 

I just figured my issue out and it might be yours as well.

 

In the test missions, it says to hit escape x2 before entering your slot to load the script in SP. It worked for me. I tried it in MP, and it seems that before entering your slot, the host needs to unpause, hit esc x2, then either repause, or simply join your jet and click fly. This may have been painfully obvious to many folks here, but I just spent the better part of a day trying to figure that out. D'oh!

 

Markeebo


Edited by Markeebo
Link to comment
Share on other sites

Totally new to all this and going through the tutorials slowly

 

I posted this up on the RAT thread, but perhaps it's more appropriate here as I'm not getting Moose to load, without an error

 

However I downloaded Moose but setting up Moose in the Triggers before doing anything generates an error when I run the Mission

 

Obviously a clutz but can someone tell me what I'm doing wrong

 

KkCwv114Wos6VgOkv0tG-6n87leGhRC48i3aVtemsMFGUwzFkTh9P92ec5LDkHg2k0qvlzO-rMe1VhJlyrjHRlvxqMVzDjkY2EWTMTiSc2fQfTGWHk1NGB5f4BuipTkFx9cM3Cgv6Z3vBy0VLB8AzAAmZRt4BQiLgzxWcX59Dj-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b2C58T8l5rLgoKWSWriZiGcE0C7U05EHLAbPTM2kT9Pv8vD4ou4-ZW2BLUddcHiNw9IHlP2RvgeB-tdbClGj6BJKTaKDFFrj1SnPo2x6HV5YimEFJmNa1ePWreI8hSa44gNYasIa7I4Agzw=w411-h228-no

Link to comment
Share on other sites

Airboss Errors

 

Can someone give me a bit of help?

 

I'm a complete noob but this seems so basic. I have this line of code in my airboss script.

 

AirbossStennis:SetSoundfilesFolder("Airboss Soundfiles/")

 

Simple. Dragged Airboss Soundfiles into my MIZ and I get the following error in DCS.LOG

 

DCS: Mission script error: : [string "C:\Users\Mark\AppData\Local\Temp\DCS.openbeta\/~mis00000E66.lua"]:8: attempt to index global 'AirbossStennis' (a nil value)
stack traceback:
[C]: ?
[string "C:\Users\Mark\AppData\Local\Temp\DCS.openbeta\/~mis00000E66.lua"]:8: in main chunk

 

I'm completely lost and out of ideas. Using the latest Development version of Static moose.lua. Ive checked and rechecked the folder location and spelling. Highly frustrated as no matter what I try to change or add, it crashes the script.

 

It does the same thing with THIS line as well. So basic....

 

AirbossStennis:SetMenuSingleCarrier()

 

Markeebo

Link to comment
Share on other sites

Totally new to all this and going through the tutorials slowly

 

I posted this up on the RAT thread, but perhaps it's more appropriate here as I'm not getting Moose to load, without an error

 

However I downloaded Moose but setting up Moose in the Triggers before doing anything generates an error when I run the Mission

 

Obviously a clutz but can someone tell me what I'm doing wrong

 

KkCwv114Wos6VgOkv0tG-6n87leGhRC48i3aVtemsMFGUwzFkTh9P92ec5LDkHg2k0qvlzO-rMe1VhJlyrjHRlvxqMVzDjkY2EWTMTiSc2fQfTGWHk1NGB5f4BuipTkFx9cM3Cgv6Z3vBy0VLB8AzAAmZRt4BQiLgzxWcX59Dj-qYP7yFpEv7n3nBBzSm4OZAvcaJwDIf9yTqgdIASnDT8JGiVMYZat08BbHBkcEoL0sZga5m44ndBV91o3wOgheEhCk0UOkB7R89RB4kK6PZl1lDJ_QWzh0R1yJV1X71UqNzdE7hjXUeQDT-1TM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w411-h228-no

The link to your pics are broken... Are you sure you are loading the right MOOSE? There is a static version, and dynamic version. Static is the one you want in your final mission. It should be over 5MB in size...

Wayz Out

 

 

Intel Core i9 9900K | ASUS ROG Strix Z390E Gaming MB | G.Skill Ripjaws V 32gb DDR4-3200 | GeForce RTX 2080 Ti | Samsung 970 EVO Plus NVMe

HTC Vive Pro VR | Logitech G x56 HOTAS | Logitech G PRO Pedals

Link to comment
Share on other sites

A101Wayz

 

Fantastic I've got it working, I still don't know what I downloaded first time a whole lot of Moose files and folders, I wonder if it's a dvelopment pack I had gotten. I got it off the Moose site

 

Anyway, I used the link on the fiirst post and BAM!!! I've got 5 A-380s getting ready.

 

Many Thanks, this (for me)was part of the problem there seems to be different versions (not revisions) and I'm still mightly confused about the whole thing

 

One more thing was on the Moose videos, Flight Control talks about the lua code (remember I'm pretty new to this) but doesn't tell you that all you need is an editor and to make a separate file, save these lines of code to it then enable it via a trigger for the RAT to work

 

Funky Franky put me wise to that, it's great what a resource

 

As to the pictures that's strange they are not showing up, I can see them fine and I've never had problems before.

 

Either way many many thanks for the assistance

Link to comment
Share on other sites

@Markeebo

 

The first error suggests that either the string value you provided is invalid or the folder doesn't exist.

I recommend that you contact Funkyfranky over the MOOSE Discord channel, he wrote AIRBOSS.

 

Thanks for answering.

 

Thats the weird part. its EXACTLY spelled that way and in the .miz. I tried the newly released 2.5.0 today and I got the same error with this simple line of code:

 

AirbossStennis:SetMenuSingleCarrier()

This crashes script and gives the error: DCS: Mission script error: : [string "C:\Users\Mark\AppData\Local\Temp\DCS.openbeta\/~mis00005DF6.lua"]:6: attempt to index global 'AirbossStennis' (a nil value)

 

So strange. Especially since the docs state that you can leave it a nil value, or use true. I've tried both and both crash the script and give the same error. Cant get more basic than that.

 

Markeebo

Link to comment
Share on other sites

Thanks for answering.

 

Thats the weird part. its EXACTLY spelled that way and in the .miz. I tried the newly released 2.5.0 today and I got the same error with this simple line of code:

 

AirbossStennis:SetMenuSingleCarrier()

This crashes script and gives the error: DCS: Mission script error: : [string "C:\Users\Mark\AppData\Local\Temp\DCS.openbeta\/~mis00005DF6.lua"]:6: attempt to index global 'AirbossStennis' (a nil value)

 

So strange. Especially since the docs state that you can leave it a nil value, or use true. I've tried both and both crash the script and give the same error. Cant get more basic than that.

 

Markeebo

 

Whats the rest of your script look like? With just one line printed its hard to tell why. Likely a syntax error.

Link to comment
Share on other sites

Whats the rest of your script look like? With just one line printed its hard to tell why. Likely a syntax error.

 

local airbossStennis=AIRBOSS:New("USS Stennis", "Stennis")

airbossStennis:AddRecoveryWindow("12:05", "21:30", 1, nil, true, 30)

AirbossStennis:SetMenuSingleCarrier()--This crashes script and give the error: DCS: Mission script error: : [string "C:\Users\Mark\AppData\Local\Temp\DCS.openbeta\/~mis00005DF6.lua"]:6: attempt to index global 'AirbossStennis' (a nil value)

airbossStennis:Start()

 

Pretty basic. If I leave the set menu out, it works. But it really doesnt matter what I put in there. it always comes up with that error.

 

Markeebo

Link to comment
Share on other sites

airbossStennis is capitalized in that line, but not in the other lines.

Variables are case sensitive.

Wayz Out

 

 

Intel Core i9 9900K | ASUS ROG Strix Z390E Gaming MB | G.Skill Ripjaws V 32gb DDR4-3200 | GeForce RTX 2080 Ti | Samsung 970 EVO Plus NVMe

HTC Vive Pro VR | Logitech G x56 HOTAS | Logitech G PRO Pedals

Link to comment
Share on other sites

I am so confused with the OnSpawnGroup callback, could i get some help please? I am trying to have a group of planes spawn and do a CAP mission and then respawn after engine shutdown. I am trying to use the example missions as templates, but i am confused, or confusing myself... I have a plane template with LA on the ME...

 

CapPlane1 = GROUP:FindByName( "Plane1" )

PatrolZone = ZONE:New( "Patrol Zone1" )

AICapZone = AI_CAP_ZONE:New( PatrolZone, 15000, 20000, 350, 500 )

EngageZoneGroup = GROUP:FindByName( "Engage Zone1" )

CapEngageZone = ZONE_POLYGON:New( "Engage Zone1", EngageZoneGroup )

AICapZone:SetControllable( CapPlane1 )
AICapZone:SetEngageZone( CapEngageZone ) -- Set the Engage Zone. The AI will only engage when the bogeys are within the CapEngageZone.

AICapZone:__Start( 1 ) -- They should statup, and start patrolling in the PatrolZone.


Edited by Seance12
adding
Link to comment
Share on other sites

I am so confused with the OnSpawnGroup callback, could i get some help please? I am trying to have a group of planes spawn and do a CAP mission and then respawn after engine shutdown. I am trying to use the example missions as templates, but i am confused, or confusing myself... I have a plane template with LA on the ME...

 

CapPlane1 = GROUP:FindByName( "Plane1" )

PatrolZone = ZONE:New( "Patrol Zone1" )

AICapZone = AI_CAP_ZONE:New( PatrolZone, 15000, 20000, 350, 500 )

EngageZoneGroup = GROUP:FindByName( "Engage Zone1" )

CapEngageZone = ZONE_POLYGON:New( "Engage Zone1", EngageZoneGroup )

AICapZone:SetControllable( CapPlane1 )
AICapZone:SetEngageZone( CapEngageZone ) -- Set the Engage Zone. The AI will only engage when the bogeys are within the CapEngageZone.

AICapZone:__Start( 1 ) -- They should statup, and start patrolling in the PatrolZone.

 

In the demo mission (CAP_11...) the plane assigned CAP is not late activated. Since your 'Plane1' is late activated, you'll need to spawn it first. Replace the first line with this:

 

CapPlane1 = SPAWN:New('Plane1'):Spawn()

 

That SHOULD do the trick.

Wayz Out

 

 

Intel Core i9 9900K | ASUS ROG Strix Z390E Gaming MB | G.Skill Ripjaws V 32gb DDR4-3200 | GeForce RTX 2080 Ti | Samsung 970 EVO Plus NVMe

HTC Vive Pro VR | Logitech G x56 HOTAS | Logitech G PRO Pedals

Link to comment
Share on other sites

In the demo mission (CAP_11...) the plane assigned CAP is not late activated. Since your 'Plane1' is late activated, you'll need to spawn it first. Replace the first line with this:

 

CapPlane1 = SPAWN:New('Plane1'):Spawn()

 

That SHOULD do the trick.

 

Thank you!

Link to comment
Share on other sites

In the demo mission (CAP_11...) the plane assigned CAP is not late activated. Since your 'Plane1' is late activated, you'll need to spawn it first. Replace the first line with this:

 

CapPlane1 = SPAWN:New('Plane1'):Spawn()

 

That SHOULD do the trick.

 

You will also probably need an OnSpawnGroup otherwise this may or may not work. Or will work sometimes but not others due to when the plane actually gets spawned. Spawns have an inherit delay in them sometimes and due to that your code for setting up the AI_CAP may not work as the group it is trying to reference may not exist yet.

Link to comment
Share on other sites

You will also probably need an OnSpawnGroup otherwise this may or may not work. Or will work sometimes but not others due to when the plane actually gets spawned. Spawns have an inherit delay in them sometimes and due to that your code for setting up the AI_CAP may not work as the group it is trying to reference may not exist yet.

 

This is what i am getting confused on, i think i just need a simple example of how to use OnSpawnGroup as the (function (object) end) is confusing me, but i do understand that OnSpawnGroup allows the spawned group to inherit the properties defined for it

Link to comment
Share on other sites

This is what i am getting confused on, i think i just need a simple example of how to use OnSpawnGroup as the (function (object) end) is confusing me, but i do understand that OnSpawnGroup allows the spawned group to inherit the properties defined for it

 

 

Here is OnSpawnGroup code frag example. function SpawnFunc() executes when TestPlane is spawned.

 

 

 

 

 

ZoneVeh = GROUP:FindByName( "PolyTest")
PolygonZone = ZONE_POLYGON:New( "Polygon Test", ZoneVeh )

function SpawnFunc()
 TestSked = SCHEDULER:New( nil,
 function()
   if SpawnPlane:IsPartlyOrCompletelyInZone( PolygonZone ) == true then
     MESSAGE:New( "Plane in zone", 10 ):ToAll()
   end
 end, 
 {}, 5, 5 )
end

TestPlane = SPAWN:New( "TestPlane" )
                 :InitLimit( 1, 1 )
                 :OnSpawnGroup( SpawnFunc )


SpawnPlane = TestPlane:Spawn()

Link to comment
Share on other sites

You can use EVENTS.Birth to check when a unit has spawned... Then check EventData for IniPlayerName...

 

function OnEventBirth(EventData)
 if EventData.IniPlayerName then
   [insert logic for playing soundfiles here]

 end
end

Never used it for that exact purpose, but I see no reason why it shouldn't work. EVENTS.PlayerEnterUnit works in SP, but not in MP.

EVENTS.Birth works in MP just fine.

 

Oh, thanks bud. I just noticed your reply. Much appreciated :thumbup:

 

VCAW-99_sig_ED_BD-3.png

 

Alienware New Aurora R15 | Windows® 11 Home Premium | 64bit, 13thGen Intel(R) Core(TM) i9 13900KF(24-Core, 68MB|  NVIDIA(R) GeForce RTX(TM) 4090, 24GB GDDR6X | 1 X 2TB SSD, 1X 1TB SSD | 64GB, 2x32GB, DDR5, 4800MHz | 1350W PSU, Alienware Cryo-tech (TM) Edition CPU Liquid Cooling  power supply | G2 Rverb VR

Link to comment
Share on other sites

Hello,

InitRandomizeZones spawns assets always on the exact same spot on mission start for me.

any workaround to have real randomization?

thx

This works for me:

    IR_Attack:InitDelayOn()
            :InitRandomizeZones( SpawnZoneTbl )   -- SpawnZoneTbl defined earlier           
            :SpawnScheduled( 240, 0.5 )

This also works well for randomized location spawning:

 

 

BanditWP = STATIC:FindByName( "My Static" )
BanditWPVec2 = BanditWP:GetVec2()  -- Vec2 location spawned aircraft will fly to

MyAircraft = SPAWN:New( "My ME Aircraft")
                  :InitLimit( 4, 1 )
                  :InitRandomizePosition( true, 60000, 40000) -- Spawn radius band in meters
                  :OnSpawnGroup(function (SpawnGroup)
                      SpawnGroup:TaskRouteToVec2( BanditWPVec2, 600 )  -- Speed km/hr. Default = 20
                      end  
                      )

MyAircraft:Spawn()

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