Page 1 of 8

Defense Range v6.12

Posted: 25 Oct 2007, 15:25
by very_bad_soldier
With this update all functions besides drawing range circles have been removed and can be found in other widgets.
There is no more automatic detection of units to draw ranges for, there is a unit list now for each supported mod. Currently CA and BA are supported. Adding support for other mods is easy as pie.

-Displays ranges of ally and enemy defense buildings. (Ground/Air/Anti-Nuke)

Enter tweak mode by pressing CTRL+F11 and you can drag the buttons position around to fit your needs.

See following image for an example:
Image

Feature requests and bug reports are welcome.
Thanks to the Lua guys for helping me out!

Props to Evil4Zerggin and Marmoth for code samples!

Changelog:
v6.12
-bugfix (BA Ambusher working again)

v6.11
-BA: added (missing) water defenses: TorpedoLauncher, Float-HLT, Float-MissileTower

v6.1
-TweakMode fixed
-XTA-Support (thx to _manolo)

v6.0
-all functions besides range drawing removed
-combo units having ground and air weapons are correctly drawn using two circles

v5.11
-updated: you now have to press meta-key (space) to see blast range when placing buildings
-updated: EXPLOSION-text replaced by explosion's default damage

v5.1
-added: displays blast radius when placing buildings
-added: hides gui correctly when pressing F5
-added: tweak mode added to move buttons around when pressing CTRL+F11

v5.01
-fixed ghosted features

v5.0
-Improved accuracy of range circles
-More accurate DPS-colors (using BurstFire)
-ghosted features
-fixed Air for BA

v4.13
-fixed: green ghosted buildings do not disappear
-small bugfixes and refactors

v4.11
fixed glBlending

v4.1
added: GhostedBuilding for nano frames
fix for CA
CA/mod specific color config

v4.0
added: new unitFile system
added: optimization and rewrites
added: range color depending now on dps
added: units can have more than one weapon (like Doomsday in BA)
added: dynamic line width and alpha depending on camera height
added: selfd-radius AND explosion-radius are visible
added: remembers button states from last game
fixed: in team games markers get set only by one player (no more multitagging)
fixed: BA armclaw and cormav fixed

v3.7q (thx to quantum)
fixed for CA
performance improvements

v3.7
added: Press meta + X to see selfd blast radius of selected units ("meta" is by default the space key) -> Space + X

v3.6
fixed: bug of disappearing ranges (hopefully, pls email me if it still happens )
added: buttons now resize depending on resolution
added: new weapon detection method depending on static unit files
updated: opacity of drawn range circles reduced to 0.1 which is more subtle

v3.4
fixed: works now with spring svn version (>0.75b2)
fixed: some unit detection glitches (Screamer/Mercury in CA)
note: XTA works with svn version

v3.3
fixed: Juno does not get marked as Nuke any longer (thx to Klopper)

v3.2
fixed: Renders correctly on ATI now
fixed: AntiNuke/Nuke gets marked again
fixed: Widget gets disabled in spectator mode
fixed: some speedups

v3.1
-fixed: AntiNuke (sorry)

v3:
-added: support for combo units (ground and air -> CA)
-added: support for different mods, especially CA (XTA does not work properly)
-updated: new icons
-updated: unit de├óÔäó┬ªtection (more accurate now, at least I hope)
-updated: code cleanup

v2:
minor bugs fixed (killed inclusion of opengl.h, correct resetting of OpenGL parameters)

Download at SpringDownloader or at:
http://spring.vsync.de/luaManager/

Posted: 25 Oct 2007, 16:07
by LordMatt
I assume it only does this if you can see the unit?

Posted: 25 Oct 2007, 16:15
by Forboding Angel
THis is very very cool! Thanks dude!

Posted: 25 Oct 2007, 16:20
by BrainDamage
opengl.h.lua is depricated & it's functionality has been integrated in spring

you can safely remove that line (please do because recent installations doesn't provide such file and adding it would be rendundant

you actually you have to, or it won't load because it won't find the file

EDIT: i have a problem running it in linux:
Incorrect arguments to gl.Shape(type, elements[])

Posted: 25 Oct 2007, 16:48
by very_bad_soldier
LordMatt wrote:I assume it only does this if you can see the unit?
Once you saw a building, the widget saves its range to display it permanently. So you dont need LOS any more to see the range of enemy's defense :-)

@Brain Damage:
I get the same error in WindowsXP if I remove the opengl.h-inclusion. Maybe better leave it in?

Posted: 25 Oct 2007, 17:01
by jK
  1. Please leave the room as you would wish to find it.
    (means you should reset gl.Color to full white (1,1,1,1) and you should reset gl.LineWidth(1.0) after you finished your drawings)
  2. opengl.h.lua is outdated (-> is not included in new installers). The reason why you get an error if you don't include it, is because you use GL_* but it is in GL.* in lua (you can localize those const if you want): see here
  3. i would prefer it if you would draw the ranges on the minimap ^^

Posted: 25 Oct 2007, 17:01
by BigHead
LordMatt wrote:I assume it only does this if you can see the unit?
It's a widget and widgets can't cheat 8)

Posted: 25 Oct 2007, 17:25
by LordMatt
What stops them from cheating?

Posted: 25 Oct 2007, 17:36
by BigHead
The same thing that stops you - if you can't see enemy unit, widgets can't see it as well, etc ...
I've thought everyone knows that.

Posted: 25 Oct 2007, 17:39
by LOrDo
Looks like a useful widget, but I got another question. What font are you using? It looks a lot cooler then the font that come with spring.

Posted: 25 Oct 2007, 18:20
by quantum
It's IceUI's font: FreeSansBold. Before you ask, I'm using it in our tutorial too :-)

Posted: 25 Oct 2007, 19:08
by LordMatt
BigHead wrote:The same thing that stops you - if you can't see enemy unit, widgets can't see it as well, etc ...
I've thought everyone knows that.
Best to assume no one knows anything, except for trepan.

Posted: 25 Oct 2007, 19:43
by ginekolog
nice widget esspecially for anti nukes. It doesnt mark mobile antis though.. bug? BTW how does widget know when antinuke is empty? cause it does not mark empty antis.. just full ones oO

Posted: 25 Oct 2007, 19:50
by very_bad_soldier
@jK:
Thanks for your hints. It's fixed now and still working :P

@LOrDo:
Yes, it's MelTrax IceUI, which is awesome. I didnt made any further modifications to the font.

@ginekolog:
ATM the widget only looks for buildings, mobile units are not taken into account.
The behaviour of just marking loaded Antinukes is very strange :shock:
It is not intended and quite mysterious 8) I will have to test it. Thanks for reporting.

Posted: 26 Oct 2007, 01:43
by LOrDo
IceUI wont update for me :(
So I guess I cant get the new one.

Posted: 26 Oct 2007, 02:23
by LordMatt
On what OS?

Posted: 27 Oct 2007, 17:15
by MelTraX
LOrDo, do you also have the problem that you're version of wget doesn't support the one switch I used?

Anyway, you can always get IceUI directly from the SVN:
https://meltrax.homeip.net/svn/IceUI/br ... entSpring/

Posted: 29 Oct 2007, 18:36
by stilicho
Great widget! Thanks for writing it.

Posted: 04 Nov 2007, 03:45
by Noruas
Whats wrong with xta?

Posted: 04 Nov 2007, 15:45
by very_bad_soldier
It seems like the weapon definitions and its damages get handled in another way in XTA. I was not able to determine the weapon types like I did in mods like BA and CA. If someone has a hint for me what I am doing wrong I would like to implement XTA-support as well.