NanoButtons Gadget - new version 1.1 - Page 2

NanoButtons Gadget - new version 1.1

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

Moderator: Moderators

User avatar
very_bad_soldier
Posts: 1397
Joined: 20 Feb 2007, 01:10

Post by very_bad_soldier »

I didnt test it yet, but I already like it :lol:
imbaczek
Posts: 3629
Joined: 22 Aug 2006, 16:19

Re: NanoButtons Gadget RELEASED (and it's good!)

Post by imbaczek »

BigHead wrote:Edit: The bad:
Auto-repair repairs units being reclaimed. I was unable to find any suitable call-out. It's possible to do but it would have an impact on performance. Unless trepan comes into this thread and says something like "lua has been able to do so for a very long time" I can't do anything about it.
Worth mentioning that this is fixed in the (mythical ^^) next release.
User avatar
BigHead
Posts: 145
Joined: 12 Jul 2007, 18:55

Post by BigHead »

I can add "Attack ON/OFF" button that would auto-reclaim nearby enemy units. Before any flame starts I want to point out that this is a gadget. This means that it's up to the modder if he includes this into his mod. Either all players have the functionality or noone has it.
In short: If a modder tells me that he wants it for his mod I'll add the functionality.

AF: Now that the gadget is released maybe you could finally tell me what should it do upon detecting an AI player.

imbaczek: This gadget doesn't use patrol command so it's not fixed. Good job anyway.
imbaczek
Posts: 3629
Joined: 22 Aug 2006, 16:19

Post by imbaczek »

well, duh. worth trying tho 8)
Saktoth
Zero-K Developer
Posts: 2665
Joined: 28 Nov 2006, 13:22

Post by Saktoth »

MelTraX please make it optional, I like to have all of the buttons that have some functionality for the unit (I can think of using repeat for a nanotower sometime) available.
True enough, ill often put a nano turret on repair/repeat for say, a hlt or dragons claw thats being hit by arty- when i dont want it to bother with repairing, say, the solars i put down to block samson fire.

Any chance of having an auto-reclaim enemies function, so that all enemies that come into range get sucked up as the first priority? (Edit: Oh, wow in the tme i was writing this post its already been brought up).

On repairing reclaims, could it perhaps chat to the Mex upgrader widget, so they Mex upgrader widget can say 'Hey, dont try and repair this.'

Thats the most common instance of repairing something thats being reclaimed.
User avatar
BigHead
Posts: 145
Joined: 12 Jul 2007, 18:55

Post by BigHead »

True enough, ill often put a nano turret on repair/repeat for say, a hlt or dragons claw thats being hit by arty- when i dont want it to bother with repairing, say, the solars i put down to block samson fire
I don't quite understand what you mean ... could you be more specific? Are you sure your use of repeat isn't already covered by this gadget (Repair ON/OFF button for example).
Edit:
could it perhaps chat to the Mex upgrader widget
That won't be possible until next version of Spring, but it's a good idea.
Saktoth
Zero-K Developer
Posts: 2665
Joined: 28 Nov 2006, 13:22

Post by Saktoth »

BigHead wrote:I don't quite understand what you mean ... could you be more specific? Are you sure your use of repeat isn't already covered by this gadget (Repair ON/OFF button for example).
If i have a nanoturret on the front line repairing my defenses, ill often set it to repeat, then give it a repair order on the defenses inside its range. I use this to counter vech arty.

If i have a damaged flash or solar panel or such within its range, even if its more damaged than the HLT, i want it to keep repairing the hlt- because the moment it stops, he takes down my hlt with his artillery.

I cant just use the guard command, as i want it to 'guard' several defences (Say, llts and hlts).
User avatar
BigHead
Posts: 145
Joined: 12 Jul 2007, 18:55

Post by BigHead »

Hmm, interesting ... so what we really need is a way to choose units that will be prefered when auto-repairing ...
I can modify the behavior of Repair (not the ON/OFF one) button. It would add/remove chosen unit into the list of prefered units if auto-repair is enabled. The only problem is that I don't know how to put visual notification on prefered units. The notification must be displayed only if unit draws it's commands (= shift is pressed).
Well you can expect repeat button to return unless I figure that out.
User avatar
flop
Posts: 335
Joined: 22 Nov 2006, 05:44

Post by flop »

how does auto reclaim deal with trees?
User avatar
BigHead
Posts: 145
Joined: 12 Jul 2007, 18:55

Post by BigHead »

Deforestation is often cited as one of the major causes of the enhanced greenhouse effect. Trees and other plants remove carbon (in the form of carbon dioxide) from the atmosphere during the process of photosynthesis. Both the decay and burning of wood releases much of this stored carbon back to the atmosphere.
Of course it reclaims trees. Wreckages and repairing have higher priority though,
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post by AF »

bighead. Automate the gadget udner AIs. Its very simple and your vastly overcomplicating it and wondering what your supposed todo. All the hard work has already been done in making the widget.

AI ABC is running QA (imaginary TA based mod with nanoturrets). QA has no routines for handling nanoturrets, and your gadget is installed in QA. Automate the gadget so that the player doesnt have to .cheat .team x to make the AI use the turret.
User avatar
BigHead
Posts: 145
Joined: 12 Jul 2007, 18:55

