Defense Range v6.12
Moderator: Moderators
Re: Defense Range v3.7
Here is a version with some fixes for the latest CA.
-
- Posts: 933
- Joined: 27 Feb 2006, 02:04
Re: Defense Range v3.7
Could you add a regular blast radius option in addition to the self destruct blast size? It'd help make sense of placing buildings much more than the self destruct blast size which is usually a lot bigger.very_bad_soldier wrote:Added one little new feature to see blast radius.
Re: Defense Range v3.7
Is there any way to get the widget to display two ranges for the same unit? I'm trying to get it to work for NOTA and the Arm Command Center has two weapons: an anti-air missile with a range of 1500 and a ground attack rocket with a range of 1300.
So far I've tried editing the gui_defenseRange_units.inc file and added
but that only marked the anti-air missile range. Next I tried
but, once again, only the anti-air range was marked. Last I tried
and it still marked the anti-air range but grouped with the ground ranges (the circle would disappear if I turned off ground ranges).
I'm guessing I'm gonna have to go into the .lua file but since I haven't done any lua before any help would be greatly appreciated. Thanks in advance.
So far I've tried editing the gui_defenseRange_units.inc file and added
Code: Select all
unitList["armbase"] = {4, nil}
Code: Select all
unitList["armbase"] = {1, nil}
unitList["armbase"] = {2, nil}
Code: Select all
unitList["armbase"] = {1, nil}
I'm guessing I'm gonna have to go into the .lua file but since I haven't done any lua before any help would be greatly appreciated. Thanks in advance.
- very_bad_soldier
- Posts: 1397
- Joined: 20 Feb 2007, 01:10
Re: Defense Range v3.7
@quantum:
Thanks for doing it. I will preserve your fixes for future versions. Btw do you use any kind of IDE for the LUA-stuff? I saw your "automatically generated locals"...
What do you think about the approach using a unit file for weapon classification? I think it could avoid future code fixes for specific mods. I will probably do a total rewrite since I dont like the code in its current form. And I am thinking about switching entirely to the unit file method because the current generic weapon detection is quite strange and fails as soon as something gets changed in a mod.
@Totbuae:
Sorry, I think there is no quick way to have two or more ranges for one weapon. I am considering a total rewrite of the widget, maybe as a gadget version as Argh suggested. If you want to patch it yourself I am here of course if you have questions.
@el_matarife:
Yay nice idea, will do...
Thanks for doing it. I will preserve your fixes for future versions. Btw do you use any kind of IDE for the LUA-stuff? I saw your "automatically generated locals"...
What do you think about the approach using a unit file for weapon classification? I think it could avoid future code fixes for specific mods. I will probably do a total rewrite since I dont like the code in its current form. And I am thinking about switching entirely to the unit file method because the current generic weapon detection is quite strange and fails as soon as something gets changed in a mod.
@Totbuae:
Sorry, I think there is no quick way to have two or more ranges for one weapon. I am considering a total rewrite of the widget, maybe as a gadget version as Argh suggested. If you want to patch it yourself I am here of course if you have questions.
@el_matarife:
Yay nice idea, will do...
Re: Defense Range v3.7
I'm using trepan's Lua localizer script to generate the locals.
In BA/CA you could use onlyTargets to spot units that can only shoot at air. In XTA you could use badTargets to see which units prioritize air targets.
I think the units file is too much work to maintain. Modders can edit the widget anyway. They will probably only need to edit the checked target categories, no complex Lua required.
In BA/CA you could use onlyTargets to spot units that can only shoot at air. In XTA you could use badTargets to see which units prioritize air targets.
I think the units file is too much work to maintain. Modders can edit the widget anyway. They will probably only need to edit the checked target categories, no complex Lua required.
- very_bad_soldier
- Posts: 1397
- Joined: 20 Feb 2007, 01:10
Re: Defense Range v4.0
Changed lot of internal stuff. I dared to call it 4.0.
Because of the many changes there may be still some bugs left. Pointing those out would help me alot, thanks.
See first post for changelog.

