Jump to content

MOOSE - Mission Object Oriented Scripting Framework


Recommended Posts

Would Moose do something like that?:book:

Where should I look.....

No. Placing units is done in the mission editor. You can use Moose to spawn existing, hidden ("late activation") units.

 

 

Currently, I didn’t find anything you can do with client planes, except Menu items...

Scripting is mostly done for AI units...

[sIGPIC][/sIGPIC]

Currently used modules:

- F16 Viper(primary)

- F/A 18 Hornet , F-5E Tiger, L-39, C-101 for fun

- (many more unused but great modules :-) )

Link to comment
Share on other sites

I'm not exactly sure what the request is but if you are NOT talking about client aircraft then you can do what you are looking to do with Moose of course and a ton more.

 

Nothing with any scripting can mess with client spawns so you are out of luck there.

 

Hey Guys,

 

Looking to create a standard server setup for missions.

 

 

Meaning

 

3 aircraft Groups of 4 spawned in Ramps

and get res-pawned after take off.

(in case of destroyed, so client can restart)

 

 

Would Moose do something like that?:book:

Where should I look.....

 

Thanx

Link to comment
Share on other sites

It is unfortunate, that we can only respawn Player-slots, but no Client-slots. I did a test-mission in multiplayer and my script was able to respawn my own Player-slot, but I think this would not work with more than one player. I wonder how DCS is deciding which player is in the Player-slot. Is it the host of the server? If it was possible to convert a Client-slot to the new Player-slot during the mission, then this would allow a workaround for Client-respawns.

Link to comment
Share on other sites

No, there is only ONE"Player" type unit. Client type units you can have multiple. Player is more accessible to scripting, you can destroy Players, get cockpit arguments, have random failures of equipment, see the training gates, do tutorial lessons with cockpit indicators like the training missions, have access to do things like turning on radar to override WOW, developer arguments, all sorts of good things.

 

Clients operate as a very limited locked down player. Player slots do not appear on a MP server, a Player takes control immediately on spawning into the mission, of whatever the unit is with the player skill level set in the mission editor.

If you attempted to edit the skill level in the miz file from "Client" to "Player" probably bad things would happen because DCS doesnt know what slot to push you into. You would probably sit in spectators and have no slots to join at all. But feel free to test that, if that's your wish. There is no circumvention of the basic game design of DCS, this has been the way since it was first made.

What you ask for is what many people have asked for.

 

It is unfortunate, that we can only respawn Player-slots, but no Client-slots. I did a test-mission in multiplayer and my script was able to respawn my own Player-slot, but I think this would not work with more than one player. I wonder how DCS is deciding which player is in the Player-slot. Is it the host of the server? If it was possible to convert a Client-slot to the new Player-slot during the mission, then this would allow a workaround for Client-respawns.

___________________________________________________________________________

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

Link to comment
Share on other sites

hey there,

i try to make my AI_A2A_DISPATCHER flights talk on the radio (tally, engage etc.) but it doesn't work.

i use this code:

 

OPFOR_A2A_DispatcherB:SetSquadron("OPFOR_Stennis","Stennis",{"BLUEF18","BLUEF14"})

OPFOR_A2A_DispatcherB:SetSquadronRadioFrequency("OPFOR_Stennis",251)

 

251 AM on COMM1 stays silent.

it works with my RAT flights (using RadioON() and RadioFrequency(251)) but not with the spawned AI_A2A_DISPATCHER flights. do i need to turn the radio on with any command first? couldn't find any documentation about that.

The Template units for the Squadron have COMMS enabled as well.

Link to comment
Share on other sites

  • 2 weeks later...

I'm following the

. When I attempt to create a new lua file, I get the following error. I guess it's a simple set-up error somewhere, but I'm not sure where.

 

org.eclipse.dltk.core.ModelException: <project root> [in My_Missions] is not on its project's build path

 

...Editing this post to add that I can create the a lua file under the automatically generated src directory, but I can't create one under a folder I manually add per the video. I notice that the manual folder and the src directory have different icons. I've searched Eclipse help, but I didn't find a key for the icon used for the src directory.

1348387382_MooseLuafilecreation.jpg.14859f8e9ea172dc251f43b5d342017f.jpg


Edited by keith55
Additional info
Link to comment
Share on other sites

Delete that src folder under My_Missions.

 

