Jump to content

Get the last ground vehicle waypoint from controller tasks


chromium

Recommended Posts

Hi,

 

I need to retrieve the last waypoint that is currently active for a moving ground groups. If the group is following an editor created route, no issue... I would know what to do. But I need to get the last waypoint coordinates even if has ben set by script after mission start or by a CA user in F10 map.

 

I know that some of those info should be in the controller tasks, but I don't know how to access them by script.

 

Can someone help me?

 

PS

the purpose is to add a feature to DAWS Package that will allow groups to save the current active routes at save moment instead of none.

ChromiumDis.png

Author of DSMC, mod to enable scenario persistency and save updated miz file

Stable version & site: https://dsmcfordcs.wordpress.com/

Openbeta: https://github.com/Chromium18/DSMC

 

The thing is, helicopters are different from planes. An airplane by it's nature wants to fly, and if not interfered with too strongly by unusual events or by a deliberately incompetent pilot, it will fly. A helicopter does not want to fly. It is maintained in the air by a variety of forces in opposition to each other, and if there is any disturbance in this delicate balance the helicopter stops flying; immediately and disastrously.

Link to comment
Share on other sites

Unfortunately there is no function to get a groups route data for new route it gets assigned. The best that can be done is for the mission scripts assigning routes to save the route into a database that can be looked up similar to the .miz file. Still wouldn't apply to routes assigned via Combined Arms.

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

Link to comment
Share on other sites

That way I will have two gathering methods:

- for auto assigned route I'll take the last wp

- for editor existent route I'll take the last wp

 

I hate to have an additional table to store those WPs... but I can't see any other way. Even MOOSE, I don't get if he can work with CA assigned routes.

ChromiumDis.png

Author of DSMC, mod to enable scenario persistency and save updated miz file

Stable version & site: https://dsmcfordcs.wordpress.com/

Openbeta: https://github.com/Chromium18/DSMC

 

The thing is, helicopters are different from planes. An airplane by it's nature wants to fly, and if not interfered with too strongly by unusual events or by a deliberately incompetent pilot, it will fly. A helicopter does not want to fly. It is maintained in the air by a variety of forces in opposition to each other, and if there is any disturbance in this delicate balance the helicopter stops flying; immediately and disastrously.

Link to comment
Share on other sites

Moose is the same as mist and every other thing using the simulator scripting engine from the perspective that we all have access to exactly the same stuff. Its just a difference in how the scripts are organized and what not.

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

Link to comment
Share on other sites

I'm going to apologise in advance for being merely an amateur here, but, from what I understand;

 

1) You can obtain the Groups template (full list of waypoints) from the mission and from inside using the databases of MOOSE and I presume MIST. I don't think this is your problem though, you can get this.

 

2) I think the way it's moved mid mission is via a Task that you push to it. You can get that if you already wrapped the group with MOOSE ie spawned it, but without it, i'm not sure how to get it. My understanding might well be wrong, but my current understanding is that

‘Tasks’ are best described as the Advanced Actions tasks in the Mission Editor, at a waypoint. In the ME they are not related to moving, but in scripting you can set a Task to let a group move. This has been refered to as a MISSION task. So a Mission task is a movement task of a SetTask that is not normally available in DCS ME. So that might be where your CA route exists, that you could obtain....but i'm not sure really, it's a bit complex. FC would be way better at knowing if these CA routes are the same thing and how to get them from the group. Of course there is some complexity in this too, since you would prefer to do this natively without having extra scripting dependencies for DAWS. But most of this isn't easily "extractable".

 

 

