fargo007 Posted October 1, 2020 Share Posted October 1, 2020 Hey guys, So glad to see people are still finding this useful! Even though I find very little time for DCS myself these days. 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) Sorry, I haven't looked into that. Thanks! Always nice to get some input. Even though this might make the error silent, the error may still occur as mentioned. Yeah, it's okay if the error is trapped and isn't fatal to the script (and therefore the server). That's where I was going with it. Thanks again for a great utility here. We are enjoying it. Have fun. Don't suck. Kill bad guys. https://discord.gg/blacksharkden/ Link to comment Share on other sites More sharing options...
gunterlund21 Posted October 10, 2020 Share Posted October 10, 2020 gROMIT Getting an error with setadvancementtimer 2020-10-10 02:38:48.654 ERROR SCRIPTING: Mission script error: [string "C:\Users\bryce\AppData\Local\Temp\DCS.openbeta\/~mis00002EEB.lua"]:2274: Parameter #1 (coalition id) missed stack traceback: [C]: ? [C]: in function 'getGroups' [string "C:\Users\bryce\AppData\Local\Temp\DCS.openbeta\/~mis00002EEB.lua"]:2274: in function <[string "C:\Users\bryce\AppData\Local\Temp\DCS.openbeta\/~mis00002EEB.lua"]:2271> (tail call): ? [string "C:\Users\bryce\AppData\Local\Temp\DCS.openbeta\/~mis00002EEB.lua"]:2338: in function 'isAccomplished' [string "C:\Users\bryce\AppData\Local\Temp\DCS.openbeta\/~mis00002EEB.lua"]:2700: in function 'updateCurrentTask' [string "C:\Users\bryce\AppData\Local\Temp\DCS.openbeta\/~mis00002EEB.lua"]:2372: in function 'updateTarget' [string "C:\Users\bryce\AppData\Local\Temp\DCS.openbeta\/~mis00002EEB.lua"]:1886: in function 'updateAndAdvance' [string "C:\Users\bryce\AppData\Local\Temp\DCS.openbeta\/~mis00002EEB.lua"]:1890: in function 'setAdvancementTimer' [string "C:\Users\bryce\AppData\Local\Temp\DCS.openbeta\/~mis000039D9.lua"]:104: in main chunk code is autogft_Setup:new() :addBaseZone("BLUE_BASE") :addControlZone("CONTROL1") :addControlZone("CONTROL2") :addControlZone("CONTROL3") :setSpeed(30) :setAdvancementTimer(120) I was in Art of the Kill D#@ it!!!! Link to comment Share on other sites More sharing options...
gunterlund21 Posted October 10, 2020 Share Posted October 10, 2020 (edited) also dont think maxroutedistance is working autogft_Setup:new() :addBaseZone("BLUE_BASE") :addControlZone("CONTROL1") :addControlZone("CONTROL2") :addControlZone("CONTROL3") :setSpeed(30) --:setAdvancementTimer(120) :setMaxRouteDistance(4) They still move about 1 km then wait for 300 seconds then move another km which must be default? Edited October 10, 2020 by gunterlund21 I was in Art of the Kill D#@ it!!!! Link to comment Share on other sites More sharing options...
gromit190 Posted October 10, 2020 Author Share Posted October 10, 2020 Hello, gROMIT Getting an error with setadvancementtimer 2020-10-10 02:38:48.654 ERROR SCRIPTING: Mission script error: [string "C:\Users\bryce\AppData\Local\Temp\DCS.openbeta\/~mis00002EEB.lua"]:2274: Parameter #1 (coalition id) missed stack traceback: [C]: ? [C]: in function 'getGroups' [string "C:\Users\bryce\AppData\Local\Temp\DCS.openbeta\/~mis00002EEB.lua"]:2274: in function <[string "C:\Users\bryce\AppData\Local\Temp\DCS.openbeta\/~mis00002EEB.lua"]:2271> (tail call): ? [string "C:\Users\bryce\AppData\Local\Temp\DCS.openbeta\/~mis00002EEB.lua"]:2338: in function 'isAccomplished' [string "C:\Users\bryce\AppData\Local\Temp\DCS.openbeta\/~mis00002EEB.lua"]:2700: in function 'updateCurrentTask' [string "C:\Users\bryce\AppData\Local\Temp\DCS.openbeta\/~mis00002EEB.lua"]:2372: in function 'updateTarget' [string "C:\Users\bryce\AppData\Local\Temp\DCS.openbeta\/~mis00002EEB.lua"]:1886: in function 'updateAndAdvance' [string "C:\Users\bryce\AppData\Local\Temp\DCS.openbeta\/~mis00002EEB.lua"]:1890: in function 'setAdvancementTimer' [string "C:\Users\bryce\AppData\Local\Temp\DCS.openbeta\/~mis000039D9.lua"]:104: in main chunk code is autogft_Setup:new() :addBaseZone("BLUE_BASE") :addControlZone("CONTROL1") :addControlZone("CONTROL2") :addControlZone("CONTROL3") :setSpeed(30) :setAdvancementTimer(120) I think this error occurs because the script is not able to determine which coalition the units in the "task force" shall be. Are there any units present in BLUE_BASE? also dont think maxroutedistance is working autogft_Setup:new() :addBaseZone("BLUE_BASE") :addControlZone("CONTROL1") :addControlZone("CONTROL2") :addControlZone("CONTROL3") :setSpeed(30) --:setAdvancementTimer(120) :setMaxRouteDistance(4) They still move about 1 km then wait for 300 seconds then move another km which must be default? Hmm, looks like you're right. It appears that the maxDistanceKM (which setMaxRouteDistance alters) is not in use. Must have been forgotten during a refactor. I'm puzzled that this hasn't come up before. I'll try to get that fixed. Thanks gunterlund21 :) Autonomous ground AI project Link to comment Share on other sites More sharing options...
gunterlund21 Posted October 10, 2020 Share Posted October 10, 2020 (edited) Gromit thanks for the tip. To answer your question yes there were units inside the base zones. :setCountry(country.id.USA) fixed the timer issue. Now its just the distance parameter. Thanks for making this a fantastic tool. Another question I have setAdvancementTimer set for each of the sides. US is set at 120 , Russia at 60. It looks like its ignoring the 120 a everyone is moving at 60. Is this command side dependent. I should see the Russians moving twice as many times as US but they are moving the same. Edited October 10, 2020 by gunterlund21 I was in Art of the Kill D#@ it!!!! Link to comment Share on other sites More sharing options...
gromit190 Posted October 10, 2020 Author Share Posted October 10, 2020 Gromit thanks for the tip. To answer your question yes there were units inside the base zones. Okay. That's odd, the script should be able to determine the coalition using those units in BASE_ZONE on mission start. Another question I have setAdvancementTimer set for each of the sides. US is set at 120 , Russia at 60. It looks like its ignoring the 120 a everyone is moving at 60. Is this command side dependent. I should see the Russians moving twice as many times as US but they are moving the same. They should be independent. Can you share the mission and/or script you are using? Autonomous ground AI project Link to comment Share on other sites More sharing options...
gromit190 Posted October 10, 2020 Author Share Posted October 10, 2020 New version: https://github.com/birgersp/dcs-autogft/releases/latest/ The crash in setAdvancementTimer should be gone now, and maxDistanceKM should be working as intended. gunterlund21 can you give 1.14 a go and let me know if the errors are gone? And can you check if you still have the same problem with setAdvancementTimer (Russia and US using the same advancement timer)? Autonomous ground AI project Link to comment Share on other sites More sharing options...
gunterlund21 Posted October 10, 2020 Share Posted October 10, 2020 New version: https://github.com/birgersp/dcs-autogft/releases/latest/ The crash in setAdvancementTimer should be gone now, and maxDistanceKM should be working as intended. gunterlund21 can you give 1.14 a go and let me know if the errors are gone? And can you check if you still have the same problem with setAdvancementTimer (Russia and US using the same advancement timer)? yes will do. Here is the test mission with old autofgt. It has moose elements in it but they should not be affecting autogft. problem still occurs without moose.GROUND_ENGAGEMENT.miz I was in Art of the Kill D#@ it!!!! Link to comment Share on other sites More sharing options...
gunterlund21 Posted October 11, 2020 Share Posted October 11, 2020 Hi Gromit ok did some testing. It looks like the maxdistance is working but not sure if the timer is working. Need to understand what its doing. Is the timer supposed to gauge how long the units will travel for or is the timer the gap between the next bound. It looks like the units travel for 120 seconds then sit for 30. My timer is set to 145 seconds so if it gauges distance they should make the 4km (assuming setMaxRouteDistance is in km) see attachedGROUND_ENGAGEMENT.miz I was in Art of the Kill D#@ it!!!! Link to comment Share on other sites More sharing options...
gunterlund21 Posted October 11, 2020 Share Posted October 11, 2020 Gromit Im a bundle of questions trying to use Capturetask USCapture = CaptureTask:new("CONTROL1", "blue") Is this the right format for the coalition. Im getting a big nil error on its execution. Im assuming that when blue is in control1 the flag will be set to true. I was in Art of the Kill D#@ it!!!! Link to comment Share on other sites More sharing options...
gromit190 Posted October 12, 2020 Author Share Posted October 12, 2020 (edited) Gromit Im a bundle of questions Great, keep em coming :) ok did some testing. It looks like the maxdistance is working but not sure if the timer is working. Need to understand what its doing. Is the timer supposed to gauge how long the units will travel for or is the timer the gap between the next bound. It looks like the units travel for 120 seconds then sit for 30. My timer is set to 145 seconds so if it gauges distance they should make the 4km (assuming setMaxRouteDistance is in km) see attached The “advancement timer” is a time interval between “task status updates”. On each “task status update”, the script will check if the units should go to the next, the previous, or stay in the current (zone). If the script decides that the units should just keep moving towards the same target as before (on previous update), the script will only calculate a new route if the units are standing still. So if your units are moving for 120 seconds then stop I would guess it means that they just reached the end of their route. They sit there waiting for a new route (which comes when the advancement timer expires, 25-30 seconds later). If the zones are close (i.e. short distances between tasks) you could do setAdvancementTimer(30) or something. But the “task status update” can be a bit performance-costly, so just keep that in mind if your mission starts slowing down ;) You could try to observe their route in the F10 map and see what happens with their route (I have done this for hours and hours while developing autogft). Now about the max route distance. The max route distance is just there to improve performance. Because, if the next target zone is very very far away from the units, DCS will use (relatively) much time to compute a route to it. So that’s why I added the “max route distance”. If the next target is more than the max route distance (let’s call it X) away from the group, then the script logic says don’t actually go to the zone but go to a point X distance towards the zone. So 10km max distance and 300 seconds between status updates is what we found to be a reasonable “sweet spot”. Realistically speaking, military units waiting in a spot for up to 300 seconds before deciding where to go is not long. And 10km means that DCS can compute a route there without slowing down the server. So those are the deafults that autogft use, if you don't use setAdvancementTimer or setMaxRouteDistance. trying to use Capturetask USCapture = CaptureTask:new("CONTROL1", "blue") Is this the right format for the coalition. Im getting a big nil error on its execution. Im assuming that when blue is in control1 the flag will be set to true. No, the CaptureTask:new takes these two arguments: zone name (string) and coalition id (number). Im getting a big nil error on its execution. Im assuming that when blue is in control1 the flag will be set to true. Not exactly. Invoking USCapture:isAccomplished() will return true when blue is in control1. The term “flag” I guess is from DCS, but USCapture is a lua table containing information about a “task” that a “task force” may accomplish. The capture task is a task where the units go to the zone, clear enemies in it and move to the next (with a “never look back” attitude). To add such a task to your setup, use addIntermidiateZone like this. autogft_Setup:new() :addBaseZone("SOME_BASE") :addIntermidiateZone("CONTROL1") :addIntermidiateZone("CONTROL2") :addIntermidiateZone("CONTROL3") The other types (like CaptureTask) in autogft aren’t really meant to be used by the “user” of the script. Or are you trying to do something more “custom”? Edited October 13, 2020 by gromit190 Autonomous ground AI project Link to comment Share on other sites More sharing options...
gunterlund21 Posted October 14, 2020 Share Posted October 14, 2020 Thanks Gromit for the great explanation. Im still a little confused though between controlzone and intermediatezone. From your explanation it looks like they do the same thing. I thought the intermediatezone was just a way to get units to go in a certain direction without any kind of capture process. Will the units fight over an intermediatezone as well? Also gain the capturetask:new should I worry about this and what are the coalition numbers... Thanks again for this great system and your support on it. Having a blast with it. I was in Art of the Kill D#@ it!!!! Link to comment Share on other sites More sharing options...
gromit190 Posted October 14, 2020 Author Share Posted October 14, 2020 Appreciate the feedback :) Im still a little confused though between controlzone and intermediatezone. From your explanation it looks like they do the same thing. I thought the intermediatezone was just a way to get units to go in a certain direction without any kind of capture process. Will the units fight over an intermediatezone as well? Yeah it's a little confusing, not sure how to name them to really. But here's the breakdown: addControlZone: The "control zone" is a zone which the units must control at all times. So even if they attacked it, won and moved on they may still retreat to it later if enemies re-appear in it again later in the mission. addIntermidiateZone: The "intermidiate zone" is a zone which units will only care to capture once. So when all enemies are cleared out, they will advance to the next. But they won't return to the "intermidiate zone", even if enemies re-appear at it. Also gain the capturetask:new should I worry about this and what are the coalition numbers... You don't need to worry about it. Just use "addIntermidiateZone" to add a "capture task". But if you still want to know, the coalition numbers can be obtained with coalition.side.RED or coalition.side.BLUE Autonomous ground AI project Link to comment Share on other sites More sharing options...
gromit190 Posted October 14, 2020 Author Share Posted October 14, 2020 I did some "hierarchical" changes to the code, and built some new docs for it. Now the Setup class only contains appropriate functions. Other, more "background-code" functions are moved to other classes. Here is a link to the new docs: https://birgersp.github.io/dcs-autogft/Setup.html Autonomous ground AI project Link to comment Share on other sites More sharing options...
gunterlund21 Posted October 15, 2020 Share Posted October 15, 2020 I did some "hierarchical" changes to the code, and built some new docs for it. Now the Setup class only contains appropriate functions. Other, more "background-code" functions are moved to other classes. Here is a link to the new docs: https://birgersp.github.io/dcs-autogft/Setup.html Brilliant Gromit. Now the docs make alot more sense. And thanks for the explanation of the zones. Big help. Now if only DCS could fix the unit path finding we will have a battle. I was in Art of the Kill D#@ it!!!! Link to comment Share on other sites More sharing options...
gunterlund21 Posted November 4, 2020 Share Posted November 4, 2020 Hey Gromit I think the latest update has done something to Autogft. Units no longer advance. I was in Art of the Kill D#@ it!!!! Link to comment Share on other sites More sharing options...
xXMustangXx Posted November 5, 2020 Share Posted November 5, 2020 Tanks don't move in my case, other units do Link to comment Share on other sites More sharing options...
gromit190 Posted November 16, 2020 Author Share Posted November 16, 2020 Hey guys, sorry for being so slow with my replies. I'll take a look at it later today. If somebody wants to help out, I'd like to know what happens exactly? Do the units not get a route? Or do they get a route but just not move through it? Autonomous ground AI project Link to comment Share on other sites More sharing options...
gavagai Posted November 16, 2020 Share Posted November 16, 2020 @gromit190 My vehicles did not appear to have a waypoint when I clicked on them. They were stuck in their initial spawn zone. It worked fine before the recent patch. 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 More sharing options...
Taslehoff Posted November 16, 2020 Share Posted November 16, 2020 Hi Gromit190 . my units are getting the routs given but only one team seems to move. I can see the routs and flags on the map for the teams to move to. Link to comment Share on other sites More sharing options...
gromit190 Posted November 17, 2020 Author Share Posted November 17, 2020 Sorry, didn't have time to work on it yesterday. Will try again tonight Autonomous ground AI project Link to comment Share on other sites More sharing options...
gromit190 Posted November 17, 2020 Author Share Posted November 17, 2020 Hey guys, I cannot reproduce the error you are having. In my tests, routes are added fine and tanks move as they should. For what it's worth, I'm on the Steam version. Someone please upload a minimalistic mission where the error occurs for you. Autonomous ground AI project Link to comment Share on other sites More sharing options...
Taslehoff Posted November 17, 2020 Share Posted November 17, 2020 (edited) @gromit190 Hi , please find attached my example. One unit of blue move , then a red unit moves a little and stops. Nothing else moves. I hope this helps mate. I am using the stand alone Beta versionTaslehoff example.miz Edited November 17, 2020 by Taslehoff Added DCS version I am using Link to comment Share on other sites More sharing options...
gromit190 Posted November 18, 2020 Author Share Posted November 18, 2020 Thanks @Taslehoff. Haven't tested your mission yet. Can you upload a completely minimalistic mission? No Mist, no Moose, no scanning/staging/misc scripts. No extra units except a single one that illustrates the problem. Just absolute minimum. Autonomous ground AI project Link to comment Share on other sites More sharing options...
Taslehoff Posted November 18, 2020 Share Posted November 18, 2020 @gromit190 There you go mate. I have noticed nothing moves now after removing all the files you requested. Taslehoff example strip down.miz Link to comment Share on other sites More sharing options...
Recommended Posts