Timberborn

Timberborn

168 ratings
Automation
3
5
   
Award
Favorite
Favorited
Unfavorite
Mod
File Size
Posted
Updated
2.592 MB
4 Sep, 2024 @ 12:12am
5 Sep @ 11:09pm
24 Change Notes ( view )

Subscribe to download
Automation

Description
Overview
This mod allows assigning a set of rules to a building. The rules execute logic "If This Then That" (a.k.a. IFTTT). Each rule has a condition to check and an action to execute if the condition evaluates to "true." The rules are written with a simple scripting language. However, it is not required to learn this language to make simple rules, since for this purpose a UI is provided. The UI is designed to be simple and intuitive, so you can easily create rules without writing any code.

If you feel like you can learn the scripting language, you can do so. The scripting language is simple and easy to learn. Read about it here[github.com].

Supported languages
English
Русский

Rules editor dialog
Rules can be created and edited via the Rules editor dialog. The dialog is opened by clicking on the related button in the building's entity UI.



Templates tools
For the simple and frequently used cases, a set of templates is provided. You can select a set of buildings and apply a template to them. The template will automatically create the rules needed to achieve the desired behavior. The created rules can be modified via the editor dialog later if needed.

All templates are grouped by their purpose. The root menu has an icon for each group.



There are also special actions available, not related to the rules:
  • Pause/resume tool. Use it to quickly change the state of a set of buildings.
  • Chained construction tool. Apply this rule to the unfinished buildings. This rule will try to order the constructions so that the builders aren't getting blocked while working. It is not guaranteed that the builders will not get blocked, but it is a good way to reduce the number of blocks.
  • Pause when almost ready. This tool applies rules that stop the construction at the last moment. Just in case you need to have control of it!
  • [Dev mode only] Immediate completion of the selected buildings. Select buildings to complete, and they all will instantly finish.
  • [Dev mode only] Inspects components and navmeshes on the buildings. Useful for those who make mods.
* Press Shift+Alt+Z to activate dev mode

Dynamite templates
Templates to create rules that automatically detonate a dynamite and place a new one at the same place. This action is repeated multiple times. It can be handy when doing massive terraform. Be careful not to kill your workers! Once one dynamite is activated, the whole field will explode. The safest usage is to dig holes below the surface (for example, from the bridges or at the cliff).



Water templates
Templates to create rules that trigger on the weather season change:
  • Pause/resume a building on the season change.
  • Close/open floodgates based on the current season.
  • Open/close the water control buildings during the drought season.



Storage templates
Templates to create rules that trigger based on the building's storage.
  • Start emptying the building when there is too much product in the inventory. In this mode, all the available workers, including the ones from the idle buildings, will rush to help move the goods out of the building to the appropriate storage with spare capacity.
  • Prioritize building to haulers when the building construction completes. The game doesn't allow setting it via UI, but with automation you can do it.



Population templates
Templates to create rules that trigger based on the current beaver or bot population size. The buildings will pause if the population is too high and resume if it is too low. It is a good way to control the bot population. Also, it will work well for the Ironteeth faction to control the beaver population.



Gathering and planting templates
The gathering templates create rules that trigger based on the current number of plants available for gathering. The buildings will pause if there are no plants left and resume if there are some plants available. It is a good way to control the gathering buildings.

The planting template creates rules that trigger based on if there are empty soil blocks available for planting. The buildings will pause if there is no soil left and resume if there are some empty soil blocks available. It is a good way to control the planting buildings.



Signals templates
This group is for the advanced players. When you need to make a rule based on a stat value of another building, the very first thing you need to do is to create a custom signal. This signal can be used in the conditions of other buildings.

The floodgate group template demonstrates how the custom signals system can be used to synchronize the behavior on the similar buildings.



Other mods support
Mods that significantly alter gameplay may affect Automation behavior. You can suggest mods for support in Discord or the Discussions threads — they might be added in the future.

Here’s the full list of what is supported as of now:

Questions and discussions
Note that Steam has a special tab called "Discussions." It is a better place to ask questions or discuss features than doing so in the comments. I will do my best to answer all questions there, so don't hesitate to ask.



