Drexx Posted June 9, 2017 Share Posted June 9, 2017 Can you set/change/update waypoints for clients using a lua script while the mission is running..... I just cant really believe after all this time we still don't have a way of doing this.... (can I give the mission task to the client group with the waypoints in it?) Developer of DDCS MP Engine, dynamicdcs.com https://forums.eagle.ru/showthread.php?t=208608 Link to comment Share on other sites More sharing options...
sea2sky Posted June 9, 2017 Share Posted June 9, 2017 (edited) absolutely. In one of my scripts I set waypoints for the client AC and it works just fine. Do it same way as setting waypoints for AI units. For example: function addWaypoints(route, groupName) local wp = {} wp.speed = 100 wp.x = route.x wp.y = route.y wp.type = 'Turning Point' wp.ETA_locked = false wp.ETA = 100 wp.alt = 500 wp.alt_type = "BARO" wp.speed_locked = true wp.action = "Fly Over Point" wp.airdromeId = nil wp.helipadId = nil local wp1 = {} wp1.speed = 500 wp1.x = route.x wp1.y = route.y wp1.type = 'Turning Point' wp1.ETA_locked = false wp1.ETA = 100 wp1.alt = 500 wp1.alt_type = "BARO" wp1.speed_locked = true wp1.action = "Fly Over Point" wp1.airdromeId = nil wp1.helipadId = nil local newRoute = {} newRoute[1]=wp1 --newRoute[#newRoute+1]=wp1 local newTask = { id = 'Mission', params = { route = { points = newRoute, }, }, } local group = Group.getByName(groupName) local ctrl = group:getController() ctrl:pushTask(newTask) end Edited June 9, 2017 by sea2sky 1 i5-9600K@4.8GHz ★ 32Gb DDR4 ★ Asus TUF rtx3080 OC ★ Quest Pro ★ Warthog on Virpil base Link to comment Share on other sites More sharing options...
Kyridious Posted June 10, 2017 Share Posted June 10, 2017 absolutely. In one of my scripts I set waypoints for the client AC and it works just fine. Do it same way as setting waypoints for AI units. For example: function addWaypoints(route, groupName) local wp = {} wp.speed = 100 wp.x = route.x wp.y = route.y wp.type = 'Turning Point' wp.ETA_locked = false wp.ETA = 100 wp.alt = 500 wp.alt_type = "BARO" wp.speed_locked = true wp.action = "Fly Over Point" wp.airdromeId = nil wp.helipadId = nil local wp1 = {} wp1.speed = 500 wp1.x = route.x wp1.y = route.y wp1.type = 'Turning Point' wp1.ETA_locked = false wp1.ETA = 100 wp1.alt = 500 wp1.alt_type = "BARO" wp1.speed_locked = true wp1.action = "Fly Over Point" wp1.airdromeId = nil wp1.helipadId = nil local newRoute = {} newRoute[1]=wp1 --newRoute[#newRoute+1]=wp1 local newTask = { id = 'Mission', params = { route = { points = newRoute, }, }, } local group = Group.getByName(groupName) local ctrl = group:getController() ctrl:pushTask(newTask) end I just started a thread specifically for naval vessels. I've tried an approach similar to this that works for AC/Land units, but not for naval. Have you had any luck tasking ships? Link to comment Share on other sites More sharing options...
FlightControl Posted June 10, 2017 Share Posted June 10, 2017 Pikey, can you answer this please :-) [TABLE][sIGPIC][/sIGPIC]| Join MOOSE community on: DISCORD :thumbup: Website of the MOOSE LUA Framework. MOOSE framework Downloads. Check out Example Missions to try out and learn. MOOSE YouTube Channel for live demonstrations and tutorials. [/TABLE] Link to comment Share on other sites More sharing options...
FSFIan Posted June 16, 2017 Share Posted June 16, 2017 absolutely. In one of my scripts I set waypoints for the client AC and it works just fine. Do it same way as setting waypoints for AI units. What aircraft type is your client aircraft? I just tried it with an A-10C and could not get it to work. I added an A-10C (group name "a10c") to a mission, skill set to "Client", runway start. I started the mission, jumped into the A-10C, and then executed the following code: local cpos = Group.getByName("a10c"):getUnit(1):getPosition().p local wp = {} wp.speed = 100 wp.x = cpos.x wp.y = cpos.y wp.type = 'Turning Point' wp.ETA_locked = false wp.ETA = 100 wp.alt = 500 wp.alt_type = "BARO" wp.speed_locked = true wp.action = "Fly Over Point" wp.airdromeId = nil wp.helipadId = nil local wp1 = {} wp1.speed = 500 wp1.x = cpos.x + 1000 wp1.y = cpos.y + 10000 wp1.type = 'Turning Point' wp1.ETA_locked = false wp1.ETA = 100 wp1.alt = 500 wp1.alt_type = "BARO" wp1.speed_locked = true wp1.action = "Fly Over Point" wp1.airdromeId = nil wp1.helipadId = nil wp1.name = "BAR" local newRoute = {} newRoute[1]=wp newRoute[#newRoute+1]=wp1 local newTask = { id = 'Mission', params = { route = { points = newRoute, }, }, } local group = Group.getByName("a10c") local ctrl = group:getController() ctrl:pushTask(newTask) My waypoints did not change at all. DCS-BIOS | How to export CMSP, RWR, etc. through MonitorSetup.lua Link to comment Share on other sites More sharing options...
sea2sky Posted June 16, 2017 Share Posted June 16, 2017 (edited) Ian;3170110']What aircraft type is your client aircraft? I just tried it with an A-10C and could not get it to work. I added an A-10C (group name "a10c") to a mission, skill set to "Client", runway start. I started the mission, jumped into the A-10C, and then executed the following code: local cpos = Group.getByName("a10c"):getUnit(1):getPosition().p local wp = {} wp.speed = 100 wp.x = cpos.x wp.y = cpos.y wp.type = 'Turning Point' wp.ETA_locked = false wp.ETA = 100 wp.alt = 500 wp.alt_type = "BARO" wp.speed_locked = true wp.action = "Fly Over Point" wp.airdromeId = nil wp.helipadId = nil local wp1 = {} wp1.speed = 500 wp1.x = cpos.x + 1000 wp1.y = cpos.y + 10000 wp1.type = 'Turning Point' wp1.ETA_locked = false wp1.ETA = 100 wp1.alt = 500 wp1.alt_type = "BARO" wp1.speed_locked = true wp1.action = "Fly Over Point" wp1.airdromeId = nil wp1.helipadId = nil wp1.name = "BAR" local newRoute = {} newRoute[1]=wp newRoute[#newRoute+1]=wp1 local newTask = { id = 'Mission', params = { route = { points = newRoute, }, }, } local group = Group.getByName("a10c") local ctrl = group:getController() ctrl:pushTask(newTask) My waypoints did not change at all. Worked for Su-25T for sure. I think you should use position a bit differently: local cpos = Group.getByName("a10c"):getUnit(1):getPosition().p [b]wp.x = cpos.x wp.y = cpos.z wp.alt = cpos.y ... [/b][b]wp1.x = cpos.x wp1.y = cpos.z wp1.alt = cpos.y [/b]Also, the coordinates for both route points should match (see above) - that will create a single waypoint. This is my observation, and I might be wrong, but that is how it worked for me. I will check the current version of that script tonight and test/see what works what does not. Will keep posted. Edited June 16, 2017 by sea2sky i5-9600K@4.8GHz ★ 32Gb DDR4 ★ Asus TUF rtx3080 OC ★ Quest Pro ★ Warthog on Virpil base Link to comment Share on other sites More sharing options...
Delta99 Posted June 18, 2017 Share Posted June 18, 2017 I've tried something similar for F15C's and always crashes to desktop for client but works fine on AI group. My Missions: Valley Patrol Mission :: Valley Escort Mission :: A2A Engagements Link to comment Share on other sites More sharing options...
sea2sky Posted June 19, 2017 Share Posted June 19, 2017 I confirm the code below works in MP for client Su-25T and Su-25, but unfortunately it does not for A-10C :(. I guess the reason is a simplification of waypoint management/loading mechanism for those 2 aircraft modules. function addWaypoints(route, groupName) local wp1 = {} wp1.speed = 500 wp1.x = route.x wp1.y = route.y wp1.type = 'Turning Point' wp1.ETA_locked = false wp1.ETA = 100 wp1.alt = 500 wp1.alt_type = "BARO" wp1.speed_locked = true wp1.action = "Fly Over Point" wp1.airdromeId = nil wp1.helipadId = nil local newRoute = {} newRoute[#newRoute+1]=wp1 local newTask = { id = 'Mission', params = { route = { points = newRoute, }, }, } local group = Group.getByName(groupName) local ctrl = group:getController() ctrl:pushTask(newTask) end i5-9600K@4.8GHz ★ 32Gb DDR4 ★ Asus TUF rtx3080 OC ★ Quest Pro ★ Warthog on Virpil base Link to comment Share on other sites More sharing options...
Delta99 Posted June 21, 2017 Share Posted June 21, 2017 My guess is that the different modules have to support this in some way but sounds like a definite bug that should be reported. My Missions: Valley Patrol Mission :: Valley Escort Mission :: A2A Engagements Link to comment Share on other sites More sharing options...
Recommended Posts