Defense Range v6.12 - Page 7

Defense Range v6.12

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

Moderator: Moderators

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

Re: Defense Range v5.0

Post by very_bad_soldier »

Hm, thanks for the hint... I did some tests on it and its quite strange: You have to enable shadows once. You can disable them again right away. When they were enabled once or are actually enabled the feature drawing works correctly.

Something seems to happen when you enable shadows. This doesnt get reverted even when you disable them again. But I have no clue what. Any ideas?
User avatar
very_bad_soldier
Posts: 1397
Joined: 20 Feb 2007, 01:10

Re: Defense Range v5.0

Post by very_bad_soldier »

Hm, I messed around with the OpenGL-States. It now works for me (without enabling shadows) on nvidiaGPU when I set this texture state manually:

Code: Select all

gl.TexEnv( GL.TEXTURE_ENV, 34184, 34167 )	--GL_SOURCE0_ALPHA_ARB			GL_PRIMARY_COLOR_ARB
Maybe someone could please test with an ATI-card? No clue if it works for ATI at all... Thanks!
Attachments
gui_defenseRange.lua
DR 5.01
ghost feature fix
(44.58 KiB) Downloaded 131 times
[Krogoth86]
Posts: 1176
Joined: 23 Aug 2007, 19:46

Re: Defense Range v5.0

Post by [Krogoth86] »

Yup - works fine now (on ATI)! :-)
User avatar
very_bad_soldier
Posts: 1397
Joined: 20 Feb 2007, 01:10

Re: Defense Range v5.1

Post by very_bad_soldier »

...new version
el_matarife
Posts: 933
Joined: 27 Feb 2006, 02:04

Re: Defense Range v5.1

Post by el_matarife »

very_bad_soldier wrote: -added: displays blast radius when placing buildings
Brilliant, now it should be much easier to setup arrays of fusions, metal makers, and anything else that tends to chain explode.
User avatar
Pxtl
Posts: 6112
Joined: 23 Oct 2004, 01:43

Re: Defense Range v5.1

Post by Pxtl »

Yay! I wanted that feature so bad. I suck at the "spam mohomakers and fusions" stage of economy, so that kind of thing is a big help.
User avatar
TheFatController
Balanced Annihilation Developer
Posts: 1177
Joined: 10 Dec 2006, 18:46

Re: Defense Range v5.1

Post by TheFatController »

Imo the 'EXPLOSION' text is unneeded, it's pretty clear from the flashing circle what it indicates, if text was going to be used i'd prefer to know how much damage the death explosion did.
User avatar
very_bad_soldier
Posts: 1397
Joined: 20 Feb 2007, 01:10

Re: Defense Range v5.1

Post by very_bad_soldier »

Yes, agreed.
After playing some games I have to admit that it is highly annoying to get this explosion range for each and every building you place. So I changed it so you have to press the META-key (Space) when placing buildings to see the blast range. I hope it does not interfer with other keyboard/UI commands.
What do you think?
Attachments
gui_defenseRange.lua
DR 5.11
-EXPLOSION-text replaced by explosion's default damage
-press meta (space) to see blast range when placing buildings
(49.51 KiB) Downloaded 141 times
User avatar
very_bad_soldier
Posts: 1397
Joined: 20 Feb 2007, 01:10

Re: Defense Range v5.11

Post by very_bad_soldier »

BOTA support added.

Please tell me if something is wrong.

EDIT: Oops, Debug outputs still enabled... Please set "debug" to "false" in line 22...
Attachments
gui_defenseRange.lua
DR 5.2
-BOTA support
(49.96 KiB) Downloaded 120 times
User avatar
BlueTemplar
Posts: 314
Joined: 28 Oct 2007, 22:37

Re: Defense Range v5.11

Post by BlueTemplar »

I tried changing unit_marker.inc to the following, but it didn't work.

Code: Select all

--[[1.0
Fill this list with your units:
Follow the given examples, fill this fields:
"markerText" -> unit gets marked with this text, nil = no marking

example entries:
unitList["BA"] = {} --initialize table
unitList["BA"]["armrad"] = { markerText = "Radar" }
unitList["BA"]["armjamt"] = { markerText = "Jammer" }
unitList["BA"]["armarad"] = { markerText = "AdvRadar" }
unitList["BA"]["armveil"] = { markerText = "AdvJammer" }
unitList["BA"]["corrad"] = { markerText = "Radar" }
unitList["BA"]["corjamt"] = { markerText = "Jammer" }
unitList["BA"]["corarad"] = { markerText = "AdvRadar" }
unitList["BA"]["corshroud"] = { markerText = "AdvJammer" }

unitList["CA"] = {} --initialize table
]]
What did I do wrong?

(Yes I know this might result in marker spam, I actually would really like to have a widget that underlines the enemy radars, jammers, and minefields when you select a Juno, but I know squat about lua coding.)

BTW, some people made widgets that mark Dragon's Eyes. I think it's a bit problematic, because the greatness of dragon's eyes is that they are hard to spot, even when de-cloaked.
[Krogoth86]
Posts: 1176
Joined: 23 Aug 2007, 19:46

Re: Defense Range v5.11

Post by [Krogoth86] »

I guess you need to give it an additional tag for the weapons. At least all the entries I have provide this and look like this:

Code: Select all

