Jump to content

Recommended Posts

Posted

Is there a way to make ground vehicles loop through their waypoints?

there is no "switch waypoint" command for ground vehicles as there is for aircraft :(

(WHYYYYY ED... its those little things :S)

Posted
Is there a way to make ground vehicles loop through their waypoints?

there is no "switch waypoint" command for ground vehicles as there is for aircraft :(

(WHYYYYY ED... its those little things :S)

 

You need to wait till patch 1.2.3. Assuming all goes according to plan, after 1.2.3, we will be releasing a new version of Mist. This new Mist version will provide a Lua function that allows ground units to do an action very similar to the "switch waypoint" airborne group AI command.

Intelligent discourse can only begin with the honest admission of your own fallibility.

Member of the Virtual Tactical Air Group: http://vtacticalairgroup.com/

Lua scripts and mods:

MIssion Scripting Tools (Mist): http://forums.eagle.ru/showthread.php?t=98616

Slmod version 7.0 for DCS: World: http://forums.eagle.ru/showthread.php?t=80979

Now includes remote server administration tools for kicking, banning, loading missions, etc.

  • 3 months later...
Posted

Is this feature implemented now? Because i cant find it, and i would love to see it.

Wer sich nicht bewegt, spürt seine Fesseln nicht.



If you don't move, you won't feel your bonds.

 
Posted

Thank you for your answer ENO.

 

Do you know a script which i can use so my units cycle their waypoints until death?

Wer sich nicht bewegt, spürt seine Fesseln nicht.



If you don't move, you won't feel your bonds.

 
Posted

I would think you could use the mist 2.0 functions "mist.goRoute" and "mist.ground.buildWP" to build a loop for a ground unit. Haven't tried it yet, though.

Posted

Here is a somewhat functioning WIP script for group patrol. I had intented to put this into Mist 2.0 but other scripts for it were more important and I had never quite finished this specific script. It has a few bugs, but for the most part it works. Simply put this in a do script trigger and the function will be globally available. This script requires Mist 2.0, so make sure Mist 2.0 is run before this, otherwise it will error out.

 

 

mist.ground.patrol = function(gpData, pType)

 

local tempRoute = {}

local useRoute = {}

if type(gpData) == 'string' then

gpData = Group.getByName(gpData)

end

 

local posStart = mist.getLeadPos(gpData)

if not route then

tempRoute = mist.getGroupRoute(gpData:getName())

else

for i = 1, #route do

tempRoute[#tempRoute +1] = mist.ground.buildWP(route, form, speed)

end

end

 

useRoute[#useRoute + 1] = mist.ground.buildWP(posStart, form, speed)

for i = 1, #tempRoute do

useRoute[#useRoute + 1] = mist.ground.buildWP(tempRoute, form, speed)

end

 

if pType and pType == 'doubleBack' then

for i = #tempRoute, 2, -1 do

useRoute[#useRoute + 1] = mist.ground.buildWP(tempRoute, form, speed)

end

end

 

local tempTask = {

id = 'WrappedAction',

params = {

action = {

id = 'Script',

params = {

command = tostring('local group = ... \n mist.ground.patrol(group:getName() , ' .. mist.utils.basicSerialize(pType) .. ')') ,

 

},

},

},

}

 

useRoute[#useRoute].task = tempTask

mist.goRoute(gpData, useRoute)

end

 

 

 

It grabs the WP for the group as setup in the mission editor to create its patrol path. You can call it via script:

mist.ground.patrol('nameOfGroup')

mist.ground.patrol('nameOfGroup', 'doubleBack')

 

The script has 2 patrol types and the type chosen is defined by the optional 2nd variable. The patrol types and how the group follows them are the following::

Double Back = 1,2,3,2,1,2,3,2...

Cycle = 1,2,3,1,2,3,1,2...

Cycle is the default value and its chosen if the optional variable is anything except for "doubleBack". If cycle is used the group will go from the last WP to the first before continuing the patrol again. So you don't need to "close" the loop with the waypoints used.

Using doubleBack the AI will simply follow their route back to WP and repeat the patrol.

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

Wow ! Thank you very much for this. I will check it out today.

Wer sich nicht bewegt, spürt seine Fesseln nicht.



If you don't move, you won't feel your bonds.

 
  • Recently Browsing   0 members

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