Jump to content

Autonomous Ground Force Tasking


gromit190

Recommended Posts

I have never used a script before, but I've read about them in the forums and love what they do to the game. Looking at yours it's seems simple enough for a newbie. Is this something I could try without any steep learning curve or needed software ?

 

Hi!

 

Yes, you should be able to get started with the utility pretty easily. I've tried my best to keep it as uncomplicated to use as possible. Here's a quick guide on how to get strarted.

And of course, if you wan't some help just post your questions here and I'll be glad to help out.

 

I write missions for a small group of guys and I just get tired of knowing whats going to happen. Even with randomizing you still kinda of know whats going to happen. Looks neat and thanks for you hard work to make the game even more enjoyable.

 

Thanks! Hope you'll find it useful.

Link to comment
Share on other sites

  • 2 months later...

Your version 1.1 will run on the Open Beta 2.5.4 ?

I haven't run this for a couple of updates. I had problems with screen stutter before. I just did a system wipe, equipment upgrade and want to use this in my server missions. I am writing a mission as you get this, with it implemented. I will give you feed back on performance.

Link to comment
Share on other sites

  • 2 weeks later...

I did work over the mission I had using AGFT, so I tried the latest trial mission you have now and it worked. What's in the the latest miz file is not the same as I gotten earlier. I believe I was out of date. I also think that I am confused as to what files are needed to complete this. I had this working at one point in time. Are there updated instructions as well ? I would love to figure this out, as I would use it in just about every mission.

Link to comment
Share on other sites

You need to create a "MISSION START" trigger, and add two "DO SCRIPT FILE" actions to it.

The first "DO SCRIPT FILE" must load the autogft-1_11.lua file.

The second "DO SCRIPT FILE" must load your homemade script which instructs autogft how to work in your mission (examples are found here)

 

One important thing to note is that whenever you want to make changes to your homemade script, you have to re-select it to apply the changes to your mission.

Just select the "DO SCRIPT FILE" action, click "OPEN", select your homemade script file and click "OK".

 

 

Here's the writeup of how to get started.

Link to comment
Share on other sites

  • 2 weeks later...

Thanks for the awesome script! Is has been a huge influence in some great dynamic missions so far - still getting to terms with some of the functions though.

 

 

 

I'm having difficulty getting the Max Respawn timer to work. I have units from two bases that I only want to respawn for a max of 1200sec in the RED_BASE1 & 2 zone but they respawn continuously.

Can you please have a look at my .lua and tell me why it isn't working?

 

 

Thanks

mymission1.lua


Edited by |DUSTY|

F-15E | AH-64 | F/A-18C | F-14B | A-10C | UH-1H | Mi-8MTV2 | Ka-50 | SA342 | Super Carrier | Nevada | Persian Gulf | Syria |

Intel Core i7 11700K - 32GB 3200MHz CL16 DDR4 - MSI GeForce RTX 3060 Gaming X 12GB - Samsung 970 EVO Plus NVMe SSD 1TB

Link to comment
Share on other sites

I'm having difficulty getting the Max Respawn timer to work. I have units from two bases that I only want to respawn for a max of 1200sec in the RED_BASE1 & 2 zone but they respawn continuously.

Can you please have a look at my .lua and tell me why it isn't working?

 

There was a bug in autogft preventing the max respawn timer to work properly. It should be resolved now. Please let me know if it isn't :)

 

So the project is now at version 1.12.

Download here.

Link to comment
Share on other sites

Thanks Gromit! You're a champ!

 

 

Will test now and get back to you.

 

 

I seriously love this script. I found myself just watching the AI battle it out while my aircraft was just sitting on the ramp for about 20 minutes the other day :D

F-15E | AH-64 | F/A-18C | F-14B | A-10C | UH-1H | Mi-8MTV2 | Ka-50 | SA342 | Super Carrier | Nevada | Persian Gulf | Syria |

Intel Core i7 11700K - 32GB 3200MHz CL16 DDR4 - MSI GeForce RTX 3060 Gaming X 12GB - Samsung 970 EVO Plus NVMe SSD 1TB

Link to comment
Share on other sites

  • 3 weeks later...

Hi,

 

 

I've done some changes to the project to make it easier for anyone wanting to develop/contribute to the project:

- Removed submodules (copied external dependencies into the project), and

- Removed hardcoded file references

 

I've also written a small section in the README on how to develop/experiment with the project; here. Maybe somebody will find it useful :smartass:

 

 

:joystick:


Edited by gromit190
Link to comment
Share on other sites

  • 2 weeks later...