[1] = 
                             {
                                 ["modulation"] = 0,
                                [b] ["tasks"] = [/b]
                                 {
                                 }, -- end of ["tasks"]
                                 ["task"] = "CAS",
                                 ["uncontrolled"] = false,
                                [b] ["route"] = [/b]
                                 {
                                    [b] ["points"] = [/b]
                                     {
                                        [b] [1] = [/b]
                                         {
                                             ["alt"] = 500,
                                             ["action"] = "Turning Point",
                                             ["alt_type"] = "BARO",
                                             ["properties"] = 
                                             {
                                                 ["vnav"] = 1,
                                                 ["scale"] = 0,
                                                 ["angle"] = 0,
                                                 ["vangle"] = 0,
                                                 ["steer"] = 2,
                                             }, -- end of ["properties"]
                                             ["speed"] = 55.555555555556,
                                             ["task"] = 
                                             {
                                                 ["id"] = "ComboTask",
                                                 ["params"] = 
                                                 {
                                                    [b] ["tasks"] = [/b]
                                                     {
                                                        [b] [1] = [/b]
                                                         {
                                                             ["enabled"] = true,
                                                             ["key"] = "CAS",
                                                             ["id"] = "EngageTargets",
                                                             ["number"] = 1,
                                                             ["auto"] = true,
                                                             ["params"] = 
                                                             {
                                                                 ["targetTypes"] = 
                                                                 {
                                                                     [1] = "Helicopters",
                                                                     [2] = "Ground Units",
                                                                     [3] = "Light armed ships",
                                                                 }, -- end of ["targetTypes"]
                                                                 ["priority"] = 0,
                                                             }, -- end of ["params"]
                                                         }, -- end of [1]
                                                     }, -- end of ["tasks"]
                                                 }, -- end of ["params"]
                                             }, -- end of ["task"]
                                             ["type"] = "Turning Point",
                                             ["ETA"] = 0,
                                             ["ETA_locked"] = true,
                                             ["y"] = 645571.42857143,
                                             ["x"] = -298428.57142857,
                                             ["name"] = "DictKey_WptName_7",
                                             ["formation_template"] = "",
                                             ["speed_locked"] = true,
                                         }, -- end of [1]
                                        [b] [2] = [/b]
                                         {
                                             ["alt"] = 629,
                                             ["action"] = "Turning Point",
                                             ["alt_type"] = "BARO",
                                             ["properties"] = 
                                             {
                                                 ["vnav"] = 1,
                                                 ["scale"] = 0,
                                                 ["angle"] = 0,
                                                 ["vangle"] = 0,
                                                 ["steer"] = 2,
                                             }, -- end of ["properties"]
                                             ["speed"] = 55.555555555556,
                                             [b]["task"] = 
                                             {
                                                 ["id"] = "ComboTask",[/b]
                                                 ["params"] = 
                                                 {
                                                   [b]  ["tasks"] = [/b]
                                                     {
                                                         [b][1] =[/b] 
                                                         {
                                                             ["enabled"] = true,
                                                             ["auto"] = false,
                                                             ["id"] = "WrappedAction",
                                                             ["number"] = 1,
                                                             ["params"] = 
                                                             {
                                                                 ["action"] = 
                                                                 {
                                                                     ["id"] = "Script",
                                                                     ["params"] = 
                                                                     {
                                                                         ["command"] = "trigger.action.outText(\"Before\", 20)",
                                                                     }, -- end of ["params"]
                                                                 }, -- end of ["action"]
                                                             }, -- end of ["params"]
                                                         }, -- end of [1]
                                                         [2] = 
                                                         {
                                                             ["enabled"] = true,
                                                             ["auto"] = false,
                                                             ["id"] = "AttackUnit",
                                                             ["number"] = 2,
                                                             ["params"] = 
                                                             {
                                                                 ["altitudeEnabled"] = false,
                                                                 ["unitId"] = 2,
                                                                 ["attackQtyLimit"] = false,
                                                                 ["attackQty"] = 1,
                                                                 ["expend"] = "Auto",
                                                                 ["altitude"] = 629,
                                                                 ["directionEnabled"] = false,
                                                                 ["groupAttack"] = false,
                                                                 ["weaponType"] = 1073741822,
                                                                 ["direction"] = 0,
                                                             }, -- end of ["params"]
                                                         }, -- end of [2]
                                                         [3] = 
                                                         {
                                                             ["enabled"] = true,
                                                             ["auto"] = false,
                                                             ["id"] = "WrappedAction",
                                                             ["number"] = 3,
                                                             ["params"] = 
                                                             {
                                                                 ["action"] = 
                                                                 {
                                                                     ["id"] = "Script",
                                                                     ["params"] = 
                                                                     {
                                                                         ["command"] = "trigger.action.outText(\"After\", 20)",
                                                                     }, -- end of ["params"]
                                                                 }, -- end of ["action"]
                                                             }, -- end of ["params"]
                                                         }, -- end of [3]
                                                     }, -- end of ["tasks"]
                                                 }, -- end of ["params"]
                                             }, -- end of ["task"]
                                             ["type"] = "Turning Point",
                                             ["ETA"] = 375.39334472698,
                                             ["ETA_locked"] = false,
                                             ["y"] = 666142.85714286,
                                             ["x"] = -301857.14285714,
                                             ["name"] = "DictKey_WptName_8",
                                             ["formation_template"] = "",
                                             ["speed_locked"] = true,
                                         }, -- end of [2]
                                     }, -- end of ["points"]
                                 }, -- end of ["route"]
                                 ["groupId"] = 1,
                                 ["hidden"] = false,
                                 ["units"] = 
                                 {
                                     [1] = 
                                     {
                                         ["alt"] = 500,
                                         ["hardpoint_racks"] = true,
                                         ["alt_type"] = "BARO",
                                         ["livery_id"] = "us army",
                                         ["skill"] = "High",
                                         ["ropeLength"] =

___________________________________________________________________________

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

Link to comment
Share on other sites

Ok, Pikey those things are what I already thought to do, as an upgrade to current "retain ME route" option.

 

Sad that we can't retrieve a CA inserted last waypoint... anyway, I will be satisfied to achieve last wp tracking from script and from ME. That will be sufficient.

ChromiumDis.png

Author of DSMC, mod to enable scenario persistency and save updated miz file

Stable version & site: https://dsmcfordcs.wordpress.com/

Openbeta: https://github.com/Chromium18/DSMC

 

The thing is, helicopters are different from planes. An airplane by it's nature wants to fly, and if not interfered with too strongly by unusual events or by a deliberately incompetent pilot, it will fly. A helicopter does not want to fly. It is maintained in the air by a variety of forces in opposition to each other, and if there is any disturbance in this delicate balance the helicopter stops flying; immediately and disastrously.

Link to comment
Share on other sites

an additional question: to retrieve scripted route mission I need to know that it has been commanded by some script. Is there an event that could be handled? Else, how can I retrieve (for istance) a goRoute script commanded by another script like MOOSE, MIST, CTLD or a dedicated one?

ChromiumDis.png

Author of DSMC, mod to enable scenario persistency and save updated miz file

Stable version & site: https://dsmcfordcs.wordpress.com/

Openbeta: https://github.com/Chromium18/DSMC

 

The thing is, helicopters are different from planes. An airplane by it's nature wants to fly, and if not interfered with too strongly by unusual events or by a deliberately incompetent pilot, it will fly. A helicopter does not want to fly. It is maintained in the air by a variety of forces in opposition to each other, and if there is any disturbance in this delicate balance the helicopter stops flying; immediately and disastrously.

Link to comment
Share on other sites

I don't think there is, it would have to be manually done by the writer. You could measure the changes by pulling the routes.... but that's excessive, I think. I might be wrong, but it's something I never heard of anyway.

___________________________________________________________________________

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

Link to comment
Share on other sites

ok, so that's impossible for my purpose till a getTask function will be implemented, and I don't like the limitation of keeping only the ground vehicle ME inserted routes. Than I will only go for automatic ground tasking and routing as did before. Sad.

  • Like 1

ChromiumDis.png

Author of DSMC, mod to enable scenario persistency and save updated miz file

Stable version & site: https://dsmcfordcs.wordpress.com/

Openbeta: https://github.com/Chromium18/DSMC

 

The thing is, helicopters are different from planes. An airplane by it's nature wants to fly, and if not interfered with too strongly by unusual events or by a deliberately incompetent pilot, it will fly. A helicopter does not want to fly. It is maintained in the air by a variety of forces in opposition to each other, and if there is any disturbance in this delicate balance the helicopter stops flying; immediately and disastrously.

Link to comment
Share on other sites

Apparently there was no formal request made for this functionality, so I made one. ETA for implementation: ¯\_(ツ)_/¯

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

Link to comment
Share on other sites

;) thanks

ChromiumDis.png

Author of DSMC, mod to enable scenario persistency and save updated miz file

Stable version & site: https://dsmcfordcs.wordpress.com/

Openbeta: https://github.com/Chromium18/DSMC

 

The thing is, helicopters are different from planes. An airplane by it's nature wants to fly, and if not interfered with too strongly by unusual events or by a deliberately incompetent pilot, it will fly. A helicopter does not want to fly. It is maintained in the air by a variety of forces in opposition to each other, and if there is any disturbance in this delicate balance the helicopter stops flying; immediately and disastrously.

Link to comment
Share on other sites

Apparently there was no formal request made for this functionality, so I made one. ETA for implementation: ¯\_(ツ)_/¯

 

Now THAT is a very useful requirement! :-) :-)

 

Controller.getTask !

[TABLE][sIGPIC][/sIGPIC]|

[/TABLE]

Link to comment
Share on other sites

+1, many thanks grimes!

ChromiumDis.png

Author of DSMC, mod to enable scenario persistency and save updated miz file

Stable version & site: https://dsmcfordcs.wordpress.com/

Openbeta: https://github.com/Chromium18/DSMC

 

The thing is, helicopters are different from planes. An airplane by it's nature wants to fly, and if not interfered with too strongly by unusual events or by a deliberately incompetent pilot, it will fly. A helicopter does not want to fly. It is maintained in the air by a variety of forces in opposition to each other, and if there is any disturbance in this delicate balance the helicopter stops flying; immediately and disastrously.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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