Post by BigHead »

Ok, next version will have all auto-options enabled by default for AI teams. I'll propably add auto enemy reclaiming for AIs as well.

Edit:

Code: Select all

QA has no routines for handling nanoturrets
Why would it build nanoturrets if it doesn't know how to use them? I know your AI uses config file so you can order it to build nanos. However it still doesn't know where to build them.
User avatar
ILMTitan
Spring Developer
Posts: 410
Joined: 13 Nov 2004, 08:35

Post by ILMTitan »

BigHead wrote:Hmm, interesting ... so what we really need is a way to choose units that will be prefered when auto-repairing ...
I can modify the behavior of Repair (not the ON/OFF one) button. It would add/remove chosen unit into the list of prefered units if auto-repair is enabled. The only problem is that I don't know how to put visual notification on prefered units. The notification must be displayed only if unit draws it's commands (= shift is pressed).
Well you can expect repeat button to return unless I figure that out.
I don't see why you don't just leave the repeat button. Having repair and the repeat button adds all of the complexity you need, but in a manner consistent with all other units. What you are describing is equally complicated, but inconsistent.

The only other though I have would be, if none of the repeating commands demands action (the HLT is fully repaired), the turret follows the Auto* standing orders (it starts repairing the solars). Once a command does require action (the HLT takes damage), the turret abandons its Auto* action and follows the command.
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post by AF »

BigHead wrote:Ok, next version will have all auto-options enabled by default for AI teams. I'll propably add auto enemy reclaiming for AIs as well.

Edit:

Code: Select all

QA has no routines for handling nanoturrets
Why would it build nanoturrets if it doesn't know how to use them? I know your AI uses config file so you can order it to build nanos. However it still doesn't know where to build them.
A nanoturret is a unit specific to mods derived from the AA base. As such nanoturrets are mod specific, and fall under the same umbrellas as cosntruction hubs among other things.

What's more an AI cant be expected to pander to AA specific gameplay at the detriment of all other mods. Nor should an AI maker take the extra effort to exclusively pander to a mod and its predecessors.

What you are suggesting is that AI makers write into their AIs code that detects and removes any chance of them building nanoturrets.

Also some AIs do indeed have routines that make use of nanoturrets. A config buidler can assign a nanoturret a task list with a few keywords, but its still only basic stuff in comparison to what has been done in this lua code.


Now putting that aside, if you look at what the original author said, the widget will automatically assign the last chosen command to new nanoturrets. This is of huge help to you in that you have been given a free mechanism, a shortcut towards the final goal, a gigantic pointer, an enourmous hint. Surely it cant be hard to assign a new value instead of the last value using a small piece of code?

AI is not as hard as people make out, because everyone thinks "AI oh no, I couldn't possibly program another intelligent being on my own", not that you would ever have to do anything as absurd as that.



And in anticipation of a certain arguement, yes AI makers could do all this lua behaviour themselves and do it much much better, by putting more time and effort into it, then following it up with months of incremental improvements, but at the detriment of all other parts of AI. There are 2 AI developers, who both spend little time as it is. There isnt enough motivation or time to build advanced logic on a per mod basis, nm a per unit basis.
User avatar
BigHead
Posts: 145
Joined: 12 Jul 2007, 18:55

Post by BigHead »

Code: Select all

What you are describing is equally complicated, but inconsistent.
You're right, Repeat button stays/returns.

Code: Select all

If none of the repeating commands demands action (the HLT is fully repaired), the turret follows the Auto*
Now this is inconsistent as well. It's same as my "list of prefered units" but more complicated. This stuff can't be consistent with other units as no othe units has similar behavior.

AF: I take that as yes, an AI will know where to place it's nanotowers while this gadget will take care of their control.
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post by AF »

Exactly. Where the turrets go is in the scope of the AI and cant really be helped by lua but what the turrets actually do is another thing altogether.
User avatar
BigHead
Posts: 145
Joined: 12 Jul 2007, 18:55

Post by BigHead »

New version is out!

Changelog 1.0 -> 1.1
- new Attack ON/OFF button
- buttons can be hidden
- AIs have all options set to ON by default
- Repeat is back
- cancels Guard order if unit is out of range
- much faster (nano updates are spread among 32 frames instead of 1)

Pro tip:
Hold shift when clicking on a button to switch all buttons with one click.
User avatar
quantum
Posts: 590
Joined: 19 Sep 2006, 22:48

Post by quantum »

It's in CA and players love it :-)
User avatar
BigHead
Posts: 145
Joined: 12 Jul 2007, 18:55

Post by BigHead »

/me is dancing, partying...
Saktoth
Zero-K Developer
Posts: 2665
Joined: 28 Nov 2006, 13:22

Post by Saktoth »

Some problems with the gadget, in CA.

It reclaims, even when your storage is full. This does terrible things like waste the metal from corpses or sit reclaiming trees when you want it to help build. It should only reclaim when you are stalling or close to stalling. You could turn reclaim off but its better if this is managed more sensibly.
Post Reply

Return to “Lua Scripts”