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

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

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

Moderator: Moderators

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

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

Post 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.
User avatar
FLOZi
MC: Legacy & Spring 1944 Developer
Posts: 6242
Joined: 29 Apr 2005, 01:14

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

Post 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.
User avatar
CarRepairer
Cursed Zero-K Developer
Posts: 3359
Joined: 07 Nov 2007, 21:48

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

Post by CarRepairer »

I made it years ago in CA. Hasn't been used once.

http://trac.caspring.org/wiki/GameOptions#EasyMetal
User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14673
Joined: 17 Nov 2005, 02:43

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

Post 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.
User avatar
FLOZi
MC: Legacy & Spring 1944 Developer
Posts: 6242
Joined: 29 Apr 2005, 01:14

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

Post by FLOZi »

tobool is part of CA's utilities package, http://trac.caspring.org/browser/trunk/ ... tobool.lua
User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14673
Joined: 17 Nov 2005, 02:43

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

Post by Forboding Angel »

Added that file in the proper location. Still getting the same error in infolog.

:-(
User avatar
CarRepairer
Cursed Zero-K Developer
Posts: 3359
Joined: 07 Nov 2007, 21:48

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

Post 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.
User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14673
Joined: 17 Nov 2005, 02:43

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

Post 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.
User avatar
jK
Spring Developer
Posts: 2299
Joined: 28 Jun 2007, 07:30

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

Post 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.
User avatar
Licho
Zero-K Developer
Posts: 3803
Joined: 19 May 2006, 19:13

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

Post 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...
User avatar
jK
Spring Developer
Posts: 2299
Joined: 28 Jun 2007, 07:30

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

Post 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.
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

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

Post by AF »

So how would I build a moho extractor or an armed extractor without reclaiming and loosing metal income?
User avatar
Licho
Zero-K Developer
Posts: 3803
Joined: 19 May 2006, 19:13

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

Post by Licho »

Its not for BA, request is for mods which don't have to think this way.
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

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

Post 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
User avatar
FLOZi
MC: Legacy & Spring 1944 Developer
Posts: 6242
Joined: 29 Apr 2005, 01:14

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

Post 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.
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

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

Post 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.
User avatar
CarRepairer
Cursed Zero-K Developer
Posts: 3359
Joined: 07 Nov 2007, 21:48

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

Post 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.
User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14673
Joined: 17 Nov 2005, 02:43

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

Post 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.
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

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

Post 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
Post Reply

Return to “Lua Scripts”