Defense Range v6.12

Defense Range v6.12

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

Moderator: Moderators

Post Reply
User avatar
very_bad_soldier
Posts: 1397
Joined: 20 Feb 2007, 01:10

Defense Range v6.12

Post 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/
Last edited by very_bad_soldier on 28 Jun 2009, 03:41, edited 44 times in total.
User avatar
LordMatt
Posts: 3393
Joined: 15 May 2005, 04:26

Post by LordMatt »

I assume it only does this if you can see the unit?
User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14673
Joined: 17 Nov 2005, 02:43

Post by Forboding Angel »

THis is very very cool! Thanks dude!
User avatar
BrainDamage
Lobby Developer
Posts: 1164
Joined: 25 Sep 2006, 13:56

Post 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[])
User avatar
very_bad_soldier
Posts: 1397
Joined: 20 Feb 2007, 01:10

Post 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?
User avatar
jK
Spring Developer
Posts: 2299
Joined: 28 Jun 2007, 07:30

Post 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 ^^
Last edited by jK on 25 Oct 2007, 17:04, edited 2 times in total.
User avatar
BigHead
Posts: 145
Joined: 12 Jul 2007, 18:55

Post 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)
User avatar
LordMatt
Posts: 3393
Joined: 15 May 2005, 04:26

Post by LordMatt »

What stops them from cheating?
User avatar
BigHead
Posts: 145
Joined: 12 Jul 2007, 18:55

Post 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.
User avatar
LOrDo
Posts: 1154
Joined: 27 Feb 2006, 00:21

Post 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.
User avatar
quantum
Posts: 590
Joined: 19 Sep 2006, 22:48

Post by quantum »

It's IceUI's font: FreeSansBold. Before you ask, I'm using it in our tutorial too :-)
User avatar
LordMatt
Posts: 3393
Joined: 15 May 2005, 04:26

Post 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.
User avatar
ginekolog
Posts: 837
Joined: 27 Feb 2006, 13:49

Post 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
User avatar
very_bad_soldier
Posts: 1397
Joined: 20 Feb 2007, 01:10

Post 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.
User avatar
LOrDo
Posts: 1154
Joined: 27 Feb 2006, 00:21

Post by LOrDo »

IceUI wont update for me :(
So I guess I cant get the new one.
User avatar
LordMatt
Posts: 3393
Joined: 15 May 2005, 04:26

Post by LordMatt »

On what OS?
MelTraX
Posts: 470
Joined: 02 Jan 2007, 16:18

Post 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/
User avatar
stilicho
Posts: 46
Joined: 21 Mar 2007, 02:49

Post by stilicho »

Great widget! Thanks for writing it.
User avatar
Noruas
XTA Developer
Posts: 1269
Joined: 24 Feb 2005, 02:58

Post by Noruas »

Whats wrong with xta?
User avatar
very_bad_soldier
Posts: 1397
Joined: 20 Feb 2007, 01:10

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

Return to “Lua Scripts”