Unit Auto Repair Widget

Unit Auto Repair Widget

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

Moderator: Moderators

User avatar
thesleepless
Posts: 417
Joined: 24 Oct 2007, 04:49

Unit Auto Repair Widget

Post by thesleepless » 29 Dec 2008, 01:53

ok, just made a Unit Auto Repair Widget

http://spring.jobjol.nl/show_file.php?id=1654

any unit with repair ability in the vicinity of a damaged unit will repair it, even if it's moving, but not if it's building something.

Known Issues

If the repair unit is set to repeat it'll repeat the repair order forever, not sure how to fix this... I need to remove the order somehow after the repair is completed.

Selection of which unit to repair is currently just based on distance, it should probably be based on the value and health of the damaged unit

But this means you can send con/repair units with your main attack force and they'll repair any combat units that get damaged as they go

It'd be nice to be able to add an AutoRepair toggle button for the unit, is this easy to do?
0 x

User avatar
overkill
Posts: 500
Joined: 02 Sep 2006, 01:15

Re: Unit Auto Repair Widget

Post by overkill » 29 Dec 2008, 02:51

oh wow, why hasnt this been made before? thanks mate.
0 x

Hacked
Posts: 116
Joined: 15 Aug 2008, 18:06

Re: Unit Auto Repair Widget

Post by Hacked » 29 Dec 2008, 06:34

this is great, the toggle would be ideal but this works just fine
this kind of functionality should be built in, but meh
0 x

User avatar
thesleepless
Posts: 417
Joined: 24 Oct 2007, 04:49

Re: Unit Auto Repair Widget

Post by thesleepless » 29 Dec 2008, 08:10

fixed a little bug which was causing it to kill itself when units died
0 x

User avatar
CarRepairer
Cursed Zero-K Developer
Posts: 3359
Joined: 07 Nov 2007, 21:48

Re: Unit Auto Repair Widget

Post by CarRepairer » 30 Jan 2009, 20:45

I'd like to stick this into CA. It would complement the retreat widget since I can take out the functionality that makes cons repeat+arearepair when placed in a retreat zone (which was annoying at times). Nice work.
0 x

User avatar
thesleepless
Posts: 417
Joined: 24 Oct 2007, 04:49

Re: Unit Auto Repair Widget

Post by thesleepless » 31 Jan 2009, 03:07

cool, go for it, i've noticed it dies during gameplay sometimes but haven't had time to debug it properly, but welcome to use and mod however you see fit
0 x

User avatar
CarRepairer
Cursed Zero-K Developer
Posts: 3359
Joined: 07 Nov 2007, 21:48

Re: Unit Auto Repair Widget

Post by CarRepairer » 01 Feb 2009, 03:35

thesleepless wrote:cool, go for it, i've noticed it dies during gameplay sometimes but haven't had time to debug it properly, but welcome to use and mod however you see fit
Don't worry, I'll debug it for you as I play and you can keep pulling it out of CA. :P

Fix #1: http://trac.caspring.org/changeset/3884
0 x

User avatar
lurker
Posts: 3842
Joined: 08 Jan 2007, 06:13

Re: Unit Auto Repair Widget

Post by lurker » 01 Feb 2009, 03:41

Car, you weren't on for me to yell at you earlier. This thing needs to not give orders to nanos. Especially orders out of reach.
0 x

Ashnal
Posts: 104
Joined: 24 Jun 2008, 00:57

Re: Unit Auto Repair Widget

Post by Ashnal » 01 Feb 2009, 03:42

It needs to ignore nanos completely, we have smart nanos for that.
0 x

Hacked
Posts: 116
Joined: 15 Aug 2008, 18:06

Re: Unit Auto Repair Widget

Post by Hacked » 01 Feb 2009, 06:56

+1
it causes nanos on patrol to repair units/reclaim wrecks 50 miles away from them
0 x

Ashnal
Posts: 104
Joined: 24 Jun 2008, 00:57

Re: Unit Auto Repair Widget

Post by Ashnal » 01 Feb 2009, 08:15

I fixed it in the CA version, it ignores nanos now
0 x

User avatar
Beherith
Moderator
Posts: 4933
Joined: 26 Oct 2007, 16:21

Re: Unit Auto Repair Widget

Post by Beherith » 01 Feb 2009, 11:27

How is this better than setting my cons to repeat on + area repair?
0 x

User avatar
lurker
Posts: 3842
Joined: 08 Jan 2007, 06:13

Re: Unit Auto Repair Widget

Post by lurker » 01 Feb 2009, 11:34

Area repair doesn't work so hot on cons mixed into battle groups.
0 x

User avatar
Hoi
Posts: 2912
Joined: 13 May 2008, 16:51

Re: Unit Auto Repair Widget

Post by Hoi » 01 Feb 2009, 11:35

The widget sees everything, and does everything very fast, you don't :wink:
0 x

User avatar
thesleepless
Posts: 417
Joined: 24 Oct 2007, 04:49

Re: Unit Auto Repair Widget

Post by thesleepless » 01 Feb 2009, 17:29

lurker wrote:Area repair doesn't work so hot on cons mixed into battle groups.
hmm this is what i originally designed it to do, what's the problem?
0 x

Hacked
Posts: 116
Joined: 15 Aug 2008, 18:06

Re: Unit Auto Repair Widget

Post by Hacked » 01 Feb 2009, 17:42

i think he was defending your widget saying that ordinary area repair isnt efficient
0 x

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

Re: Unit Auto Repair Widget

Post by very_bad_soldier » 01 Feb 2009, 18:57

Widget is nice but I often have problems with builders stopping their normal build-task to repair some nearby units. Is this intended? I thought only idle builders would be affected by this widget?
0 x

User avatar
CarRepairer
Cursed Zero-K Developer
Posts: 3359
Joined: 07 Nov 2007, 21:48

Re: Unit Auto Repair Widget

Post by CarRepairer » 02 Feb 2009, 02:25

very_bad_soldier wrote:Widget is nice but I often have problems with builders stopping their normal build-task to repair some nearby units. Is this intended? I thought only idle builders would be affected by this widget?
That shouldn't be, I assume. There will be kinks to work out.
0 x

User avatar
hunterw
Posts: 1838
Joined: 14 May 2006, 12:22

Re: Unit Auto Repair Widget

Post by hunterw » 03 Feb 2009, 02:48

very_bad_soldier wrote:Widget is nice but I often have problems with builders stopping their normal build-task to repair some nearby units. Is this intended? I thought only idle builders would be affected by this widget?
This. Love the widget and will still use it despite this, but fix please!!
0 x

User avatar
CarRepairer
Cursed Zero-K Developer
Posts: 3359
Joined: 07 Nov 2007, 21:48

Re: Unit Auto Repair Widget

Post by CarRepairer » 03 Feb 2009, 16:37

I'll fix it tonight.
0 x

Post Reply

Return to “Lua Scripts”