Then right-click My_Missions > Build Path > Configure Build Path... > Add Moose_Framework under Projects tab (if it isn't already there)

 

Intellisense should work fine, assuming that Moose_Framework project is correctly set up. Also, you should be able to create folders and put scripts in them.


Edited by Hardcard
Link to comment
Share on other sites

Then right-click My_Missions > Build Path > Configure Build Path... > Add Moose_Framework under Projects tab (if it isn't already there)

.

 

I thought it was going to be related to the reference to Moose_Framework, but that was set up correctly. The only way to get it to work was right-click=>Build Path=>Use as a source folder

Link to comment
Share on other sites

The only way to get it to work was right-click=>Build Path=>Use as a source folder

 

Then you've probably set up My_Missions wrong.

 

Delete the project and create it again.

 

- No execution environment

- No default template

- Delete the src folder

- Make sure Moose_Framework is referenced

- Make sure Moose_Framework is properly set up (Moose Development/Moose should be selected as source folder)


Edited by Hardcard
Link to comment
Share on other sites

The environment seems to be okay now. I've been working through the tutorials and it's working as expected. Setting the folder to be a source folder seems to have fixed the problem.

 

I did uninstall and reinstall it a few times. There were a couple of internal errors reported, but judging by the comments on the video, that seems to be normal. I also had to download moose.lua from an earlier version at github because the pre-release doesn't have it.

Link to comment
Share on other sites

There were a couple of internal errors reported, but judging by the comments on the video, that seems to be normal.

 

Those module errors are normal, the error you reported isn't.

 

I also had to download moose.lua from an earlier version at github because the pre-release doesn't have it.

 

The Moose.lua include that you need to run in your missions is definitely there.

It's the third asset/link --> https://github.com/FlightControl-Master/MOOSE/releases/tag/v2.5.0pre1

 

Previous MOOSE versions are missing AIRBOSS module, new methods and a host of bug fixes.


Edited by Hardcard
Link to comment
Share on other sites

Those module errors are normal, the error you reported isn't.

The Moose.lua include that you need to run in your missions is definitely there.

It's the third asset/link --> https://github.com/FlightControl-Master/MOOSE/releases/tag/v2.5.0pre1

Previous MOOSE versions are missing AIRBOSS module, new methods and a host of bug fixes.

 

Thanks, I missed that. Do I need to download the sound and voice files, too? Where do they need to go?

Link to comment
Share on other sites

I've been playing around with some of the demo missions and I have a couple of questions. What is the recommended way to determine when a plane has reached waypoint? There are some ground unit examples, but I haven't seen anything for aircraft. It would be handy to be able to subscribe to an event, but as far as I can see there isn't one raised.

 

For the SetFileName method on a Radio object, where is it expecting the sound file to be? I've tried giving it an absolute path and various other permutations, but I'm not having much luck.

 

Thanks!

Link to comment
Share on other sites

I've been playing around with some of the demo missions and I have a couple of questions. What is the recommended way to determine when a plane has reached waypoint? There are some ground unit examples, but I haven't seen anything for aircraft. It would be handy to be able to subscribe to an event, but as far as I can see there isn't one raised.

 

For the SetFileName method on a Radio object, where is it expecting the sound file to be? I've tried giving it an absolute path and various other permutations, but I'm not having much luck.

 

Thanks!

 

 

Did you try: handle:WayPointFunction(WayPoint,WayPointIndex,WayPointFunction,...)

like

handle:WayPointFunction(1, 1, myWpImplementation)

 

 

Normally, files are located in the Mission MIZ file (which is a renamed ZIP). The MIZ file is extracted on mission start, and deleted on leave.

[sIGPIC][/sIGPIC]

Currently used modules:

- F16 Viper(primary)

- F/A 18 Hornet , F-5E Tiger, L-39, C-101 for fun

- (many more unused but great modules :-) )

Link to comment
Share on other sites

For the SetFileName method on a Radio object, where is it expecting the sound file to be? I've tried giving it an absolute path and various other permutations, but I'm not having much luck.

 

Thanks!

 

In the ME, create a new Once Trigger.

add a condition that will never occur (like FLAG IS TRUE(1000))

then under the ACTION section, add as many SOUND TO ALL entries as needed. (All sounds added need to have unique file names)

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

Escorting an AI plane

 

Hi. I want to know if it's possible to script escorting of AI planes.

 

 

Scenario:

There's 1 late-activated AWACS named "AWACS BLUE".

If I use SPAWN:New("AWACS BLUE") I get instances called "AWACS BLUE #0001"

 

 

How can I add an F16 to protect the freshly spawned AWACS? Does the ESCORT Class help with this, or is it possible to simply spawn a Fighter plane and assign the escort task?

[sIGPIC][/sIGPIC]

Currently used modules:

- F16 Viper(primary)

- F/A 18 Hornet , F-5E Tiger, L-39, C-101 for fun

- (many more unused but great modules :-) )

