Connect adjacent belts to entity

This is the place to request new mods or give ideas about what could be done.
Post Reply
judos
Filter Inserter
Filter Inserter
Posts: 266
Joined: Mon Dec 08, 2014 11:17 am
Contact:

Connect adjacent belts to entity

Post by judos »

For my belt sorter mod I would like to make outgoing belts connect to the entity itself.
However currently I don't see a way to implement this. Spawning invisible belts below the entity doesn't help since there would be multiple outgoing belts and those outgoing belts only check for 1 belt on the beltSorter's tile it seems.
See also this screenshot: https://github.com/judos/beltSorter/issues/9

It would be cool to have a property to make belts automatically connect (visually change their input direction) to an entity.
Thanks for your feedback!

Cheers

User avatar
aubergine18
Smart Inserter
Smart Inserter
Posts: 1264
Joined: Fri Jul 22, 2016 8:51 pm
Contact:

Re: Connect adjacent belts to entity

Post by aubergine18 »

The base game is getting "loader" belts that do this sort of thing. There's a mod that enables the hidden entities: https://mods.factorio.com/mods/kij336/add-loader
Better forum search for modders: Enclose your search term in quotes, eg. "font_color" or "custom-input" - it prevents the forum search from splitting on hypens and underscores, resulting in much more accurate results.

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

Re: Connect adjacent belts to entity

Post by DedlySpyder »

aubergine18 wrote:The base game is getting "loader" belts that do this sort of thing. There's a mod that enables the hidden entities: https://mods.factorio.com/mods/kij336/add-loader
Pretty sure that loaders were scrapped from the game (replaced by stack inserters), but they included what they had on them for modders to use

judos
Filter Inserter
Filter Inserter
Posts: 266
Joined: Mon Dec 08, 2014 11:17 am
Contact:

Re: Connect adjacent belts to entity

Post by judos »

Ok thanks to Nexela we could narrow down the problem.

Spawning multiple belts on the same tile helps and adjacend belts will connect. The problem is only 2 output belts will connect and it's always either only vertical or only horizontal. See also the image.
Attachments
3d15177a-790b-11e6-95c1-1d5368d4366e.png
3d15177a-790b-11e6-95c1-1d5368d4366e.png (213.91 KiB) Viewed 2809 times
Last edited by judos on Mon Sep 12, 2016 11:01 pm, edited 1 time in total.

User avatar
aubergine18
Smart Inserter
Smart Inserter
Posts: 1264
Joined: Fri Jul 22, 2016 8:51 pm
Contact:

Re: Connect adjacent belts to entity

Post by aubergine18 »

See also the appendix.
?
Better forum search for modders: Enclose your search term in quotes, eg. "font_color" or "custom-input" - it prevents the forum search from splitting on hypens and underscores, resulting in much more accurate results.


User avatar
aubergine18
Smart Inserter
Smart Inserter
Posts: 1264
Joined: Fri Jul 22, 2016 8:51 pm
Contact:

Re: Connect adjacent belts to entity

Post by aubergine18 »

For the curved belts, have you investigated their .direction/.orientation/etc? Maybe a combination of the two is what determines whether to use curved belt sprites? If so, you could potentially listen for changes in belts (create/destroy, etc) adjacent to your entity, and then ensure any that connect to your entity have the right combo of .direction and .orientation etc?
Better forum search for modders: Enclose your search term in quotes, eg. "font_color" or "custom-input" - it prevents the forum search from splitting on hypens and underscores, resulting in much more accurate results.

Nexela
Smart Inserter
Smart Inserter
Posts: 1828
Joined: Wed May 25, 2016 11:09 am
Contact:

Re: Connect adjacent belts to entity

Post by Nexela »

Just for giggles

Way too hacky to include reliably but a proof of concept. and gives me hope that it can be done!
Attachments
sorter.png
sorter.png (156.35 KiB) Viewed 2803 times

User avatar
aubergine18
Smart Inserter
Smart Inserter
Posts: 1264
Joined: Fri Jul 22, 2016 8:51 pm
Contact:

Re: Connect adjacent belts to entity

Post by aubergine18 »

Which property was it - the .orientation or .direction or something else?
Better forum search for modders: Enclose your search term in quotes, eg. "font_color" or "custom-input" - it prevents the forum search from splitting on hypens and underscores, resulting in much more accurate results.


Post Reply

Return to “Ideas and Requests For Mods”