LTN Cleanup

by keombre

Sends LTN trains with remaining cargo to cleanup stops

Content
2 years ago
1.1
29.7K
Trains

i Thumbnail

3 years ago
(updated 3 years ago)

1) I would appreciate being asked before using my Thumbnail.
It took quite some time to get it look somewhat decent and is released under a restrictive license.

2) Iconography is just wrong, this says trash provider to normal requester.
The trash symbol should be instead of the blue requester chest.

3 years ago
(updated 3 years ago)

Regarding the thumbnail. You are completely right. I took your thumbnail in good faith, thinking (since it’s published on GitHub) it’s licensed under a more permissive license.
Do you want me to remove it completely, or would you grant me permission to use it?

As for the iconography, you are again right. I’m no graphics designer, but I’ll try something better.

Lastly in your license, you state that: “No Modification - ... you are not allowed to distribute anything altered, or derived from my code...”. In my mod, I’m using one of LTNs settings to set the train timer. Although not derived from your codebase, it still uses part of your mod, not exposed by your API. (see here: https://github.com/keombre/factorio-ltn-cleanup/blob/master/control.lua#L75)
Do you want me to remove that feature as well, or could I ask for your permission to keep it?

3 years ago

You are free to use the thumbnail, having the same base thumbnail for LTN submods looks nice.

I'd move the trash bin over the requester chest.

Settings are exposed by the core game, so they are fine to use the same way as prototypes are.

3 years ago

Thank you very much!

I've updated the thumbnail slightly (to hopefully better reflect what the mod does).

Also, I would like to seek advice from you as a senior developer.
Do you know, how to reference a train in the rich text? If I try to display a train as "[train=" .. train.id .. "]", it shows up as an invalid.
I'm assuming there are two train ids. One used internally and the other exposed in LuaTrain.

3 years ago

Train rich text is implemented in the dumbest possible way.
It uses locomotive.unit_number instead of train.id.

To get unit_numbers you could do:

/c
for _, entity in pairs(game.player.surface.find_entities_filtered{type = "locomotive"}) do
  log(string.format("Locomotive %s: %s", entity.unit_number, entity.backer_name))
end
3 years ago

Perfect, again thanks!

3 years ago

PS: Check out FLib train module: https://factoriolib.github.io/flib/modules/train.html
For your purpose of getting the loco unit number from train.id would be a simple call to get_main_locomotive(train)

New response