Page 1 of 2

MexUpgraderAI replacement gadget

Posted: 13 Oct 2007, 19:47
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/

Posted: 13 Oct 2007, 20:04
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.

Posted: 13 Oct 2007, 20:05
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.

Posted: 13 Oct 2007, 20:08
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 :-)

Posted: 13 Oct 2007, 20:20
by trepan
LuaUI can make custom command buttons,
has been able to do so for a very long time.

Posted: 13 Oct 2007, 21:10
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

Posted: 13 Oct 2007, 21:53
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.

Posted: 14 Oct 2007, 00:02
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.

Posted: 14 Oct 2007, 04:09
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.

Posted: 14 Oct 2007, 09:33
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 :)

Posted: 16 Oct 2007, 09:01
by ginekolog
i tried to use it as widget, does not add any button for me :( Is it still gadget only?

Posted: 16 Oct 2007, 09:08
by BigHead
yup

Posted: 16 Oct 2007, 21:05
by LOrDo
Nice! I would much rather have it as a widget though.

Posted: 16 Oct 2007, 23:34
by Neddie
Now, how is the compatibility with non-OTA based content?

Posted: 17 Oct 2007, 08:06
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.

Posted: 11 Nov 2007, 17:36
by NOiZE
BigHead wrote:
"area upgrade"
Consider it done.
So how does that work?

Posted: 11 Nov 2007, 18:21
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 :)

Posted: 11 Nov 2007, 18:23
by MightySheep
(I don't even get to play Spring)
i hardly ever see you on spring anymore anyway.

Posted: 11 Nov 2007, 18:28
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).

Posted: 11 Nov 2007, 18:44
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.