Page 1 of 2
Widget: IdleBuilder 2
Posted: 07 Apr 2007, 01:35
by chlue
I want to advertise the latest version of the
IdleBuilders2 widget.
The original IdleBuilder is from Ray; see
here.
Some highlights:
- moddependent config stored in widget_data.lua
- ingame changing of config via Tweakmode (STRG+F11)
- premade config for EE 0.173 and BA 4.7
Interface:
F: Factories
M: MobileUnits
G: GuardingUnits
The number indicate how many units are in that category
Mouseclick on Unitpic:
Left: select
middle: select and center
right: send unit to assist nearst factory (on factories this does nothing) or assign a task defined by the rules in the config function.
Mouseclick on Button:
Left: toggle visibility of that category
middle: select nearst unit of that category
right: select radom unit of that category
Tweakmode:
Left: toggle ignorestate for this unitid. Select Unit
middle: select and center Unit
right: Hide from view for this seasson. The widget will max use 60% of screenwidth, so if you hide one, you see another one, if there are more units than place on the screen.
You can use this commands ingame:
/luaui autobuild <new time>
/luaui v_pos <new spacing from bottom>
Please report Bugs and Featurerequests here.
If you encounter a Bug giving an error msg please include the line from \Spring\infolog.txt
-- edit 23.07.2007
Lastest version is 2.3

Posted: 08 Apr 2007, 21:13
by semi
Feature request:
Instead of showing the same type of builder many times, show just one icon with a count. With that some way to cycle selection may be needed.
Then at least you would have a chance to see each different type of builder instead of a full width of level 1 kbot builders :)
Posted: 09 Apr 2007, 20:50
by EmMeister
Then at least you would have a chance to see each different type of builder instead of a full width of level 1 kbot builders :)
How many idle builders do you usually have?
Posted: 22 Apr 2007, 09:28
by KDR_11k
Can you do some debugging? The script tends to flip out and kill Lua especially when you're speccing.
Posted: 22 Apr 2007, 15:13
by chlue
Damn I hoped it is errorfree.
Can you post the errors it drops in infolog.txt?
The only problem i am currenty aware is, that it can produce errors, if you spec a mod you have never played before. (So there is no stored config.) Using this widget when you are spec is probably useless anyway, so it would be better to disable it for that.
Easiest way to fix: (Line 154-159 in gui_idle_builders2.lua)
Code: Select all
154 function widget:Initialize()
155 local _, _, spec = Spring.GetPlayerInfo(Spring.GetMyPlayerID())
156 if spec then
157 -- widgetHandler:RemoveWidget()
158 return false
159 end
Simply remove the -- in line 157 and the widget will disable itself if you are spec.
Instead of showing the same type of builder many times, show just one icon with a count. With that some way to cycle selection may be needed.
I don't think this is usefull. If you have so much idle builders, than it is better to hide them by clicking on the green buttons on the left. The idea is, that you assign the builders you currently don't need to assist something. The third row keeps track of units who are assisting something (and are waiting), so there is an easy way to find them, if you need them again.
Posted: 30 Apr 2007, 13:39
by NOiZE
When i want to hide the commander in a corner being cloaked, hold fire, hold position, it will start doing something so it will uncloak

Posted: 30 Apr 2007, 19:15
by chlue
Noize I am pretty sure, the widget will not do something with the normal config.
But if you set autobuild to a value other than 0, the widget will check idle units and after the idletime is over it will build some semirandom stuff. If you don't wan't this then edit the configfile and make sure there is some "IdleTime = 0" or just enter "/luaui autobuild 0" ingame.
If you never set this value, then you probably use my first release of this widget and should upgrade, to get the new features (stored moddependent ingame changeable config). My first release has "autobuild = 10" set.
Posted: 30 Apr 2007, 20:52
by NOiZE
well i want the other units to autobuild stuff, if i am too busy, but not the commander.
Posted: 30 Apr 2007, 21:21
by Tim-the-maniac
Set him to wait (W)
Posted: 30 Apr 2007, 22:40
by NOiZE
Tim-the-maniac wrote:Set him to wait (W)
that might do the trick, thanks.
Posted: 01 May 2007, 02:18
by LordMatt
In my opinion, autobuilding (aside from upgrading mex) steps over the line of good sportsmanship.
Posted: 01 May 2007, 03:12
by Forboding Angel
For TA maybe, not for EE or Fun:TA though. Those mods are designed to be very easy on the resourcing side.
Posted: 01 May 2007, 06:27
by Dragon45
Generally a good practice is to have the builder icons be "stacked" (one picture with numbers on the picture to cycle) once there is some combination of too many builders or too many different types of builders.
Posted: 01 May 2007, 07:31
by LordMatt
Dragon you better come on the lobby and play when finals are over. OR ELSE!

