Area Mex - Page 3

Area Mex

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

Moderator: Moderators

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

Re: Area Mex

Post by Ashnal »

1v0ry_k1ng wrote:it does on comet

much as I love manually placing 9000 metal extractors
Apparently there are people who enjoy the task of placing tons of metal extractors. Regret is one of them.
User avatar
phi711
Posts: 12
Joined: 12 May 2009, 21:48

Re: Area Mex

Post by phi711 »

Hello :-)
I want try this widget but it don't run. :(
I download the file cmd_area_mex.lua , put it in the folder C:\Program Files\Spring\LuaUI\Widgets and after I write
bind ctrl+w areamex in the file uikeys.txt.
In the game : BA 6.92 I can't see a area when I press ctrl+w with my commander.

Do you have a idea ?
Thank you
User avatar
CarRepairer
Cursed Zero-K Developer
Posts: 3359
Joined: 07 Nov 2007, 21:48

Re: Area Mex

Post by CarRepairer »

phi711 wrote:Hello :-)
I want try this widget but it don't run. :(
I download the file cmd_area_mex.lua , put it in the folder C:\Program Files\Spring\LuaUI\Widgets and after I write
bind ctrl+w areamex in the file uikeys.txt.
In the game : BA 6.92 I can't see a area when I press ctrl+w with my commander.

Do you have a idea ?
Thank you
After you pressed ctrl-w, did you try to click and drag? You should see a gray circle as you drag.
User avatar
phi711
Posts: 12
Joined: 12 May 2009, 21:48

Re: Area Mex

Post by phi711 »

Yes I drag but I see nothing (not like when I press attack for example).
jorenm
Posts: 13
Joined: 01 Dec 2005, 03:57

Re: Area Mex

Post by jorenm »

I hit my hotkey, and it gives the repair icon, then I click drag and it draws a grey circle, but when I release nothing happens.
User avatar
CarRepairer
Cursed Zero-K Developer
Posts: 3359
Joined: 07 Nov 2007, 21:48

Re: Area Mex

Post by CarRepairer »

jorenm wrote:I hit my hotkey, and it gives the repair icon, then I click drag and it draws a grey circle, but when I release nothing happens.
Did you do it over a metal spot(s)?
jorenm
Posts: 13
Joined: 01 Dec 2005, 03:57

Re: Area Mex

Post by jorenm »

Did you do it over a metal spot(s)?
Uh, yes.

This was on my friends computer. I put it on my computer, and it doesn't even show the repair icon or let me drag a circle. I used /keydebug and it's bound to the right action.
Gedanken
Posts: 121
Joined: 13 Oct 2008, 02:57

Re: Area Mex

Post by Gedanken »

Will this ever be fixed for metal maps? It is indeed one of the handiest macro widgets out there, it is just a shame it doesn't work with metal maps (crashes at Loading LuaUI). I have tried the latest version and the no button version, but to no avail. (This is with BA btw)
User avatar
NTG
Posts: 23
Joined: 15 Nov 2008, 12:49

Re: Area Mex

Post by NTG »

