The snapping is currently only usable for one unit. That sucks, because I have a ground mex and an underwater mex.Google_Frog wrote: Gadgets
mex_spot_finder
Broadly this does three things:To determines the metal spot layout it tries these things in order and stops when one of them works.
- Determines the metal spot layout of the map
- Puts this layout in GG
- Is able to send this layout to widget land.
This gadget just determines and broadcasts a layout.
- Include a legal config from "LuaRules/Configs/MetalSpots/" .. (Game.mapName or "") .. ".lua"
- Include a legal config from "mapconfig/map_metal_layout.lua"
- Generate a metal spot layout from the metal map image.
If it receives a synced lua message "RequestMetalSpots" it has a SyncAction wrap to LuaUI which sends the metalspots table to a widget.
mex_placement
This gadget limits the placement of the metal extractor unit to the spots in GG.metalSpots. It does AllowCommand to cancel construction commands to illegal spots. It SetUnitRulesParams mexes detected in UnitCreated with the value of the spot they were built on, this will be their income.
This is a gadget which implements game specific behaviour and without it mex_spot_finder would do absolutely nothing to the game.
unit_mex_overdrive
This gadget does most of the economy system and much of it isn't relevant here. In short it GetUnitRulesParams mexes for their income, does things and eventually adds some metal to the storage of each teamID.
Widgets
wg_mexspot_fetcher
A small widget which simply asks mex_placement for the metal spot layout. Upon receiving this it puts the layout in WG and removes itself.
cmd_mex_placement
This is the entire mex placement UI. It draws the mex spots on the ground, snaps attempts to place mexes to legal mex spots and implements area mex.
****************
http://evolutionrts.googlecode.com/svn/ ... cement.lua
http://evolutionrts.googlecode.com/svn/ ... cement.lua
It appears that zk hasn't really considered the fact that at some point they may have more than one extractor. Either that or adding in more unitdefs is simple as pie and I just don't know how. << More likely.