MexUpgraderAI replacement gadget

MexUpgraderAI replacement gadget

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

Moderator: Moderators

User avatar
BigHead
Posts: 145
Joined: 12 Jul 2007, 18:55

MexUpgraderAI replacement gadget

Post by BigHead »

The button looks like this:
Image

Improvements over MexUpgraderAI:
- T2 planes no longer reclaim underwater mexes
- More accessible: one click instead of three. See this post for pictures
- Queuing: you can now use shift when right clicking a mex to make the builder upgrade it
Image
- I'm open to suggestions :)

Features:
- Automatically detects what should be upgraded into what
- There are two variabiles you can change: ignoreWeapons=false and ignoreStealth=false. For example if you set ignoreWeapons to true, exploiters will be upgraded into moho mines instead of moho exploiters.
- DefaultCommand call-in is going to be implemented in next version. Until then, I made a widget that allows right-clicking. There's upgradeMouseCursor="Reclaim" variabile in it which you can change into whatever you want.

Notes:
- I don't have anyone to test this on. It works well for me but I wouldn't put it into my mod yet (without testing) ;)
- If you're not a modder and just want to test it see this thread for help on using gadgets.

Download:
http://www.unknown-files.net/3638/MexUp ... nt_gadget/
User avatar
LordMatt
Posts: 3393
Joined: 15 May 2005, 04:26

Post by LordMatt »

What is the difference between a widget and a gadget, and how would someone install this? I'm happy to try it out, if it's easier than having to go set the AI. Ideally you could just make an upgrade option and queue up the mex you want upgraded yourself, as sometimes the mex upgrader AI does stupid things.
tombom
Posts: 1933
Joined: 18 Dec 2005, 20:21

Post by tombom »

Gadgets are synced so the mod needs to have them. I don't really know why specifically this can't be a widget.
User avatar
BigHead
Posts: 145
Joined: 12 Jul 2007, 18:55

Post by BigHead »

- Queuing: you can now use shift
- If you're not a modder and just want to test it see this thread for help on using gadgets.
This can't be a widget becouse widgets can't make custom commands. It's the only reason. In fact I had widget version of this two days ago :-)
trepan
Former Engine Dev
Posts: 1200
Joined: 17 Nov 2005, 00:52

Post by trepan »

LuaUI can make custom command buttons,
has been able to do so for a very long time.
User avatar
LordMatt
Posts: 3393
Joined: 15 May 2005, 04:26

Post by LordMatt »

Does that mean this could be ported to being a widget instead? I tried it out, and I like it better than the group AI tbh, though it could use an "area upgrade" feature like the group AI has (where you can drag a circle for upgrading like you can with repair and reclaim.

I admit to being wrong about group AIs sucking compared to lua. :P
User avatar
BigHead
Posts: 145
Joined: 12 Jul 2007, 18:55

Post by BigHead »

After some interesting #lua discussion I learned that it could be done as a widget. However it would require me to write my own DefaultHandler and do some other nasty things so the conclusion is that this remains a gadget.
"area upgrade"
Consider it done.
User avatar
LordMatt
Posts: 3393
Joined: 15 May 2005, 04:26

Post by LordMatt »

Well as a gadget it messed up my IceUI (windows stopped updating themselves) so I'm less enthusiastic about it now. :(

Edit: nm now I can't reproduce this.
Saktoth
Zero-K Developer
Posts: 2665
Joined: 28 Nov 2006, 13:22

Post by Saktoth »

T2 planes no longer reclaim underwater mexes
Do Seaplanes upgrade underwater mexes and not land ones, also?
For example if you set ignoreWeapons to true, exploiters will be upgraded into moho mines instead of moho exploiters.
Id set ignoreweapons as the default behaviour.
User avatar
BigHead
Posts: 145
Joined: 12 Jul 2007, 18:55

Post by BigHead »

Do Seaplanes
Seaplanes upgrade land mexes correctly.
Id set ignoreweapons as the default behaviour.
It's up to mod devs. They could make it autoupgrade solars, towers and factories if they wished ... not that i think it's a good idea :)
Last edited by BigHead on 16 Oct 2007, 09:07, edited 1 time in total.
User avatar
ginekolog
Posts: 837
Joined: 27 Feb 2006, 13:49

Post by ginekolog »

i tried to use it as widget, does not add any button for me :( Is it still gadget only?
User avatar
BigHead
Posts: 145
Joined: 12 Jul 2007, 18:55

Post by BigHead »

yup
User avatar
LOrDo
Posts: 1154
Joined: 27 Feb 2006, 00:21

Post by LOrDo »

Nice! I would much rather have it as a widget though.
User avatar
Neddie
Community Lead
Posts: 9406
Joined: 10 Apr 2006, 05:05

Post by Neddie »

Now, how is the compatibility with non-OTA based content?
User avatar
BigHead
Posts: 145
Joined: 12 Jul 2007, 18:55

Post by BigHead »

Well, it uses standard reclaim and build commands to "upgrade" mexes so this shouldn't be an issue.

The algorithm that decides who should upgrade what into what cosiders everything with extractsMetal > 0 to be a mex.
minWaterDepth >= 0 -- this means it's a water mex and needs to be upgraded into another water mex.
if weapons count > 0 the mex is considered to be armed so unless ignoreWeapons=true the mex is upgraded into another armed mex.
if stealth=true the mex is conside...

You don't need to use the algorithm and can modify the gadget to upgrade only units you want it to. You can even make it upgrade your factories, towers or anything else.
User avatar
NOiZE
Balanced Annihilation Developer
Posts: 3984
Joined: 28 Apr 2005, 19:29

Post by NOiZE »

BigHead wrote:
"area upgrade"
Consider it done.
So how does that work?
User avatar
BigHead
Posts: 145
Joined: 12 Jul 2007, 18:55

Post by BigHead »

As this gadget recieved little attention from modders I wasn't motivated to release new version. Couple this with me being very busy these day (I don't even get to play Spring) and you see why it's not implemented yet. However implementing "area upgrade" shouldn't be very difficult and if there's demand for it I might be able steal a few minutes in upcoming weeks :)
User avatar
MightySheep
Posts: 243
Joined: 11 Nov 2007, 02:17

Post by MightySheep »

(I don't even get to play Spring)
i hardly ever see you on spring anymore anyway.
User avatar
LordMatt
Posts: 3393
Joined: 15 May 2005, 04:26

Post by LordMatt »

BigHead wrote:As this gadget recieved little attention from modders I wasn't motivated to release new version. Couple this with me being very busy these day (I don't even get to play Spring) and you see why it's not implemented yet. However implementing "area upgrade" shouldn't be very difficult and if there's demand for it I might be able steal a few minutes in upcoming weeks :)
I think it has a good chance of being included in the next version of BA if you added that feature. Noize particularly likes the area upgrade feature of the current group AI (though I think this should be included regardless :P).
tombom
Posts: 1933
Joined: 18 Dec 2005, 20:21

Post by tombom »

MightySheep wrote:
(I don't even get to play Spring)
i hardly ever see you on spring anymore anyway.
That's what he just said.
Post Reply

Return to “Lua Scripts”