Jump to content

Autonomous Ground Force Tasking


gromit190

Recommended Posts

Ok I tried adding that exact code set to a mission on a once trigger on time +10 as a do script. It didn't crash even though I had a single blue Mi8 (only unit) in the mission. Give it a go and see what you get so as to compare. If you don't get a crash either then it seems that perhaps the groups table is not getting populated properly when running in the auto ground script. Possibly the #groups is getting corrupted and is therefore the loop trying to address a non existent table entry and then the getUnits() is being passed crap and crashes as a result. Changing to a pairs loop would stop that from happening.

 

EDIT: This is the line causing the crash.

 

Here's how to reproduce the crash (without AutoGFT). Add a BLUE MI-8 and then run this script:

local groups = coalition.getGroups(coalition.side.BLUE)
for i = 1, #groups do
   env.info("CRASHING TIME")
   local units = groups[i]:getUnits() --   <- Will crash if the group has a MI-8
end

:music_whistling:

 

<edit> just tried again quickly before I go and work on the house. Added a couple more Mi8s to the group for 3 helos and a group of 3 A10Cs. Still no crash on that code set for me

 

<edit2> sorry brain dead. you set the groups table just prior to the loop so my earlier comment about #groups makes no sense.


Edited by Stonehouse
I'm stupid
Link to comment
Share on other sites

You would need to use the reinforce() option instead as respawn continues and reinforce is limited, by design.

There's something in the future we hope with regards to hidden pools of vehicles on paper like a warehousing system, attached to a physical building with possible rates of production, but its a while away yet and more pressing functionality to build in right now.

 

I see, thanks for your reply.

 

See it as a wish list item perhaps?

What i'd like to do is have endless respawns for both sides, until one of the teams ground units reach their last target position, then have the other teams respawning stop (or why not have the respawn position change to a backup respawn point farther away).

Link to comment
Share on other sites

I tried the example1_4.miz with a Player Mi8, worked great.

I changed one of the BLUE to "reinforce" two groups of 4 each of M-1 to Spawn1 zone. No Mi8, works great.

 

Add Player Mi8 (Blue or Red) to miz with one blue reinforce , CTD.

 

autogft_TaskForce:new()

:setCountry(country.id.USA)

:addBaseZone("SPAWN1")

:addControlZone("Combat1")

:addControlZone("Combat2")

:addControlZone("Combat3")

:addGroup(4, "M-1 Abrams")

:reinforce()

:setAdvancementTimer(300)

:setReinforceTimer(600)

Am I setting this up correctly or is there still some issues with the Player Mi8 and Uh-1?

 

OB 1.5.5

Autogft 1.4

No Mods

 

No crash on my side either.

Link to comment
Share on other sites

I tried the example1_4.miz with a Player Mi8, worked great.

I changed one of the BLUE to "reinforce" two groups of 4 each of M-1 to Spawn1 zone. No Mi8, works great.

 

Add Player Mi8 (Blue or Red) to miz with one blue reinforce , CTD.

 

autogft_TaskForce:new()

:setCountry(country.id.USA)

:addBaseZone("SPAWN1")

:addControlZone("Combat1")

:addControlZone("Combat2")

:addControlZone("Combat3")

:addGroup(4, "M-1 Abrams")

:reinforce()

:setAdvancementTimer(300)

:setReinforceTimer(600)

Am I setting this up correctly or is there still some issues with the Player Mi8 and Uh-1?

 

OB 1.5.5

Autogft 1.4

No Mods

 

The bug with "getUnits()" crashing on any group with MI-8 or UH-1 units is quite a devastating bug (and not just for this script, I would imagine). As to this script it means: As long as the there's a MI-8/UH-1 in a base zone when a reinforcement (not spawning) timer is triggered, it will CTD ...

 

Can someone report this to the higher-ups?

 

(Meanwhile, the only workaround is to keep your UH-1 and MI-8 away from base zones, sorry to say)

 

