Container AND rotatable?

Place to get help with not working mods / modding interface.
Post Reply
billw
Long Handed Inserter
Long Handed Inserter
Posts: 67
Joined: Tue May 27, 2014 10:27 am
Contact:

Container AND rotatable?

Post 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?

User avatar
Adil
Filter Inserter
Filter Inserter
Posts: 945
Joined: Fri Aug 15, 2014 8:36 pm
Contact:

Re: Container AND rotatable?

Post 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.
I do mods. Modding wiki is friend, it teaches how to mod. Api docs is friend too...
I also update mods, some of them even work.
Recently I did a mod tutorial.

billw
Long Handed Inserter
Long Handed Inserter
Posts: 67
Joined: Tue May 27, 2014 10:27 am
Contact:

Re: Container AND rotatable?

Post 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.

User avatar
Adil
Filter Inserter
Filter Inserter
Posts: 945
Joined: Fri Aug 15, 2014 8:36 pm
Contact:

Re: Container AND rotatable?

Post 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
I do mods. Modding wiki is friend, it teaches how to mod. Api docs is friend too...
I also update mods, some of them even work.
Recently I did a mod tutorial.

User avatar
ownlyme
Filter Inserter
Filter Inserter
Posts: 400
Joined: Thu Dec 21, 2017 8:02 am
Contact:

Re: Container AND rotatable?

Post 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..
mods.factorio.com/user/ownlyme
My requests: uiAbove||Grenade arc||Blueprint allies||Creeps forget command/ don't get removed||Player Modifiers||textbox::selection||Better Heat IF||Singleplayer RCON||tank bug w/ min_range >= projectile_creation_distance

Post Reply

Return to “Modding help”