Add option for LuaControl:Opened() to ignore distance constraints.

Things that we aren't going to implement
Post Reply
Oarc
Fast Inserter
Fast Inserter
Posts: 100
Joined: Sun Sep 18, 2016 2:04 pm
Contact:

Add option for LuaControl:Opened() to ignore distance constraints.

Post by Oarc »

Add option for LuaControl:Opened() to ignore distance constraints.

Use case is that sometimes I want to open a chest or something that is outside of the reach range, for mod purposes.
Special chests, special inventories that can only be accessed under special conditions. But essentially it's still just a chest or inventory or something that you can open and disregard distance requirements.

I just want some way to be able to open inventories from across the map... of trains/entities/containers whatever.

Let me know if there is already a way to do this as well, I already asked around on discord and tried to find an easy way myself.

Rseding91
Factorio Staff
Factorio Staff
Posts: 13204
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: Add option for LuaControl:Opened() to ignore distance constraints.

Post by Rseding91 »

LuaControl::opened doesn't do any distance checks in the Lua API. It's simply a part of the game logic that a player can't open something they can't reach. There's no "override" behavior it's just baked into the logic of anything opened if it's out of reach it's closed.

So the answer to this request would be: it can't be done as an API request. If you want to ignore distance limits then just set the distance limits to unlimited in the prototype for the player.
If you want to get ahold of me I'm almost always on Discord.

ratchetfreak
Filter Inserter
Filter Inserter
Posts: 952
Joined: Sat May 23, 2015 12:10 pm
Contact:

Re: Add option for LuaControl:Opened() to ignore distance constraints.

Post by ratchetfreak »

Rseding91 wrote:
Wed Jun 12, 2019 1:24 am
LuaControl::opened doesn't do any distance checks in the Lua API. It's simply a part of the game logic that a player can't open something they can't reach. There's no "override" behavior it's just baked into the logic of anything opened if it's out of reach it's closed.

So the answer to this request would be: it can't be done as an API request. If you want to ignore distance limits then just set the distance limits to unlimited in the prototype for the player.
But one of the mod ideas I've had mulling around is to mark objects with a tool and a construction bot will hover over it and let the player open the gui to interact with it remotely.

This is one of the issues with it, the other is how to prevent items from moving between the inventories and how to mark modules and such to be delivered and picked up/excess items to be moved as the recipe changes instead of appearing in the player inventory, etc.

Post Reply

Return to “Won't implement”