Page 1 of 1

Container AND rotatable?

Posted: Mon Sep 08, 2014 8:31 pm
by billw
So I knocked up a quick prototype of the Ore Hoppers I mentioned in the Ideas/Requests forum (https://forums.factorio.com/forum/vie ... =33&t=5707).
They work really well so far, but I don't have a great grasp on the entity system, so just need a bit of help with getting them working right:
Currently my entity definition looks like:

Code: Select all

data:extend(
{
	{
		type = "container",
		name = "orehopper",
		icon = "__base__/graphics/icons/basic-inserter.png",
		flags = {"placeable-neutral", "player-creation"},
		minable = {mining_time = 1, result = "orehopper"},
		max_health = 50,
		corpse = "medium-remnants",
		collision_box = {{-0.4, -0.4}, {0.4, 0.4}},
		selection_box = {{-0.5, -0.5}, {0.5, 0.5}},
		fast_replaceable_group =  "container-small",
		inventory_size = 40,
		open_sound = { filename = "__base__/sound/wooden-chest-open.ogg" },
		close_sound = { filename = "__base__/sound/wooden-chest-close.ogg" },
		vector_to_place_result = {0, 0.1},
		rotatable = true,
		picture =
		{
			filename = "__base__/graphics/entity/basic-inserter/basic-inserter-platform.png",
			priority = "extra-high",
			width = 46,
			height = 33,
			shift = {0.3, 0}
		}
	}
}
)
How can I modify this to make it both a container like a chest AND rotatable like an inserter?

Re: Container AND rotatable?

Posted: Tue Sep 09, 2014 7:34 pm
by Adil
Unfortunately.
https://forums.factorio.com/wiki/inde ... #rotatable
Entities that are not rotatable naturally (like chest or furnace) can't be set to be rotatable.
Also, what's "vector_to_place_result"? It's not present on anything in vanilla.

Re: Container AND rotatable?

Posted: Tue Sep 09, 2014 8:11 pm
by billw
Thanks for the reply. Yeah I read that about the rotatable, but I've decided it wouldn't be the best solution to make this hopper a container anyway as I only want it to be able to contain and pick up ores, not any item type. So I'm thinking I will manage contents outside the entity using global objects. But what I need now is an entity type that IS rotatable but doesn't really have any other special functions that will interfere with the custom behaviour I am implementing (basically just picking up stuff from one side and dropping it on the other but with a buffer in between). Could you tell me what is the best entity type for this purpose? Inserters have complicated arm stuff I think, miners try to mine stuff, not sure what else is available.

Regarding vector_to_place_result that is actually a miner entity property. I think I added it to try and get the alt key overlay to show an arrow but it didn't work.

Re: Container AND rotatable?

Posted: Tue Sep 09, 2014 10:25 pm
by Adil
billw wrote:Regarding vector_to_place_result that is actually a miner entity property. I think I added it to try and get the alt key overlay to show an arrow but it didn't work.
Well, classes are hardcoded, that property will only work on mines.

As for the type, I'd try the inserter anyway. I haven't had a look on those teleporting mods yet but one of them had handless inserters just fine so hand stuff shouldn't be the most problematic.
some coding blabbering

Re: Container AND rotatable?

Posted: Thu Apr 11, 2019 6:05 am
by ownlyme
still not possible?
no equivalent entity that can do this?
they could at least let us use the on_player_rotated_entity event for non-rotatable entities..