The calling is not really applicable, because I need the AI to also detect idle units when re-initializing, loading a save game, taking over from a player who has quit etc.knorke wrote:There is callin:UnitIdle() --> http://springrts.com/wiki/LuaCallinReturn#Unit-Specific:
Guess that is supposed to find idle units.
Though when I tried to use it I was not sure what it considers "idle."
Idle in the sense that I'm using it is a unit that has no commands issued to it at present. So yea, I'll go GetUnitCommands road. Can I do:
Code: Select all
if Spring.GetUnitCommands(unitID) > 0 then...
Code: Select all
local count
for k,v in Spring.GetUnitCommands(unitID) do
count++
end
It would be nice if the lobby/engine actually used the mod version number instead of the string "<not-versioned>" everywhere then.spring\rts\ExternalAI\LuaAIImplHandler.cpp says:...