Jump to content

MOOSE - Mission Object Oriented Scripting Framework


Recommended Posts

@BoneDust

 

What about EWR_Red ?

 

As I understand it, the error you're getting says that your A2ADispatcher global variable is invalid (so it can't be indexed):

 

A2ADispatcher = AI_A2A_DISPATCHER:New( EWR_Red )

 

Are you sure that EWR_Red is a valid detection object?

Are you sure it exists while the script is running?


Edited by Hardcard
Link to comment
Share on other sites

@BoneDust

 

What about EWR_Red ?

 

As I understand it, the error you're getting says that your A2ADispatcher global variable is invalid (so it can't be indexed):

 

A2ADispatcher = AI_A2A_DISPATCHER:New( EWR_Red )

 

Are you sure that EWR_Red is a valid detection object?

Are you sure it exists while the script is running?

 

Yes for both :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

Thanks man.

 

I couldn't get it to work, so I started from scratch again and its working now.

 

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

I'm running this respawn script for a KC130. It respawns no problem, but it doesn't perform its task of refueling; it just reaches the steer point and then RTB.

 

I would like it to stay on station to refuel clients.

 

What am I missing?

 

SpawnTanker1 = SPAWN:NewWithAlias("KC130 Tanker","TEXACO")
SpawnTanker1:InitRandomizeRoute(0,0,15000,3658)  --steer point start, end radius in meters, and height in meters
SpawnTanker1:InitRepeatOnEngineShutDown()
SpawnTanker1:InitLimit(1,6)
SpawnTanker1:SpawnScheduled(300,0)
SpawnTanker1:SpawnAtAirbase( AIRBASE:FindByName( AIRBASE.Caucasus.Kobuleti ), SPAWN.Takeoff.Hot )
)


Edited by BoneDust
 

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

@BoneDust

 

I'd try it without route randomization (in case it's messing with ME wp tasks, somehow).

 

 

If it still doesn't work, I guess you could script the tanker enroute task instead.

I'd use :OnSpawnGroup() combined with :EnRouteTaskTanker(), with some sort of logic to decide when to push the task.


Edited by Hardcard
Link to comment
Share on other sites

@BoneDust

 

I'd try it without route randomization (in case it's messing with ME wp tasks, somehow).

 

 

If it still doesn't work, I guess you could script the tanker enroute task instead.

I'd use :OnSpawnGroup() combined with :EnRouteTaskTanker(), with some sort of logic to decide when to push the task.

 

Cheers man. I'll give that a try.

 

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

  • 2 weeks later...

UH1 radio guidance

 

Hello

Maybe someone has a solution. There is a problem with UH1 and navigation to the ground unit. I know that this can be done, the script CSAR sends a signal to be traced by UH1. How to do it so that the soldiers could also send such a signal. Turning off after seeing the helicopter.

Thank you

Specialization A-10C

https://vbw304.pl/

Link to comment
Share on other sites

I have a question whether it is possible to enable AI_A2A_GCICAP once. The idea is that he would send only one hunter for one purpose without respawning after destruction? Of course, being included for new purposes.
When you define the squadron assigned to the airport and that you will use for the gci, just put 1 as the number of available planes.

 

A2ADispatcher:SetSquadron( "Mozdok", AIRBASE.Caucasus.Mozdok, { "SQ CCCP MIG-31" }, 1 )

 

Inviato dal mio CPH1877 utilizzando Tapatalk


Edited by Mano
Link to comment
Share on other sites

I have a question as a new user thinking about learning MOOSE. On the first page of the thread you mention having 2 lua files:

Moose.lua

Moose_.lua

