Drag? Brush? mode on custom-input

Place to ask discuss and request the modding support of Factorio. Don't request mods here.
Post Reply
galibert
Inserter
Inserter
Posts: 42
Joined: Fri Sep 15, 2017 7:42 am
Contact:

Drag? Brush? mode on custom-input

Post by galibert »

I'd like to have the capability to add custom-inputs where it's possible to activate the input in one place and move the mouse/move the player so that it applies to multiple tiles/entities/ghosts. Exactly the way the mouse controls currently work for building, filling, destroying, etc. The obvious interface would be an activate/deactivate parameter in the event since the behaviour can then be built from the selection event, but that may not fit the current internals. So, well, whichever way is currently used for building, just[1] have it exposed to lua.

Best,

OG.

[1] Famous last words, but in that particular case I don't see what code structure could make it difficult or with annoying side effects. ICBW abviously :-)

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

Re: Drag? Brush? mode on custom-input

Post by Rseding91 »

There's an item specifically designed for this - the "selection-tool" type item. It's what blueprints and the deconstruction planner use.

It has nothing to do with custom-inputs - it's tied to a specific item.
If you want to get ahold of me I'm almost always on Discord.

galibert
Inserter
Inserter
Posts: 42
Joined: Fri Sep 15, 2017 7:42 am
Contact:

Re: Drag? Brush? mode on custom-input

Post by galibert »

Rseding91 wrote:There's an item specifically designed for this - the "selection-tool" type item. It's what blueprints and the deconstruction planner use.

It has nothing to do with custom-inputs - it's tied to a specific item.
Hmm yeah, I don't think it matches the use case I have in mind. Let me explain.

I've decided to try to make early-game blueprints more useful. Right now, when you use a blueprint early, you get a ghost image of what to build and what to delete is marked. But when you delete stuff you delete the ghosts too, so you have to put on the blueprint again. And when you build stuff you can easily get the wrong item or the wrong orientation, and you lose settings (recipes, chest stack limits, ...). You can use the picker tool to get the correct item in the correct orientation, but a series of q-click-q-q-click-q-... gets annoying fast.

So the idea, which I started in a mod (filtered placement), is to have a placement variant (cltr-lmb) that only places if it matches a ghost, and applies orientation/settings of the ghost. In addition, to have a mining variant (ctrl-rmb) that only deletes an entity marked for destruction. That way, if the player wants, he can be guided entirely by the blueprint. The current UX of the mod is dreadful because you have to click on each ghost individually with the correct item in hand instead of just brushing over it.

Doing that with a selection tool would be "build (part of) blueprint from inventory", also known as personal roboport with construction bots or the nanobots mod. We're not in a zero-cost, early game, only QoL, no gameplay change anymore :-) Incidentally, feel very, very free to swipe the idea for mainline if you like it.

That's not the only QoL thingy brush support would make possible in a mod either. For instance, a mid-game problem is upgrading stuff, in particular buses. Even if you have bots they're a pain there because in vanilla you have to deconstruct then reconstruct and that gets plates everywhere in your inventory or the logistic network. And fast-replacement is iffy because you have to manage the rotations or break everything, and half the times ends up adding belts by mistakes where there wasn't any. Or, with the recent UI changes, add splitters where you don't want one. Enter the "upgrade" placement variant where if you have a fast-replacing item in hand the selected item is replaced with its original orientation/settings, and otherwise nothing happens. Then upgrading a balancer is just brushing three item types (belt, splitter, underground belt) or the upgraded version over the balancer and everything is clean without any possible mistake. And it doesn't add anything the player can't do with vanilla, only prevents errors.

There are just examples where a selection wouldn't work nearly as well.

OG.

Post Reply

Return to “Modding interface requests”