Preconfigure Placement


Build with MMB to configure an entity before it starts working. Also allows copy pipetting with Alt + Q, as well as copying entity settings while building.

Utilities
20 days ago
2.0
64

i Why not just Middle-click?

23 days ago

First, I must commend you for a very clever approach to the problem, I never would have thought to do things this way. I may just use your mod instead. :P

As far as I know, Middle-click has one function when EventData::in_gui is false, which is to cycle entity/decorative variations in Editor mode, but you're probably checking the cursor already anyway.

Also, "pp_preconfigure" control is missing its LocalisedString, but you probably fixed that already.

22 days ago
(updated 22 days ago)

Thanks!

A decent amount of people use middle click as regular pipette, so I didn't want to have a default keybind that overlapped.
You're free to rebind it though, which is one of the great things about Factorio.

I already did locale for the control, but I renamed the control internally at some point and forgot to also change the locale key, so I was not aware of that. Thanks for the report, fixed in 0.0.2.

22 days ago

Okay. I had wondered if there was a more technical reason, but it's good to know that people can use Middle-click safely.

As it happens, I'm the polar opposite kind of user. I dislike middle-click intensely, and I rebind all of the vanilla controls that use it.

22 days ago

I wanted to do Alt + Q for the default bind, but that would conflict with any of the "queue to front" crafting mods including my own, which I also know have a decent amount of people using them. That would be a bad look, having a conflicting keybind between two of my own mods, but oh well. That would be my recommended keybind for anyone not using those mods.

20 days ago

I ended up reworking half the mod entirely, instead of having a toggle for a mode, you can just build with the keybind directly. Naturally, this needed new keybinds, and MMB / Shift + MMB / Ctrl + Shift + MMB for the different build modes just happen to line up. Oh well, the few MMB pipette users can figure something else out.

Along with this change, the copy pipette keybind needed to be something else, as it can't be merged with the building keybind anymore. I did end up changing that to Alt + Q, and I've added compatibility between my other mod Crafting Queue Enhancements specifically when this mod is enabled, so there's no conflicts there.

20 days ago

That's how I expected the mod would work at first, although using a modal switch did have advantages (not needing three separate binds). I wonder why you decided to switch it; just to make the mod more intuitive?

A little request: Could you clear the cursor when you open the Configure GUI? Since you pipette it back when it closes anyway.


This next part is not feedback, merely a difference of opinion/rambling. (Don't take this as negative)

I feel like you have two mods in one: the part that freezes and configures a building when you place it (with MMB), and the part that copies entity settings into the cursor (with Shift-RMB, or Alt-Q as a shortcut for Q + Shift-RMB). They both do "preconfiguring", but they could theoretically be split into two separate mods and they don't rely on each other.

Well, except for the automatic copy after MMB, which I don't expect to happen and I don't always want it to. I would have it require an explicit Shift-RMB.

20 days ago
(updated 20 days ago)

I wonder why you decided to switch it; just to make the mod more intuitive?

Pretty much. For some reason I thought the player's cursor direction wasn't accessible through script, but as it turns out it is accessible, just only inside a custom input event (which I forgot I knew). That's how I wanted the mod to work in the first place, as the modal approach is an extra click / button press every single time.

Could you clear the cursor when you open the Configure GUI?

I do, or at least it's supposed to. I just tested it and it seems to work correctly for me, do you have any other mods enabled that might be interacting with the cursor in some way?

I feel like you have two mods in one

I agree, it solves two very closely related but separate issues. I don't want to split them into different mods, especially since if you don't like one of the features you can unbind the control(s) for it and the rest of the mod will still function.

Well, except for the automatic copy after MMB,

I've added a per-player mod setting to disable that behavior in 0.0.4.

20 days ago
(updated 20 days ago)

cursor direction ... it is accessible, just only inside a custom input event

You are my new best friend. Seriously, why don't they expose these things in the rest of the API? :P

I just tested it and it seems to work correctly for me, do you have any other mods enabled that might be interacting with the cursor in some way?

Yes! It is Cursor Enhancements! I wonder why it's doing that...

EDIT: I changed the keybind away from MMB, so it's not a Controls conflict. I thought I might be tripping CEN's "Recall last item" which is normally on Shift-Q.

20 days ago

I'll investigate the cursor enhancements interaction when I get home, I'm out for a couple more hours.

As for the former, I can answer that, and it's because cursor direction isn't normally in game state. You may know this already, but Factorio uses lockstep networking, so every client is simulated deterministically and the only things sent over the network are input actions. When someone presses a custom input, that's an input action, and data from the client can be sent along with the input action. Being able to access it server side at any given time is impossible though, since the cursor direction isn't being sent at all unless it's with the input action. It's an unfortunate limitation, but it thankfully wasn't one here.

20 days ago

cursor direction isn't normally in game state ... Factorio uses lockstep networking

I did know this, but for some reason, I thought pressing "Rotate" would be the input action and the cursor direction would exist state-side. But that would be less optimised, of course!

I'll return your courtesy with my own: The "auto ghost cursor" feature of Cursor Enhancements activates whenever you place a building, and places either a ghost or the real stack into your cursor depending on whether you ran out of them, or have newly acquired some items.

The solution is simple: you declare a hidden dependency on CEN, and the load order ensures that your event runs last, fixing the issue.

20 days ago

Awesome, I've done that in 0.0.6. Thanks for all the suggestions and feedback!

17 days ago

would be nice if it would also work with force build (CTRL + SHIFT + MMB)

17 days ago

Or in remote mode

17 days ago

Due to an API limitation, I can't make it work with cursor ghosts.
You're still able to force build things when your cursor has a real item in it though.
This mod mainly exists to fix the issue of having to use workarounds to configure a placed entity before it starts working, which only really matters for non-ghost entities. Sure, having to clear your cursor and open the ghost gui is still a little annoying, but at least it's not breaking anything if you do so.

17 days ago

But my construction robots are quick sometimes, so the ghost gets built before I have configured it properly.

New response