I see, thanks for your reply.

 

See it as a wish list item perhaps?

What i'd like to do is have endless respawns for both sides, until one of the teams ground units reach their last target position, then have the other teams respawning stop (or why not have the respawn position change to a backup respawn point farther away).

 

That's definitely a reasonable feature request :) I should add functions to stop the timers (issue #64). Maybe just a single "stop()" that stops them all (reinforcement, respawning, advancement).


Edited by gromit190
Link to comment
Share on other sites

The bug with "getUnits()" crashing on any group with MI-8 or UH-1 units is quite a devastating bug (and not just for this script, I would imagine). As to this script it means: As long as the there's a MI-8/UH-1 in a base zone when a reinforcement (not spawning) timer is triggered, it will CTD ...

 

Can someone report this to the higher-ups?

 

(Meanwhile, the only workaround is to keep your UH-1 and MI-8 away from base zones, sorry to say)

 

 

 

That's definitely a reasonable feature request :) I should add functions to stop the timers (issue #64). Maybe just a single "stop()" that stops them all (reinforcement, respawning, advancement).

 

Sounds good!

Link to comment
Share on other sites

The bug with "getUnits()" crashing on any group with MI-8 or UH-1 units is quite a devastating bug (and not just for this script, I would imagine). As to this script it means: As long as the there's a MI-8/UH-1 in a base zone when a reinforcement (not spawning) timer is triggered, it will CTD ...

 

Can someone report this to the higher-ups?

 

(Meanwhile, the only workaround is to keep your UH-1 and MI-8 away from base zones, sorry to say)

 

Reported here: https://forums.eagle.ru/showthread.php?p=3007246#post3007246

Link to comment
Share on other sites

Hey,

 

Is there a way to assign different kind of units to a single group?

 

eg.

 

:addGroup(4, "M-1 Abrams"),(4, "LAV-25")

 

Hi,

 

 

I'm afraid not. I could add a mechanism to have multiple unit specifications per task force group. But I'm not sure what would be the best way to specify these units.

 

 

(EDIT: Deleted concept code, issue resolved)


Edited by gromit190
Link to comment
Share on other sites

New release is out (download link here).

 

Is there any command to stop respawning forces for one side?

 

I've added a "stopReinforcing" function which kills the reinforcement/respawning timers. You can assign the task force to some variable and then "stop" it with another trigger. Perhaps not very useful, but I can give you an example mission if you'd like.

 

Later I'm going to add a function to define base "objects". When these objects are destroyed, the task force will stop reinforcing/respawning.

 

Hey,

 

Is there a way to assign different kind of units to a single group?

 

eg.

 

:addGroup(4, "M-1 Abrams"),(4, "LAV-25")

 

The new version lets you define units of multiple types for a single task force group.

 

I've updated the example to show how you can use it. The example adds two groups to the task force:

First group: 4 M-1 Abrams

Second group: 3 M-1 Abrams + 4 LAV-25s


Edited by gromit190
Link to comment
Share on other sites

New release is out (download link here).

 

I've added a "stopReinforcing" function which kills the reinforcement/respawning timers. You can assign the task force to some variable and then "stop" it with another trigger. Perhaps not very useful, but I can give you an example mission if you'd like.

 

Later I'm going to add a function to define base "objects". When these objects are destroyed, the task force will stop reinforcing/respawning.

 

That was quick, thanks!

 

What would I put in the trigger to stop the respawning? Maybe it's clear in the documentation, if so I apologize.

Link to comment
Share on other sites

That was quick, thanks!

 

What would I put in the trigger to stop the respawning? Maybe it's clear in the documentation, if so I apologize.

 

It's not very clear, but I can try to show you.

 

Firstly, you need to assign the task force declaration (in the script running on mission start, like the example.lua) to a global variable.

 

Current example

autogft_TaskForce:new()
 :setCountry(country.id.USA)
 (... more example code)

 

