Page 1 of 2

RepairChest Mod

Posted: Fri Jun 19, 2015 8:48 pm
by kiba
Would be nice if I could have a chest which request all the necessary materials to repair a given area. Then, the construction bots can use it as a source.

Heck, I am working on learning how to mod right now so I can do that sort of thing.

Re: RepairChest Mod

Posted: Wed Jun 24, 2015 3:35 am
by omega_haxors
I suppose you could simply use a requester chest and insert the contents into a roboport.

Not really too hard to make a mod for either, so I would highly suggest you take a few hours to learn the API and how to add new items.

Re: RepairChest Mod

Posted: Wed Jun 24, 2015 10:14 pm
by kiba
Got to the point of having a working "repair chest" but it's still basically a copy of the requester chest.

From now on, I'll have to write new code and make it do something different. Currently, I should be focused on identifying all objects within a limited area. Say, 5x5.

Re: RepairChest Mod

Posted: Thu Jun 25, 2015 1:23 am
by kiba
I am trying to find the code for various logistic modes, but I can't find it anywhere.

I don't know where to look even. I think I'll have to look at different mods and see how they do stuff.

Re: RepairChest Mod

Posted: Thu Jun 25, 2015 2:06 am
by semvoz
kiba wrote:I am trying to find the code for various logistic modes, but I can't find it anywhere.

I don't know where to look even. I think I'll have to look at different mods and see how they do stuff.
I am not sure what you are exactly looking for, but if I correctly remember TreeFarm's fieldmk2 (or its overlay can't remember) is extending from logistic chest.

You can give it a try I guess.

Re: RepairChest Mod

Posted: Thu Jun 25, 2015 2:12 am
by kiba
semvoz wrote:
kiba wrote:
I am not sure what you are exactly looking for, but if I correctly remember TreeFarm's fieldmk2 (or its overlay can't remember) is extending from logistic chest.

You can give it a try I guess.
I want to know:

1) How the robotic network gets a list of items to supply a given area.
2) How to make the robots use the chest as a source.

But baby step first, or at least find where should I take a baby step.

The first question that pop up in my mind is how to access the content of the chest. That I will figure out tomorrow.

Re: RepairChest Mod

Posted: Thu Jun 25, 2015 2:29 am
by semvoz
I am just guessing here, but I am not sure there's such area you are talking of unless you implement it.

If my understanding is correct (and that is a big if), the list should be computed by checking each requester chest in the logistic network.

If your chest extends passive/active provider chest, the robots (logistic) should be able to access it, not sure for construction robots as they might need to take the repair pack from a roboport. Maybe you can simulate the chest behavior by automatically adding the repair pack to a roboport? But then you'll lose the control over the repair area.

Could also extends roboport and change the size of the construction area, just ideas, don't take my words as truth, I'm also a beginner in modding :mrgreen:

Accessing the content of the chest is pretty easy but it's good exercise to search for it so I won't spoil the pleasure :lol:

Re: RepairChest Mod

Posted: Thu Jun 25, 2015 3:29 am
by kiba
semvoz wrote:I am just guessing here, but I am not sure there's such area you are talking of unless you implement it.

If my understanding is correct (and that is a big if), the list should be computed by checking each requester chest in the logistic network.
Not quite it.

The idea is that the repair chest takes a list of items in a small area. That list becomes a request list.

For example, within a five by five area, you have five turrets, one medium electric pole, 5 inserters and five transport belts.

Thus, the repair chest requests those long list of items from the logistic network to be kept there when objects go BOOM and you need to replace them. It doesn't help you replace the repair chest when it goes boom though.

Re: RepairChest Mod

Posted: Thu Jun 25, 2015 6:14 am
by semvoz
kiba wrote:
semvoz wrote:I am just guessing here, but I am not sure there's such area you are talking of unless you implement it.

If my understanding is correct (and that is a big if), the list should be computed by checking each requester chest in the logistic network.
Not quite it.

The idea is that the repair chest takes a list of items in a small area. That list becomes a request list.

For example, within a five by five area, you have five turrets, one medium electric pole, 5 inserters and five transport belts.

Thus, the repair chest requests those long list of items from the logistic network to be kept there when objects go BOOM and you need to replace them. It doesn't help you replace the repair chest when it goes boom though.
I misunderstood what you were saying there:
kiba wrote:1) How the robotic network gets a list of items to supply a given area.
I thought you wanted to know how the actual logistic network was handling the requested items.

Based on what you say, I do not understand the difference with a classic provider chest then.
I am getting confused.

Re: RepairChest Mod

Posted: Thu Jun 25, 2015 6:27 am
by Koub
I think what the OP wants to do is a requester chest that can make an inventory of all entities built within a given range (20, or 50 tiles maybe), and request a few of each entity preventively. Like that, if an entity is damaged, the construction bots can rebuild faster (they don't have to fly waaaay to the storage area to get that turret or that wall : there will always be a certain amount of what's needed to rebuild close by).

Re: RepairChest Mod

Posted: Thu Jun 25, 2015 7:27 am
by semvoz
Koub wrote:I think what the OP wants to do is a requester chest that can make an inventory of all entities built within a given range (20, or 50 tiles maybe), and request a few of each entity preventively. Like that, if an entity is damaged, the construction bots can rebuild faster (they don't have to fly waaaay to the storage area to get that turret or that wall : there will always be a certain amount of what's needed to rebuild close by).
I see a sort of local buffer, why not :)

Re: RepairChest Mod

