i asked BD if he makes a lil widget for me (when game starts, my boi should be grouped to group 1)
but i got an error while its loading
[ 0] Error in DrawScreen(): [string "C:\games\Spring\LuaUI\Widgets\gui_comm_ends..."]:107: Incorrect arguments to gl.Text(msg, x, y [,size] [,"options"]
[ 0] Removed widget: CommanderEnds2
Code: Select all
function widget:GetInfo()
return {
name = "Auto Group com",
desc = "Has automagic inside!.",
author = "BD",
date = "Yesterday",
license = "GNU GPL, v2 or later",
layer = 0,
enabled = true -- loaded by default?
}
end
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
function widget:Initialize()
end
function widget:Shutdown()
end
function widget:GameFrame(t)
local allUnits = GetAllUnits()
for _,
unitID in pairs(allUnits) do
local unitDefID = GetUnitDefID(unitID)
if (unitDefID and UnitDefs[unitDefID].isCommander) then
Spring.SetUnitGroup( unitDefID, 1 )
end
end
widgetHandler:RemoveWidget()
end