Jump to content

bug of setTask() with a DCS task follow


Go to solution Solved by Grimes,

Recommended Posts

Posted (edited)

*** edited to refocus and clarifying core problem

Hello all,

This message relates to a bug of Controller.setTask(Class self , table task ) when used in conjunction with a DCS task follow (NOT another task following the first one, a task specific for a unit to follow another one)

 

Set-up:

  • Set-up two AI controlled F/A18 within separate groups - let’s call them Lead and Wing, with waypoints in front of them. Both missions set to nothing.
  • Add through the Mission Editor a follow task to wing, to follow lead as per a Vec3

Action:

  • Run the mission and dynamically add through a F10 activated script a task to Lead using Controller.setTask (or push, doesn't matter really)

Unexpected behaviour:

  • Lead will execute the task properly, but wing will stop following it leads and RTB, effectively breaking the previously set DCS task follow
  • Of note if one uses trigger.action.setAITask rather than setTask - then it works. Lead executes manoeuvre and wing follows,

 

 

Based on the inconsistency of behaviours between the two it looks like a bug to me.

I am happy to elaborate on interact as required.

Thanks all,

best, AMBeXT.

Edited by AMBeXT
refocus and clarifying core problem
  • AMBeXT changed the title to bug of setTask() with a DCS task follow
  • 3 weeks later...
Posted

Please post a mission file. Even with the best description there is no guarantee that I will recreate it in the same exact way as you did to reproduce the bug. 

The right man in the wrong place makes all the difference in the world.

Current Projects:  Grayflag ServerScripting Wiki

Useful Links: Mission Scripting Tools MIST-(GitHub) MIST-(Thread)

 SLMOD, Wiki wishlist, Mission Editing Wiki!, Mission Building Forum

Posted (edited)

here you go.

two leads, Aerial-1-1 on the right (East) and Aerial-3-1 on the left (West), both with a wingman with an initial follow echelon left (x = -80, z = -80). You can confirm they are following as they are not tracking towards their respective waypoints 1, which are offset to leads trajectory.

Once in the player slot (don't bother flying the plane) with the F10 menu you can ask either of the leads to do a turn to their outside.

Aerial-1-1 is tasked with a Controller.setTask

Aerial-3-1 is tasked through trigger.action.setAITask 

You will see that when tasked through F10:

Aerial-1-1 will properly do its turn to its right, but then its wingman Aerial-2-1 is not following anymore.

Aerial-3-1 will properly do its turn to its left, and its wingman Aerial-4-1 will follow as expected

Let me know what you think, thanks again for looking into this!

 

230918 example mission for breaking follow task bug.miz

Edited by AMBeXT
  • Solution
Posted (edited)

Not 100% certain it is a bug. 

In your script you use Unit.getByName():getController():setTask(). I bolded unit because trigger.action.setAITask uses the group controller. If you change your script to assign the task via Group then it will work as expected. 

 

The part I'm not sure about is the behavior of the follow command when tasks get assigned to the unit controller. 

1. 1 ship, task assigned to Lead results in follow task ends

2. 2 ship, task assigned to Lead; Follow unit switches to number 2. 

3. 2 ship, task assigned to no2, Follow unit keeps following number 1. 

4. 2 ship, tasks assigned to both at different times, Follow unit task ends
 

It seems to be similar to the behaviors of when giving multiple tasks via Group and Unit controllers within the same group. Meaning if you used only unit tasks then the wingmen will forget to rejoin when the tasks get complete because the lead unit no longer has a "group" level task for them to rejoin on. 

 

 

Edit, fun fact I only realized this upon remaking the mission on Caucuses for the bug report. Only then did I notice the use of the "unit" controller instead of group because I instinctively wrote a test task and used Group.getByName. 

Edited by Grimes

The right man in the wrong place makes all the difference in the world.

Current Projects:  Grayflag ServerScripting Wiki

Useful Links: Mission Scripting Tools MIST-(GitHub) MIST-(Thread)

 SLMOD, Wiki wishlist, Mission Editing Wiki!, Mission Building Forum

Posted

thanks heaps @Grimes !

Re Unit / Group that makes a bit more sense. Possibly worth having that in the wiki (and also indicating what is trigger.action.setAITask  ID # ref to I reckon) - I am happy to contribute as appropriate on this.

Re your point of behavior of the follow command when tasks get assigned to the unit controller - I would have to test a bit more myself to make sure I comprehend it all - thanks for pointing though.

  • Recently Browsing   0 members

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