MOOSE - Mission Object Oriented Scripting Framework - Page 135 - ED Forums
 


Notices

Reply
 
Thread Tools Display Modes
Old 11-11-2018, 04:07 AM   #1341
Dino Might
Member
 
Dino Might's Avatar
 
Join Date: May 2015
Posts: 538
Default

Found an error in the way I set up my code in our testing session tonight.
Spawning groups through Moose assigns a new number to the group name without reusing numbers.


So, we start with F5#001, F5#002, etc. and eventually get to F5#006 instead of recycling to F5#001 (well after that group was destroyed). Then the count function stops working as intended, because the existing units are outside the table. I figured this all out around the time I clicked on a unit in F10 and saw "F5#076."


I was thinking of two options, both of which I do not know how to do:
1) Count function goes through all active groups and checks if group name is "F5" .. * (wildcard). If yes, then add to count.
2) F5 spawn function forces newly spawned unit to take relinquished name from the table.


I think the first option makes more sense, but I'm not sure if it's doable and how to do it. I have been pouring through the wiki trying to find how to input wildcards, to no avail.

By the way, this error did make tonight's test pretty fun. SM-2s flying through the air on final approach, CIWS going off right overhead as we're catching wires. MiGs strafing statics and players on the carrier. It was nuts. Then, someone hops on as GCI and says "You have a 10-ship coming at you, 000 for 15 miles. And another 10 or so behind that. good luck."

Last edited by Dino Might; 11-11-2018 at 04:09 AM.
Dino Might is offline   Reply With Quote
Old 11-11-2018, 04:16 AM   #1342
fargo007
Member
 
Join Date: Jul 2017
Posts: 443
Default

Why must it matter what the group name is, so long as the correct number of them are alive at any particular event window?

Have you looked at :InitLimit() and :SpawnScheduled() ?

That's a vehicle to guarantee you have a certain amount of assets alive at one time.
__________________



You dig rotorcraft? Training, Quals, Missions, & FUN. Ask me about joining the Black Sharks!
fargo007 is offline   Reply With Quote
Old 11-11-2018, 04:02 PM   #1343
Dino Might
Member
 
Dino Might's Avatar
 
Join Date: May 2015
Posts: 538
Default

Yes, I have looked at those, but with the Spawn scheduler, the periodicity value sets the time between spawns for each group. I would like to set a time between spawns for all groups that will spawn.


For example, I want spawns to occur every 4 minutes. If player numbers dictate that 3 new groups should spawn when the timer ticks over, then I want all 3 of those groups spawning at once.

With spawn scheduler, if I schedule spawn every 4 minutes for that group, one of those groups will spawn every 4 minutes, up to the limit. Is there a way to tell the spawn scheduler to spawn multiple copies of the same group? My issue is that spawn scheduler is supposed to be called once, and then left alone. I would need to be updating the number of groups to spawn every time the scheduler initiates a spawn.

I could set a spawn scheduler for each group and turn the schedulers on and off depending on player count, but I rather prefer the wildcard solution if it's possible, in part because it will be useful for other things I'm going to want to do.


Ultimately, I need a robust way to count all groups of a certain type.

Last edited by Dino Might; 11-11-2018 at 04:05 PM.
Dino Might is offline   Reply With Quote
Old 11-11-2018, 04:43 PM   #1344
fargo007
Member
 
Join Date: Jul 2017
Posts: 443
Default

You can set the limit with :initLimit(n,n), use a SpawnScheduler(2400,1) and STILL spawn that group manually in between with :Spawn().

Another possible way to handle this is to take a count of the alive groups by defining another SET_GROUP with a filter based on that groups name and use the iterator function to collect a count.

Then compare the count of alive clients to alive groups and spawn according to the desired ratio.

Or, you could put the entire declaration of the enemy (and the numbers in :InitLimit(n,n) ) inside your loop so you are defining what n, and n are based on your counts of clients and then let the SpawnScheduler populate the enemies accordingly.

The existing ones may disappear and reappear somewhere else though. Not sure how that behavior will shake out but it may work for you.
__________________



You dig rotorcraft? Training, Quals, Missions, & FUN. Ask me about joining the Black Sharks!
fargo007 is offline   Reply With Quote
Old 11-11-2018, 05:14 PM   #1345
Hardcard
Member
 
Hardcard's Avatar
 
Join Date: May 2013
Posts: 182
Default

I'd go the SET_GROUP + iterator way too (combining it with checks and flags, in order to manage scheduler activation, specific number of units to spawn, and all that stuff).

If you haven't already, join the MOOSE Discord channel. People over there will help you crack this, ask the MOOSE contributors over there (Pikes and funkyfranky should be able to help you with this)

Last edited by Hardcard; 11-11-2018 at 05:22 PM.
Hardcard is offline   Reply With Quote
Old 11-14-2018, 01:56 AM   #1346
Dino Might
Member
 
Dino Might's Avatar
 
Join Date: May 2015
Posts: 538
Default

Just joined the Discord.

Recoded to use SET_CLIENT and SET_GROUP, but I bet I'm missing some very simple syntax that is breaking my script before it even starts. I threw in a bunch of debug messages so I could see where it breaks, and apparently:
Quote:
clients = SET_CLIENT:New()
:FilterActive()
:FilterStart()
the first block is causing a hiccough. Posted in Discord, but throwing it up here because I'm sitting here questioning my sanity for the past hour messing with this.