Posted: Thu Jun 25, 2015 7:36 am
by omega_haxors
Koub wrote:I think what the OP wants to do is a requester chest that can make an inventory of all entities built within a given range (20, or 50 tiles maybe), and request a few of each entity preventively. Like that, if an entity is damaged, the construction bots can rebuild faster (they don't have to fly waaaay to the storage area to get that turret or that wall : there will always be a certain amount of what's needed to rebuild close by).
If that's the case, a few storage chests placed near areas of interest would work great, since (i'm pretty sure) construction bots can obtain repair packs from them. Call me out if i'm wrong.

Just make sure it's within the logistics zone. Not sure if it matters, but it's better to be safe.

Re: RepairChest Mod

Posted: Thu Jun 25, 2015 7:45 am
by Takezu
Thing with storage chests is, they get only filled with one item as long as free storage chests avilable in the system. and they get filled somwhat randomly.
But yes Construction bots can take Items out of any of the tree providing chests, the activ the passiv and the storage chest.
They however have no acess to items in requesterchests, well, items in requester chests are no longer considert avilable for the system.

Re: RepairChest Mod

Posted: Thu Jun 25, 2015 11:54 am
by kiba
Koub wrote:I think what the OP wants to do is a requester chest that can make an inventory of all entities built within a given range (20, or 50 tiles maybe), and request a few of each entity preventively. Like that, if an entity is damaged, the construction bots can rebuild faster (they don't have to fly waaaay to the storage area to get that turret or that wall : there will always be a certain amount of what's needed to rebuild close by).
This is correct!

Re: RepairChest Mod

Posted: Fri Jun 26, 2015 7:23 am
by omega_haxors
Takezu wrote:Thing with storage chests is, they get only filled with one item as long as free storage chests avilable in the system. and they get filled somwhat randomly.
But yes Construction bots can take Items out of any of the tree providing chests, the activ the passiv and the storage chest.
They however have no acess to items in requesterchests, well, items in requester chests are no longer considert avilable for the system.
Requester chest with a smart inserter, and 2 red/green wires will fix this. Just tell it "as long as the amount of repair packs in the red/green network is over/under said amount, activate"

Nice to hear that construction-bots can use items from the chests. I have fun things in plan for next game I start. :twisted:

Re: RepairChest Mod

Posted: Fri Jun 26, 2015 7:45 am
by Takezu
Well you're aware that if you transfer items from a requester back into a storage chest creat a loop?
Item gets transferd bot comes packs it back in the requester, item gets transfered, and so on and so forth.
Afaik items in a smart chest aren'T available for bots either. So the thing would be pretty funny to watch as the bot packs the item right back into the requester chest as son as the inserter has transfered it. Sad side is that the bot is occupied by that task and not available for other tasks.

Re: RepairChest Mod

Posted: Fri Jun 26, 2015 7:51 am
by omega_haxors
Takezu wrote:Well you're aware that if you transfer items from a requester back into a storage chest creat a loop?
Item gets transferd bot comes packs it back in the requester, item gets transfered, and so on and so forth.
Afaik items in a smart chest aren'T available for bots either. So the thing would be pretty funny to watch as the bot packs the item right back into the requester chest as son as the inserter has transfered it. Sad side is that the bot is occupied by that task and not available for other tasks.
I didn't think of that! I suppose using an off-network requester or a belt-based one, you could work around that limitation. Smart use of smart inserters and local wire networks might also help.

It's worth noting that logistics chests have the same capabilities as smart chests, so you can hook a wire to a storage chest and then to an inserter.

It's confirmed that the chests have to be within the logistics zone, so that makes things a lot harder for me to figure out. Seems the only solution is to belt around all of your repair packs to all of the different areas.

Re: RepairChest Mod

Posted: Fri Jun 26, 2015 8:13 am
by Takezu
Yeah right, but the logistics network and the wire network are seperate things.
Bots can only take and deliver things in the supplyarea, construction bots can also construct and deconstruct in the cunstruction area.
I don't now where you want to went there, but items for construction have to be provided in the supply area. The bad thing is, any provider is equally valid.
The priority chain says only take first from activ then storage then take from passiv. if you request something, and how ever you build it if in the end it lands in a provider or stroage, which it inevetablie must because the bots have to take it, it lands in the end again by the provider. The bots don't care about wires as far as i'm aware. Neither can they grab things out of smart chests. so sooner or later your item has to land in a storage or provider chest in the supply area to be available for the constructors. And if your starting point is a requester chest, it's highly possible that the thing starts the circle anew. What might work is changing the requester to a belt feed smart chest. but that works only if the thing wouldn'T be needet at some other point. and if you would have more then one of those storages there is no guarantee that the bots grab from the nearest point. All points are equal whereever they are, as long as they are in the supplyarea of the network, which the have to be for the bots.
So in the end i don't see a reliable path to prevent that logibots grab the thing to bring it back to the start, or the constuctor grab the things near the constuction site, if all is in the same logisticsystem.

If you where to seperate the system wich does the constuction from the sytsem with the item and shortcut it with an inserter, then it would work. But that would raise new logistical problems i think. but thats where they leave me, i've no experience with more then one Network ;)

Re: RepairChest Mod

Posted: Fri Jun 26, 2015 8:18 am
by omega_haxors
You would be surprised what you can do with the wire network.

That said, the problem boils down to what you mentioned; sooner or later you need to get resources from somewhere, and that somewhere tends to be the closest storage chest.

Although the solution may be a lot simpler than we have been thinking. Active provider from the factory. The bots will search out for storage chests when no valid target is found. Won't work as well if there's other storage chests on the same network, but a few smart inserters can filter them out.

Re: RepairChest Mod

Posted: Fri Jun 26, 2015 8:22 am
by Takezu
Yeah but you'll end up with one itemtype per storage chest as long as free storage chests available. The bots only put different items together if the find no free storage chest.