I'm trying to write a simple widget, to set sharing resources level at the beginning of each game.
I've found the function described in API.txt:
SetShareLevel(string "metal" | "energy", number fraction) -> nil
I wrote a widget:
Code: Select all
function widget:GetInfo()
return { name = "MyWidget" }
end
function widget:Initialize()
Spring.SetShareLevel("metal", 0.9)
Spring.SetShareLevel("energy", 0.8)
end
Only the second call of the function SetShareLevel() is evaluated, the first one isn't...
Why is that?