Request for UI mod for TML auto pause
-
=
The Request
As I have the coding ability of a grasshopper, I ask if someone could make a simple UI mod with the following features:- Pauses TML and turns off auto-build when the TML reaches a certain number of stored projectiles.
- Ability to customise the number of desired missiles to be stored in the UI Mod options menu of the f10 dropdown menu.
- Unpauses and turns on auto-build when the number of stored missiles is less than the desired amount.
This mod should also be able to work for strategic missile launchers.
=
The backstory:
When playing a game against the AI, I built some TML to troll their lack of TMD.
However, a storage bug occurred where the TML would auto-pause and turn off the auto-build functionality of the structure whenever it had 2 missiles loaded. I have not been able to replicate this bug since, but I found it somewhat useful.
The auto-pause when you have X number of missiles was good, but the turning off of auto-build was annoying because you'd have to manually re-enable it by right clicking every time the TML reached it's self imposed missile cap.
-
@arran It's a rare thing to have a bug work in your favor!
You know, I think the wish a mod foundation might just be able to grant your request.
This idea has been on my mind too for a while, but I am thinking it has to be possible to set each individual launcher differently. For me I don't see how it will be that useful if I am locked to one level, and who has time to go to the menu mid game? Instead, I'd go all the way and put everything into a UI and have an overlay of the number to go along with it. With the ability to save the default number to persist between games as well.
It so happens that I am working on a mod that autopauses any category of units with the click of a button. Only on low energy right now but should be easy to add other conditions. I need to finish up the icons mod first but after that it might be time for me continue on it, and it would fit to integrate your idea there I think. It is a lot of work though, I wouldn't hold my breath. Maybe someone else can make a simple one first. I'd be happy to copy some of that code when I need it
-
That auto pause category mod seems very useful! Ever since UI party was depreciated (and later brought back somehow) I've been missing a way to pause categories to free up BP and mass for other projects. Or just generally any mod that could visualise eco spending of categories that wasn't buggy.
Hopefully you can integrate the TML/Nuke storage mod idea into your project (which sounds amazing!) as that would be lovely to see. -
@arran Let me share the current state of things, maybe you have some ideas!
I actually built it from the econtrol in UI-Party, but beware: I have made other changes in there as well and some things are removed after my personal needs. So it's not just UI-Party with a modifed econtrol. Need to clean that up sometime.
If you want to try:
mods.zip (Includes my slightly modified common mod tools that fixes a problem I had with UMT SetHiddenSelect.)
It works but it's been left like this for a while, but my ambition for it is to be much more configurable, yet should be simple to use as well. I've found it hard to figure out how it will look to fulfil both of those and also integrate all my ideas.
It already:
- Shows expenditure (green/pink bars - left side is abilities, right side construction)
- Pause whole category (red square - right click the bar area)
- Show how much resources were spent before pausing (red/turquoise bars)
- Autopause (orange square, ctrl-right click bar area)
- Continue (left click bar area)
I'd like it to:
- Set specific threshold for each category to control which units gets autopaused first (now they all autopause when less than 80% or something like that).
- Profiles, that can be saved and activated quickly during the game.
- Prioritize, meaning pause everything else unless over a resource threshold
- Autopause on mass thresholds as well
- Expandable subcategories: T1, T2, T3 factories for example, right now I just have land/air etc.
- Set autopause/prioritize only, or ignore some, specific units - useful for autopausing for example all radars/shields except your most important ones.
- Special cases like for launchers. Maybe there is something more
- Auto activate, for example Cybran ASF stealth capability that starts off even when overflowing energy.
- And more, these are just the things I could remember
If you get an idea of how to puzzle all of this into the UI, let me know. I'd be very grateful. At this point the coding feels much easier to me even though that's a lot of work for sure.
-
Looks and sounds good so far.
A couple of thoughts.
If you are appropriating code from UI-Party, make sure that the cycle bug isn't present. This bug caused hotkeys which cycled through selections (e.g. factories or templates) to reset periodically (on some tick count) to the first in the selection. One example that happened frequently was cycling through intel structures (from radar to select sonar), only for UI-Party to reset me back to T3 radar when I was trying to build sonar.
Instead of left clicking to unpause, can you change it to right click? My logic is that right clicking can toggle paused/unpaused, while left click selects all things in that expenditure category (useful for manually implementing a partial reduction of expenditures).
Also, why did you decide on green/pink bars for eco, not the traditional green/yellow? You could also use the colour wheel to invert colours for paused vs unpaused eco representation. E.g. Green (mass) and yellow (energy) for current expenditure, then red (mass) and blue (energy) for paused expenditure. You could honestly just make colour customisation another setting (so many settings :/) by taking some code from 4z0t's ScoreBoard. Their UI mod probably has all the code you'd need for that.Your idea of integrating eco managing via thresholds and profiles is inspired! Usually eco UI programs are full automation, or full manual. The hybrid approach should really help with getting a balance between the two while maintaining user control and preference.
In a similar vein, could you add a feature (e.g. clicking mouse scroll wheel) to set a category (or any project really) as maximum priority. The mod will then pause everything else (with some selective logic of what to pause first) so that you don't stall on what you must complete ASAP.The auto activate function seems amazing! I understand why cybran ASF's have it off by default, but it makes no sense if you are overflowing. Same for seraphim selens.
As for how to represent all this functionality on the UI, you seem to be on a good path. The idea to keep a display of how much a paused category would consume if turned back on is a really nice touch.
For things like profiles and settings you can shove most of them under the hood into the wrench icon (top left of your image). Stuff I'd put here include:
- TML missile storage limit.
- Specific threshold for each category to control which units gets autopaused first.
- Profiles.
- Autopause mass thresholds.
- Ordering of prioritisation order. This can be it's own sub-menu where you click and drag icons into an order you like. Similar to kiddy coding programs with visual code blocks.
- Set autopause/prioritize only, or ignore some, specific units. Can be integrated into the above UI sub-menu as I binary "include/ignore" tickbox.
- Auto activate unit abilities. On/off setting. A more advanced version might have aa on/off setting for each unit.
For many things in the above list, you can use a similar UI layout to the Eco display itself. Or just appropriate code from 4z0t's mods as they have implemented submenus, sliders, drop down menus and tick boxes.
For things which will potentially need to be adjusted in-game on the fly, they need to have a designated keypress and/or UI element. An example of this already implemented would be the left/right click of the eco display to pause/unpause stuff.
These include:- Expandable subcategories. This can be represented as a dropdown menu which automatically opens up when the mouse is hovered over the main category.
Those are my quick initial thoughts. Shove most out of sight, and only worry about what the player is likely to want to use differently every game.
-
@arran This is why
I made everything to be in line with the color scheme of Color Coded Strategic Icons, but yes some sort of color picker is a good idea. I love settings, as long as there is a good default out of the box!
I have made so many of those fixes to UI-Party and other mods to make it all work together, and I think I remember having that problem and fixing it. With 38 mods running in total () it all runs smooth for me now after all.
You ideas are great as always, thanks! When it's time to start working on it I will come back and go through everything in detail.
-
There was an entire balance patch dedicated to resolve your issue
https://patchnotes.faforever.com/pages/balance/2016/3655.html#tml
EnjoyThough not with customization feature, that one is really for UI mod