I'm trying to create a panel to the right of the unit info panel. However when running the following lua script i get an error.
the error,
line five is the following,
Now i'm pretty new to the modding beyond earth but i'm pretty familiar with programming and scripting languages. So to me this looks as though i don't have DetailsGrid in local scope. I've changed the gridHeight var to a standard int and got the same error.
However if i add the following line above everything i would expect it to error but it doesn't.
So that makes me think maybe the setSizeY() method is the issue.
Any idea on how i can get this to work?
Code:
function OnUnitSelectionShowUnitGroupPanel( p, u, i, j, k, isSelected )
print("OnUnitSelectionShowUnitGroupPanel: Unit Selected");
gridHeight = 420;
Controls.DetailsGrid:SetSizeY( gridHeight );
Controls.ShadowsLeft:SetSizeY( gridHeight );
Controls.ShadowsRight:SetSizeY( gridHeight );
Controls.DetailsGrid:ReprocessAnchoring();
local unitPanelX = ContextPtr:LookUpControl("/InGame/WorldView/UnitPanel/UnitPanelBackground"):GetSizeX();
Controls.EnemyPanel:SetOffsetX(unitPanelX-62);
Controls.DetailsGrid:SetOffsetX(unitPanelX-257);
Controls.DetailsGrid:SetHide(false);
end
Events.UnitSelectionChanged.Add( OnUnitSelectionShowUnitGroupPanel );
the error,
Code:
unitSelect.lua:5: attempt to index a nil value
line five is the following,
Code:
Controls.DetailsGrid:SetSizeY( gridHeight );
Now i'm pretty new to the modding beyond earth but i'm pretty familiar with programming and scripting languages. So to me this looks as though i don't have DetailsGrid in local scope. I've changed the gridHeight var to a standard int and got the same error.
However if i add the following line above everything i would expect it to error but it doesn't.
Code:
grid = Controls.DetailsGrid;
So that makes me think maybe the setSizeY() method is the issue.
Any idea on how i can get this to work?