When I go to the downloads (https://github.com/FlightControl-Master/MOOSE/releases) I see MOOSE Patch 2.4.13 and it does not have a zip download available and only the one Moose.lua file. Is that all I need to get started besides the code editor and some coffee?

Thanks

Link to comment
Share on other sites

I have a question as a new user thinking about learning MOOSE. On the first page of the thread you mention having 2 lua files:

Moose.lua

Moose_.lua

When I go to the downloads (https://github.com/FlightControl-Master/MOOSE/releases) I see MOOSE Patch 2.4.13 and it does not have a zip download available and only the one Moose.lua file. Is that all I need to get started besides the code editor and some coffee?

Thanks

 

 

Good question. I look forward to a direct link to the DL.

Night Ops in the Harrier

IYAOYAS


 
Link to comment
Share on other sites

Guys, that is the link.

 

Moose.lua = include version of MOOSE that you'll need to add to every mission (if you plan on using MOOSE scripts in it)

 

Source code (zip) = files needed to set up MOOSE in LDT (the zip contains a different Moose.lua, which is NOT meant to be included in your missions)

 

 

Watch

to set it up in LDT.

 

In fact, I recommend that you watch the entire YT series.


Edited by Hardcard
Link to comment
Share on other sites

Guys, that is the link.

 

Moose.lua = include version of MOOSE that you'll need to add to every mission (if you plan on using MOOSE scripts in it)

 

Source code (zip) = files needed to set up MOOSE in LDT (the zip contains a different Moose.lua, which is NOT meant to be included in your missions)

 

 

Watch

to set it up in LDT.

 

In fact, I recommend that you watch the entire YT series.

 

 

I tried it 3 times and when I click FINISH I get an error message about "An internal error occurred during: "Build Modules".

 

Edit: I tired again and it seems to have worked. :thumbup:

Thanks


Edited by davebert
Link to comment
Share on other sites

Hi folks,

I'm new to mission development using the moose framework and over the past couple of weeks have immersed myself in learning and applying it. Recently I ran my first coop mission using Moose and tested it alongside the group I'm involved with. One thing I'm interested in is finding a technique for balancing the mission such that any opposing Ai that spawn can be scaled, based on the number of players in the mission on the Blue side.

 

I understand that the ai balancer can be applied for aircraft on the players side, but is there a way to begin a scheduled spawn by monitoring how many players take a cap role? The current mission implements scheduled spawning such that there is always a potential of 10 Ai Cap in the air on the Red side. The problem was that it wore our CAP players down, as they felt they weren't making much progress.

 

thanks in advance

Link to comment
Share on other sites

@Tonmeister

 

Off the top of my head (without having actually tested it), I'd start by doing the following:

 

In Mission Editor:

 

- Create a bunch of late activated AI CAP groups (4 units each). If you want to, give them waypoints and tasks as well.

 

- Give all relevant clients a common prefix in their unit names (EDIT: No need to do this, just ignore it)

 

 

In the MOOSE script:

 

- Define a set that targets all relevant clients (you can use a prefix filter for this).

 

- Define the AI CAP groups as SPAWN objects

 

- You can then use a scheduler to periodically check the number of relevant clients that are currently active

 

- Create a scheduled spawn logic for the AI CAP groups, based on number of active clients

 

- You can use :InitLimit() in order to limit the number of AI CAP units spawned (it can also be used to make them respawn)

 

- Decide how do you want to trigger the scheduler (for instance, you could use a coalition F10 menu for this)

 

 

Script example:

 

 

local ClientSET = SET_CLIENT:New() -- Use SET_CLIENT instead of SET_UNIT

ClientSET:FilterActive(Active)

-- ClientSET:FilterPrefixes("Chosen common prefix in ME") seems to be causing problems, don't use it

 

local CAP_1 = SPAWN:New("Name of the first AI CAP group in ME")

 

local CAP_2 = SPAWN:New("Name of the second AI CAP group in ME")

 

-- etc.

 

local function CAP_Start()

 

SCHEDULER:New(nil,

function()

 

ClientSET:FilterStart() -- This should keep our client set updated

 

local Client_Count = ClientSET:Count()

 

MESSAGE:New("Number of active clients = "..Client_Count,10):ToAll() -- This is simply a troubleshooting message, in order to verify that the active client count is accurate. Comment it out if you want

 

if Client_Count <= 2 then

 

CAP_1:InitLimit(Client_Count,1):Spawn()

 

elseif Client_Count > 2 then

 

CAP_1:InitLimit(Client_Count,1):Spawn() -- You might need to subtract a few bandits, depending on number of clients active (to keep it balanced). To do this, simply add - number of bandits to subtract after Client_Count

CAP_2:InitLimit(Client_Count,1):Spawn() -- You might need to subtract a few bandits, depending on number of clients active (to keep it balanced). To do this, simply add - number of bandits to subtract after Client_Count

 

-- You could just limit these AI flight spawns to 2 units max and get rid of Client_Count altogether. It's up to you.

 

-- etc.

 

end

 

end, {}, 1, 10

)

end

 

CAPMenuRoot = MENU_COALITION:New(coalition.side.BLUE,"CAP Spawn Menu")

MENU_COALITION_COMMAND:New(coalition.side.BLUE, "Start Spawn Scheduler!", CAPMenuRoot, CAP_Start)

 

 

 

As I said, this is just off the top of my head, there might be simpler/better ways of achieving the same goal (using AI dispatchers, for instance)... also, it's pretty raw, you'd need to polish it.

 

EDIT: After some testing, looks like the prefix filter is causing problems with the unit count, so use the active filter only (it seems to work fine). Also, use SET_CLIENT instead of SET_UNIT.


Edited by Hardcard
Link to comment
Share on other sites

Thanks, HardCard.

I'll look into your suggestion and thanks for the example code and comments, I didn't think of that approach. There's still much to learn from moose, it seems quite a powerful and flexible approach to mission design and balancing the mission can quite a challenge when player numbers change. I'll see how I go with it.

 

thanks!

Link to comment
Share on other sites

Hello

Since i am running the dedicated serverversion of dcs i am not able to get my ratscript running.

Missions that run well on my pc won`t run on my server pc. (running, but whithout the script)

Maybe someone can point me in the right direction ?!


Edited by markuscha


CPU: i7-5820K, 3.3GHz GPU: nVidia GeForce GTX1080 Motherboard: Gigabyte X99-UD3 RAM: G.Skill DDR4-2133 16GB SSD: Crucial MX200 500GB OS: Win 10 64Bit
Link to comment
Share on other sites

Ups ! Sorry .

Problem solved !

Found the problem between the headphones :music_whistling:



CPU: i7-5820K, 3.3GHz GPU: nVidia GeForce GTX1080 Motherboard: Gigabyte X99-UD3 RAM: G.Skill DDR4-2133 16GB SSD: Crucial MX200 500GB OS: Win 10 64Bit
Link to comment
Share on other sites

Hi, I am having a bit of trouple with the PseudoATC module. It looks as though I was able to instatiate MOOSE and the PseudoATC correctly via:

 

 

pseudoATC=PSEUDOATC:New()
pseudoATC:Start()
pseudoATC:DebugOn()

However, I do not get any F10 menu entry, and I also see the following in the log:

 

 

2019-06-02 03:32:51.022 INFO    SCRIPTING: Error in SCHEDULER function:[string "C:\Users\Jeff\AppData\Local\Temp\DCS\/~mis00000B75.lua"]:66433: attempt to index field '?' (a nil value)
2019-06-02 03:32:51.022 INFO    SCRIPTING: stack traceback:
   [string "C:\Users\Jeff\AppData\Local\Temp\DCS\/~mis00000B75.lua"]:6062: in function <[string "C:\Users\Jeff\AppData\Local\Temp\DCS\/~mis00000B75.lua"]:6058>
   [string "C:\Users\Jeff\AppData\Local\Temp\DCS\/~mis00000B75.lua"]:66433: in function 'PlayerTakeOff'
   [string "C:\Users\Jeff\AppData\Local\Temp\DCS\/~mis00000B75.lua"]:66338: in function <[string "C:\Users\Jeff\AppData\Local\Temp\DCS\/~mis00000B75.lua"]:66323>
   (tail call): ?
   [C]: in function 'xpcall'
   [string "C:\Users\Jeff\AppData\Local\Temp\DCS\/~mis00000B75.lua"]:6360: in function 'onEvent'
   [string "Scripts/World/EventHandlers.lua"]:13: in function <[string "Scripts/World/EventHandlers.lua"]:11>

I am using the latest version of MOOSE from git.

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