Prospector v1.9

Prospector v1.9

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

Moderator: Moderators

User avatar
Evil4Zerggin
Posts: 557
Joined: 16 May 2007, 06:34

Prospector v1.9

Post by Evil4Zerggin »

Prospector

This widget calculates the amount of metal a mex will extract when you're about to build it. Doesn't account for spots being already occupied. Nothing fancy. May optimize/merge into another widget later.

Version History:

v1.9
Now displays extraction pre-game when metal map is on instead.

v1.8
Fixed bug where pregame circle was not being drawn level with the ground.

v1.7
Now displays extraction pre-game when Shift is held.

v1.4
Hack to get around broken gl.GetTextWidth. Tooltips should have properly-sized backgrounds now.

v1.2
Fixed for new Spring, a few optimizations.

v1.1
Fixed for even footprints.

v1.0
First forum release.

Get it from caspring: http://trac.caspring.org/browser/trunk/ ... pector.lua

Dev Notes
As with all my widgets, several of the major config variables are at the top.

Pregame extraction display looks for a unitname="armmex". If there is no such mex, it uses the weakest mex (i.e., lowest positive extractsMetal).
Last edited by Evil4Zerggin on 23 Jan 2009, 21:07, edited 11 times in total.
BaNa
Posts: 1562
Joined: 09 Sep 2007, 21:05

Re: Prospector v1.0

Post by BaNa »

cool pies! I've gotten used to the widget that tells you how much m you reclaim, this will be just as indispensable.
User avatar
manolo_
Posts: 1370
Joined: 01 Jul 2008, 00:08

Re: Prospector v1.0

Post by manolo_ »

nice idea, but the background of the font isnt used for the whole length of the font
User avatar
Evil4Zerggin
Posts: 557
Joined: 16 May 2007, 06:34

Re: Prospector v1.0

Post by Evil4Zerggin »

Yeah, the background thing is a bit wierd; I'm already making its width equal to gl.GetTextWidth times a correction factor, but the necessary correction factor seems to vary from machine to machine. In any case, you can change TEXT_CORRECT_X in the file itself to change the background width (I think Licho used 2.1, while 1.75 works on my current machine).
User avatar
TheFatController
Balanced Annihilation Developer
Posts: 1177
Joined: 10 Dec 2006, 18:46

Re: Prospector v1.0

Post by TheFatController »

I haven't tried it so not sure if its a big deal or not but you could probably cache the result of 'IntegrateMetal' and update it a few times a second rather than each frame, looks good tho :)
User avatar
Evil4Zerggin
Posts: 557
Joined: 16 May 2007, 06:34

Re: Prospector v1.0

Post by Evil4Zerggin »

Yeah, it's a pretty unoptimized widget. I'd probably put in a MouseMove callin, check if I need to update, and cache the result. Maybe after I finish working on SWIW's weapon CEGs :p
User avatar
FLOZi
MC: Legacy & Spring 1944 Developer
Posts: 6242
Joined: 29 Apr 2005, 01:14

Re: Prospector v1.0

Post by FLOZi »

What about S44's CEGs!? :mrgreen:
User avatar
Hoi
Posts: 2917
Joined: 13 May 2008, 16:51

Re: Prospector v1.0

Post by Hoi »

WZ 1v1 Flozi to determinate on who's cegs zerg works on :P
User avatar
Evil4Zerggin
Posts: 557
Joined: 16 May 2007, 06:34

Re: Prospector v1.1

Post by Evil4Zerggin »

Fixed for mexes with even footprints.

As for CEGs, the later you get your CEGs, the more experience I'll have by then :p
User avatar
Evil4Zerggin
Posts: 557
Joined: 16 May 2007, 06:34

Re: Prospector v1.2

Post by Evil4Zerggin »

Fixed for new Spring; unitDef.ysize got renamed to unitDef.zsize. Also a couple optimizations.
User avatar
MidKnight
Posts: 2652
Joined: 10 Sep 2008, 03:11

Re: Prospector v1.2

Post by MidKnight »

I can see this replacing easymetal...
User avatar
manolo_
Posts: 1370
Joined: 01 Jul 2008, 00:08

Re: Prospector v1.4

Post by manolo_ »

request:

situation: when u play an unknown map and u dont know what a metalspot gives as M-output(before choosing startpositions). with this lua u will see the m-output (for normal metal spots, not metal areas) while choosing the startpos.
User avatar
Evil4Zerggin
Posts: 557
Joined: 16 May 2007, 06:34

Re: Prospector v1.7

Post by Evil4Zerggin »

Good idea. Done. Hold Shift pregame to see.
User avatar
CarRepairer
Cursed Zero-K Developer
Posts: 3359
Joined: 07 Nov 2007, 21:48

Re: Prospector v1.2

Post by CarRepairer »

MidKnight wrote:I can see this replacing easymetal...
No, they're two completely different things that can complement eachother.
User avatar
manolo_
Posts: 1370
Joined: 01 Jul 2008, 00:08

Re: Prospector v1.7

Post by manolo_ »

seems to be a bug there:

while holding shift (in the startpos-phase) the circle isnt on the right place
User avatar
Evil4Zerggin
Posts: 557
Joined: 16 May 2007, 06:34

Re: Prospector v1.8

Post by Evil4Zerggin »

Ah, I see, it wasn't being drawn at ground level. Fixed.
R-TEAM
Posts: 177
Joined: 22 Jan 2009, 19:25

Re: Prospector v1.8

Post by R-TEAM »

Hi,

can the shift key replaced with other key ?
It is a little bit confusing by fast scrolling [with shift pressed]

And btw. great Widget ;)

Regards
R-TEAM
User avatar
Evil4Zerggin
Posts: 557
Joined: 16 May 2007, 06:34

Re: Prospector v1.9

Post by Evil4Zerggin »

I've changed it so that it displays automatically when you're looking at the metalmap pregame.
User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14673
Joined: 17 Nov 2005, 02:43

Re: Prospector v1.0

Post by Forboding Angel »

Hoi wrote:WZ 1v1 Flozi to determinate on who's cegs zerg works on :P
But the mod they must 1v1 in has to be one of emmanuel's mods.
Warlord Zsinj
Imperial Winter Developer
Posts: 3742
Joined: 24 Aug 2004, 08:59

Re: Prospector v1.9

Post by Warlord Zsinj »

En Garde!
Image
Post Reply

Return to “Lua Scripts”