Area reclaim: only metal or energy?

Area reclaim: only metal or energy?

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

Moderator: Moderators

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

Area reclaim: only metal or energy?

Post by TradeMark »

is there such widget made already?

if not, could someone make it?

just annoying to make area reclaim when i need E but not M, and the other way around.
BaNa
Posts: 1562
Joined: 09 Sep 2007, 21:05

Re: Area reclaim: only metal or energy?

Post by BaNa »

TradeMark wrote:is there such widget made already?

if not, could someone make it?

just annoying to make area reclaim when i need E but not M, and the other way around.
Seconded, this is very much needed. Perhaps it could be done in a way that the con reclaims all the m in the area first and then the e?
Warlord Zsinj
Imperial Winter Developer
Posts: 3742
Joined: 24 Aug 2004, 08:59

Re: Area reclaim: only metal or energy?

Post by Warlord Zsinj »

This should be default behaviour, imo.

In supcom, units will only automatically harvest resources while on patrol if you have less than full storages, and they will always prioritise the resource you have less of.
User avatar
TradeMark
Posts: 4867
Joined: 17 Feb 2006, 15:58

Re: Area reclaim: only metal or energy?

Post by TradeMark »

some shortkey would be nice, like when i press SHIFT at the same time when i am doing area reclaim, it would reclaim only that type of stuff. for example, if i click on a tree, and drag it to make area reclaim, it would reclaim only stuff which gives E, and if i click on metal thing, it would reclaim only metal, and if i click on thing which gives both, it would reclaim only those which gives both.

OR two shortkeys, CTRL+mouse for metal and SHIFT+mouse for energy! then i can always adjust my diet as i want it to be.
BaNa
Posts: 1562
Joined: 09 Sep 2007, 21:05

Re: Area reclaim: only metal or energy?

Post by BaNa »

TradeMark wrote:some shortkey would be nice, like when i press SHIFT at the same time when i am doing area reclaim, it would reclaim only that type of stuff. for example, if i click on a tree, and drag it to make area reclaim, it would reclaim only stuff which gives E, and if i click on metal thing, it would reclaim only metal, and if i click on thing which gives both, it would reclaim only those which gives both.

OR two shortkeys, CTRL+mouse for metal and SHIFT+mouse for energy! then i can always adjust my diet as i want it to be.

shift is probably fail for this because we wants to maek queue. but the press-drag thing is cool. That way if i select a rock and then drag, it will suck all rocks.
space is relatively unused tho.

Zsinj: your m should never be at full, if it is you are neebing out anyway, so no need for spring to help with that :D
User avatar
aegis
Posts: 2456
Joined: 11 Jul 2007, 17:47

Re: Area reclaim: only metal or energy?

Post by aegis »

done, except I can't figure out Spring.GiveOrderToUnit() for reclaim

the script intercepts reclaim commands and determines whether they are area reclaims

if it finds an area reclaim command, it gets the selected units and determines which are able to reclaim

it then indexes all of the features in the radius of the area reclaim and sorts into a metal and energy group and detects features intersecting the center

then it takes the last feature intersecting the center and checks its metal and energy remaining to see if it is a metal or energy feature (and if it provides both, it reverts to a normal reclaim)

if we are continuing with the smart reclaim, it then indexes all features we will reclaim and sorts them according to distance from each selected unit able to reclaim (using the units position including the move commands in the queue if any... this means each unit will reclaim closer features first)

it loops through the prepared data to reclaim (it has unit id to reclaim with and feature id to reclaim)

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

Re: Area reclaim: only metal or energy?

Post by aegis »

EDIT: source removed - nobody cares
Warlord Zsinj
Imperial Winter Developer
Posts: 3742
Joined: 24 Aug 2004, 08:59

Re: Area reclaim: only metal or energy?

Post by Warlord Zsinj »

Zsinj: your m should never be at full, if it is you are neebing out anyway, so no need for spring to help with that :D
o_O

I don't see how this relates to anything I said.
BaNa
Posts: 1562
Joined: 09 Sep 2007, 21:05

Re: Area reclaim: only metal or energy?

Post by BaNa »

Warlord Zsinj wrote: if you have less than full storages, and they will always prioritise the resource you have less of.
i guess i was kind of riffing off to this, but tbh I dont quite know why. Speedreading ftw, i may have just sort of misunderstood.
User avatar
aegis
Posts: 2456
Joined: 11 Jul 2007, 17:47

Re: Area reclaim: only metal or energy?

Post by aegis »

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

Re: Area reclaim: only metal or energy?

Post by TradeMark »

nobody cares?

what the fuck you think i made this thread up for
BaNa
Posts: 1562
Joined: 09 Sep 2007, 21:05

Re: Area reclaim: only metal or energy?

Post by BaNa »

aegis wrote:EDIT: source removed - nobody cares

:(

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

Re: Area reclaim: only metal or energy?

Post by aegis »

thank you everyone for your patience

the widget is here
Post Reply

Return to “Lua Scripts”