daemon1808 Posted April 9, 2024 Posted April 9, 2024 (edited) Hi ED, I have this problem using the Mission Scripting Engine, that was not happening last time I tried it: If I pushTask() a "mission" that gets an helicopter into an orbit in its current location, and after that I pushTask() a new "mission" to get it to orbit in another place, the helicopter refuses to acknowledge the second "mission", and continues orbiting the first location. In fact it resuses any kind of "mission" (like Attack, or Escort, etc) I think there is some kind of bug once the helicopter starts the "orbit", because it seems to ignore pushTask() commands for the Controller of the Group after that. I attached an example .miz where this is happening. The helicopter start an orbit at 2 seg time, because the 1st trigger. At 40segs it should leave the orbit and goes to the origin of the map ({x=0, z= 0}), because the second trigger, but it refuses. At 120segs it should replace the current route and go to another point in the map, because the third trigger, but it refuses too. In the other hand, If I delete the 1st trigger (so the helicopter do not orbit anymore at the start of the mission) the 2 and 3 points happens without any problem, as expected. (I have tried even using resetTask and popTask before replacing the first mission with the second, but no joy) Could you check it, please? Thanks in advance. NOTE: When I speak about "mission" I am refering to something like below, where in the routePoints are embed a Task "orbit" (or attack, or whatever) local _mission = { id = 'Mission', params = { airborne = true, route = { points = routePoints }, } testHELICOPTER.miz Edited April 9, 2024 by daemon1808 adding more info
daemon1808 Posted April 9, 2024 Author Posted April 9, 2024 I have noticed that it not happens only with "orbit" task. i.e: once an helicopter starts an "AttackGroup" task pushed to its Controller, you can't stop them to attack pushing another "mission".
Omelette Posted April 28, 2024 Posted April 28, 2024 (edited) Can confirm that I am having the exact same problem. Same behavior of push/pop/reset observed on my end. One workaround I found to cancel a pushed task is by using controlledTask. If I want to update an orbit every 60 seconds, so that it is always centered around a moving unit: orbitTask = { id = 'ControlledTask', params = { task = { id = 'Orbit', params = { pattern = 'Circle', point = mist.utils.makeVec2(movingUnit:getPoint()), speed = 250, altitude = 500, } }, condition = { true }, stopCondition = { duration = 59 -- stop the task before the next run } } } -- Every 60 seconds, run this: orbitTask.params.task.params.point = mist.utils.makeVec2(movingUnit:getPoint()) orbitGroup:getController:pushTask(self.orbitTask) Edited April 28, 2024 by Omelette Add workaround
Recommended Posts