Page 1 of 1

"Local mexes" widget 1.0

Posted: 01 May 2015, 12:25
by jetbird
Hi!

I finally created 1.0 version of my very first widget, "Local mexes". It's purpose is to (re-)build mexes inside the perimeter of your base (using idle air/water/ground constructors). The perimeter is calculated automatically as the base grows.

See the video:
http://www.youtube.com/watch?v=WtyR-42I ... e=youtu.be
Early version video: http://www.youtube.com/watch?v=muKukY6UIzM

Local mexes on github: https://github.com/jet-bird/local-mexes
Direct download link: https://github.com/jet-bird/local-mexes ... e/v1.0.zip

Installation: place localmexes.lua into your widgets directory.

Re: "Local mexes" widget 1.0

Posted: 08 May 2015, 12:20
by jetbird
In new version constructors operate in a whole "team" perimeter of your allies. For the clarity it's vizualized with transparent polygon:
Image

https://github.com/jet-bird/local-mexes ... ag/v1.2.1b

Re: "Local mexes" widget 1.0

Posted: 08 May 2015, 12:49
by PicassoCT
wow

Re: "Local mexes" widget 1.0

Posted: 08 May 2015, 20:59
by Forboding Angel

Code: Select all

local armComUDId = UnitDefNames["armcom"].id
local coreComUDId = UnitDefNames["corcom"].id
It is not wise to do it this way. Make an excluded units array and do that. Not all games use arm or core commanders. Better to use an array like:

Code: Select all

excludedUnits = {
    ecommander, //evo's commander name
    armcom, // *a commander name
    corecom, // *a commander name
    yomomma // because she's a big bitch
}

Code: Select all

-- exclude commanders
	if ud == nil or udid == armComUDId or udid == coreComUDId then
		return false
	end
Use an array instead. Far more robust and less prone to future failure.

https://github.com/jet-bird/local-mexes/issues/8

Re: "Local mexes" widget 1.0

Posted: 09 May 2015, 11:33
by jetbird
Forboding Angel wrote: Use an array instead. Far more robust and less prone to future failure.
https://github.com/jet-bird/local-mexes/issues/8
Thank you for this little code review. Is there a widget (for example) with all commander names for all games placed in array for exclusion?

Re: "Local mexes" widget 1.0

Posted: 09 May 2015, 11:35
by Forboding Angel
Honestly there is no need. in your array by default you can just have armcom and corecom, and the user/gamedev can add others as needed.

local excludedUnits = {} Is really pretty self explanatory, but you could leave a little comment next to it explaining the purpose of the array.

Re: "Local mexes" widget 1.0

Posted: 17 Jul 2015, 11:55
by jetbird
Strange, but in new BA 8.18/Spring 100 I don't see my widget in the list of widgets. Does anybody know if there were some breaking changes?

Re: "Local mexes" widget 1.0

Posted: 17 Jul 2015, 12:43
by Forboding Angel
You never made an excludedUnits array, Bad JetBird! :cry:

Re: "Local mexes" widget 1.0

Posted: 17 Jul 2015, 12:58
by jamerlan
I just tried.. and this widget is present in the list, all ok

Re: "Local mexes" widget 1.0

Posted: 17 Jul 2015, 14:47
by jetbird
Forboding Angel wrote:You never made an excludedUnits array, Bad JetBird! :cry:
Sorry for that , but I was trying to fix the bug with perimeter: https://github.com/spike-spb/local-mexes/issues/9, it's not so easy as I thought.

Re: "Local mexes" widget 1.0

Posted: 19 Jul 2015, 22:27
by jetbird
v1.2.2 (bug fix release) demo:
https://youtu.be/AYycDfjPQ2k

Re: "Local mexes" widget 1.0

Posted: 19 Jul 2015, 23:29
by Forboding Angel
It works differently in your demo than I thought. That's not a bad thing, but it begs the question, why not allow the player to set the perimeter manually as well? That would be a lot more useful than ONLY relying on your outer mexes not getting asploded/built.

Re: "Local mexes" widget 1.0

Posted: 19 Jul 2015, 23:50
by jetbird
Forboding Angel wrote:It works differently in your demo than I thought. That's not a bad thing, but it begs the question, why not allow the player to set the perimeter manually as well? That would be a lot more useful than ONLY relying on your outer mexes not getting asploded/built.
Maybe this will be implemented in future versions :)