Change it to

myTaskForce = autogft_TaskForce:new()
 :setCountry(country.id.USA)
 (... more example code)

 

So now you have variable called "myTaskForce" which you can use later. So then you can add another trigger event, which calls this code

myTaskForce:stopReinforcing()

 

5v4JSPC.jpg

 

And the reinforcing/respawning for the task force should stop. If you want it to happen to multiple task forces you have to declare multiple variables (myTaskForce1, myTaskForce2, ...) and call "stopReinforcing" for each.

 

Hope this helps :)

 

I guess what would really help you would be to have some object that the task force "depends on". Like a base warehouse or similar. When the warehouse is destroyed, the task force will stop respawning. Or would you rather have some other condition for the task force?


Edited by gromit190
Link to comment
Share on other sites

New release is out (download link here).

The new version lets you define units of multiple types for a single task force group.

 

I've updated the example to show how you can use it. The example adds two groups to the task force:

First group: 4 M-1 Abrams

Second group: 3 M-1 Abrams + 4 LAV-25s

 

Sweet and superquick!

Thank you, Sir!

Link to comment
Share on other sites

It's not very clear, but I can try to show you.

 

Firstly, you need to assign the task force declaration (in the script running on mission start, like the example.lua) to a global variable.

 

Current example

autogft_TaskForce:new()
 :setCountry(country.id.USA)
 (... more example code)

 

Change it to

myTaskForce = autogft_TaskForce:new()
 :setCountry(country.id.USA)
 (... more example code)

 

So now you have variable called "myTaskForce" which you can use later. So then you can add another trigger event, which calls this code

myTaskForce:stopReinforcing()

 

And the reinforcing/respawning for the task force should stop. If you want it to happen to multiple task forces you have to declare multiple variables (myTaskForce1, myTaskForce2, ...) and call "stopReinforcing" for each.

 

Hope this helps :)

 

I guess what would really help you would be to have some object that the task force "depends on". Like a base warehouse or similar. When the warehouse is destroyed, the task force will stop respawning. Or would you rather have some other condition for the task force?

 

Thanks! It works perfectly!

 

This is really great, all I need is the snippet to end respawning, and from that I can make my own conditions for it (object destroyed, group destroyed, group in zone, whatever). Nice work man.

Link to comment
Share on other sites

Hi EasyEB,

 

We've currently got this issue solved in more than two ways. There's a time limit, but hopefully on the horizon we wish to attach the respawning capabilities to a static object like a warehouse. The goal being, destroy the warehouse, the units stop respawning. Hopefully Grommit will get round to that, at his current rate, its goign to be "soon". :)

Thanks! It works perfectly!

 

This is really great, all I need is the snippet to end respawning, and from that I can make my own conditions for it (object destroyed, group destroyed, group in zone, whatever). Nice work man.

___________________________________________________________________________

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

Link to comment
Share on other sites

Hi EasyEB,

 

We've currently got this issue solved in more than two ways. There's a time limit, but hopefully on the horizon we wish to attach the respawning capabilities to a static object like a warehouse. The goal being, destroy the warehouse, the units stop respawning. Hopefully Grommit will get round to that, at his current rate, its goign to be "soon". :)

 

But that can already be done with myTaskForce:stopReinforcing()?

 

Oh, and while we are on the topic of feature requests, it would be cool if you could stop enemy units from using for instance Spawn1 if condition X is met. For example if Blue is in Zone1, red can not spawn in Spawn1 (but instead Spawn2 and Spawn3).

 

Also, it would be nice if you could make it spawn for example a random number of enemy vehicles of random type. For instance between 2 and 4 of BMP-1 and T-55.

 

But again guys, thanks for your hard work. I really appreciate this!

Link to comment
Share on other sites

But that can already be done with myTaskForce:stopReinforcing()?

 

You're right, but it's a little cumbersome to do and I think the ability to declare a "warehouse"/"base object" of sorts would be an easier alternative for some mission makers.

 

