Area Mex
Moderator: Moderators
-
- Moderator
- Posts: 2464
- Joined: 12 Oct 2007, 09:24
Area Mex
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.
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.
- Attachments
-
- cmd_area_mex_no_button.lua
- (10.65 KiB) Downloaded 50 times
-
- cmd_area_mex.lua
- (10.62 KiB) Downloaded 60 times
Last edited by Google_Frog on 27 Feb 2009, 05:28, edited 5 times in total.
- Forboding Angel
- Evolution RTS Developer
- Posts: 14673
- Joined: 17 Nov 2005, 02:43
Re: Area Mex
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
-
- Moderator
- Posts: 2464
- Joined: 12 Oct 2007, 09:24
Re: Area Mex
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
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.
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.
-
- Moderator
- Posts: 2464
- Joined: 12 Oct 2007, 09:24
Re: Area Mex
Thanks. That was the problem.
-
- Moderator
- Posts: 2464
- Joined: 12 Oct 2007, 09:24
Re: Area Mex
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.
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
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
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
-
- Moderator
- Posts: 2464
- Joined: 12 Oct 2007, 09:24
Re: Area Mex
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.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
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.
- CarRepairer
- Cursed Zero-K Developer
- Posts: 3359
- Joined: 07 Nov 2007, 21:48
Re: Area Mex
I made that entire gadget from start to finish, so you're welcome.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.
Re: Area Mex
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
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
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?
-
- Moderator
- Posts: 2464
- Joined: 12 Oct 2007, 09:24
Re: Area Mex
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.
- CarRepairer
- Cursed Zero-K Developer
- Posts: 3359
- Joined: 07 Nov 2007, 21:48
Re: Area Mex
I don't even remember if I added such an escape or not, I'll have to check.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?
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.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.
- CarRepairer
- Cursed Zero-K Developer
- Posts: 3359
- Joined: 07 Nov 2007, 21:48
Re: Area Mex
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
Fixed. Think of the ending remark now as incentive.
-
- Moderator
- Posts: 2464
- Joined: 12 Oct 2007, 09:24
Re: Area Mex
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.
Car, I've edited the first post so people don't get confused and I'll look into some anti freeze for metal maps.
- CarRepairer
- Cursed Zero-K Developer
- Posts: 3359
- Joined: 07 Nov 2007, 21:48
Re: Area Mex
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.
-
- Moderator
- Posts: 2464
- Joined: 12 Oct 2007, 09:24
Re: Area Mex
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
It caused big lagspikes for me so i stoped using it. Would love button free working vers .. i have hotkey ctrl+rGoogle_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.
ty.