Niobium:
local function GetCanUnitLayMines(uDefId)
return true
end
You did exclude excactly the part he has trouble with
---
That
make_minelayer_table() stuff is only needed in case of /luarules reload, which is kind of a side problem.
=forgett about it for now.
1) make gadget that says "hello" when a unit is created
2) make it say the unitname of every unit that is created
3) make that it only says "hello" to to one type of unit
4) Read
http://lua-users.org/wiki/TablesTutorial it will answer
A table is in {} right?
What does i do?
What does pairs do?
What does _,v do?
5) make gadget that says hello to unittype A and unittype B, but not to others.
6) make a counter that displays the amount of units from every type
7) add the creation blocking
7) tada, you have made a unitlimit gadget
---
This is the version I made some time ago:
http://pastebin.com/JLfaZ5BE
http://pastebin.com/pZjUnVDY
It adds a "place bomb" button and when you click/hotkey the unit places a bomb behind itself.
It is 2 files, one for the minelaying and another handles "mana"/ammo/ remaining mines w/e for special abilities, which seemed like a lol idea at the time.
Also, even if I could someday construct shoddy, barely working gadgets, I doubt anyone would copy+paste from me
yes, people will. its funny because its spring.