Page 1 of 7

Area Mex

Posted: 07 Feb 2009, 05:35
by Google_Frog
Area Mex with Button
Area Mex without Button
Warning, only springfiles mirror provides correct version.

A widget I've been wanting to make for a while. I got around to it after recently playing a 3 way FFA on Conquer Isle and noticing that 50% of the map was uncapped just because of how much clicking it would take to make all those mexes.

This widget gives all selected mex constructors orders to create mexes in the defined circle. It's has basic path optimization that should find the best path most of the time and other times it's not far off.

The mex button needs ca_layout.lua to appear properly or it might appear in a strange place or not appear at all. The command can be bound with uikeys.txt though regardless of having ca_layout.lua with the command 'areamex' eg. 'bind ctrl+w areamex'.

It uses the mex detection code from easymetal by carrepairer.

v1.6 Added multiple mexes per constructor (underwater mexes).
v2.1 Merged with NTG file handling.

Attachments in case spring files fails.

Re: Area Mex

Posted: 07 Feb 2009, 05:50
by Forboding Angel
oi yes, this is a wonderful thing to have. Is there any way that someone could figure out what all is needed to make the button display correctly? Surely just for a button a particular layout wouldn't be needed O_O

Re: Area Mex

Posted: 07 Feb 2009, 06:33
by Google_Frog
CALayout doesn't do much. It adds lua commands into the command menu in the right order. Just extract it from ca.sdz, I'll probably get around to adding the relevant bit of CALayout to area mex if I'm not too lazy though.

Re: Area Mex

Posted: 07 Feb 2009, 07:15
by Niobium
To fix your shift-required problem all you need to do is add 'return true' at the very end of the CommandNotify function.

Basically returning true tells spring that you've taken care of the CMD_AREA_MEX order and spring itself doesn't need to do anything. If you don't return true, spring continues and issues the CMD_AREA_MEX order to the unit. If shift was held, the command gets added to end of queue and the mex queue remains. If shift isn't held down, the new command overwrites previous queue (As happens with any order without shift held), but because CMD_AREA_MEX doesn't do anything by itself, the unit just stands there.

I'm 95% sure that will fix your problem and that my understanding of CommandNotify is correct.

Re: Area Mex

Posted: 07 Feb 2009, 07:23
by Google_Frog
Thanks. That was the problem.

Re: Area Mex

Posted: 07 Feb 2009, 09:31
by Google_Frog
Updated v1.2
Units which can't make mexes no longer show the command when selected.

Edit: Editing my uploads on JJ doesn't seem to be working.

Re: Area Mex

Posted: 07 Feb 2009, 12:09
by ginekolog
this widget wil be good but it has some troubles:

1. It keeps saying
[ 375] /give all
[ 678] /give 20 coraca
[ 680] Giving 20 coraca to team 0
[ 724] GetLuaCmdDescList() non "actions" table: pos
[ 724] GetLuaCmdDescList() non "actions" table: params
[ 1313] GetLuaCmdDescList() non "actions" table: pos
[ 1313] GetLuaCmdDescList() non "actions" table: params


2. With many units it gives big lag spikes every ~10 sec.

3. I suggest u to add also T2 cons units for ba, i added:
mexIds[UnitDefNames['armmoho'].id] = UnitDefNames['armmoho'].id
mexIds[UnitDefNames['cormoho'].id] = UnitDefNames['cormoho'].id

Re: Area Mex

Posted: 07 Feb 2009, 14:22
by Google_Frog
ginekolog wrote:this widget wil be good but it has some troubles:

1. It keeps saying
[ 375] /give all
[ 678] /give 20 coraca
[ 680] Giving 20 coraca to team 0
[ 724] GetLuaCmdDescList() non "actions" table: pos
[ 724] GetLuaCmdDescList() non "actions" table: params
[ 1313] GetLuaCmdDescList() non "actions" table: pos
[ 1313] GetLuaCmdDescList() non "actions" table: params


2. With many units it gives big lag spikes every ~10 sec.

