Antinuke Rocket Autobuild
Moderator: Content Developer
Antinuke Rocket Autobuild
I want to antinuke must have 3 rockets always. If enemy attack me with nuke, antinuke spend 1 rocket and automaticaly begin to create 1 more. And not need to check load antinuke.
I think that need to make a minimal threshold for nuke and antinuke?
Can you realize this?
I think that need to make a minimal threshold for nuke and antinuke?
Can you realize this?
Re: Antinuke Rocket Autobuild
I have stockpiler widget which automatically adds 100 nukes and anti-nukes to each silo when built.
Re: Antinuke Rocket Autobuild
I was working on something similar when I noticed the one that just stockpiles 100, so I just went with that.
The only benefit I can see for mildarf's version is that stockpiling 100 instead of 3 can take a fair chunk of your resources for a fair amount of time. On the other hand, I'd hate to lose most of my economy because I had one too few anti nukes.
On the other other hand, this shouldn't be too difficult...
Here we go. This widget monitors units that can stockpile and adds orders to stockpile more whenever they fall below a certain level. Change line 26 local stockpile = 3 to whatever you want that level to be.
The only benefit I can see for mildarf's version is that stockpiling 100 instead of 3 can take a fair chunk of your resources for a fair amount of time. On the other hand, I'd hate to lose most of my economy because I had one too few anti nukes.
On the other other hand, this shouldn't be too difficult...
Here we go. This widget monitors units that can stockpile and adds orders to stockpile more whenever they fall below a certain level. Change line 26 local stockpile = 3 to whatever you want that level to be.
- Attachments
-
- unit_stockpile_dynamic.lua
- Keeps all units that can stockpile topped off automatically.
- (2.01 KiB) Downloaded 114 times
Re: Antinuke Rocket Autobuild
widget:StockpileChanged(unitID, unitDefID, unitTeam, weaponNum, oldCount, newCount)
Makes it heaps easier :D
Makes it heaps easier :D
Re: Antinuke Rocket Autobuild
2 troycheek:
Thanks. Where this file must be placed?
Thanks. Where this file must be placed?
-
- Posts: 834
- Joined: 19 May 2009, 21:10
Re: Antinuke Rocket Autobuild
<Spring-Directory>/LuaUI/Widgets/mildarf wrote:Where this file must be placed?
- BrainDamage
- Lobby Developer
- Posts: 1164
- Joined: 25 Sep 2006, 13:56
Re: Antinuke Rocket Autobuild
I made a better version, only thing that it misses is that I don't know how to remove the 100 stockpile items when you capture/recieve an unit
- Attachments
-
- unit_stockpile_dynamic.lua
- (3.32 KiB) Downloaded 119 times
-
- Posts: 834
- Joined: 19 May 2009, 21:10
Re: Antinuke Rocket Autobuild
Optimized Brain Damage's version:
Uses ctr + shift to issue less commands.
Uses "right" as command option to cancel excess.
Uses ctr + shift to issue less commands.
Uses "right" as command option to cancel excess.
- Attachments
-
- unit_stockpile_dynamic.lua
- (4.78 KiB) Downloaded 111 times
Re: Antinuke Rocket Autobuild
cool, talked to grapefruit about that and he was making the same :) (or tries to :D )
Re: Antinuke Rocket Autobuild
manolo_ wrote:cool, talked to grapefruit about that and he was making the same :) (or tries to :D )
edit: so summing up, that widget keeps the stockpile at a constant predefinied amount (what does ctrl or shift do?)
- very_bad_soldier
- Posts: 1397
- Joined: 20 Feb 2007, 01:10
Re: Antinuke Rocket Autobuild
Brain Damage wrote:I made a better version, only thing that it misses is that I don't know how to remove the 100 stockpile items when you capture/recieve an unit
Code: Select all
Spring.SendCommands{"luaui disablewidget Stockpiler"} -- Disable the old stockpiler widget which could conflict
Re: Antinuke Rocket Autobuild
I'd considered that, but then decided that if you're stockpiling large amounts, you'd probably be better off using trepan's old "just add 100" widget. I mean, I think the whole point of this widget is to keep a small stockpile to conserve resources. I think.SirMaverick wrote:Optimized Brain Damage's version:
Uses ctr + shift to issue less commands.
(If you need more than 100 nukes or anti nukes or anything else that can be stockpiled, you're probably doing something wrong.)
Niobium: I found StockpileChanged after I already had it working the other way, naturally. Some day soon, I'm going to have to alphabetize or otherwise organize that wiki more to my liking. My latest revision is enough like the others that I'm not going to bother releasing it. Just another interesting little programming exercise.
-
- Posts: 834
- Joined: 19 May 2009, 21:10
Re: Antinuke Rocket Autobuild
Spring version? I don't have any problems with 0.79.1.2 (single thread).very_bad_soldier wrote:This line makes my spring.exe freeze on "Loading LuaUI" if Stockpiler is already disabled.Code: Select all
Spring.SendCommands{"luaui disablewidget Stockpiler"} -- Disable the old stockpiler widget which could conflict
-
- Posts: 834
- Joined: 19 May 2009, 21:10
Re: Antinuke Rocket Autobuild
The point of this widget is to keep the stockpile at a certain number. This number is defined by the user.troycheek wrote:I'd considered that, but then decided that if you're stockpiling large amounts, you'd probably be better off using trepan's old "just add 100" widget. I mean, I think the whole point of this widget is to keep a small stockpile to conserve resources. I think.SirMaverick wrote:Optimized Brain Damage's version:
Uses ctr + shift to issue less commands.
Re: Antinuke Rocket Autobuild
so what is the difference between troys and bd/sirs widget?
and sir mav what did u ment with ctrl+shift...?
and sir mav what did u ment with ctrl+shift...?
-
- Posts: 834
- Joined: 19 May 2009, 21:10
Re: Antinuke Rocket Autobuild
in short: every of those stockpiles 3 anti nukes.manolo_ wrote:so what is the difference between troys and bd/sirs widget?
troys: stock pile up to the number defined in the widget (default 3)
bd: like toys
+ stock pile can be changed ingame: "/luaui stockpilecount 100" (the number is saved in spring settings and will be restored in the next game)
mine: like bd's
+ fix when you disable and reenable the widget ingame
Implementation details. There are no differences for the user.and sir mav what did u ment with ctrl+shift...?
Re: Antinuke Rocket Autobuild
i dont want to bind /luaui stockpilecount 100 to a key, so how could i change it without modify the widget itself?
Re: Antinuke Rocket Autobuild
If you hold down shift when left clicking to add to the stockpile, it adds 5 instead of just 1. When you hold down ctrl, it adds 20. Both together adds 100. (Same when giving factories build orders.) Right clicking while holding those keys takes the same number away. This works for orders issued by the player and for orders issued by widgets if you do it right.manolo_ wrote:[(what does ctrl or shift do?)
So if you wanted to add 127 stockpiled anti nukes as efficiently as possible, you'd shift-ctrl-click, ctrl-click, shift-click, click, click. Or something like that.
- very_bad_soldier
- Posts: 1397
- Joined: 20 Feb 2007, 01:10
Re: Antinuke Rocket Autobuild
Yeah same version here. It's strange, dont know, absolutely reproducable for me. Can't run it two times in a row, spring doesn't start anymore after the widget disabled originalStockpile once. Have to out-comment that line or enable origStockpiler again (makes me able to run it one more time).SirMaverick wrote:Spring version? I don't have any problems with 0.79.1.2 (single thread).very_bad_soldier wrote:This line makes my spring.exe freeze on "Loading LuaUI" if Stockpiler is already disabled.Code: Select all
Spring.SendCommands{"luaui disablewidget Stockpiler"} -- Disable the old stockpiler widget which could conflict
Besides that, great widget!

@manolo:
Just type that command in chat.