Tiny but useful little lua gadget
Posted: 09 Sep 2009, 10:08
The entire poi9nt of this gadget is to alleviate having to tie starting resource income to a unit. I figured others might like to have it. The values are obvious enough, but this gadget gives those values per second all game long to each player.
For example, BA could make it so that the comm didn't have an income of 2/2 anymore, but that the 2/2 was there not tied to a unit. To edit, just change the values that I highlighted in red.
For example, BA could make it so that the comm didn't have an income of 2/2 anymore, but that the 2/2 was there not tied to a unit. To edit, just change the values that I highlighted in red.
function gadget:GetInfo()
return {
name = "Resource Gifts",
desc = "Adds 1/1 resource income so that I don't have to tie it to units anymore",
author = "lurker (Dylan Petonke)",
date = "Sept 8 2009",
license = "GPL",
layer = 1,
enabled = true
}
end
if (gadgetHandler:IsSyncedCode()) then
---synced----
function gadget:GameFrame(n)
if n%30 == 4 then
for _,i in ipairs(Spring.GetTeamList()) do
Spring.AddTeamResource(i,"e",1)
Spring.AddTeamResource(i,"m",1)
end
end
end
end --for ifsynced