Jump to content

Recommended Posts

Posted

Is there any way in retrieving the AI skill? As far as I know there's a table

 

AI.Skill = {
  AVERAGE,
  GOOD,
  HIGH,
  EXCELLENT,
  PLAYER,
  CLIENT
}

 

It said to be used with Controller functions but there's no indication on how to use it. Suppose I have an unit with skill AVERAGE, how do I retrieve it?

[sIGPIC]OK[/sIGPIC]

Posted (edited)

Yea, I was looking for this the other day. It turns out that we forgot to request it, and/or Saint forgot to add it. Can't remember which.

 

All hope is not lost. You can still get skill, you just have to work for it more- you do have env.mission. And if you're dynamically adding any groups, you know what their skill is.

 

So to get a unit's skill, you need to look in env.mission. env.mission holds the mission table. So you'll have to step through that, and throw all the units into a big database (my favorite is to make them into a DB by unit name), and then you can quite easily just get the skill by indexing that particular unit's .skill.

 

Mist does this for you automatically, in the mist.DBs.unitsByName table. You don't need all of mist for this, just get the parts that are relevant to DB building from env.mission.

 

So now, to get the skill of a unit named <unit name>, you would just use

local skill = mist.DBs.unitsByName[<unit name>].skill

Edited by Speed

Intelligent discourse can only begin with the honest admission of your own fallibility.

Member of the Virtual Tactical Air Group: http://vtacticalairgroup.com/

Lua scripts and mods:

MIssion Scripting Tools (Mist): http://forums.eagle.ru/showthread.php?t=98616

Slmod version 7.0 for DCS: World: http://forums.eagle.ru/showthread.php?t=80979

Now includes remote server administration tools for kicking, banning, loading missions, etc.

  • Recently Browsing   0 members

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