Whenever a miner dies or is created, the table is updated.
Then I draw some stuff around the unit, similiar to teamplatter.
And later the miners should mine by killing solars but that is only the next step.
For testing I started with a widget, "arm_flash" is the miner unit and the results looks like this:
Flashes are marked with this diamond/red triangle thing, other units not. Cool, it works.
How do I transform it into a gadget?
If i simpy replace all widget: with gadget: that does not work complety.
New build flashes are ignored also it seems that UnitFinished() is called. Maybe it is a problem with unitIDs?
When doing /luarules reload the make_miner_table() works and gets all flashs. Even if I put make_miner_table() in UnitFinished() it does not work. wtf?
I made a test gagdet that just counts units and that seems to work: http://pastebin.ca/1954798
I suppose I must use some
Code: Select all
if (gadgetHandler:IsSyncedCode()) then
here go all the callins?
else
here goes the Drawing stuff?
end
Here is the widget:
http://pastebin.ca/1954785