"Local mexes" widget 1.0

"Local mexes" widget 1.0

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

Moderators: Moderators, Moderators

Post Reply
jetbird
Posts: 18
Joined: 21 Oct 2014, 13:19

"Local mexes" widget 1.0

Post 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.
0 x

jetbird
Posts: 18
Joined: 21 Oct 2014, 13:19

Re: "Local mexes" widget 1.0

Post 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
0 x

User avatar
PicassoCT
Journeywar Developer & Mapper
Posts: 10306
Joined: 24 Jan 2006, 21:12

Re: "Local mexes" widget 1.0

Post by PicassoCT »

wow
0 x

User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14636
Joined: 17 Nov 2005, 02:43

Re: "Local mexes" widget 1.0

Post 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
0 x

jetbird
Posts: 18
Joined: 21 Oct 2014, 13:19

Re: "Local mexes" widget 1.0

Post 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?
0 x

User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14636
Joined: 17 Nov 2005, 02:43

Re: "Local mexes" widget 1.0

Post 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.
0 x

jetbird
Posts: 18
Joined: 21 Oct 2014, 13:19

Re: "Local mexes" widget 1.0

Post 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?
0 x

User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14636
Joined: 17 Nov 2005, 02:43

Re: "Local mexes" widget 1.0

Post by Forboding Angel »

You never made an excludedUnits array, Bad JetBird! :cry:
0 x

User avatar
jamerlan
Balanced Annihilation Developer
Posts: 683
Joined: 20 Oct 2009, 13:04

Re: "Local mexes" widget 1.0

Post by jamerlan »

I just tried.. and this widget is present in the list, all ok
0 x

jetbird
Posts: 18
Joined: 21 Oct 2014, 13:19

Re: "Local mexes" widget 1.0

Post 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.
0 x

jetbird
Posts: 18
Joined: 21 Oct 2014, 13:19

Re: "Local mexes" widget 1.0

Post by jetbird »

v1.2.2 (bug fix release) demo:
https://youtu.be/AYycDfjPQ2k
0 x

User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14636
Joined: 17 Nov 2005, 02:43

Re: "Local mexes" widget 1.0

Post 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.
0 x

jetbird
Posts: 18
Joined: 21 Oct 2014, 13:19

Re: "Local mexes" widget 1.0

Post 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 :)
0 x

Post Reply

Return to “Lua Scripts”