3. I suggest u to add also T2 cons units for ba, i added:
mexIds[UnitDefNames['armmoho'].id] = UnitDefNames['armmoho'].id
mexIds[UnitDefNames['cormoho'].id] = UnitDefNames['cormoho'].id
I think the non "actions" are because you don't have calayout which is a widget that supports adding buttons to the interface with lua.

With the lag spikes I tried giving all then telling 20 aircons to make mexes all over tablua and I didn't get anything more than normal lag. Though if I had all the units selected the game froze for a second or two. The time between you giving the command and seeing the commands appear will be your ping just like every other command.

Re: Area Mex

Posted: 09 Feb 2009, 01:19
by CarRepairer
Google_Frog wrote:It uses the mex detection code from easymetal by carrepairer but I don't think car made it so thanks to whoever made the mex detection code.
I made that entire gadget from start to finish, so you're welcome.

Re: Area Mex

Posted: 09 Feb 2009, 15:14
by 1v0ry_k1ng
:-) :-) :-) :-)

Re: Area Mex

Posted: 10 Feb 2009, 06:37
by Niobium
Sounds like a great widget, however when I have it enabled my fps will occasionally fall to 1 for no apparent reason, even with as little as 3 units on the entire map, and thats without ever issuing an area mex command :l

Maybe it's just a conflict with my particular setup, but it only ever happens with your widget enabled. So I don't know. Tested with CA as well as BA with ca layout

Re: Area Mex

Posted: 10 Feb 2009, 13:49
by lurker
If he took car's code, then why is the lockup-escape clause not kicking in on metal maps, and spring freezing? Did car remove it or is it not trying hard enough?

Re: Area Mex

Posted: 11 Feb 2009, 07:16
by Google_Frog
Sorry about that car. When looking through the code I saw the mex spots were called flags instead of mexes so assumed it came from one of those mods that use flags.

Re: Area Mex

Posted: 11 Feb 2009, 17:31
by CarRepairer
lurker wrote:If he took car's code, then why is the lockup-escape clause not kicking in on metal maps, and spring freezing? Did car remove it or is it not trying hard enough?
I don't even remember if I added such an escape or not, I'll have to check.
Google_Frog wrote:Sorry about that car. When looking through the code I saw the mex spots were called flags instead of mexes so assumed it came from one of those mods that use flags.
Well yeah perhaps s44 was in my mind when I was naming the "spots" since they use metal spots as "flags" to capture. But I didn't even bother looking at their code since I preferred to make my own - which I assume would be obvious when looking at it. s44 was part the inspiration though.

Re: Area Mex

Posted: 15 Feb 2009, 17:39
by CarRepairer
Thanks, the "I don't think car made it" has now propagated over to springinfo.info. Wanna fix that sometime this decade?

Re: Area Mex

Posted: 16 Feb 2009, 02:28
by lurker
Fixed. Think of the ending remark now as incentive.

Re: Area Mex

Posted: 16 Feb 2009, 06:34
by Google_Frog
Update: The command is now a circle not a square. Download from the JJ mirror because darkstars seems to take a while to update.

Car, I've edited the first post so people don't get confused and I'll look into some anti freeze for metal maps.

Re: Area Mex

Posted: 16 Feb 2009, 08:39
by CarRepairer
I think the reason I never took the time to care is because I made it for a mod option so it would only be used for the right maps. Now that it's a widget it's a different story.

Re: Area Mex

Posted: 26 Feb 2009, 11:45
by Google_Frog
I think the way I was placing the button using CAlayout was causing the lag spikes for some people. The button no longer shows up but I don't mind because I have a hotkey for it, idk if people want a button-free version though.

Re: Area Mex

Posted: 26 Feb 2009, 13:07
by ginekolog
Google_Frog wrote:I think the way I was placing the button using CAlayout was causing the lag spikes for some people. The button no longer shows up but I don't mind because I have a hotkey for it, idk if people want a button-free version though.
It caused big lagspikes for me so i stoped using it. Would love button free working vers .. i have hotkey ctrl+r ;)

ty.