Context Build - build sea or land stuff depending to context

Context Build - build sea or land stuff depending to context

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

Moderator: Moderators

Post Reply
dizekat
Posts: 438
Joined: 07 Dec 2007, 12:10

Context Build - build sea or land stuff depending to context

Post 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?
Last edited by dizekat on 30 Jul 2009, 22:26, edited 2 times in total.
User avatar
Peet
Malcontent
Posts: 4384
Joined: 27 Feb 2006, 22:04

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

Post by Peet »

Awesome idea, this sort of intuitive behaviour is one of the things spring has been missing for a long time.
User avatar
SinbadEV
Posts: 6475
Joined: 02 May 2005, 03:56

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

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

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

Post 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.
dizekat
Posts: 438
Joined: 07 Dec 2007, 12:10

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

Post 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 :/
User avatar
Jazcash
Posts: 5309
Joined: 08 Dec 2007, 17:39

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

Post 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?
mongus
Posts: 1463
Joined: 15 Apr 2005, 18:52

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

Post by mongus »

This is not working for spring spring_0.80.4.2 .
User avatar
REVENGE
Posts: 2382
Joined: 24 Aug 2006, 06:13

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

Post by REVENGE »

This is nice, but I still like what CA did. It condenses your build menus as well.
User avatar
manolo_
Posts: 1370
Joined: 01 Jul 2008, 00:08

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

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

Return to “Lua Scripts”