Minimal mod allowing incompatibility with the base mod

by Bilka

This mod provides the minimal prototypes needed to load the game without the base mod. Modders are encouraged to build their own mod on top of this one or depend on it to aid development of mods incompatible with the base mod.

Overhaul
4 years ago
0.18 - 1.1
284

b "Gathered resource" label not moving

With base mod disabled, when I mine a resource, the label "Gathered resourcename (1)"
appears, but does not move nor disappear. It just stays there forever (reload does not help). However every other moving label, such as "Cannot reach" moves and disappears like it's supposed to.

This looks like this:
https://imgur.com/a/IMA7VAo

I assume it is because of missing feature that was defined in the base mod, but what was this feature? How do I fix it in my mod?

3 years ago
(updated 3 years ago)

The "label" is a flying-text type entity. This mod doesn't define any entity of that type, because the game already has one in the core "mod", here: https://github.com/wube/factorio-data/blob/master/core/prototypes/unknown.lua#L11. The problem is easily obvious from that prototype, time to live and speed is set to 0 (= lives forever, doesn't move).

If defined, the game will use the prototype with the name "flying-text" for these labels. So, the easiest way to fix this would be to just copy that prototype from the base mod: https://github.com/wube/factorio-data/blob/master/base/prototypes/entity/entities.lua#L4826.

I hope this helps. If you have any other issues like these and could use my help, please let me know, I'm happy to help :)

Just curious: if the default flying-text prototype has 0 lifetime and 0 speed, why the texts, like "Cannot reach" do move and disappear?

3 years ago
(updated 3 years ago)

Those texts aren't entities. They are only shown to that player (not all players) and not save/loaded. They are called "local flying text" in the lua API: https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.create_local_flying_text

if the default flying-text prototype has 0 lifetime and 0 speed

Just to be clear, the "default" flying text prototype is the one in the second link. The "unknown entity" prototype just abuses the flying text prototype for another reason that needs one prototype per "ID type": Migrating modded blueprints in the blueprint library (https://factorio.com/blog/post/fff-357).
This mod then abuses the fact that the entity prototype already exists and doesn't need an extra dummy entity.

New response