Jump to content

Recommended Posts

Posted

Hi DCS lua gurrus,

I am fighting with the groupStopMoving DCS function.

function myStopRoute(_par)
  if Group.getByName(_par[1]) ~= nil then
      Group.getByName(_par[1]):getController():setCommand({ id = 'StopRoute', params = {true} }))
  else
    trigger.action.outText(_par[1].." does not exist!!", 15)
	return
  end
end

I have no error but vehicles do not stop....

Probably I am doing something wrong...  Where/What ?

Thanks

Posted
function myStopRoute(_par)
  if Group.getByName(_par[1]) ~= nil then
      Group.getByName(_par[1]):getController():setCommand({ id = 'StopRoute', params = {value = true} }))
  else
    trigger.action.outText(_par[1].." does not exist!!", 15)
	return
  end
end

You weren't setting the "value" table entry to true. 

params = {value = true}

 

There is no function that returns whether the AI is on or off. Just gotta save it for reference when you change it. 

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)

@Grimes, et. al.

Timely topic here...

I can't get this to work either:

where  _doStop = true/false

        local controller = _object:getController()
        if controller then
          local command = { id = 'StopRoute', params = {value = _doStop } }
          controller:setCommand( command )
        end      

1) My group's route is following a path on the road (not x-country, though I've not tested this now that I mention it...).

2) There is a Task (FAC_ENGAGE_GROUP) assigned to the Blue group.

3) They are actually engaged - firing at each other.

I assume the either of the last two (or both) are the issue. I'm trying to keep them from basically "jousting" when both Red and Blue groups are opposite direction (for instance) on a road. Seems that in the AI's mind there's only one form of combat: Melee mode!

Courageous bunch they are!

My basic workaround is to make both go stupid (controller AI off) until the player's flight can come to the rescue; gets within a certain "bubble" (range). A Troops In Contact thing.

 

Basically, since it seems I can't rely on any form of tactics from the AI, I want to draw out the combat longer.

Other thoughts I've had, are

- Make them all "Novice" 

- Periodically set them to WEAPONS_HOLD, say every 60 seconds they have a smoke break. But this might cause the FAC to stop the exchange with the player providing CAS?

Edited by jross194

i6700k 4.4mhz, 32Gb, nVidia 1080, Odyssey+, CH Products, Derek Speare Designs button box, Bass shaker w/SimShaker For Aviators

Posted

Only guess is to make sure you are using the Group controller. Ground vehicles don't have a unit controller. local controller = Group.getController()

Ground and ship AI don't have a ton of capability when it comes to decision making and moving. They follow the route they are given. If they need to slow down, stop, or slightly re-orient the hull in order to shoot they will. They won't search and destroy, use cover, terrain, or anything else on their own. Really the only major pathfinding that AI do automatically is to use bridges or search for shallow points in a river to cross it. 

I don't think the ROE setting impacts the FAC task behavior. 

  • Like 1

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)

Awesome! Thanks for the response.

I've just refactored it to use the 'Mission' task[1] and it has achieved the desired results (a fxn I needed to write anyway).  Yeah, Gen. Patton they ain't but it works well enough from an airborne perspective.

[1] For those coming here later (and trying to figure this stuff out), pushing a new Mission task, with a point where they currently are, effectively makes them move to - where they are: Halt. You could save the old route for later. And toggling on/off ROE takes some of the sass out of em - so they don't massacre everything before I can get any meaningful CAS done 🙂

 

See @Grimes stuff for more - it's been a tremendous help.

Edited by jross194
Clarity

i6700k 4.4mhz, 32Gb, nVidia 1080, Odyssey+, CH Products, Derek Speare Designs button box, Bass shaker w/SimShaker For Aviators

  • Recently Browsing   0 members

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