AAI Programmable Structures


Adds scanning and control structures based on other mods installed. Includes a Tile Scanner by default that can the contents of tiles. Can scan and place Zones with AAI Zones mod. Can scan and control vehicles and their data with AAI Programmable Vehicles mod.

Content
2 years ago
0.14 - 1.1
123K
Circuit network

g How to count the number of buildings in a zone?

6 years ago

Hey folks, I'm trying to make a capacity indicator for a group of storage tanks with combinators. I've set that up, but so far I have to manually set the number of tanks on a constant combinator, and then the mechanism will do the math to determine the % use capacity for the combined tanks.

This isn't terrible, but this is also factorio, so I want to automate that, so that I can just add more tanks and it'll all update. I think the best way to do this is by placing a zone in the area I'll put all of the tanks in, and then use a zone and tile scanner to count the # of tanks, and replace the constant combinator with that output.

So far, I've placed the zone scanner and hooked it's output up to the input of a tile scanner, but that only seems to scan one tile at a time, so it'll never see more than one tank. How would I make the time scanner scan the whole zone and determine the number of tanks?

6 years ago

You'd have to loop through every x%3 y%3 position in the zone and add 1 to a tank counter if there is a tank there, save the result at the end, clear the temporary counter and then repeat. I would not recommend this at all, it's a huge UPS cost for something that can be done a different way. In your blueprint just add a constant combinator linked to each tank with a value of 1 tank so each added tank also adds a tank signal, or you could save combinators by having 1 combinator per column of 5 tanks with a value of 5, something like that.