unitList["armguard"] = { markerText = nil, weapons = { 1 } }
User avatar
very_bad_soldier
Posts: 1397
Joined: 20 Feb 2007, 01:10

Re: Defense Range v5.11

Post by very_bad_soldier »

BlueTemplar wrote: What did I do wrong?
You probably just have to put your code outside the comments :-)

Code: Select all

--[[1.0
Fill this list with your units:
Follow the given examples, fill this fields:
"markerText" -> unit gets marked with this text, nil = no marking

example entries:
--]]
unitList["BA"] = {} --initialize table
unitList["BA"]["armrad"] = { markerText = "Radar" }
unitList["BA"]["armjamt"] = { markerText = "Jammer" }
unitList["BA"]["armarad"] = { markerText = "AdvRadar" }
unitList["BA"]["armveil"] = { markerText = "AdvJammer" }
unitList["BA"]["corrad"] = { markerText = "Radar" }
unitList["BA"]["corjamt"] = { markerText = "Jammer" }
unitList["BA"]["corarad"] = { markerText = "AdvRadar" }
unitList["BA"]["corshroud"] = { markerText = "AdvJammer" }
Besides that I have reworked this widget completely. I have split it up into four individual widgets so each function goes into its own file. So for your case there is a unitMarker-widget (I think I posted an early version in this thread some months ago).
Defense Range itself will only support static unit lists then, no more auto-detection cause it just fails if it comes to supporting different mods.
Im going to bed now I will post them tomorrow, its barely tested but you can have a try with it.
User avatar
BlueTemplar
Posts: 314
Joined: 28 Oct 2007, 22:37

Re: Defense Range v5.11

Post by BlueTemplar »

Thank you! (I didn't knew --[[ ... --]] was for comments :P )
User avatar
very_bad_soldier
Posts: 1397
Joined: 20 Feb 2007, 01:10

Re: Defense Range v5.11

Post by very_bad_soldier »

Here they are. I dont know when I will have time to test them but if someone has the patience to use them I would be happy to hear about bugs and problems and suggestions.
Attachments
gui_blastRadius.lua
Blast Radius
-displays blast radius of select units (META+X) and while placing buildings (META)
(9.04 KiB) Downloaded 124 times
unit_ghostSite.lua
Ghost Site
-displays ghosted buildings in progress (in green) and features (DragonTeeth/Walls whatever)
(7.56 KiB) Downloaded 113 times
unit_marker.lua
Unit Marker 1.1
-currently only CA and BA Nukes and AntiNukes get marked. Others can be added easily within the file
-multiple mod support (currently CA & BA. They can be added/tweaked easily)
-no multiple markers if multiple players use it
(5.18 KiB) Downloaded 127 times
User avatar
very_bad_soldier
Posts: 1397
Joined: 20 Feb 2007, 01:10

Re: Defense Range v5.11

Post by very_bad_soldier »

While we are at it: I played around with a widget for local team recoloring (idea from another thread): You can put a list of player names and colors inside the widget and it will recolor these players as desired. If another player has that color already the colors will be swapped. This is even less tested :o You have to manually disable and re-enable after the game has started since obviously changing team colors in widget:Initialize doesnt work.
Attachments
unit_localTeamColors.lua
Local Team Colors
Updated! Now probably even working!
(5.22 KiB) Downloaded 128 times
gui_defenseRange.lua
Defense Range 6
-only static unit lists supported (currently just BA, others to add)
-all other functions besides range drawing have gone to own files
-combo-units (air and ground) do correctly drawn with two circles
(33.84 KiB) Downloaded 121 times
Last edited by very_bad_soldier on 15 Apr 2009, 20:02, edited 1 time in total.
User avatar
manolo_
Posts: 1370
Joined: 01 Jul 2008, 00:08

Re: Defense Range v5.11

Post by manolo_ »

could u release another defense range widget which include all the old functions (i dont want to have too much widgets in the list)
User avatar
BlueTemplar
Posts: 314
Joined: 28 Oct 2007, 22:37

Re: Defense Range v5.11

Post by BlueTemplar »

IMHO it's best to keep the widgets separate, so that you can de-activate some of them if you wish, but we do need to be able to separate them in different categories, a bit like in Ice UI.

BTW, did you fix the spec problem with the unit marker? (Specs are adding automatic markers too)
It might be interesting to keep it for some units, to show the specs when a player is building something that will change the game, like a t2 fac, a nuke, a big bertha/vulcan...
User avatar
manolo_
Posts: 1370
Joined: 01 Jul 2008, 00:08

Re: Defense Range v5.11

Post by manolo_ »

u could enable/disable them with ctrl+f11 (would be nice)
el_matarife
Posts: 933
Joined: 27 Feb 2006, 02:04

Re: Defense Range v5.11

Post by el_matarife »

Any way to make the blast radius toggle on and off with a button like you've got for ground defense, air defense, and anti-nukes on Defense Range widget? I'm thinking 3 buttons, one for showing the blast radius of enemy buildings, one for showing the blast radius of your buildings under construction, and one for showing the blast radius of all your buildings and friendlies buildings.
User avatar
BlueTemplar
Posts: 314
Joined: 28 Oct 2007, 22:37

Re: Defense Range v5.11

Post by BlueTemplar »

NVM
Last edited by BlueTemplar on 15 Apr 2009, 00:02, edited 1 time in total.
Post Reply

Return to “Lua Scripts”