Posted: 09 May 2007, 11:01
by ginekolog
This one does not work for me, so i still use rays script. When i deactivate rays and turn on yours, it just does nothing. No indication of idlers.
Doing sth wrong here?
Posted: 09 May 2007, 13:04
by chlue
ginekolog wrote:This one does not work for me, so i still use rays script. When i deactivate rays and turn on yours, it just does nothing. No indication of idlers.
Doing sth wrong here?
It's hard to give an advise to you with this information. You should look in your 'infolog.txt' file in your spring directory if there are any errors. If everything works right you should see some output like this:
Code: Select all
Modname: BA47.sd7
Dataset 1 : Expand_and_Exterminate_v_0.173.sd7
Dataset 2 : CvC 0.4.sd7
Dataset 3 : BA47.sd7
Dataset 4 : 1944publicalpha_v0.01b3h.sd7
Loading Dataset 3
Stored config detected and loaded
If you see any lua errors instead then post them here, please.
If there is something wrong with your config, you can try deleting the file '\LuaUI\Config\widget_data.lua'. If you do this you will lose at least the configuration of the widgets 'FPS' and 'Message Separator', too. So you should make a backup of this file if you use a lot of other widgets.
Posted: 09 May 2007, 13:30
by KDR_11k
I often disable the widget since I think it causes crashes and I haven't crashed out of midgame since I disabled it whereas previously I often crashed out during longer games. Since it sometimes happened when the enemy was destroying my base I think it may be related to destroyed units not being registered as such. It's pretty rare though, no idea how you can reproduce it.
Also once I had a crash when trying to make a builder patrol. It'd mess up its patrol queue (making the patrol return to its current position between patrol orders despite a move order being queued before the first patrol order), not move at all and after a while crash the game. Can't reproduce that one either.
Posted: 09 May 2007, 15:05
by chlue
KDR_11k wrote:I often crashed out during longer games. Since it sometimes happened when the enemy was destroying my base I think it may be related to destroyed units not being registered as such.
Also once I had a crash when trying to make a builder patrol.
KDR_11k do you use the autobuild stuff? The autobuildstuff is a bit strange in my opinion. It is writen by Ray and i don't really understand how it works and left it mainly untouched. It uses the varaibles 'idleTime' and 'iconunit' which get never deleted and iconunit gets updated only in 'widget:DrawScreen()'. So they may cause some problems in the 'widget:update()' function, expecially if the framerate drops under the simulationrate of 32? frames per second. Maybee you can try adding 'if iconunit
== nill then break end' in the fourth line of the update function. But as I allready said, I don't really understand that part and I am not really familiar with tables and garbage collection.
But from my understanding it should be impossible to crash the game with a widget. the worst thing I encountered is the generation of so many error msg's, that the whole lua-stuff stops working and you get a huge infolog file. Maybee Trepan could add some enlightment here.
Posted: 09 May 2007, 18:38
by KDR_11k
I managed to stacktrace one of those crashes, it was caused by Lua. I've disabled the autobuild (changed that idletime variable or so) and played Gundam (which has no profile and no autobuildable stuff).
Posted: 09 May 2007, 18:44
by trepan
How about feeding those stacktraces to the devs?

(especially if you have already run them through the converter)