Page 1 of 1

Can someone plz fix sorting in this old mod?

Posted: Fri Nov 20, 2015 12:02 pm
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?

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

Posted: Fri Nov 20, 2015 12:30 pm
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.

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

Posted: Fri Nov 20, 2015 12:41 pm
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.

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

Posted: Fri Nov 20, 2015 2:35 pm
by Peter34
Thanks a lot!

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

Posted: Fri Jul 01, 2016 12:51 am
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.

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

Posted: Mon Jul 04, 2016 9:07 pm
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