Jump to content

Reading the current task of an AI group?


Recommended Posts




I'm trying to read out the current task of an AI group.


I've the Controller for it, but I can't see a way to read the tasks for this controller (doc). I can only see how to set it, not get it.


local controller = Group.getByName("SomeGroup"):getController()




Anyone tried this before?

Link to comment
Share on other sites

Someone else may give you a better answer but looking through a _G dump from about 6 months ago you seem to be only able to set the task and not interrogate the controller to find out what it's current task is. There is hasTask but I think that is a Boolean to determine whether they have one or not. Is there another way of looking at it? ie spawn them with the appropriate task and then when an event/trigger condition happens give them a new one linked to the event? Otherwise you might need to have a table to record the task they are spawned with and then update it when they are given a new one. Probably worth doing a new _G dump using mist (see mist.debug.dump_G)


["Controller"] = table: 0000000061537EC0     {
   ["Controller"]["isTargetDetected"] = "function: 0000000061538410, C function",
   ["Controller"]["pushTask"] = "function: 00000000615380A0, C function",
   ["Controller"]["__eq"] = "function: 000000006153D1D0, defined in (24-30)",
   ["Controller"]["popTask"] = "function: 0000000061538140, C function",
   ["Controller"]["className_"] = "Controller",
   ["Controller"]["getDetectedTargets"] = "function: 00000000615384B0, C function",
   ["Controller"]["setTask"] = "function: 0000000061537F10, C function",
   ["Controller"]["resetTask"] = "function: 0000000061538000, C function",
   ["Controller"]["setOption"] = "function: 0000000061538280, C function",
   ["Controller"]["__index"] = table: 0000000061537EC0 already defined: ["Controller"],
   ["Controller"]["setCommand"] = "function: 00000000615381E0, C function",
   ["Controller"]["Detection"] = table: 0000000061538370         {
       ["Controller"]["Detection"]["VISUAL"] = 1,
       ["Controller"]["Detection"]["DLINK"] = 32,
       ["Controller"]["Detection"]["OPTIC"] = 2,
       ["Controller"]["Detection"]["RWR"] = 16,
       ["Controller"]["Detection"]["IRST"] = 8,
       ["Controller"]["Detection"]["RADAR"] = 4,
   ["Controller"]["__tonumber"] = "function: 000000006153D2C0, defined in (48-50)",
   ["Controller"]["__lt"] = "function: 000000006153D270, defined in (40-46)",
   ["Controller"]["parentClass_"] = table: 000000006153D360 already defined: ["Unit"]["parentClass_"]["parentClass_"],
   ["Controller"]["tonumber"] = "function: 000000006153D310, defined in (52-54)",
   ["Controller"]["__le"] = "function: 000000006153D220, defined in (32-38)",
   ["Controller"]["hasTask"] = "function: 0000000061538190, C function",
   ["Controller"]["setOnOff"] = "function: 0000000061537F60, C function",
   ["Controller"]["__newindex"] = "function: 000000006153D3B0, defined in (63-65)",
   ["Controller"]["knowTarget"] = "function: 0000000061538550, C function",

Link to comment
Share on other sites

  • 3 years later...

  • Recently Browsing   0 members

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