Page 1 of 1

[Request] Gadget to disallow building mexes on non-metal

Posted: 09 Jul 2010, 06:14
by Forboding Angel
spots.

Can this be done? I would like it to work very similar to how placing geothermals works.

Don't worry about maps without proper metal spots, this is for evo and while any map will technically work, it is designed to be played on maps with specific spots, so I don't care if it doesn't work on maps without proper metal patches.

Re: [Request] Gadget to disallow building mexes on non-metal

Posted: 09 Jul 2010, 06:22
by FLOZi
You can just kill the build order if the ground metal value is below some value, so technically yes.

Getting it to gel nicely with normal building placement is another issue, while there is a function to test if a build position is valid, there isn't one to control how that is determined - that I am aware of, anyway.

Re: [Request] Gadget to disallow building mexes on non-metal

Posted: 09 Jul 2010, 16:52
by CarRepairer
I made it years ago in CA. Hasn't been used once.

http://trac.caspring.org/wiki/GameOptions#EasyMetal

Re: [Request] Gadget to disallow building mexes on non-metal

Posted: 10 Jul 2010, 13:21
by Forboding Angel
It doesn't work and this appears in the infolog twice.

Code: Select all

[      0] Failed to load: easymetal2.lua  ([string "LuaRules/Gadgets/easymetal2.lua"]:14: attempt to call global 'tobool' (a nil value))
This:
Easy Metal ┬Â

Metal spots on the map are analyzed at the start of the game and flagged. The placement of mexes is restricted to only those spots, exactly the way geothermal plants are restricted. When building a mex, a snap-to lets you place it more easily on a flagged spot. This setting works well with the Area Mex widget.

The metalmap is replaced with a new one which shows a color-coded M and the name of whomever owns it.
Is nice because it tells you how it's supposed to work, but I don't know what to do to get it to work in the first place.

Re: [Request] Gadget to disallow building mexes on non-metal

Posted: 10 Jul 2010, 14:46
by FLOZi
tobool is part of CA's utilities package, http://trac.caspring.org/browser/trunk/ ... tobool.lua

Re: [Request] Gadget to disallow building mexes on non-metal

Posted: 10 Jul 2010, 20:20
by Forboding Angel
Added that file in the proper location. Still getting the same error in infolog.

:-(

Re: [Request] Gadget to disallow building mexes on non-metal

Posted: 10 Jul 2010, 23:47
by CarRepairer
Wrong gadget anyway. Easymetal2 was intended to integrate an areamex into the game and also allow a simple right click to build a mex, but it failed miserably (mostly due to engine lacking features). It is very different from easymetal.lua (1) which is now in evorts.

Re: [Request] Gadget to disallow building mexes on non-metal

Posted: 11 Jul 2010, 02:56
by Forboding Angel
Thanks Car.

Btw to anyone else wanting to give this a go, it's in EvoRTS now and should work for just about any game that uses mex spots.

Re: [Request] Gadget to disallow building mexes on non-metal

Posted: 11 Jul 2010, 13:16
by jK
The problem with "easy metal" is that it forces the player to build mexes always on the same places instead of giving him assistance to do so.

Re: [Request] Gadget to disallow building mexes on non-metal

Posted: 11 Jul 2010, 13:45
by Licho
I think thats ok. I would like ghosted structures on mex spots (appear when you select conbot) and you just right click to build.

I dont think that extra complexity of free placing extractors is worth it.

Currently its possible to place mexes around spot only because mappers make radius bigger to allow for mex and moho mex to go into same spot...

Re: [Request] Gadget to disallow building mexes on non-metal

Posted: 11 Jul 2010, 13:51
by jK
Licho wrote:I think thats ok. I would like ghosted structures on mex spots (appear when you select conbot) and you just right click to build.

I dont think that extra complexity of free placing extractors is worth it.

Currently its possible to place mexes around spot only because mappers make radius bigger to allow for mex and moho mex to go into same spot...
It's okay for mexspots maps, but it totally fails for maps with cloud metalmaps.

Re: [Request] Gadget to disallow building mexes on non-metal

Posted: 11 Jul 2010, 15:34
by AF
So how would I build a moho extractor or an armed extractor without reclaiming and loosing metal income?

Re: [Request] Gadget to disallow building mexes on non-metal

Posted: 11 Jul 2010, 16:37
by Licho
Its not for BA, request is for mods which don't have to think this way.

Re: [Request] Gadget to disallow building mexes on non-metal

Posted: 11 Jul 2010, 17:19
by AF
I use BA only as an example because it has the necessary units that come to mind first.

Instead it should snap not to the actual location of the spot, but to within a range of the spot that covers it, which would be far more flexible and convenient

Re: [Request] Gadget to disallow building mexes on non-metal

Posted: 11 Jul 2010, 18:10
by FLOZi
AF wrote:I use BA only as an example because it has the necessary units that come to mind first.

Instead it should snap not to the actual location of the spot, but to within a range of the spot that covers it, which would be far more flexible and convenient
For BA.

It's irrelevant when you don't have different mexes or have upgradeable mexes or anything else altogether.

And coding for every eventuality leads to a convoluted mess (c.f. unit_morph.lua). Games should reuse gadgets, but they should do the customisation for themselves. It's impossible to plan for every eventuality.

Re: [Request] Gadget to disallow building mexes on non-metal

Posted: 11 Jul 2010, 20:40
by AF
Have you ever played supreme commander and noticed that the extraction points for mass arent perfectly lined up leaving you with awkward gaps which are half the size of the smallest building footprint for raiders to slip through?

Its not purely a matter of moho vs non moho, there are advantages beyond having 2 extractors purely from a placement perspective.

Re: [Request] Gadget to disallow building mexes on non-metal

Posted: 12 Jul 2010, 04:11
by CarRepairer
jK wrote:It's okay for mexspots maps, but it totally fails for maps with cloud metalmaps.
It doesn't totally fail. Easymetal works on Smalldivide (original one with cloud metal) just fine.
AF wrote:Instead it should snap not to the actual location of the spot, but to within a range of the spot that covers it, which would be far more flexible and convenient
Good luck to you, feel free to modify easymetal and use it in whatever mod it is you're working on. I prefer it this way.

You know, like geothermals? No one seems to freak out over those.

Re: [Request] Gadget to disallow building mexes on non-metal

Posted: 12 Jul 2010, 07:48
by Forboding Angel
jK wrote:
Licho wrote:I think thats ok. I would like ghosted structures on mex spots (appear when you select conbot) and you just right click to build.

I dont think that extra complexity of free placing extractors is worth it.

Currently its possible to place mexes around spot only because mappers make radius bigger to allow for mex and moho mex to go into same spot...
It's okay for mexspots maps, but it totally fails for maps with cloud metalmaps.
That's fine with me. Evo has it's own official maps, and because of the way Evo works, a feature like this is extremely important.

I might point out that the majority of maps which use clouds aren't very good. There are exceptions, but it is more or less the rule.

Re: [Request] Gadget to disallow building mexes on non-metal

Posted: 12 Jul 2010, 08:36
by AF
Geothermals actually have a greater degree of freedom in that your only limitation is that the footprint covers the target, it doesn't snap to an exact position.

Cloudy metal maps in particular are a prime reason for changing it