Gedanken wrote:Will this ever be fixed for metal maps? It is indeed one of the handiest macro widgets out there, it is just a shame it doesn't work with metal maps (crashes at Loading LuaUI).
you mean it crashes/blocks game or simply that widget unloads?
if first one, try the one i attached - you can run it on any map, but it may auto-remove if there are many metal spots because i lowered max metal spots value.
if that's the second option, open widget in any text editor, find line 285 (by default: if #metalData > 250000 then) and change the value... the higher value, the more maps it should support, but also the more spots, the longer it loads... perhaps it needs some new mex detecting algorithm - i haven't seen any PC capable of running areamex on SheerMetal (20x20, mex radius 2) with some reasonable loading speed :(
Attachments
cmd_area_mex_no_button.lua
(8.23 KiB) Downloaded 32 times
User avatar
CarRepairer
Cursed Zero-K Developer
Posts: 3359
Joined: 07 Nov 2007, 21:48

Re: Area Mex

Post by CarRepairer »

If you're talking about metal maps where the mex radius is minimal, it's useless. You wouldn't need it as you could drag out a grid of mexes.

If you're talking about a map like Azure Rampart (full metal but the mex radius is large), it does indeed work with it. I've used it.
User avatar
NTG
Posts: 23
Joined: 15 Nov 2008, 12:49

Re: Area Mex

Post by NTG »

i mean the moment when i switch from normal map to huge metal map with small radius... it's pretty hard to choose proper value so script won't work for long (on default settings script loads few times longer than pathing - sometimes i'm missing forcing game part)... perhaps it's just a matter of selecting proper value so it works on most of metal maps and loads really fast - haven't got enough time for more than scratching one zero - now loads really fast and works as should on normal maps, but i haven't tested it on any metal map if it won't auto-disable.
User avatar
1v0ry_k1ng
Posts: 4656
Joined: 10 Mar 2006, 10:24

Re: Area Mex

Post by 1v0ry_k1ng »

Ashnal wrote:
1v0ry_k1ng wrote:it does on comet

much as I love manually placing 9000 metal extractors
Apparently there are people who enjoy the task of placing tons of metal extractors. Regret is one of them.
I have no qualms with the sadomasochism of others
Pako
Posts: 174
Joined: 12 Jul 2009, 18:57

Re: Area Mex

Post by Pako »

NTG wrote:i mean the moment when i switch from normal map to huge metal map with small radius... it's pretty hard to choose proper value so script won't work for long (on default settings script loads few times longer than pathing - sometimes i'm missing forcing game part)... perhaps it's just a matter of selecting proper value so it works on most of metal maps and loads really fast - haven't got enough time for more than scratching one zero - now loads really fast and works as should on normal maps, but i haven't tested it on any metal map if it won't auto-disable.
I fixed that with following code:

if Spring.GetGameFrame()<10 and (string.find(string.lower(Game.mapName),"metal") or string.find(string.lower(Game.mapName),"speed")) then
Spring.Echo("<Mex Helper> Disabled Area Mex, 'metal' or 'speed' found in map name.")
else
AnalyzeMetalMap()
end
Gedanken
Posts: 121
Joined: 13 Oct 2008, 02:57

Re: Area Mex

Post by Gedanken »

Nice, yeah - needs a few more checks ofc 'dividing' and 'uberpwn' etc. Are you guys saying that it just takes a long time to load at "Loading LuaUI" on metal maps? I have never stuck around to see it load because I assumed it never would
Google_Frog
Moderator
Posts: 2464
Joined: 12 Oct 2007, 09:24

Re: Area Mex

Post by Google_Frog »

I already stops if it detects too many metal 'patches' (very large on a metal map). Maybe you don't have the latest version.
User avatar
MidKnight
Posts: 2652
Joined: 10 Sep 2008, 03:11

Re: Area Mex

Post by MidKnight »

why isn't this in CA anymore? :|
Google_Frog
Moderator
Posts: 2464
Joined: 12 Oct 2007, 09:24

Re: Area Mex

Post by Google_Frog »

MidKnight wrote:why isn't this in CA anymore? :|
Broke for some people.
Gedanken
Posts: 121
Joined: 13 Oct 2008, 02:57

Re: Area Mex

Post by Gedanken »

Google_Frog wrote:I already stops if it detects too many metal 'patches' (very large on a metal map). Maybe you don't have the latest version.
Yes I have latest as I said - guess it will just not work
User avatar
NTG
Posts: 23
Joined: 15 Nov 2008, 12:49

Re: Area Mex

Post by NTG »

Pako wrote:I fixed that with following code:

if Spring.GetGameFrame()<10 and (string.find(string.lower(Game.mapName),"metal") or string.find(string.lower(Game.mapName),"speed")) then
Spring.Echo("<Mex Helper> Disabled Area Mex, 'metal' or 'speed' found in map name.")
else
AnalyzeMetalMap()
end
i have another idea- LUA got interface to handle files. if map got pretty much metal data (i guess range of values would be best here), it could simply save it to file after analysis and, on start/initializing of script, check if file exists - yes- load mexes positions from file, no- begin analysis... but your code should work nice too :)

[EDIT]
i guess i'm better and better - widget works almost perfectly now.
let's make example of SpeedMetal:
- 653 mex spots found
- loading without file - not less than 2-3 mins - later i left room
- loading with file - less than 1s
- cache file size - 20.3kB
- also, since data is cached, you can manually add some spots if script missed some (and you're maniac) - file saved in text mode

well, too bad i used writing in text mode - binary would be faster and would take half this HDD space... well, it's my first day with LUA :P

in first lines of script you should see:

Code: Select all

local maxMetalData = 2500000
local pathToSave = "LuaUI/Widgets/MetalMaps/" -- where to store mexmaps
first variable tells how much data script may process (default value * 10), second is the path to storage dir (WARNING: DIRECTORY MUST EXIST!!! well, i couldn't find any info about making directories)
i also added support for XTA

i'm waiting for your feedback :roll:

[EDIT]
thanks to SirMaverick i added creation of dir if it doesn't exist so you don't need to care about that warning any more.
hint from Regret about shipping it with LUA was good as well :)

[EDIT]
original script maker forgot to add EE as short name for Expand & Exterminate (strange, in previous versions it was) -- fixed
Attachments
AreaMex.rar
modified AreaMex + MexMap for SpeedMetal (takes long to load that map for first time without it), modified to work on Linux too...
(11.89 KiB) Downloaded 34 times
Last edited by NTG on 12 Sep 2009, 16:35, edited 2 times in total.
User avatar
NTG
Posts: 23
Joined: 15 Nov 2008, 12:49

Re: Area Mex

Post by NTG »

screen for SpeedMetal + msg to bring topic back on top - on original phpBB editions of last post doesn't mark changes last post date :(

Image

PS: i was wondering why script makes so huge spaces between mexes - is there any minimal radius for analyser?
Attachments
SMscreen.jpg
SpeedMetal screen
(171.07 KiB) Downloaded 90 times
Post Reply

Return to “Lua Scripts”