Smart Area Reclaim

Smart Area Reclaim

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

Moderator: Moderators

User avatar
aegis
Posts: 2456
Joined: 11 Jul 2007, 17:47

Smart Area Reclaim

Post by aegis »

Smart Area Reclaim:

When you area reclaim, it normally just grabs everything, no matter if you actually need energy or metal.
With this widget, when you area reclaim centered on a specific type of feature (energy or metal) it will only reclaim features of the type specified, starting with the ones closest to the unit.

In short: you won't reclaim metal when you need energy, and won't reclaim energy when you need metal.
You do this by basing an area reclaim around a feature with the type of resource you want to reclaim from.
This widget handles the rest.

v1.0
Basic functionality.

todo:
  • optimized reclaim sorting (don't zigzag)
  • resource prioritizing (if you're E stalling but have max M, go for E, and vice versa...)
  • for these, probably need to update after every reclaim
  • visual thingy?
  • hotkey to disable or enable
  • maybe a custom queue to look nicer

note: the center feature is decided by the base of the feature, even though you can reclaim from the top of a feature when your camera is at an angle
so use SelectionCircle or something and put your cursor inside the feature's base
Attachments
unit_smart_area_reclaim.lua
helps to attach things
(4.86 KiB) Downloaded 195 times
BaNa
Posts: 1562
Joined: 09 Sep 2007, 21:05

Re: Smart Area Reclaim

Post by BaNa »

Thank you, it is these types of player-helping things that make spring win.
User avatar
Crayfish
Posts: 481
Joined: 12 Feb 2008, 12:39

Re: Smart Area Reclaim

Post by Crayfish »

Wow, great idea. Does this look at your resource state and intelligently adjust to meet needs, or just keep going with the resource-type you started it on?
User avatar
TradeMark
Posts: 4867
Joined: 17 Feb 2006, 15:58

Re: Smart Area Reclaim

Post by TradeMark »

THANKS TO ME IT WAS MY IDEA!!!!! lol.

but yeah, its good.

this should be hardcoded in spring engine!

i still seek for that shortkey thing, SHIFT+ something = only metal and CTRL + something = only energy, etc.
because, sometimes i may want to reclaim EVERYTHING, to just clean the way for buildings and stufff.
User avatar
manolo_
Posts: 1370
Joined: 01 Jul 2008, 00:08

Re: Smart Area Reclaim

Post by manolo_ »

TradeMark wrote:THANKS TO ME IT WAS MY IDEA!!!!! lol.

but yeah, its good.

this should be hardcoded in spring engine!

i still seek for that shortkey thing, SHIFT+ something = only metal and CTRL + something = only energy, etc.
because, sometimes i may want to reclaim EVERYTHING, to just clean the way for buildings and stufff.
├â┬Âhm no :D
you: Post subject: Area reclaim: only metal or energy? PostPosted: 13 Aug 2008, 11:45

me: Post subject: Request: just reclaim metal lua PostPosted: 01 Jul 2008, 00:11

:P :P :P
User avatar
TradeMark
Posts: 4867
Joined: 17 Feb 2006, 15:58

Re: Smart Area Reclaim

Post by TradeMark »

WHAT, no, i gave this idea like year ago, but nobody responded or smthing


anyways, i was just being trollish/sarcastic, just nevermind me. i dont care who the fuck made the idea at the first place.
UAF
Posts: 96
Joined: 02 Jan 2008, 19:25

Re: Smart Area Reclaim

Post by UAF »

TradeMark wrote:anyways, i was just being trollish/sarcastic, just nevermind me. i dont care who the fuck made the idea at the first place.
As lonsg as it was you, right? :wink:
User avatar
aegis
Posts: 2456
Joined: 11 Jul 2007, 17:47

Re: Smart Area Reclaim

Post by aegis »

trademark: it still reclaims everything if you don't center the area reclaim on a tree or rock
User avatar
Gota
Posts: 7151
Joined: 11 Jan 2008, 16:55

Re: Smart Area Reclaim

Post by Gota »

Awsome.
User avatar
TradeMark
Posts: 4867
Joined: 17 Feb 2006, 15:58

Re: Smart Area Reclaim

Post by TradeMark »

aegis wrote:trademark: it still reclaims everything if you don't center the area reclaim on a tree or rock
wait, what distinguish tree from rock? yeah the metal or energy

so you mean, when i press area reclaim, without pressing it on a object, it reclaims everything?
Last edited by TradeMark on 15 Aug 2008, 22:03, edited 2 times in total.
User avatar
Hoi
Posts: 2917
Joined: 13 May 2008, 16:51

Re: Smart Area Reclaim

Post by Hoi »

if you do it on a corpse, it will reclaim all corpses, if you do it on a tree, it will reclaim all trees, ect
User avatar
very_bad_soldier
Posts: 1397
Joined: 20 Feb 2007, 01:10

Re: Smart Area Reclaim

Post by very_bad_soldier »

Sounds great! Nice1!
User avatar
TradeMark
Posts: 4867
Joined: 17 Feb 2006, 15:58

Re: Smart Area Reclaim

Post by TradeMark »

UAF wrote:
TradeMark wrote:anyways, i was just being trollish/sarcastic, just nevermind me. i dont care who the fuck made the idea at the first place.
As lonsg as it was you, right? :wink:
i do not fucking care okay
Hoi wrote:if you do it on a corpse, it will reclaim all corpses, if you do it on a tree, it will reclaim all trees, ect
yeah thats my point, what if i want to reclaim EVERY FUCKING THING no matter what? (forgive my bad language, i dont mean bad).
Gnomre
Imperial Winter Developer
Posts: 1754
Joined: 06 Feb 2005, 13:42

Re: Smart Area Reclaim

Post by Gnomre »

That's already been answered, jackass
User avatar
TradeMark
Posts: 4867
Joined: 17 Feb 2006, 15:58

Re: Smart Area Reclaim

Post by TradeMark »

yeah but then i cant just click on a feature. nevermind.
User avatar
Hoi
Posts: 2917
Joined: 13 May 2008, 16:51

Re: Smart Area Reclaim

Post by Hoi »

:/ click reclaim hover mouse over corpse hold shift hold left mouse and drag, simple
User avatar
Otherside
Posts: 2296
Joined: 21 Feb 2006, 14:09

Re: Smart Area Reclaim

Post by Otherside »

trademark stop trying to claim its your brainwave. Everyone has wanted or talked about something like this for ages it just took someone with some LUA knowledge to do it. You did nothing so stop trying to take credit.

good work aegis
User avatar
TradeMark
Posts: 4867
Joined: 17 Feb 2006, 15:58

Re: Smart Area Reclaim

Post by TradeMark »

it was just a joke...
User avatar
Otherside
Posts: 2296
Joined: 21 Feb 2006, 14:09

Re: Smart Area Reclaim

Post by Otherside »

TradeMark wrote:it was just a joke...
just cause your maps are a joke not everything you say or do is taken as a joke.

aegis whens the next version out so it can be implemented in CA
User avatar
aegis
Posts: 2456
Joined: 11 Jul 2007, 17:47

Re: Smart Area Reclaim

Post by aegis »

what meta keys should I use for enable/disable/force a certain resource?
Locked

Return to “Lua Scripts”