Help with widget "Show build"
Posted: 23 Jul 2012, 12:13
Hello After upgrade to version 89 I have a problem with the widget Show build. After a while the widget exits with an error on line 82
local r,g,b = Spring.GetTeamColor(Spring.GetUnitTeam(myCmd.uid))
The console shows that the argument GetTeamColor is null.
I need your help or advice to fix the problem.
Here is the entire text of the program to this point.
function widget:DrawWorld()
for key, myCmd in pairs(command) do
local cmd = myCmd.id
local params = myCmd.params
cmd = math.abs( cmd )
local x, y, z, h = params[1], params[2], params[3], params[4]
if(h ~= nil) then
local degrees = h * 90
if Spring.IsAABBInView(x-1,y-1,z-1,x+1,y+1,z+1) then
local r,g,b = Spring.GetTeamColor(Spring.GetUnitTeam(myCmd.uid))
local r,g,b = Spring.GetTeamColor(Spring.GetUnitTeam(myCmd.uid))
The console shows that the argument GetTeamColor is null.
I need your help or advice to fix the problem.
Here is the entire text of the program to this point.
function widget:DrawWorld()
for key, myCmd in pairs(command) do
local cmd = myCmd.id
local params = myCmd.params
cmd = math.abs( cmd )
local x, y, z, h = params[1], params[2], params[3], params[4]
if(h ~= nil) then
local degrees = h * 90
if Spring.IsAABBInView(x-1,y-1,z-1,x+1,y+1,z+1) then
local r,g,b = Spring.GetTeamColor(Spring.GetUnitTeam(myCmd.uid))