Oh, and while we are on the topic of feature requests, it would be cool if you could stop enemy units from using for instance Spawn1 if condition X is met. For example if Blue is in Zone1, red can not spawn in Spawn1 (but instead Spawn2 and Spawn3).

 

Also, it would be nice if you could make it spawn for example a random number of enemy vehicles of random type. For instance between 2 and 4 of BMP-1 and T-55.

 

Interesting ideas! I could quite easily make spawn zones "disabled" when there is enemy presence (issue link).

 

Regarding random units I'm hoping to add that too, would be nice not to know exactly what kind and count of units that gets put in to action :) (issue link). How would you prefer to declare the randomness (if you could just write it in the task force declaration)?

 

Maybe like this?

 

autogft_TaskForce:new()
 :setCountry(country.id.USA)
 :addBaseZone("SPAWN1")
 :addControlZone("Combat1")
 :addRandomizedGroup():setRange(2,8):addType("M-1 Abrams"):addType("LAV-25")
 (... more code)

Link to comment
Share on other sites

You're right, but it's a little cumbersome to do and I think the ability to declare a "warehouse"/"base object" of sorts would be an easier alternative for some mission makers.

 

 

 

Interesting ideas! I could quite easily make spawn zones "disabled" when there is enemy presence (issue link).

 

Regarding random units I'm hoping to add that too, would be nice not to know exactly what kind and count of units that gets put in to action :) (issue link). How would you prefer to declare the randomness (if you could just write it in the task force declaration)?

 

Maybe like this?

 

autogft_TaskForce:new()
 :setCountry(country.id.USA)
 :addBaseZone("SPAWN1")
 :addControlZone("Combat1")
 :addRandomizedGroup():setRange(2,8):addType("M-1 Abrams"):addType("LAV-25")
 (... more code)

 

Yeah, that seems straight forward enough! I don't know if it's already implemented but random skill would be great aswell.

Link to comment
Share on other sites

Gromit

Love this system. I was trying to do something similar with MOOSE but dont have the technical where with all to complete. I used the same concept of going after zones. So I filled my mission with zones. One thing I tried to do is have units leapfrog so if one unit takes a zone another will push on to the next. Also tried to simulate if a unit get reduced to a percent they will retreat to a previous zone. Zones get listed as Blue or red as they are captured so units would retreat to their approp zone. Would love to see this capability.

I was in Art of the Kill D#@ it!!!!

Link to comment
Share on other sites

Hello there.

 

I recenty found out about that script and i can say "amazing work".Keep up!

To my question now.Although i mangaed to mess around with ground units i haven't been able to do that with naval.

I use the names you pre-defined in the txt and also moved the zones to sea but...no luck!

 

Can you plz create a simple mission for example and how the script must look like?

 

Thnx a lot and looking forward for your answer. :-)

Lock-On Greece / DCS World Greece http://lockon-greece.forumotion.net/

🇬🇷 1st Hellinic Virtual Squadron for Flaming Cliffs & DCS World
~ Flying since 2008 ~

 

Link to comment
Share on other sites

Thanks so much for the great feedback and support, guys!

 

Gromit

Love this system. I was trying to do something similar with MOOSE but dont have the technical where with all to complete. I used the same concept of going after zones. So I filled my mission with zones. One thing I tried to do is have units leapfrog so if one unit takes a zone another will push on to the next. Also tried to simulate if a unit get reduced to a percent they will retreat to a previous zone. Zones get listed as Blue or red as they are captured so units would retreat to their approp zone. Would love to see this capability.

 

Hmm, very interesting idea! Groups taking heavy casualties could even stay "pinned down" while they wait for reinforcements. I'll write it up (issue link), thanks!

 

Hello there.

 

I recenty found out about that script and i can say "amazing work".Keep up!

To my question now.Although i mangaed to mess around with ground units i haven't been able to do that with naval.

