[UI MOD] Light Touch: Worker Automation, Unit Control Functionality

Redox

Warlord
Joined
Jun 15, 2011
Messages
134
Overview:

This mode was created to reduce the amount of micromanagement and boring tasks required in a more-or-less long game, especially if you build many units and have a big empire.

Features:

Worker Automation

- a worker can be told to build improvements for a specific city. Select a worker and R-Click the city.
- you determine whether he will build improvements maximizing :c5production: / :c5food: or :c5gold:
- worker will prioritize tiles with strategic/luxury resources, will take into account whether a tile is used by the city, etc.
- worker will automatically repair pillaged improvements and clean fallout
- most importantly: he will never ever build a road or, god forbid, a railroad! Never!!! :mad:

Unit auto fortifying

- if moved by mouse right-clicking, a unit will be put on Fortify/Alert/Sleep upon arrival. This way if you are moving a bunch of units from point A to point B, they won't be asking for new orders almost every damn turn! Makes reinforcing and massing units before attack much more hassle-free.
- works for all non-civilian units. Air units will be put on Intercept or Sleep after rebasing. Naval and Ranged units - on Alert.
- you can use M+LeftClick to move a unit, if you don't want to use this feature. This is useful for moving scouts and other units which you want to control every turn.

Multi-turn rebasing

- if you want to move an air unit to a remote destination, simply choose "rebase" and click on the destination. The unit will calculate a route along which it can reach destination in a minimum number of turns (uses vanilla Dijkstra's pathfinding algorithm) and start rebasing.
- starting and ending points could be ships (carrier/sub etc) but in-between only cities will be used.
- the whole route is calculated as you issue the command, so unless you see a blip around destination and the unit starts moving, it means reaching the destination is impossible.
- useful for moving Guided Missiles and other relatively short-ranged aircraft

Workers work under a hail of bullets

- workers won't stop working no matter what. Useful if you are building roads or forts in the enemy territory next to your fighting troops.
- just watch out for barbarians early in the game

~~~~~~~~~~~

Compatibility:

- compatible with Gods and Kings, Vanilla Civ, latest June and July 2012 patches
- compatible with Thal's Unofficial Patch (G&K), Thal's Vanilla Enhanced Mod, Hulfgar's Industrial Warfare
- compatible with InfoAddict and other mods

overwrites files:
- Heavily modified: WorldView.lua
- Very lightly modified: UnitPanel

Version History:

Spoiler :

Version 6.0
Compatibility:
- Made compatible with the latest patches, as well as Gods&Kings expansion
- Compatible with Thal's VEM, Unofficial Patch (G&K)
- Uses the new modular Diplo Corner provided by civ

Bug Fixes:
- Fixed unit swapping
- Fixed Garrisoning and behavior of Great Admiral

Version 5.0
Compatibility:
- Uses modular Diplo Corner by alpaca, to allow sharing Diplo Corner menu with InfoAddict and other mods.
- LightTouch - Alternative v4 is discontinued for above reason.

Version 4.0
Compatibility:
- Compatible with July 2011 patch

Bugs Fixed:
- If an air unit performs a multi-turn rebasing to a ship, it no longer wakes the ship.
- Execution of scheduled missions could stop sometimes for all units if a unit got killed.

Version 3.0
Compatibility:
- Allows other mods to prevent LightTouch from processing interface inputs for a specific unit for a specific duration by calling LuaEvents.LTMOD_RemoteControl

Version 2.0
General:
- Debug info is now disabled by default
- Mod no longer uses InGame.xml

Bugs Fixed:
- Mod functionality didn't work properly for units which embarked/disembarkerd
- automated workers were sometimes stopping after cleaning fallout
- in Ancient period, automated workers were trying to build improvements for which the tech was not researched yet
- worker automation didn't work near the left/right edge of the map (on maps which have such edges)



Download:

- on Steam Workshop http://steamcommunity.com/sharedfiles/filedetails/?id=82796516
- on Civ Database: http://forums.civfanatics.com/downloads.php?do=file&id=19634

Also, here's a youtube video demonstrating all of the functionality http://www.youtube.com/watch?v=SYhSH4J-NT4
 
looks good, will try it in my next game :goodjob:
 
looks good, will try it in my next game :goodjob:

Thanks :)
Actually, you should have no problems trying it even in your current game if you want to. It doesn't add any new objects to the game database. So, even though it adds data to savefiles, they can still be loaded without my mod. And the other way around, saves created without my mod can be opened when it's on.
 
Can't seem to get my workers to idle; they improve all available tiles, then ask for orders. Is that how "Standby" should be working?

Great work on this though!
 
Can't seem to get my workers to idle; they improve all available tiles, then ask for orders. Is that how "Standby" should be working?

Great work on this though!

Thanks Loot. That's exactly how Standby should work, so it sounds like it's not working properly for you. If you have an SDK installed, you could give me the LiveTuner console output and I'll take a look at what's going on.
Otherwise, err... It might be interference with some other mod, do you have many installed?
 
