let mods invoke custom selection tools from themselves or other mods

Place to ask discuss and request the modding support of Factorio. Don't request mods here.
ahicks
Inserter
Inserter
Posts: 24
Joined: Sat Jul 13, 2024 10:45 pm
Contact:

let mods invoke custom selection tools from themselves or other mods

Post by ahicks »

If this seems strange, I'm one of the three people working on Factorio Access, a tts-based alternative interface. If we were able to set the player's selection and invoke the associated events globally, we'd be able to support any mod that has a selection tool which is able to do something reasonable with default settings (unfortunately I'm pretty sure changing settings would require a remote API from the other mod, but if not consider that in this request too...)

Hopefully this is as easy as I think it is. Our alternative is try to do more mouse movement hackery which for a variety of reasons ends up being beyond fragile.
Gweneph
Inserter
Inserter
Posts: 45
Joined: Thu Nov 14, 2019 11:51 pm
Contact:

Re: let mods invoke custom selection tools from themselves or other mods

Post by Gweneph »

To clarify we already have player.start_selection. We'd just like to be able to control where the end of the selection is too. That could be with a new command specific to selection tool manipulation, or a command that could set the player's cursor position that we could call before player.start_selection.
splee
Burner Inserter
Burner Inserter
Posts: 12
Joined: Thu Apr 23, 2020 10:08 am
Contact:

Re: let mods invoke custom selection tools from themselves or other mods

Post by splee »

To add an additional use case for the LuaPlayer to complete custom cursor selections through the API, I am working on a tool assisted speedrun of Krastorio 2. TAS are implemented through the mod interface. Being able to complete a selection in the described manner with the Krastorio 2 creep collector tool would be the cleanest way for this TAS to collect biomass, which is a necessary step in this run.

I think I can also use the methods of the LuaPlayer to begin a desconstruction planner order, an upgrade planning order, to begin a copy selection, and to put the most recent copied blueprint into the cursor. But maybe not "complete" such actions. Being able to "complete" these actions (which conceptually for a player is the same kind of left-click for each) via the API would open the door to tool assisted speedruns utilising bots. This is something I'm hoping I can do in this Krastorio 2 TAS as well.
ahicks
Inserter
Inserter
Posts: 24
Joined: Sat Jul 13, 2024 10:45 pm
Contact:

Re: let mods invoke custom selection tools from themselves or other mods

Post by ahicks »

I could also put things for automation in our Kruise Kontrol fork (we are effectively the Kruise Kontrol maintainers via a fork, and offer a remote API for other mods).

start_selection and clear_selection are a whole thing because it's odd to have them but not the other half, but the biggest part of this is being able to dispatch the event itself. The events already include area, and hopefully mods are actually using that.

Krastorio 2 is also one of our use cases. I am myself blind, and so will need to delegate to sighted team members as I can't try mods until we have compatibility, but the first time this ever came up was indeed K2 as well. For context we can support any mod out of the box which doesn't use too much scripting or gui, so e.g. BZ and Seablock (but not the rest of the seablock modpack as bob's is an issue). My understanding is that K2 is closer than I think if we had the selection tool based on the original internal discussion we had.
Post Reply

Return to “Modding interface requests”