Rotateable entity with inventory

Place to get help with not working mods / modding interface.
Post Reply
User avatar
DaveMcW
Smart Inserter
Smart Inserter
Posts: 3700
Joined: Tue May 13, 2014 11:06 am
Contact:

Rotateable entity with inventory

Post by DaveMcW »

I need an entity with:
4 rotations
1 inventory that holds at least 1 item of any type

What is the best entity type to use?

User avatar
eradicator
Smart Inserter
Smart Inserter
Posts: 5206
Joined: Tue Jul 12, 2016 9:03 am
Contact:

Re: Rotateable entity with inventory

Post by eradicator »

There's only 3 types that have variable inventory size in the first place. Wagons, Cars and Containers (yea, i didn't count logistic variants).
Containers don't rotate, wagons need rails, so there's only cars left. As a bonus you get filters. Unless you don't really need an actual inventory, in which case a constant combinator might work.
Author of: Belt Planner, Hand Crank Generator, Screenshot Maker, /sudo and more.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.

User avatar
DaveMcW
Smart Inserter
Smart Inserter
Posts: 3700
Joined: Tue May 13, 2014 11:06 am
Contact:

Re: Rotateable entity with inventory

Post by DaveMcW »

I don't need variable inventory size, just the ability to insert 1 item without silly restrictions like "ammo only".

User avatar
eradicator
Smart Inserter
Smart Inserter
Posts: 5206
Joined: Tue Jul 12, 2016 9:03 am
Contact:

Re: Rotateable entity with inventory

Post by eradicator »

Oh. I misread as "1 item of each type" instead of "any type". Doesn't change my answer though. The only other things that have inventories are assembling machines, furnaces, players, etc. Things with too much behavior attached. There's no "container-with-rotations" except for the constant combinator...

What are you trying to do?
Author of: Belt Planner, Hand Crank Generator, Screenshot Maker, /sudo and more.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.

User avatar
DaveMcW
Smart Inserter
Smart Inserter
Posts: 3700
Joined: Tue May 13, 2014 11:06 am
Contact:

Re: Rotateable entity with inventory

Post by DaveMcW »

Ultimately, I'm trying to overload an item so it can be used to build 2 different building ghosts.

My solution is to make the "ghost" a container with an invisible item-request proxy, then "revive" the ghost by replacing it with a real (4-way-rotateable) building.

User avatar
eradicator
Smart Inserter
Smart Inserter
Posts: 5206
Joined: Tue Jul 12, 2016 9:03 am
Contact:

Re: Rotateable entity with inventory

Post by eradicator »

What's wrong with the standard solution of simply surface.create_entity'ing the second building in when the first one is built in on_built_entity?
Author of: Belt Planner, Hand Crank Generator, Screenshot Maker, /sudo and more.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.

User avatar
DaveMcW
Smart Inserter
Smart Inserter
Posts: 3700
Joined: Tue May 13, 2014 11:06 am
Contact:

Re: Rotateable entity with inventory

Post by DaveMcW »

Spoiler

User avatar
eradicator
Smart Inserter
Smart Inserter
Posts: 5206
Joined: Tue Jul 12, 2016 9:03 am
Contact:

Re: Rotateable entity with inventory

Post by eradicator »

Or maybe it's a rail that looks like a train. That's not relevant to the solution, just spawn stuff in. I.e use a simple-entity as proxy.
Author of: Belt Planner, Hand Crank Generator, Screenshot Maker, /sudo and more.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.

Post Reply

Return to “Modding help”