[Idea] Smart Blocker

This is the place to request new mods or give ideas about what could be done.
Post Reply
n7m6e7
Long Handed Inserter
Long Handed Inserter
Posts: 78
Joined: Fri Mar 04, 2016 8:39 pm
Contact:

[Idea] Smart Blocker

Post by n7m6e7 »

I just still can't get over the fact that one cannot block a single lane of a belt without using an underground belt. (which then requires the "lane blocker" to be 3X2 minimum, 2 spaces to the opposite side of the lane you want, to keep the belt straight. I understand challenge... but its kinda more BS than challenge in my opinion. such a pain that its not worth doing in most cases. )

How difficult would it be to make a Smart blocker?

Features:
Able to block the left, right, both or neither lane

Possible extra features:
Connection to network (so logic could dictate when it allows flow. i.e. if you build an overflow sensor, 2 could be used with a splitter to redirect flow)
Moves as fast as the belt feeding into it (as such, it'll cost more than an express belt)

Seriously, I've never modded anything, and this may be my first attempt if no one picks it up. How difficult would it be to add this device as I've explained it?
There are no absolutes. I live knowing I could always be wrong, but with confidence that I could also be right.

User avatar
DedlySpyder
Filter Inserter
Filter Inserter
Posts: 253
Joined: Fri Jun 20, 2014 11:42 am
Contact:

Re: [Idea] Smart Blocker

Post by DedlySpyder »

There's an old mod out there for pre 0.12 that did this. But in 0.12 they changed how transport lanes work and the mod stopped being updated.

I think the issue is that the items on a belt don't exist like normal items and entities, they only check collision in a very specific way that may make a blocker impossible. (I can't verify this for sure though, it definitely broke the old mod AFAIK)

n7m6e7
Long Handed Inserter
Long Handed Inserter
Posts: 78
Joined: Fri Mar 04, 2016 8:39 pm
Contact:

Re: [Idea] Smart Blocker

Post by n7m6e7 »

Well, underground belts can block a lane. Im unfamiliar with how its coded, but worst case, couldnt i modify the underground belt? Keep the collision that stops one lane, and rotate the belt part 90 degrees
There are no absolutes. I live knowing I could always be wrong, but with confidence that I could also be right.

User avatar
DedlySpyder
Filter Inserter
Filter Inserter
Posts: 253
Joined: Fri Jun 20, 2014 11:42 am
Contact:

Re: [Idea] Smart Blocker

Post by DedlySpyder »

n7m6e7 wrote:Well, underground belts can block a lane. Im unfamiliar with how its coded, but worst case, couldnt i modify the underground belt? Keep the collision that stops one lane, and rotate the belt part 90 degrees
¯\_(ツ)_/¯

I think the underground hood blocks the one lane because it isn't really there, so the lane that hits the hood is effectively just ending, while the other one is hitting a lane.

Again these are only assumptions, and reading the prototypes requires tracking down several variables in different files, so I'm too lazy to track them down to make some sense of the matter. There is also no page in the wiki for the prototypes of anything involving belts.

User avatar
Mooncat
Smart Inserter
Smart Inserter
Posts: 1194
Joined: Wed May 18, 2016 4:55 pm
Contact:

Re: [Idea] Smart Blocker

Post by Mooncat »

I don't think it is possible with the current API.
As DedlySpyder said, 0.12 has changed the mechanism. (FFF #82)

Basically, each Transport Belt has 2 Transport Lines, and here is the API you can use. There is no stop() function or something like that.
An Underground Belt can stop a lane because its Transport Line doesn't connect to the line on Transport Belt.

Based on my research, an Underground Belt actually has 4 Transport Lines, 2 lines on the first half (surface) and 2 on the remaining half (underground). When placed perpendicularly, a line on the first half can connect to the Transport Belt, while the line on the remaining half cannot. As the result, a line on the Transport Belt is blocked because there is no further path.

Same go to Splitter. It has 4 Transport Lines, but none of them connect to the lines on perpendicular Transport Belt.

Also, based on the current way of entity creation, I can't see any way to define the behavior of Transport Line.

Post Reply

Return to “Ideas and Requests For Mods”