I've got a basic file set up now and it's working. I am going to go through all your examples to learn what they do and how to use them. I do have one question I can't find documents on, TaskForces ? Can you have more than one of the same force (BLUE) ? Are these linked to the original control points ? Does each TaskForce need it's own control points ? Is it linked to the BLUEBASE_1 or does each TaskForce have it's own BLUEBASE_1 ? Is TaskForce the top of hierarchy ? Great work by the way, will use it in every mission.

Link to comment
Share on other sites

  • 2 weeks later...

Hey! Sorry for the terribly late reply.

 

... TaskForces ? Can you have more than one of the same force (BLUE) ?

Yep, each Setup creates its own TaskForce. And you can have as many Setups (thus, TaskForces) as you want in your script.

(https://github.com/birgersp/dcs-autogft/blob/master/autogft/setup.lua#L28)

 

Are these linked to the original control points ?

Sorry, not sure I understand your question.

 

Does each TaskForce need it's own control points ?

Control points? Do you mean zones? If you mean zones, then no.

In the basic example you can see that two Setups use the same control zone:

https://github.com/birgersp/dcs-autogft/blob/master/examples/basic.lua

 

Is it linked to the BLUEBASE_1 or does each TaskForce have it's own BLUEBASE_1 ?

BLUEBASE_1 is just a mission zone. You can use the same zone multiple times for multiple Setup instances (i.e. TaskForces).

 

Is TaskForce the top of hierarchy ?

No, Setup is the top. A setup controls a TaskForce.

 

Great work by the way, will use it in every mission.

Thanks! :)


Edited by gromit190
Link to comment
Share on other sites

Thanks for the reply, it was perfect timing because I had to get a couple of race cars finished. Antarctica, sounds cold ! I've got a little time now to play. I wanted to set up multiple task forces with different goals to make the battle a little more wide spread. Going to give it a try, I'm sure I'll have some questions after fiddling. Thanks again.

Link to comment
Share on other sites

  • 1 month later...
  • 1 year later...

FYI, This is still working in the current version as of today, and it's awesome, but I did find an error,and it stops the server cold with a pop up that must be clicked to continue.

 

2020-09-26 04:07:30.789 DEBUG LuaGUI: --- onChatMessage--- RED unknown in T-72B killed BLUE unknown in M-2 Bradley with 125mm HE nil

 

2020-09-26 04:07:30.809 ERROR SCRIPTING: Error in scheduled function: [string "C:\Users\fargo\AppData\Local\Temp\DCS\/~mis0000002C.lua"]:2554: Object doesn't exist

 

I think this one may have been reported in an earlier version so perhaps a regression?

 

      local function checkPosAdvance()
       if self.groupLead then
         local currentPos = self.groupLead:getPosition().p  -- ** this is 2554 **
         if currentPos.x == prevPosX and currentPos.z == prevPosZ then
           self:forceAdvance()
         end
       end
     end

 

A question too - Does anyone have a way to specify the livery? I'd like them to all have 'desert' if possible. It doesn't pull it from the template.

 

ETA - I was able to fix this by basically breaking the problematic call out into its own function and encapsulating it with a pcall() also the schedule pcall which I now don't believe is needed.

 

I ran this hard for four CTRL-z sim hours with not a single error.

 

    
...
self.destinationIndex = nextDestination
   if previousDestination ~= self.destinationIndex then
     self:forceAdvance()
   else
     local prevPos = self.groupLead:getPosition().p
     local prevPosX = prevPos.x
     local prevPosZ = prevPos.z
     local function checkPosAdvance()
       if not self.groupLead  then
         return
       else
         local status,currentPos = pcall(getCurrentPosition,self.groupLead)
         if currentPos.x == prevPosX and currentPos.z == prevPosZ then
           self:forceAdvance()
         else
           return
         end
       end
     end
     pcall(autogft.scheduleFunction(checkPosAdvance, 2))
   end
 end
end

function getCurrentPosition(groupLead)

 currentPos = groupLead:getPosition().p
 return currentPos

end


Edited by fargo007

 

Banner EDForum2020.jpg

Have fun. Don't suck. Kill bad guys. 👍

https://discord.gg/blacksharkden/

Link to comment
Share on other sites

Just testing out this script for the first time and trying to replicate the youtube intro... No specification about whether the ground units should be set to delayed activation or not, so I have tried both.

 

Either way the ground units proceed toward their objectives very haltingly... They stop for no reason and then creep a few more meters every 15 minutes or so.

 