Discord:
See more details in the Wiki: https://github.com/ihsoft/TimberbornMods/wiki/Automation
Report a bug: https://github.com/ihsoft/TimberbornMods/labels/automation
GitHub repository: https://github.com/ihsoft/TimberbornMods
Popular Discussions View All (17)
30
1 Oct @ 12:53am
PINNED: HELP! Automation scripting questions and answers
ihsoft
39
8 hours ago
PINNED: Q&A: Automation features
ihsoft
10
19 Jun @ 12:19am
Crash: Automation v Moddable Weather
波紋 小石
154 Comments
ihsoft  [author] 4 Oct @ 8:59pm 
@OldGamer Thankls for the report. Will be fixed in the next version.
OldGamer 1 Oct @ 8:08am 
Hi Igor,
Small bug in the 'add' function. When adding up to two warehouses, everything works fine. However, if a third is added, it's visible in script mode, but only the first two are shown when saving. Is there a solution?
Seraphin 29 Sep @ 8:44am 
Thank you for your response.
ihsoft  [author] 27 Sep @ 7:24pm 
@Seaphin, the comments section is not a very good place for discussions. I moved your questions to https://gtm.steamproxy.vip/workshop/filedetails/discussion/3324234282/4635988093614225284/ and added my comments. Check them out.
Seraphin 25 Sep @ 11:09am 
2/2

Also I miss signals for power usage to pause/unpause buildings, but I'm aware you made a separate full mod for power, guess I need to check it out, if it's usefull to me. I don't know if it's already included, as I didn't unlock batteries yet, how about at least being able to read the stored power if not included yet?

And as someone asked already below, I'd also like to support sluices being able to set a contamination signal, just like the gauges. They already messure it in vanilla. If there is already a sluice in the river, a separate gauge my be redundant and as it's 3 tiles high, it doesn't always fit into a place visually.
Seraphin 25 Sep @ 11:09am 
Hi Igor, first I wanna say thank you very much for this mod. I just started to use it recently and already using adancing more complex conditions for automatition. I really like these possibilities, even thought it gets a little confusing the more complex the scripts get.

A few questions though:

First I realized you are able to set sluices to "flow" and "no flow", but theres no way to set it back to "auto". I've got a case where I like to shut it by automatition, but instead of fully opening I'd like it to be auto. So I really would appreciate it if that one would be added? Is it missing by design? Was it forgotten? Or are there any problems involved?

1/2
ihsoft  [author] 30 Aug @ 6:53pm 
@Imricdaelf120741 Supporting other mods is always a pain. As of now there is only one mod that Automation is officially supporting: Moddable Weather. The modded weathers are offered in UI when you create rules. However, there are issues like this one: https://github.com/ihsoft/TimberbornMods/issues/118 . There can be more in the future - it's how the modding world lives).

Feel free to raise your case in the discussions section (create a thread if you want to) with the mod that you use and want to be supported in Automation. I can't promise to support all the suggested mods, but I can promise to consider every suggestion.
Imricdaelf120741 30 Aug @ 3:35pm 
For anyone who has modded foods (like berry filling for example) the simple UI if/then script might not work with this. I.E. when my fermenter fills up it pauses, then resumes when its empty. I ended up using efficiency automation settings for the fermenter making berry filling and it gave me the same end result. (Not a complaint or a real problem)

Also if you have other weather effects (like Moddable Weather) the automation settings can be a bit rough to do with the if/then. My water pumps were able to work with a long list of on/offs, but my floodgates didn't act together and had to each have the same settings. (Also not a complaint or a real problem)

Great mod though and super useful.
ihsoft  [author] 24 Aug @ 6:17pm 
@OldGamer Checkout the "Signals templates" section above (in the description). The template wth the gaage on the icon will help you to setup "the export". Once you did it, you will see "Signal: XXX" in the normal conditions UI. And the link to Wiki can also help: https://github.com/ihsoft/TimberbornMods/wiki/Automation-(scripting)#main-concepts-of-the-scripting-approach (it's in the mod description).
OldGamer 24 Aug @ 4:38pm 
Sorry, but I don't understand your answer. Could you explain it for idiots like me?