Jack Bauer Posted July 28, 2023 Posted July 28, 2023 (edited) After reading the following topic with no success: I was trying to edit a late acivated group route through this lua code using mist: cityIntel = trigger.misc.getZone(city); -- Activate Group Group.activate(Group.getByName('1º Defense Squadron')) jetRoute = mist.getGroupRoute('1º Defense Squadron') jetRoute[2]["x"] = cityIntel.point.x jetRoute[2]["y"] = cityIntel.point.z mist.goRoute('1º Defense Squadron', jetRoute) The group is configured as in the attached image, but when it gets activated, it flyes to "DP" and gets RTB. The coordinate of "DP" remain the same as in the editor instead of changing to coded zone coordinate. If I run mist.getGroupRoute before and after the group is activated, the result is the same, and mist.goRoute is always returning true. Edited July 28, 2023 by Jack Bauer
Solution Grimes Posted July 30, 2023 Solution Posted July 30, 2023 AI generally don't like being spawned and then immediately being given a new task. Best to have at least some delay built in. Since you are spawning the group in the same motion you can easily just change the route it starts with. local cityIntel = trigger.misc.getZone(city); local ng = mist.getGroupTable('1º Defense Squadron') ng.lateActivation = nil -- group is set to late activate, remove the value so it doesn't spawn late activated ng.route.points[2].x = cityIntel.point.x --- rroute is part of groupTable, but might want to verify that waypoint exists. ng.route.points[2].y = cityIntel.point.z mist.dynAdd(ng) -- spawns the group 1 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
Jack Bauer Posted July 30, 2023 Author Posted July 30, 2023 (edited) Work like a charm! Final code: local jetGroup = mist.getGroupTable('1º Defense Squadron') jetGroup.lateActivation = nil jetGroup.category = "PLANE" jetGroup.country = 18 jetGroup.route.points[2].x = cityIntel.point.x jetGroup.route.points[2].y = cityIntel.point.z mist.dynAdd(jetGroup) Edited July 30, 2023 by Jack Bauer
Recommended Posts