Jump to content

Recommended Posts

Posted

It is known that it is sometimes difficult for missionmakers to understand why an AI does not behave as desired.

In LUA, the "Controller" object contains functions for programming tasks, such as:

setTask, resetTask, pushTask, popTask, hasTask

But there is no getter functions to know the list of current tasks, or the information of the current task, and it seems that this is a key element to better understand the behavior of an AI and then adapt the tasks that are given to it. ordered.

I propose to have some news LUA function in the controller object, like : 

New object Task

function Task.getID(Class self  )

Return integer : the ID of the task

function Task.getName(Class self  )

Return String : the Name of the task

function Task.isActive(Class self  )

Return Boolean : True/false if task is active or not

function Task.getNum(Class self  )

Return integer : Numero of the task

function Task.getDesc(Class self  )

Returns table : task description table, containing the type of task (Ex: "Fire at point", "attack group", "FAC" etc...), as well as all the information about this task (for example, for "Fire at point", coordinates, radius, type of weapon configured, etc...)

Example of the structure of Task Object

{
	taskID : xxxxx,
	taskName : "MyTask",
	taskNum : 1
	active : true
	typeTask :
				{
					typeTask : "Fire At Point"
					radius : 10
					weapon : <weaponTagid>
                    altitude : 0
                    .....
                }
 }

 

And another Controller function : 

function Controller.getTasks(Class self  )

Return a table of tasks

 

With thoses few function, a programmer in LUA will have a much better understanding about task pile, the order of the task, and can make a true task management!

  • Like 3
  • 1 year later...
  • Recently Browsing   0 members

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