Thank you guys for the SET suggestion though - looks to be exactly what I've been trying to find.


Pikes on Discord hooked me up - turns out I had an outdated version of MOOSE, and he cleaned up my code a lot. It's now working perfectly!
Quote:
-- SET DYNAMIC GROUP LISTING

clients = SET_CLIENT:New()
:FilterActive()
:FilterStart()

F5_active = SET_GROUP:New()
:FilterPrefixes("F5")
:FilterActive()
:FilterStart()

MiG_29_active = SET_GROUP:New()
:FilterPrefixes("MiG_29")
:FilterActive()
:FilterStart()

Anti_Ship = SET_GROUP:New()
:FilterPrefixes("Anti_Ship")
:FilterActive()
:FilterStart()

-- SET SPAWN GROUP DEFINITIONS
F5 = SPAWN:New("F5")
MiG_29 = SPAWN:New("MiG_29")
AS = SPAWN:New("Anti_Ship")



CountScheduler = SCHEDULER:New( nil, function()

num_clients = clients:Count()
num_F5 = F5_active:Count()
num_29 = MiG_29_active:Count()
num_as = Anti_Ship:Count()
env.info("Count of clients is " .. num_clients)

local msgClients = {}
msgClients.text = num_clients..' Clients Active \n'..
num_F5..' F5 Groups Active \n'..
num_29..' MiG 29 Groups Active \n'..
num_as..' Anti-Ship Groups Active'
msgClients.displayTime = 15
msgClients.msgFor = { coa = {'all'}}
mist.message.add(msgClients)

if num_F5 < num_clients then
for k = 1, (num_clients - num_F5) do
F5:Spawn()
end
end

if (num_29*2) < num_clients then
for k = 1, (num_clients - num_29*2) do
MiG_29:Spawn()
end
end

end, {}, 240, 240, 0.1)

Last edited by Dino Might; 11-14-2018 at 04:57 AM.
Dino Might is offline   Reply With Quote
Old 11-14-2018, 07:36 AM   #1347
Hardcard
Member
 
Hardcard's Avatar
 
Join Date: May 2013
Posts: 182
Default

Glad you got it working!

PS. The MOOSE discord channel always delivers (might take weeks / months sometimes, but it always does! You just need to be patient.)
Hardcard is offline   Reply With Quote
Old 11-15-2018, 11:31 PM   #1348
Skippa
Junior Member
 
Join Date: Jul 2018
Posts: 1
Default

Hi @all...

WoW...i dont know where to start...i try to get into MOOSE aswell.
Its so awesome what we can do with it. Makes DCS such a better game.
But for ppl with no coding experience it can be quite a huzzle to get the head around this.

I already got some simple A2G and A2A tasking up and running wich i am currently testing and playing around with values and things.

Now got to a point where i could use some help of some experts, wich leads me to my first problem.

No matter what i try "Eclipse LDT" wont start on my system. I tryed all Fixes/Solutions i could find on google but with no success.
Really would like to have "Intelli sense" funktion.

I got "Eclipse Photon" running with no problems but it seems not to have the Intelli Sense funktion so i rather stick with notepad++ for now.
Or i just set it up the wrong way, i dont know its all so complicated.

Maybe someone can help?

0/
Skippa is offline   Reply With Quote
Old 11-16-2018, 06:25 PM   #1349
Hardcard
Member
 
Hardcard's Avatar
 
Join Date: May 2013
Posts: 182
Default

@Skippa

I had a similar issue with LDT some months back.
If I remember correctly, I solved it by doing this:

-Uninstall Java using this tool

-Remove all traces of any previous LDT installations from your system

-Download/Install Java 8 from here

-Use this LDT build

-Then simply follow the rest of instructions from this video

PS. I'm assuming you have a 64bit version of Windows, btw.

Last edited by Hardcard; 11-16-2018 at 06:29 PM.
Hardcard is offline   Reply With Quote
Old 11-17-2018, 08:35 AM   #1350
Naj-Treg
Junior Member
 
Join Date: Sep 2014
Posts: 39
Default

Hi all.

I have a question/problem with a mission i created.

I created a WWII intercept mission where players and AI work together as interceptors.
I have a working GCICAP script. I setup A2ADispatcher:SetSquadronOverhead and A2ADispatcher:SetSquadronGrouping so that there is not a 1 on 1 but lesser GCI plane spawn. This way the human players can fill the gap.
This script works great.

Now for the problem.
When the enemy bombers are in range, the script spawns the GCI planes and they take off.
After take off all the GCI planes go after 1 enemy plane till it gets shot down. Wich results that the rest of the bombers follow the route without getting intercepted only till the first plane get shot down. then it all repeats for the second plane.

Am i doing something wrong? or is this a flaw within DCS/Moose?

I tought that the spawned GCI planes would go after different targets and not all after one target.

Is there a solution for this?

Greetings Naj-Treg
Naj-Treg is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT. The time now is 01:49 AM. vBulletin Skin by ForumMonkeys. Powered by vBulletin®.
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.