Lumax Posted March 24, 2015 Posted March 24, 2015 (edited) Hi all. Is it not possible to assign a new set of waypoints for the ground units. I am using Controller.setTask(...) to set the waypoint for my units. This works fine the 1st time i use it. But when i want to assaign a new route it dosent work. I even tried to Controller.popTask(...) . before assigning them a new set of waypoints. but no go. So can waypoints only be assigned once to ground units and they are stuck with it until they get destroyed? Edited March 24, 2015 by Lumax
Stonehouse Posted March 25, 2015 Posted March 25, 2015 Don't know if this helps you? Have a look at the script in this thread http://forums.eagle.ru/showthread.php?t=120195
Lumax Posted March 25, 2015 Author Posted March 25, 2015 I took a look at that. not much of help though. My problem is not assigning a route to a group (random or not) But rather assign a new route for the group which should replace the current assigned route. So the question still remains unanswered: can waypoints only be assigned once to ground units and they are stuck with it until they get destroyed?
Grimes Posted March 25, 2015 Posted March 25, 2015 So the question still remains unanswered: can waypoints only be assigned once to ground units and they are stuck with it until they get destroyed? You can assign a new task as many times and whenever you want. It doesn't matter if you pop the task or not because setTask effectively removes all previous tasks from the queue. This is a snippet of a function from mist that assigns a given route to a group. mist.goRoute =function(group, path) local misTask = { id = 'Mission', params = { route = { points = mist.utils.deepCopy(path), }, }, } if type(group) == 'string' then group = Group.getByName(group) end local groupCon = group:getController() if groupCon then groupCon:setTask(misTask) return true end ... The right man in the wrong place makes all the difference in the world. Current Projects: Grayflag Server, Scripting Wiki Useful Links: Mission Scripting Tools MIST-(GitHub) MIST-(Thread) SLMOD, Wiki wishlist, Mission Editing Wiki!, Mission Building Forum
Lumax Posted March 26, 2015 Author Posted March 26, 2015 Thanks for clearing that up. Guess i'll have to look at my code again. because setting a taks for the 1st time works but not the 2nd time :/
Recommended Posts