It's Back! An attempt to recover most Picker Extended functionality. Includes Planner Menu, Planner Zapper, Held Item Count, Belt Reverser, Auto Ghost Reviver, Auto Inventory Sort, Player Searchlight, Quality Item Scrolling, and more!
Providing the player with new tools or adjusting the game interface, without fundamentally changing gameplay.
Change blueprint behavior.
I was trying to learn how to write a mod, so I made one which does exactly what the "Auto Ghost Reviver" part of your mod does (and then I discovered that you already made this). However, it has an extra feature which works thusly:
It's quite useful before bots and you need to replace wooden power poles and inserters.
Perhaps I missed a setting somewhere, but I don't think Picker Extended can do this.
I realize now that I forgot to include a note on the front page of this mod, but I'm not actually the original creator for most of these features; Nexela was the one who created the original mod back in Factorio 1.1 (before the space age update), I just took over this mod (and its dependency) when they never came back to Factorio modding.
That being said, the ghost revive feature was one that I had to put a lot of work into fixing for Factorio 2.0, so I do know it quite well, and it does not have the ghost upgrade functionality you describe. I think I should be able to add that in though, it does sound incredibly useful (even though I don't use the upgrade planner as often as I do the basic blueprint planner)
Should be implemented in v1.0.6, hopefully has the same functionality as your work-in-progress version
Yes, that seems to work in the same way. I did some testing and I'm delighted to see that it also inserts modules. Thank you!
I looked at your implementation in Lua just to make sure you didn't repeat some of my mistakes (like forgetting about quality), and I'm wondering about the "mirror" field when calling LuaPlayer.build_from_cursor(). You don't use it at all, but it seems like both revival functions respect mirroring correctly anyway - I wonder why...
EDIT: Let me clarify what I mean by "inserts modules":
However,
Here's a bug I found:
Ah, I actually forgot to test if the ghost upgrade worked with quality (also forgot to test filters), but good to know it does (makes sense, considering it borrows most of the logic from the standard ghost reviver, where both features were working properly).
I can work on ghost module inserting as well (without the ghost upgrade middle man), if there's function or property to grab the ghost module, then it should be possible.
I'll also take a look at that bug, considering that this mod exists, it should be possible to clear those ghost modules, I must have missed something
I apologise, I was testing on my Krastorio 2 world (which doesn't support quality). Quality seems quite broken on upgrades. It looks like you get target_quality in the code but never test on it.
Current behaviour:
Both tier and quality upgrade
- Upgrading from Assembler 2 ANY -> Assember 3 Rare
- ANY quality Assembler 3 will complete the upgrade
Quality upgrade from Normal
- Upgrading from Assembler 3 Normal -> Assembler 3 Rare
- NO quality Assembler 3 will complete the upgrade (nothing happens)
Quality upgrade from Quality
- Upgrading from Assembler 3 Legendary -> Assember 3 ANY
- ANY quality Assembler 3 will complete the upgrade
EDIT 2: Reviving from a ghost doesn't seem to respect quality either.
EDIT: Tested modules too, because who can forget QUALITY modules? (That is, modules with quality)
They seem to work except for one scenario:
The upgrade scenario has a similar behaviour.
It also happens when I turn OFF Ghost Revival. Perhaps this is a bug in the base game?
EDIT 3: Tiles! I should really just make another thread shouldn't I?
Tiles when placed in the world don't have quality, but the mod will place them regardless of quality. Doing this destroys its quality, and I would argue that the mod should be designed NOT to do this. Tile ghost revival should check explicitly for NORMAL quality only.
Huge update for you, fixed most quality-related issues listed above, and updated the module inserting functionality, as of v1.0.7
Added a setting to ignore quality entirely, which will retain the current functionality (i.e. any quality of machine will fulfill the request, as long as it's in your cursor). If this setting is disabled, then quality will be a strict requirement for ghost entities, tiles, and upgrades, preventing auto-placement unless the correct quality is in the cursor.
One unfortunate but important note, I was not able to get quality replacements working with a 0 quality (normal) entity. When the base entity is anything but 0 quality, it can be auto-replaced with any other quality, but as soon as it becomes a 0 quality entity, this functionality stops working.
It seems to be a base game issue with build_from_cursor, because even after disabling all of the checks and just auto-replacing on hover, a 0 quality machine would never be auto-replaced with any other quality (despite still working with any other quality).
The module request related code had to be re-written, since the original implementation never modified the requests after an auto-replace. The original author expected there to be a way to modify existing requests, which was unfortunately never added. After peeking at the other mod, the way they made it work involved running through the module list twice: one pass to insert any modules that were possible, and the second pass to recreate the module request list with whatever was missed.
I ended up adapting most of that logic to work within the scope of this mod, so it works perfectly with the auto-replacing feature, and respects the quality of each individual module being requested.
Anyways, lots of stuff for you to test now!
One unfortunate but important note, I was not able to get quality replacements working with a 0 quality (normal) entity. When the base entity is anything but 0 quality, it can be auto-replaced with any other quality, but as soon as it becomes a 0 quality entity, this functionality stops working.
It seems to be a base game issue with build_from_cursor, because even after disabling all of the checks and just auto-replacing on hover, a 0 quality machine would never be auto-replaced with any other quality (despite still working with any other quality).
I can corroborate this, the same issue affects my mod and it seems like can_build_from_cursor() will return FALSE, but left-clicking to manually build in-place works like normal. A bug in the mod API.
The new module system seems solid, I tried my best to break it.
I like the strict quality toggle, although I'm not sure how often I'll go into the settings to change it just because I have the wrong kind of solar panels with me. Tiles I still think should be hard-coded to only accept NORMAL, regardless of the toggle setting, because construction robots will NEVER place quality tiles. I can't think of many situations where I need to precisely place tiles in a pattern and I only have Uncommon on me. Destroying their quality should be done deliberately.
New bug: Setting a ghost-upgrade on an entity, then hover over that entity with any kind of planner (Alt-Q cycles through them all with Picker) will print an error message.
I'm glad that it wasn't just me doing something wrong, I swear I had tried every way to make it just work, and yet it wouldn't lol.
I wasn't sure how useful the toggle to ignore quality would be, since I've basically never touched quality, but it's possible somebody might find it useful, and it was easy to implement, so better to have it available and not need it.
You may have a point about the tiles thing... though I can't really think of any situation in which the player would have quality tiles in their inventory and not want to use them. If their quality is destroyed when being placed, why craft them to begin with? If they are an incidental output of a process that occasionally produces quality tiles, why keep them in the inventory instead of placing them in a box or having an automated output to a recycler system? Quality tiles won't just be appearing in the player inventory without deliberate action, I think?
I'll look into that last issue when I can, thanks for the report!
I can't really think of any situation in which the player would have quality tiles in their inventory and not want to use them. If their quality is destroyed when being placed, why craft them to begin with? ... Quality tiles won't just be appearing in the player inventory without deliberate action, I think?
You got me. I'm the kind of player who just stuffs Quality modules into my recyclers because why not, then I can manually fish out the Uncommon concrete from my sixty unsorted steel chests at the end of the recycler line, hand-insert into an assembler making Uncommon rocket silos, and cry when covering the entire Fulgora island with ghost concrete caused me to ghost-revive that Uncommon concrete straight out of my cursor.
... Maybe you're right, it doesn't make much sense in the normal Space Age setting. I haven't tried that Spaghetti mod, there might be a recipe that requires concrete to make inserters.
It's ultimately a preference about UX. Hovering over something with the mouse is really easy to do, whereas a destructive or non-reversible action should be laborious or require confirmation. If the code said "hovering over a biter spawner causes you to fire the nukes"... well that'd be great!
Hand feeding concrete to make a rocket silo.. sounds like me the first time I beat this game lol.
An important thing to note is that this theoretical player would have to be using quality, and would likely have strict quality enabled, which would prevent tiles from being auto-placed like that.
There are so many layers that a very specific kind of player would have to pass through before "accidentally" consuming their higher quality concrete like this, as opposed to the much simpler player (like me) who, by some random chance, ended up with quality concrete in the inventory, doesn't care about preserving it, and still wants to use the auto tile placement feature.
Both cases are honestly pretty unlikely either way lol. I'd really prefer not to have to make that yet another setting...
Then don't. You'll never make everyone happy, and the complexity greatly outweighs the utility.
It really wouldn't be that complex of a change; at most, it would be like one copy-paste and a minor edit to one line of code.
I just don't like seeing too many unnecessary settings in the mod settings menu, especially when playing with a larger modlist, and the picker reviver feature alone already has four of these settings. But I get what you mean