Can someone plz fix sorting in this old mod?

This is the place to request new mods or give ideas about what could be done.
Post Reply
Peter34
Smart Inserter
Smart Inserter
Posts: 1100
Joined: Mon Nov 10, 2014 12:44 pm
Contact:

Can someone plz fix sorting in this old mod?

Post by Peter34 »

Hi

The "Letters" mod was really good back in alpha 11, in coop MP games, for labelling various sections of the factory ("What's this 'citadel' thing you keep talking about, Peter?" / "It's the thing that I've labelled 'citadel'!" / "Oh, OK...")
https://forums.factorio.com/forum/vie ... 96&t=15314

Sadly, with alpha 12, the sorting of the items of the mod broke, badly, and given that it contains a lot of item, proper sorting - alphabetical sorting, even - is crucial. As it is now, this mod in its broken state is actually useless.

But I'm sure one of you expert modders, who know all about how sorting works in alpha 12, can get it ship-shape with less than 30 minutes of work.

So... Any takers?

daniel34
Global Moderator
Global Moderator
Posts: 2761
Joined: Thu Dec 25, 2014 7:30 am
Contact:

Re: Can someone plz fix sorting in this old mod?

Post by daniel34 »

less than 30 minutes, challenge accepted...

The only thing that needed changing were the order lines in letters-entity.lua and letters-item.lua, example:
from

Code: Select all

order = "b[decorative]-a[Silver]-a[1]"
to

Code: Select all

order = "b[decorative]-a[Silver]-a[01]"
It needed prefixing (01 instead of 1) because it is treated as string and not as number.
Attachments
Letters_0.0.3.zip
(88.93 KiB) Downloaded 211 times
quick links: log file | graphical issues | wiki

User avatar
prg
Filter Inserter
Filter Inserter
Posts: 947
Joined: Mon Jan 19, 2015 12:39 am
Contact:

Re: Can someone plz fix sorting in this old mod?

Post by prg »

Damn, daniel34 again...

To add some sanity to the mod, replace all of letters-items.lua with

Code: Select all

for num = 1, 95 do
    data:extend({{
        type = "item",
        name = "letter-"..num,
        icon = "__Letters__/graphics/letter/Letter_"..num..".png",
        flags = {"goes-to-quickbar"},
        subgroup = "Silver",
        order = "a[Silver]-a["..string.format("%.2d", num).."]",
        place_result = "letter-"..num,
        stack_size = 30
    }})
end
and do something similar with the other files.
Automatic Belt (and pipe) Planner—Automate yet another aspect of constructing your factory!

Peter34
Smart Inserter
Smart Inserter
Posts: 1100
Joined: Mon Nov 10, 2014 12:44 pm
Contact:

Re: Can someone plz fix sorting in this old mod?

Post by Peter34 »

Thanks a lot!

Peter34
Smart Inserter
Smart Inserter
Posts: 1100
Joined: Mon Nov 10, 2014 12:44 pm
Contact:

Re: Can someone plz fix sorting in this old mod?

Post by Peter34 »

And once again, can somebody please do what's necessary to update this mod to alpha 0.13, and then upload it to the portal?

I know there are other mods, now, to make letters appear in the game, and while those are more convenient to use (faster to make the text, much faster to change the text after having placed it), they honestly look ugly, whereas this mod's one-letter-per-tile approach has a certain austere beauty to it. It looks in-game rather than kludged-onto-the-game.

Thanks in advance.

vlczero
Inserter
Inserter
Posts: 47
Joined: Sun Oct 05, 2014 1:51 pm
Contact:

Re: Can someone plz fix sorting in this old mod?

Post by vlczero »

Peter34 wrote:And once again, can somebody please do what's necessary to update this mod to alpha 0.13, and then upload it to the portal?

I know there are other mods, now, to make letters appear in the game, and while those are more convenient to use (faster to make the text, much faster to change the text after having placed it), they honestly look ugly, whereas this mod's one-letter-per-tile approach has a certain austere beauty to it. It looks in-game rather than kludged-onto-the-game.

Thanks in advance.
Here you go viewtopic.php?f=96&t=15314&p=178765#p178765

Post Reply

Return to “Ideas and Requests For Mods”