Because of the many changes there may be still some bugs left. Pointing those out would help me alot, thanks.
See first post for changelog.
-
- Posts: 933
- Joined: 27 Feb 2006, 02:04
Re: Defense Range v4.0
Anyway that you can get the explode and self D rings to show up on a building when you're placing it for construction? I'd love an option to always show those rings when you're placing buildings.
Also, can you add it as a button for enemies and allies so you don't have to grab at your keyboard when trying to find that out. It'd make it a lot easier to plan assaults too.
Also, can you add it as a button for enemies and allies so you don't have to grab at your keyboard when trying to find that out. It'd make it a lot easier to plan assaults too.
Re: Defense Range v4.0
Error in UnitEnteredLos(): [string "LuaUI/Widgets/gui_defenserange.lua"]:850: attempt to perform arithmetic on local 'damage' (a nil value)
Removed widget: Defense Range v4.0
Error in UnitCreated(): [string "LuaUI/Widgets/gui_defenserange.lua"]:850: attempt to perform arithmetic on local 'damage' (a nil value)
Removed widget: Defense Range v4.0
- very_bad_soldier
- Posts: 1397
- Joined: 20 Feb 2007, 01:10
Re: Defense Range v4.0
Thanks Licho. That one was a CA specific issue. Its fixed now (and attached). I also added green ghosted buildings for nano frames aka buildings under construction and adapted the color configuration for CA:
(the values are dps of the weapon)
For Ground:
Minimum = 60 = Red
Maximum = 350 = Yellow
For Air:
Minimum = 60 = Green
Maximum = 400 = Blue
I hope this a are good values but its not hard to change them though.
(the values are dps of the weapon)
For Ground:
Minimum = 60 = Red
Maximum = 350 = Yellow
For Air:
Minimum = 60 = Green
Maximum = 400 = Blue
I hope this a are good values but its not hard to change them though.
- Attachments
-
- gui_defenseRange.lua
- DefenseRange 4.1
- (33.95 KiB) Downloaded 52 times
Re: Defense Range v4.0
could you make the values dynamic?
Re: Defense Range v4.0
Thx for the fix :)
- CarRepairer
- Cursed Zero-K Developer
- Posts: 3359
- Joined: 07 Nov 2007, 21:48
Re: Defense Range v4.0
Hey, verybadsoldier. I made a ticket on caspring about the widget. Apparently you are setting gl.blending somewhere and you need to turn it off. As I can't live without defenseranges, you must fix!
http://trac.caspring.org/ticket/709

http://trac.caspring.org/ticket/709
- very_bad_soldier
- Posts: 1397
- Joined: 20 Feb 2007, 01:10
Re: Defense Range v4.0
Damn, sorry
But I was not able to reproduce. The only calls to gl.Blending were in the function DrawGhosts, so only got called when drawing ghosts for nanoframes.
But since they were useless anyway and were only still there by mistake they are totally gone now, maybe have try.
If you still got the same error maybe you could supply further information on how to reproduce?
Glad you like it
And thanks for error report, its hard to test all these stuff in single player mode :/

But since they were useless anyway and were only still there by mistake they are totally gone now, maybe have try.
If you still got the same error maybe you could supply further information on how to reproduce?
Glad you like it

- Attachments
-
- gui_defenseRange.lua
- DR 4.11
- (33.92 KiB) Downloaded 154 times
- very_bad_soldier
- Posts: 1397
- Joined: 20 Feb 2007, 01:10
Re: Defense Range v4.0
Did it help? Any more bugs?
Re: Defense Range v4.0
It seems to have helped :) Works fine now..
Re: Defense Range v4.11
hi, could u fix it for nota (didnt test it with 4.11 yet)?
- very_bad_soldier
- Posts: 1397
- Joined: 20 Feb 2007, 01:10
Re: Defense Range v4.11
Just ask if you have probs to make it work with a mod. Maybe I can even take a look at it, but you will have to explain how you can distinguish between air and ground firing units.
Btw.: The green ghosted buildings are buggy, they dont disappear. I will upload a fixed version maybe later when I did some tests.
Btw.: The green ghosted buildings are buggy, they dont disappear. I will upload a fixed version maybe later when I did some tests.
Re: Defense Range v4.11
Hmm, I can't seem to get the unitlist file to work. I add an entry for my unit, but the unit is never marked or shown.
- very_bad_soldier
- Posts: 1397
- Joined: 20 Feb 2007, 01:10
Re: Defense Range v4.11
Hm, you have set useUnitFile to "true" in the widget right? If its so, you could send me your unitFile and I take a look. Maybe its a bug since its not tested very well. Please send to robin at dronezone.de
btw, which mod is it?
btw, which mod is it?
Re: Defense Range v4.11
I'm trying to adapt your widget for use with War Evolution. I've set useUnitFile to true.very_bad_soldier wrote:Hm, you have set useUnitFile to "true" in the widget right? If its so, you could send me your unitFile and I take a look. Maybe its a bug since its not tested very well. Please send to robin at dronezone.de
btw, which mod is it?
Here's the unitFile:
Code: Select all
unitList["cutter"] = { 1, "Cutter"}
--Fill this list with your units
-- First column is the type:
-- 1 Ground
-- 2 Air
-- 3 AntiNuke
-- 4 Ground + Air capable
-- Second column is the marker column
-- put in "nil" to not use markers
-- or put in "AntiNuke" to label the marker AntiNuke
--example entries
--unitList["armllt"] = { 1, nil}
--unitList["armsilo"] = { 1, "Nukee"}