Lua Widget - Reclaim Area Info on M & E!

Lua Widget - Reclaim Area Info on M & E!

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

Moderator: Moderators

Post Reply
User avatar
Pendrokar
Posts: 658
Joined: 30 May 2007, 10:45

Lua Widget - Reclaim Area Info on M & E!

Post 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!
Torrasque
Posts: 1022
Joined: 05 Oct 2004, 23:55

Post by Torrasque »

I can't help you, but that's a really cool idea !
Satirik
Lobby Developer
Posts: 1688
Joined: 16 Mar 2007, 18:27

Post by Satirik »

can't help either but it already like this script
User avatar
Pendrokar
Posts: 658
Joined: 30 May 2007, 10:45

Post by Pendrokar »

Maybe it doesn't need to be a widget! Could be implemented in Spring!
gunblob
Posts: 9
Joined: 27 May 2007, 09:21

Post 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?
User avatar
Pendrokar
Posts: 658
Joined: 30 May 2007, 10:45

Post 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!
User avatar
Pendrokar
Posts: 658
Joined: 30 May 2007, 10:45

Post 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!! :cry:

::Feel free to modify::
User avatar
Pendrokar
Posts: 658
Joined: 30 May 2007, 10:45

Post by Pendrokar »

K I made it! (In one day acctually, not this whole time :) )

http://www.unknown-files.net/spring/378 ... laim_Info/
User avatar
manolo_
Posts: 1370
Joined: 01 Jul 2008, 00:08

Re: Lua Widget - Reclaim Area Info on M & E!

Post by manolo_ »

could u modify the lua so, that it will show u m/e without press the reclaim-button
User avatar
Pendrokar
Posts: 658
Joined: 30 May 2007, 10:45

Re: Lua Widget - Reclaim Area Info on M & E!

Post 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)
User avatar
manolo_
Posts: 1370
Joined: 01 Jul 2008, 00:08

Re: Lua Widget - Reclaim Area Info on M & E!

Post by manolo_ »

User avatar
Tribulexrenamed
Posts: 775
Joined: 22 Apr 2008, 19:06

Re: Lua Widget - Reclaim Area Info on M & E!

Post by Tribulexrenamed »

yeah this already exists. I have had it for years. Always check CA before requesting shit.
User avatar
manolo_
Posts: 1370
Joined: 01 Jul 2008, 00:08

Re: Lua Widget - Reclaim Area Info on M & E!

Post 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*
User avatar
Pendrokar
Posts: 658
Joined: 30 May 2007, 10:45

Re: Lua Widget - Reclaim Area Info on M & E!

Post 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
User avatar
Pendrokar
Posts: 658
Joined: 30 May 2007, 10:45

Re: Lua Widget - Reclaim Area Info on M & E!

Post by Pendrokar »

fixed issue in 0.77(Minimap issue). Uploaded to Spring Job Jol Files.
User avatar
manolo_
Posts: 1370
Joined: 01 Jul 2008, 00:08

Re: Lua Widget - Reclaim Area Info on M & E!

Post by manolo_ »

if u come with ur mouse outside of the map the reclaim-stats (amount of what u could reclaim) drops to 0
Attachments
spring 2008-11-18 15-21-45-87_agk.rar
videoproof
(688.8 KiB) Downloaded 10 times
User avatar
Pendrokar
Posts: 658
Joined: 30 May 2007, 10:45

Re: Lua Widget - Reclaim Area Info on M & E!

Post by Pendrokar »

Thanks for reporting I will try to fix that!
User avatar
manolo_
Posts: 1370
Joined: 01 Jul 2008, 00:08

Re: Lua Widget - Reclaim Area Info on M & E!

Post by manolo_ »

np, im good at finding bugs :)
User avatar
Pendrokar
Posts: 658
Joined: 30 May 2007, 10:45

Re: Lua Widget - Reclaim Area Info on M & E!

Post 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.
User avatar
manolo_
Posts: 1370
Joined: 01 Jul 2008, 00:08

Re: Lua Widget - Reclaim Area Info on M & E!

Post 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
Post Reply

Return to “Lua Scripts”