Is it possible to use the built-in type "underground-belt" to create non-straight (i.e. moves five right, one up) underground belts? I'd like to make a belt which looks "right" when traversing cliffs, so going down a cliff would make the belt go down one tile.
Ideally I would be able to manually set the "neighbours" attribute of the LuaEntity, but it's read-only...
Non-straight underground belts
-
- Burner Inserter
- Posts: 17
- Joined: Tue Aug 15, 2017 7:53 am
- Contact:
Re: Non-straight underground belts
Underground belts search for their neighbor on building and saving/loading. They don't store who their neighbor is. This logic has to be strictly deterministic independent of order or it can change on load, causing a desync.
But I'm definitely looking into it!
But I'm definitely looking into it!
- Ranakastrasz
- Smart Inserter
- Posts: 2124
- Joined: Thu Jun 12, 2014 3:05 am
- Contact:
Re: Non-straight underground belts
Ok, that is cool. Can't wait.
Obviously needs to apply to pipes as well
Hmm. Can probably scan on placement somehow, and shift the scan up/down one tiles for left/right cliffs. I have a vague idea of how you might do it.
If you load the game, and it resets the connection, and you, on... load? (that can't be the right one, because on_load isn't multiplayer friendly or something) force it to reconnect the same way... What happens to the items in the tunnel?
Obviously needs to apply to pipes as well
Hmm. Can probably scan on placement somehow, and shift the scan up/down one tiles for left/right cliffs. I have a vague idea of how you might do it.
If you load the game, and it resets the connection, and you, on... load? (that can't be the right one, because on_load isn't multiplayer friendly or something) force it to reconnect the same way... What happens to the items in the tunnel?
My Mods:
Modular Armor Revamp - V16
Large Chests - V16
Agent Orange - V16
Flare - V16
Easy Refineries - V16
Modular Armor Revamp - V16
Large Chests - V16
Agent Orange - V16
Flare - V16
Easy Refineries - V16
Re: Non-straight underground belts
Cliffs overlap so a simple "is there a cliff in this tile?" check may end up counting a cliff twice or counting two overlapping cliffs and resulting in an extreme offset. I can't limit the check to only one elevation change or there can be circumstances where an UB cannot bridge a short u-bend of cliffs, or two cliffs close together would line up with only a single offset. Additionally, the process needs to work in reverse, pathing from the other UB. It's tricky business!
- Ranakastrasz
- Smart Inserter
- Posts: 2124
- Joined: Thu Jun 12, 2014 3:05 am
- Contact:
Re: Non-straight underground belts
Hmm, true enough. Can probably detect if they are side-by-side by coordinates being vertically adjacent to each other.Mylon wrote:Cliffs overlap so a simple "is there a cliff in this tile?" check may end up counting a cliff twice or counting two overlapping cliffs and resulting in an extreme offset. I can't limit the check to only one elevation change or there can be circumstances where an UB cannot bridge a short u-bend of cliffs, or two cliffs close together would line up with only a single offset. Additionally, the process needs to work in reverse, pathing from the other UB. It's tricky business!
Corners however might be more complex.
Still, Setup some logic, test it, figure out exactly what needs to be handled.
My Mods:
Modular Armor Revamp - V16
Large Chests - V16
Agent Orange - V16
Flare - V16
Easy Refineries - V16
Modular Armor Revamp - V16
Large Chests - V16
Agent Orange - V16
Flare - V16
Easy Refineries - V16