Jump to content

Group Path Editing


OneFatBird

Recommended Posts

Sorry, once again, I'm not finding anything helpful regarding making custom group paths in DCS scripting. I'm getting very unexpected results from my experiments trying to fathom it out, so I am throwing in the towel with taxing myself, and hoping someone can please shed some light on this...

 

Here's an example of what I mean...

 

SOLDIER_GROUP = {
   ["visible"] = false,
   ["route"] = 
   {
       ["spans"] = 
       {
           [1] = 
           {
               [1] = 
               {
                   ["y"] = 40000,
                   ["x"] = 40010,
               }, 
               [2] = 
               {
                   ["y"] = 40010,
                   ["x"] = 40020,
               }, 
           }, 
       }, 
       ["points"] = 
       {
           [1] = 
           {
               ["alt"] = 0,
               ["type"] = "Turning Point",
               ["ETA"] = 0,
               ["alt_type"] = "BARO",
               ["formation_template"] = "",
               ["y"] = 40000,
               ["x"] = 40010,
               ["name"] = "DictKey_WptName_7",
               ["ETA_locked"] = false,
               ["speed"] = 5,
               ["action"] = "Off Road",
               ["task"] = 
               {
                   ["id"] = "ComboTask",
                   ["params"] = 
                   {
                       ["tasks"] = 
                       {
                       },
                   },
               },
               ["speed_locked"] = true,
           },
           [2] = 
           {
               ["alt"] = 0,
               ["type"] = "Turning Point",
               ["ETA"] = 0,
               ["alt_type"] = "BARO",
               ["formation_template"] = "",
               ["y"] = 40010,
               ["x"] = 40020,
               ["name"] = "DictKey_WptName_8",
               ["ETA_locked"] = false,
               ["speed"] = 5,
               ["action"] = "Off Road",
               ["task"] = 
               {
                   ["id"] = "ComboTask",
                   ["params"] = 
                   {
                       ["tasks"] = 
                       {
                       },
                   },
               },
               ["speed_locked"] = true,
           },
       },
   },
   ["groupId"] = 102,
   ["name"] = "Soldier Group 102",
   ["tasks"] = {},
   ["hidden"] = false,
   ["units"] = 
   {
       [1] = 
       {
       ["x"] = 40000,
       ["y"] = 40000,
       ["type"] = "Soldier M4",
       ["name"] = "Soldier_101",
       ["unitId"] = 101,
       ["heading"] = 0,
       ["playerCanDrive"] = false,
       ["skill"] = "Excellent",
       },
   },
   ["task"] = "Ground Nothing",
}

Now, as the method is someone else's brainchild, I must ask.

 

1. What are SPANS, and their purpose?

2. What are POINTS, and their purpose?

 

Knowing at least that might help me figure the rest out. I kind pof imagine that POINTS are the locations where you want to send the group, in map coordinates from origin, but SPANS has me defeated. Why two parameters?

 

Also, what's this?

 

"DictKey_WptName_7"

 

...and where can I find out more about it?

 

Thanks in advance!

Link to comment
Share on other sites

Spans are simply there for the mission editor to use and they don't effect the actual route. They are not needed if you try to assign a new task via scripting. Specifically they are used to "draw" the lines that make up the route in the mission editor. For whatever reason this data is saved directly within the mission file instead of being generated on load. If you have excessively long routes that are at least several 100 km long on roads you will gradually bloat the size of the mission file.

 

Points define the actual route and information associated with the waypoint.

 

DictKey_Whatever is there for localization purposes and is not an issue when creating a task. Basically its a unique common value and within the l10z folder within the .miz there can be different localizations saved. So the waypoint could be named "Ingress" for English and have the appropriate translation for use with other languages.

 

 

So it looks like you are spawning a group, but this page on assigning a new task is just as relevant as I believe the required values are the same.

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

Excellent. Thank you, that was exactly what I needed to know.

 

:thumbup:

 

PS:

And, with mixed results. Yes, the guy started moving. No, he did not go where he was supposed to, but turned a clear 90º to the right of the intended advance and ran forever. I don't know, this path business is one of the hardest aspects of the scripting to get to grips with. It makes no sense. I'll keep playing with it...


Edited by OneFatBird
Link to comment
Share on other sites

All solved now, thanks.

 

One thing to note is that paths are in 2D with x and y coordinates; which correspond to x and z 3D coordinates. For 3D coordinates, y is altitude.

 

No, it wasn't that. I'd learned that lesson in a previous experience on the site, but thank you just the same!

 

:)

Link to comment
Share on other sites

  • Recently Browsing   0 members

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