Link to comment
Share on other sites

In the ME, create a new Once Trigger.

add a condition that will never occur (like FLAG IS TRUE(1000))

then under the ACTION section, add as many SOUND TO ALL entries as needed. (All sounds added need to have unique file names)

 

Thanks. That's what I ended up doing, although it does seem a bit cumbersome.

Link to comment
Share on other sites

Thanks. That's what I ended up doing, although it does seem a bit cumbersome.

If you use MOOSE Airboss, there are many files to copy. Its easier to use 7zip and copy the whole directory with drag&drop...

[sIGPIC][/sIGPIC]

Currently used modules:

- F16 Viper(primary)

- F/A 18 Hornet , F-5E Tiger, L-39, C-101 for fun

- (many more unused but great modules :-) )

Link to comment
Share on other sites

  • 2 weeks later...

Trigger and evenhandling for the death of a group

 

Hello everyone,

 

I've been struggling with something that must be very straight forward I guess.

 

Testing if a group is dead on an event.

 

I can play with events and know when a unit is down. I also know that I can plug a onEventDead to a group and this will be "called" each time a group member is down. But I struggle to retrieve info on the parent group in the code.

 

here is my test code :

 

local AirDefense = GROUP:FindByName( "AG-AA #001" )

AirDefense:HandleEvent(EVENTS.Dead)

function AirDefense:OnEventDead( EventData )
local infos = ''
infos = infos.."IniCategory : "..EventData.IniCategory..string.char(10)
infos = infos.."IniCoalition : "..EventData.IniCoalition..string.char(10)
infos = infos.."IniDCSGroupName : "..EventData.IniDCSGroupName..string.char(10)
infos = infos.."IniGroupName : "..EventData.IniGroupName..string.char(10)
infos = infos.."IniObjectCategory : "..EventData.IniObjectCategory..string.char(10)
infos = infos.."IniUnitName : "..EventData.IniUnitName..string.char(10)
infos = infos.."GetCategoryName : "..EventData.IniGroup:GetCategoryName()..string.char(10)
local unitsAlive = EventData.IniGroup:CountAliveUnits()
infos = infos.."CountAliveUnits : "..unitsAlive
display( infos , 2 , dbug )
if not EventData.IniDCSGroup:isExist() then
	display( "AirDefense down" , 10 , dbug )
else
	display( "AirDefense up" , 2 , dbug )
end
end

 

When I do this, I get the correct GetCategoryName() on the EventData.IniGroup object ie. 'Ground Unit'. But when I do CountAliveUnits() on the same object I get this in the log file :

 

Error in SCHEDULER function:[string "C:\Users\Arnaud\AppData\Local\Temp\DCS.openbeta\/~mis0000060E.lua"]:224: attempt to call method 'CountAliveUnits' (a nil value)

 

When am in the AirDefense:OnEventDead function I should be able to retrieve infos about the group calling the function right ?

 

I tried :

 

self:isExist()

 

or

 

self:CountAliveUnits() == 0

 

to no avail, self doesn't seem to work here. Nor EventData.IniDCSGroup.

 

The strange thing is that the line

 

display( "Groupe "..EventData.IniDCSGroupName , 0.5 , dbug )

 

is working....


Edited by Arnaud
Link to comment
Share on other sites

When am in the AirDefense:OnEventDead function I should be able to retrieve infos about the group calling the function right ?.

No... When you are in the AirDefense: (any function), self refers to AirDefense object and NOT a GROUP.

You would have to use something like:

EventData.IniGroup:CountAliveUnits()
or
EventData.IniGroup:IsAlive()

 

And you can't use the DCS groups with Moose functions. You'll need to use the Moose wrappers - EventData.IniUnit, EventData.IniGroup, EventData.IniUnitName, EventData.IniGroupName, etc...


Edited by A101Wayz

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

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