Hover ALT Mode

by Morlot

Shows the ALT mode icon for just the entity under your mouse cursor, while the ALT mode stays off. ALT mode no longer has to be permanent. Normal mode becomes a real alternative, without giving up what ALT mode tells you.

Utilities
14 hours ago
2.0 - 2.1
187

g Error in version 0.21.12

4 days ago

This is in a multiplayer server fwiw, i am the host, the other players experience desyncs every now and then but i don't know why, might be unrelated!

The mod Hover ALT Mode (0.21.12) caused a non-recoverable error.
Please report this error to the mod author.
Error while running event hover-alt-mode::on_selected_entity_changed (ID 63)
hover-alt-mode/control.lua: 1010: attempt to index field 'flags' (a nil value)
stack traceback:
hover-alt-mode/control.lua:1010: in function 'hides alt info'
hover-alt-mode/control.lua:2976: in function 'get _ hovered'
hover-alt-mode/control.lua:3233: in function 'create icons'
hover-alt-mode/control.lua:3440: in function 'refresh'
hover-alt-mode/control.lua:3553: in function
hover-alt-mode/control.lua:3551>

4 days ago
(updated 4 days ago)

Thanks for the report — the crash is fixed in 0.21.13: an entity whose prototype declares no flags at all made the mod read something that isn't there.

The desyncs are a separate thing, and I have nothing pointing at this mod so far. Nothing in it reads anything that differs between clients, and the only thing it writes is the vanilla ALT mode switch, from an event that every peer runs the same way. But I'd rather check than assume. If you can get me any of the following, that would help a lot:

  1. A desync report. It has to come from the client that desynced, not from the server. When it happens, the game puts up a dialog naming where the report was written, with a Copy desync report path button on it. The file is the single most useful thing here, because it names which mod's state diverged.
  2. Does it still happen with the setting "Auto ALT mode" off? The only thing this mod changes about the game rather than just drawing on top of it is Auto ALT mode, and only while it is switched on. It is off by default, so if nobody has switched it on, this mod writes nothing at all and can be ruled out on the spot. If somebody has, turn it off for everyone for a session and see whether the desyncs continue.
  3. Your mod list, with versions — the desync report contains it, so this is only needed if you cannot get the report.
  4. What people were doing when it hit, if there is any pattern: someone picking up a blueprint, a player joining, a particular area of the base.
  5. Which Factorio version the server and the clients are on.
23 hours ago
  1. How would i get this to you, is posting links allowed? If so here: https://drive.google.com/file/d/12x8y1zxSF23Grw-IG3tvFdwFuB_f2b9O/view?usp=sharing
  2. I'm pretty sure nobody has Auto ALT mode on, and claude seems to think this exonerates the mod and i'm inclined to agree. The only lead i have is it started the 22:nd when i updated this mod, but i think factorio updated at the same time? It happened like 5 times and not again when i removed the mod (and factorio updated again, i'm on the experimental).
  3. The feeling is it happened when someone was browsing the tech tree, pressing q, or both! Or it could be neither and just superstition :p
  4. Factorio 2.1.14 build 87180

So i don't think you're the culprit but if you wanna check it out it's here, cheers!

14 hours ago

Thanks for the files — they settled it, and not in my favour: it was my mod.

Both saves are from the same tick, so they could be compared directly. In the whole 470 MB dump they differ in exactly one thing: your client had not drawn two overlay objects that the server had drawn, a recipe icon and its backdrop on an assembling machine. Everything else that differs follows from those two missing objects.

The cause: the mod steps aside when a player has ALT mode on, so it asked the game whether that player had it on. That value turns out to be a display setting, and each machine only keeps it up to date for its own player — for everybody else it holds whatever arrived with the map. Your client believed the other player on your server had ALT mode on, the server believed it was off. So the server drew the icons and you did not, and from there the two came apart.

Auto ALT mode had nothing to do with it, by the way: the version running was 0.21.9, and that setting did not exist before 0.21.12.

Fixed in 0.21.15. The mod now keeps track of ALT mode itself, from the toggle event, which does reach every machine — I set up a server and a client side by side to make sure of that before relying on it. One thing to expect when you first load an existing save with this version: ALT mode gets switched off once, for everyone. What each machine believed beforehand cannot be recovered, and off is the one value they are certain to agree on. A single keypress puts it back.

I have also asked the Factorio developers for the piece that would make the whole workaround unnecessary: A counterpart to only_in_alt_mode for LuaRendering

Thanks again for uploading the report. Without it I would still be guessing, and guessing in the wrong direction.

New response