Jump to content

Recommended Posts

Posted

My mission edition scripting skills is getting a bit rusty... I am trying to make a ground unit group dynamically move and use the roads on the way. How?

 

Here's what I got now:

 

local _mission = { 
           id = 'Mission', 
           params = { 
               route = { 
                   points = { 
                       [1] = {
                               action = 0,
                               x = 684878.31512451,
                               y = -285936.0,
                               speed = 25,
                               ETA = 100,
                               ETA_locked = false,
                               name = "Starting point", 
                               task = nil 
                       },
                       [2] = {
                               action = 0,
                               x = 688961.42410916,
                               y = -283350.27609121,
                               speed = 25,
                               ETA = 100,
                               ETA_locked = false,
                               name = "Destination point", 
                               task = nil 
                       },  
                   } 
               }, 
           } 
       }
local _controller = Group.getByName("TestGroup"):getController();
Controller.setOption(_controller, AI.Option.Ground.id.ALARM_STATE, AI.Option.Ground.val.ALARM_STATE.GREEN)
_controller:setTask(_mission)

Help greatly appreciated!

DCS AJS37 HACKERMAN

 

There will always be bugs. If everything is a priority nothing is.

Posted

I have a very messy way of doing this by having the group move to random point in random zone when it enters a zone on the map spammed with zones. It's awful.

 

I look forward to a more civilized way.

Posted

Action needs to be "On Road"

 

Also need to add a type = "Turning Point"

 

 

Its worth noting that it is best if the on road points given are actually on a road. If the on-road WP is off a road the AI will usually try to find the nearest road to that point, but it doesn't always work.

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

you can as well use Land.surfaceType function to check if it is a road or not. And if not iterate over x/y until find one. I'm not at home right now, don't have my code in front of me, but that is an idea basically.

  • Like 1

i5-9600K@4.8GHz 32Gb DDR4 rtx5070ti Quest Pro Warthog on Virpil base

  • Recently Browsing   0 members

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