Stockpile API?

Stockpile API?

Discuss Lua based Spring scripts (LuaUI widgets, mission scripts, gaia scripts, mod-rules scripts, scripted keybindings, etc...)

Moderator: Moderators

Post Reply
User avatar
Pxtl
Posts: 6112
Joined: 23 Oct 2004, 01:43

Stockpile API?

Post by Pxtl »

I was looking around in the Wiki and couldn't find anything about it, so I thought I'd ask - is there any granularity of control in stockpile-based weapons? Any way to manipulate it from Lua, set a maximum stockpile, etc?

I can't find anything. Is it just one of those abandoned blind-alleys that nobody cares about, or am I missing something?
User avatar
knorke
Posts: 7971
Joined: 22 Feb 2006, 01:02

Re: Stockpile API?

Post by knorke »

There is Spring.SetUnitStockpile & Spring.GetUnitStockpile
The commandID is CMD.STOCKPILE ( http://springrts.com/wiki/Lua_CMDs ) in case you want to block the command or something.
User avatar
Silentwings
Posts: 3720
Joined: 25 Oct 2008, 00:23

Re: Stockpile API?

Post by Silentwings »

Any way to manipulate it from Lua, set a maximum stockpile, etc?
http://imolarpg.dyndns.org/trac/balates ... _limit.lua is a stockpile limiter. It was one of this first things I wrote for Spring and could be done better, but that code works fine ;)
User avatar
Pxtl
Posts: 6112
Joined: 23 Oct 2004, 01:43

Re: Stockpile API?

Post by Pxtl »

Thanks everyone, no idea how I missed all that stuff.
User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14673
Joined: 17 Nov 2005, 02:43

Re: Stockpile API?

Post by Forboding Angel »

The version in evo that I modified allows for more control over specific units and such:
https://github.com/EvolutionRTS/Evoluti ... EvoRTS.lua

Nothing special, but more useful.
Post Reply

Return to “Lua Scripts”