Page 1 of 1
Lua Widget - Reclaim Area Info on M & E!
Posted: 09 Aug 2007, 13:48
by Pendrokar
Well I acctually wanted to make this myself but I still don't get the commands in Spring. All this Widget would do is show how much M or E can be reclaimed within the area with a floating text near the center of reclaim area!
Posted: 09 Aug 2007, 19:14
by Torrasque
I can't help you, but that's a really cool idea !
Posted: 09 Aug 2007, 19:18
by Satirik
can't help either but it already like this script
Posted: 09 Aug 2007, 20:34
by Pendrokar
Maybe it doesn't need to be a widget! Could be implemented in Spring!
Posted: 10 Aug 2007, 11:39
by gunblob
http: //spring.unknown-files.net/file/3414/Feature_Calculator/
No fancy stuff yet.. This widget calculate amount of metal (no energy yet) of features in specified rectangle and shows on widget.
Does anyone know how to get amount of energy in a feature?
Posted: 11 Aug 2007, 19:11
by Pendrokar
gunblob wrote:http: //spring.unknown-files.net/file/3414/Feature_Calculator/
No fancy stuff yet.. This widget calculate amount of metal (no energy yet) of features in specified rectangle and shows on widget.
Does anyone know how to get amount of energy in a feature?
Problem was here:
local fm, fe = Spring.GetFeatureResources(fid)
Spring.GetFeatureResources has 5 arguments you needed to ignore the second! (first was initial metal of feature, second max metal same for E 3. and 4. but dont know what fifth is!)
local fm,_,fe = Spring.GetFeatureResources(fid)
and second problem - M and E showed equal cause of this:
... gl.Text("energy: " .. metalAmount, ...
... gl.Text("metal: " .. metalAmount, ...
Though your lua wasn't what I wanted. I wanted it to show when reclaim order with area was in action! But my oldest brother though me something about finding info on coding!
PS. My brother found those problems in your script!
Posted: 10 Sep 2007, 20:24
by Pendrokar
I need help on this Lua script! -
http://pastebin.com/m3f602f0c
Well it works, but it takes over C++ scripts such as drawing Reclaim area and reclaim it self!!
::Feel free to modify::
Posted: 20 Nov 2007, 14:50
by Pendrokar
K I made it! (In one day acctually, not this whole time :) )
http://www.unknown-files.net/spring/378 ... laim_Info/
Re: Lua Widget - Reclaim Area Info on M & E!
Posted: 01 Sep 2008, 19:28
by manolo_
could u modify the lua so, that it will show u m/e without press the reclaim-button
Re: Lua Widget - Reclaim Area Info on M & E!
Posted: 03 Sep 2008, 15:32
by Pendrokar
manolo_ wrote:could u modify the lua so, that it will show u m/e without press the reclaim-button
You mean you press on a tree or other feature and drag upon it and nothing is shown(yes need a fix...) or just about having m/e shown upon enemies? (because it already works on friendlies)
Re: Lua Widget - Reclaim Area Info on M & E!
Posted: 05 Sep 2008, 18:47
by manolo_
Re: Lua Widget - Reclaim Area Info on M & E!
Posted: 11 Sep 2008, 05:04
by Tribulexrenamed
yeah this already exists. I have had it for years. Always check CA before requesting shit.
Re: Lua Widget - Reclaim Area Info on M & E!
Posted: 11 Sep 2008, 08:04
by manolo_
and? i didnt do what i wanted, it just show the information when i press e and make that circle, when i just click a con and set him reclaim and make then the circle, it shows nothing *bäm*
Re: Lua Widget - Reclaim Area Info on M & E!
Posted: 27 Sep 2008, 10:01
by Pendrokar
New version: -
http://spring.jobjol.nl/show_file.php?id=1492
Shows the amount of metal/energy when using area reclaim.
Changes since last version:
-works within MiniMap
-you
nolonger need to have reclaim order activated to see the amount of metal in units!
-right-click area reclaim on units and
features now works the same as a normal area reclaim order!
Known bugs(not that trivial):
- does not work right in
maximized minimap
- starting area reclaim from the minimap and draging it to game world will still continue to count the
resources from the minimap. But It does not work vice-versa
Re: Lua Widget - Reclaim Area Info on M & E!
Posted: 23 Oct 2008, 23:17
by Pendrokar
fixed issue in 0.77(Minimap issue). Uploaded to Spring Job Jol Files.
Re: Lua Widget - Reclaim Area Info on M & E!
Posted: 18 Nov 2008, 15:20
by manolo_
if u come with ur mouse outside of the map the reclaim-stats (amount of what u could reclaim) drops to 0
Re: Lua Widget - Reclaim Area Info on M & E!
Posted: 19 Nov 2008, 15:22
by Pendrokar
Thanks for reporting I will try to fix that!
Re: Lua Widget - Reclaim Area Info on M & E!
Posted: 19 Nov 2008, 18:59
by manolo_
np, im good at finding bugs :)
Re: Lua Widget - Reclaim Area Info on M & E!
Posted: 24 Nov 2008, 16:41
by Pendrokar
manolo_ wrote:np, im good at finding bugs :)
Really? Did you use this version of the widget -
http://spring.jobjol.nl/show_file.php?id=1492
Because everything works fine for me.
Re: Lua Widget - Reclaim Area Info on M & E!
Posted: 24 Nov 2008, 17:13
by manolo_
yes i used it, but it doesnt depends on going out of the map, while drag a circle, u have to come with ur mouse over the build-panel