I use the names you pre-defined in the txt and also moved the zones to sea but...no luck!

 

Can you plz create a simple mission for example and how the script must look like?

 

Thnx a lot and looking forward for your answer. :-)

 

Hello. I haven't gotten around to testing naval, I'm afraid. But unless there's some big differences in the waypoint logic, I would assume it would work the same way. I can try to test and create an example for naval a little later, right now my hands are a bit full. It's on the list (issue created).

 

(Sorry, but I have to ask) Did you re-load the script (example.lua) to your mission after you modified it? Did the units not respawn, or not move, or what went wrong exactly?

Link to comment
Share on other sites

Thanks so much for the great feedback and support, guys!

 

 

 

Hmm, very interesting idea! Groups taking heavy casualties could even stay "pinned down" while they wait for reinforcements. I'll write it up (issue link), thanks!

 

 

 

Hello. I haven't gotten around to testing naval, I'm afraid. But unless there's some big differences in the waypoint logic, I would assume it would work the same way. I can try to test and create an example for naval a little later, right now my hands are a bit full. It's on the list (issue created).

 

(Sorry, but I have to ask) Did you re-load the script (example.lua) to your mission after you modified it? Did the units not respawn, or not move, or what went wrong exactly?

 

I saved the new lua file and i renamed it just to be sure not to use the old one (example_NAVY).

I used your mission.I deleted the pre-defined red units (T-90),i created also another SPAWN3 & 4 zones (it works with ground units,so no worries if i made something wrong) and i use the naval names you have in your text document.

The result was the mission to run (i didnt have any error messages or CTD) but the naval units never spawned.

 

A mission from you as an example would be great,since Viggen is on the way and your script opens new horizons in mission designing.

 

Looking forward for your answer.

Thnx a lot.


Edited by Spanker79

Lock-On Greece / DCS World Greece http://lockon-greece.forumotion.net/

🇬🇷 1st Hellinic Virtual Squadron for Flaming Cliffs & DCS World
~ Flying since 2008 ~

 

Link to comment
Share on other sites

I tested also. Naval use of autoGFT doesn't work. Probably something to do with the way each are tasked. It does try to use them, it deletes the existing units for a TF and then craps out spawning them.

 

For now I would leave ships out of the equation, perhaps when Viggen arrives it will get renewed interest but its up to Grommit, I'd be using MIST to spawn randomly.

I saved the new lua file and i renamed in just to be sure not to use the old one (example_NAVY).

I used your mission.I deleted the pre-defined red units (T-90),i created also another SPAWN3 & 4 zones (it works with ground units,so no worries if i made something wrong) and i use the naval names you have in your text document.

The result was the mission to run (i didnt have any error messages or CTD) but the naval units never spawned.

 

A mission from you as an example would be great,since Viggen is on the way and your script opens new horizons in mission designing.

 

Looking forward for your answer.

Thnx a lot.

___________________________________________________________________________

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

Link to comment
Share on other sites

what does creating a task force do.

 

:scanUnits("TF")

 

Sorry, what are you asking exactly?

Maybe this will help: https://birgersp.github.io/dcs-autogft/taskforce.html##(autogft_TaskForce).scanUnits

 

I saved the new lua file and i renamed in just to be sure not to use the old one (example_NAVY).

I used your mission.I deleted the pre-defined red units (T-90),i created also another SPAWN3 & 4 zones (it works with ground units,so no worries if i made something wrong) and i use the naval names you have in your text document.

The result was the mission to run (i didnt have any error messages or CTD) but the naval units never spawned.

 

A mission from you as an example would be great,since Viggen is on the way and your script opens new horizons in mission designing.

 

Looking forward for your answer.

Thnx a lot.

 

Thanks for clearing that up. Pikey confirmed that ships are in fact not working in this script atm. I'll do more tests later to try and figure out whats going wrong and how I can fix it.

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...