-- BLUE UNITS
autogft_Setup:new()
 :addBaseZone("BlueBase")
 :addControlZone("Objective2")
 :addControlZone("Objective1")

-- RED UNITS
autogft_Setup:new()
 :addBaseZone("RedBase")
 :addControlZone("Objective1")
 :addControlZone("Objective2")

 

Mission Start trigger does the autogft script file, then the above script. I have 4 zones on the map with the names above. Red and blue each have 4 tanks that start in the base zones.

 

One of the things that would be nice to have is a miz file that corresponds to each of the demo scripts, just for the sake of a sanity check.

 

--------------------

 

Watching the tanks with F7 view, they go completely dumb during these halting phases. One moment the tanks can be within range of each other and they're fighting, then all of a sudden they stop and become uncontrolled.

test.miz


Edited by gavagai

P-51D | Fw 190D-9 | Bf 109K-4 | Spitfire Mk IX | P-47D | WW2 assets pack | F-86 | Mig-15 | Mig-21 | Mirage 2000C | A-10C II | F-5E | F-16 | F/A-18 | Ka-50 | Combined Arms | FC3 | Nevada | Normandy | Straight of Hormuz | Syria

Link to comment
Share on other sites

There's been a problem with the AI manning the ground vehicles since a few months.

This is a DCS issue, and heavily affects pathfinding and combat mechanics.

Zip - VEAF :pilotfly:

 

If you want to learn, talk and fly with french-speaking friends, the Virtual European Air Force is here for you ! Meet us on our Discord and our forum

If you're a mission creator, you may want to check the VEAF Mission Creation Tools (and its GitHub repository) a set of open-source scripts and tools that make creating a dynamic mission a breeze !

Link to comment
Share on other sites

Hey guys,

 

So glad to see people are still finding this useful! Even though I find very little time for DCS myself these days.

 

FYI, This is still working in the current version as of today, and it's awesome, but I did find an error,and it stops the server cold with a pop up that must be clicked to continue.

 

2020-09-26 04:07:30.789 DEBUG LuaGUI: --- onChatMessage--- RED unknown in T-72B killed BLUE unknown in M-2 Bradley with 125mm HE nil

 

2020-09-26 04:07:30.809 ERROR SCRIPTING: Error in scheduled function: [string "C:\Users\fargo\AppData\Local\Temp\DCS\/~mis0000002C.lua"]:2554: Object doesn't exist

 

I think this one may have been reported in an earlier version so perhaps a regression?

 

      local function checkPosAdvance()
       if self.groupLead then
         local currentPos = self.groupLead:getPosition().p  -- ** this is 2554 **
         if currentPos.x == prevPosX and currentPos.z == prevPosZ then
           self:forceAdvance()
         end
       end
     end

 

Yeah this one seems to ring a bell. The error occurs when the group lead is killed within those two seconds that the "checkPosAdvance" is delayed. As you said it was reported before (I think). I will implement a fix for it today and upload a fixed version.

 

In short, it takes 2 seconds for the code to reach "step 2" here:

      local function checkPosAdvance()
       if self.groupLead then
         local currentPos = self.groupLead:getPosition().p <--- (step 2)
         if currentPos.x == prevPosX and currentPos.z == prevPosZ then
           self:forceAdvance()
         end
       end
     end
     autogft.scheduleFunction(checkPosAdvance, 2) <--- (step 1)

 

A question too - Does anyone have a way to specify the livery? I'd like them to all have 'desert' if possible. It doesn't pull it from the template.

 

Sorry, I haven't looked into that.

 

ETA - I was able to fix this by basically breaking the problematic call out into its own function and encapsulating it with a pcall() also the schedule pcall which I now don't believe is needed.

 

I ran this hard for four CTRL-z sim hours with not a single error.

 

    
...
self.destinationIndex = nextDestination
   if previousDestination ~= self.destinationIndex then
     self:forceAdvance()
   else
     local prevPos = self.groupLead:getPosition().p
     local prevPosX = prevPos.x
     local prevPosZ = prevPos.z
     local function checkPosAdvance()
       if not self.groupLead  then
         return
       else
         local status,currentPos = pcall(getCurrentPosition,self.groupLead)
         if currentPos.x == prevPosX and currentPos.z == prevPosZ then
           self:forceAdvance()
         else
           return
         end
       end
     end
     pcall(autogft.scheduleFunction(checkPosAdvance, 2))
   end
 end
end

function getCurrentPosition(groupLead)

 currentPos = groupLead:getPosition().p
 return currentPos

end

 

Thanks! Always nice to get some input. Even though this might make the error silent, the error may still occur as mentioned.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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