Version 2.0 out

It should be called 1.1, but civ doesn't seem to allow that. List of changes:

General:
- Debug info is now disabled by default
- Mod no longer uses InGame.xml

Bugs Fixed:
- Mod functionality didn't work properly for units which embarked/disembarkerd
- automated workers were sometimes stopping after cleaning fallout
- in Ancient period, automated workers were trying to build improvements for which the tech was not researched yet
- worker automation didn't work near the left/right edge of the map (on maps which have such edges)

~~~~~~~~

I updated it on Mod Hub and in the OP. It seems that Mod Hub doesn't allow to update the mod, only post a new version separately, so I have set the previous version to private, which leaves new version with 0 rating and downloads. I think it's always more reassuring to download a mod which has already been downloaded by a hundred people, I wonder if I'm missing anything here.
 
Hi, haven't tried it yet, but sounds interesting. Part of the reason I've stayed away is because of the changes to WorldView.lua, which is similar to an issue I was having trying to come up with a way to enable the Airlift functionality.

In that one figured out how to pull all of the interface handling stuff off into its own LUA, which would be potentially a really useful thing to do for you - as any other mod that modified WorldView.lua would be incompatible with this one. (Explained here: http://forums.civfanatics.com/showthread.php?t=427632)

Otherwise awesome work, I will try this one out shortly! This puts in something that I very much wanted to see.
 
Thanks jerseymike! When I saw your mod posted I was quite curious so I have already checked it out, good job on it too :goodjob:

I was thinking about how to make my mod separate from standard WorldView, and there are a couple of problems. For example, your mod's input handler starts with check "if (interfaceMode == InterfaceModeTypes.INTERFACEMODE_AIRLIFT)". Airlift interface is not handled in WorldView, so even though WorldView InputHandler function will be triggered when you use Airlift, it won't process it.

For some of my functionality, like multi-turn rebasing, this will work similarly: if you try to rebase to a city that's too far, WorldView won't process it, and then my mod will handle it. But there is some functionality, which my mod is specifically intended to overwrite, like if you select a worker and right-click a city, you want him to automate, and you don't want the standard WorldView handler to issue move command to him. So, as long as I want to overwrite some of the original functionality, it seems I have to use the same file, because there is no way to disable a specific WorldView handler without replacing the whole file.

Also, I am concerned about compatibility, but I am not aware of any mods which modify WorldView. If I knew of any, I'd like to take a look so I can get a more concrete idea of compatibility issues. Any mod which adds a new interface, like your Airport, won't conflict with my mod. Any mod which changes existing input handling will be overwriting WorldView, so to make it compatible it will need to be physically merged I guess, just like this: :assimilate: hehe

Actually, I am updating my mod to allow any other mods to disable input handling for a specific unit, by calling a specific LuaEvent. Theoretically, this could allow all mods which want to modify WorldView to use the same modded WorldView plus additional functionality which they want to introduce in modular lua files. Of course, if any people modding WorldView have interest in such modularity ;)
 
Version 4.0 out:

This update is necessary to make Light Touch compatible with the latest patch.

Bug Fixed:
- If an air unit performs a multi-turn rebasing to a ship, it no longer wakes the ship.
- Execution of scheduled missions could stop sometimes for all units if a unit got killed.

Otherwise no functionality changes.

Enjoy! :yup:
 
Alternative Version 4.0 is available:

this version doesn't modify Diplo Corner menu. Some mods, like InfoAddict totally need that menu, and for my mod it's not that important. So, if you were having problems using LightTouch and InfoAddict together, you should try the alternative version.

You won't be able to use the LT Options menu in that version, but it's probably not like you were using it anyway xD
 
actually i've been using the right click fuction just moving my soldiers around faster than the left click button. i've been that menu to fix it.

Joey
 
actually i've been using the right click fuction just moving my soldiers around faster than the left click button. i've been that menu to fix it.

Joey

You are welcome to stay with the standard version then. I'm glad that menu wasn't entirely useless :)

There is a "modular" Diplo Corner menu somewhere here on the forums. I'm not sure how it works but I'll try to make it so both LT Options and InfoAddict are accessible in Diplo Corner.
 
i tried the standard v4 and the info addicts where still there over the light touch button.

I liked the workers keep moving while the enemy is around. the right button i turn off the option. Because i like the lazy way in moving anyone.

Joey
 
The reason InfoAddict is on top is because it loaded later. Honestly, I don't know what determines the order of mods loading :blush:, but I think it's related to which one is released or installed later.

InfoAddict uses modular DiploCorner, so I will modify LT to use modular asap. That way both InfoAddict and LT will be in the menu.

Thanks for pointing this out.
 
your welcome.

Take your time as i'm trying to get through a game that can reload and not crash...

Joey
 
Alright i'll give it a try...

I'm happy with the new version thank you.

Joey
 
Top Bottom