Jump to content

Recommended Posts

Posted (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. 

  1. The helicopter start an orbit at 2 seg time, because the 1st trigger.
  2. 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.
  3. 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 by daemon1808
adding more info
Posted

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".

  • 3 weeks later...
Posted (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 by Omelette
Add workaround
  • Recently Browsing   0 members

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