Page 1 of 1

Rotateable entity with inventory

Posted: Thu Jul 19, 2018 9:00 am
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?

Re: Rotateable entity with inventory

Posted: Thu Jul 19, 2018 11:44 am
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.

Re: Rotateable entity with inventory

Posted: Thu Jul 19, 2018 4:51 pm
by DaveMcW
I don't need variable inventory size, just the ability to insert 1 item without silly restrictions like "ammo only".

Re: Rotateable entity with inventory

Posted: Thu Jul 19, 2018 5:17 pm
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?

Re: Rotateable entity with inventory

Posted: Thu Jul 19, 2018 5:29 pm
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.

Re: Rotateable entity with inventory

Posted: Thu Jul 19, 2018 6:31 pm
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?

Re: Rotateable entity with inventory

Posted: Thu Jul 19, 2018 7:14 pm
by DaveMcW
Spoiler

Re: Rotateable entity with inventory

Posted: Thu Jul 19, 2018 8:24 pm
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.