Page 1 of 1

Context Build - build sea or land stuff depending to context

Posted: 30 Jul 2009, 22:07
by dizekat
There ya go:
http://dmytry.pandromeda.com/tmp/lua_fo ... _build.lua
(rightclick, 'save target as', save into your LuaUI/Widgets folder)

edit: BrainDamage added XTA stuff.
edit2: Added BA energy generating structures.

What it does do: for example, you want to build metal extractor. When your cursor is over water, this widget will auto-switch to underwater metal extractor, when over land, to land metal extractor.

Mostly useful in combination with custom keybindings for common buildings - now you don't need separate keys for land and sea. Also saves time if you rarely play sea/land - if you click on land buildings by mistake, its alright.

To add support for other unit groups and mods:
Edit the 'unitlist' table. It consists of groups of equivalent units that are iterated through to find the unit that can be built. For example, first group lists all t1 mexes, land and sea.

Todo: also remove redundant entries from build menu?

Re: Context Build - build sea or land stuff depending to context

Posted: 30 Jul 2009, 22:17
by Peet
Awesome idea, this sort of intuitive behaviour is one of the things spring has been missing for a long time.

Re: Context Build - build sea or land stuff depending to context

Posted: 30 Jul 2009, 22:26
by SinbadEV
I don't really even play anymore and I think this is an awesome idea... Fewer buttons is always better in my opinion so I look forward to you figuring that out or Mod-designers implementing this feature as a gadget.

Re: Context Build - build sea or land stuff depending to context

Posted: 30 Jul 2009, 23:31
by CarRepairer
SinbadEV wrote:I don't really even play anymore and I think this is an awesome idea... Fewer buttons is always better in my opinion so I look forward to you figuring that out or Mod-designers implementing this feature as a gadget.
CA already implemented this as a gadget... only instead of implementing it as a gadget we just dropped the water buildings and made the land ones amph/float. Best non-gadget ever.

Re: Context Build - build sea or land stuff depending to context

Posted: 31 Jul 2009, 00:22
by dizekat
CarRepairer wrote:
SinbadEV wrote:I don't really even play anymore and I think this is an awesome idea... Fewer buttons is always better in my opinion so I look forward to you figuring that out or Mod-designers implementing this feature as a gadget.
CA already implemented this as a gadget... only instead of implementing it as a gadget we just dropped the water buildings and made the land ones amph/float. Best non-gadget ever.
right, also cuts down number of models :/

Re: Context Build - build sea or land stuff depending to context

Posted: 31 Jul 2009, 22:08
by Jazcash
I'm getting spammed with "Can't build" or w/e from it but it still works.

In fact, I'm getting spammed with all sorts of info ingame. It's as if there's some sort of dbugging option set on.

I press my keybound keys, and it prints all the commands I have set to that key... When I press another key like Ins or Del, it will paste a load of crap....

I press stop, it will say "Stop".

Seriously, how do I turn this annoying thing off?

Re: Context Build - build sea or land stuff depending to context

Posted: 10 Oct 2009, 22:53
by mongus
This is not working for spring spring_0.80.4.2 .

Re: Context Build - build sea or land stuff depending to context

Posted: 11 Oct 2009, 04:24
by REVENGE
This is nice, but I still like what CA did. It condenses your build menus as well.

Re: Context Build - build sea or land stuff depending to context

Posted: 13 Oct 2009, 12:38
by manolo_
REVENGE wrote:This is nice, but I still like what CA did. It condenses your build menus as well.
BD could u implement that too