What does "order" do?

Place to get help with not working mods / modding interface.
Villfuk02
Long Handed Inserter
Long Handed Inserter
Posts: 79
Joined: Mon Apr 30, 2018 7:23 am
Contact:

What does "order" do?

Post by Villfuk02 »

I see the value order needed in almost any prototype, so inspired by other mods i just set it to "a-b", but I have no idea what does it do. Could somebody please explain? thanks.
Bilka
Factorio Staff
Factorio Staff
Posts: 3392
Joined: Sat Aug 13, 2016 9:20 am
Contact:

Re: What does "order" do?

Post by Bilka »

The order string is a simple string that determines the order of items in your inventory (if automatic sorting is on), the order of recipes in the recipe gui, technologies in the technology GUI, bonuses in the bonus GUI, and entities in the map editor entity GUI. Most of these things are ordered by subgroup, and then by order string. The strings are sorted lexicographically in ASCII order (random link from google). For more info, see https://wiki.factorio.com/Types/Order
I'm an admin over at https://wiki.factorio.com. Feel free to contact me if there's anything wrong (or right) with it.
Villfuk02
Long Handed Inserter
Long Handed Inserter
Posts: 79
Joined: Mon Apr 30, 2018 7:23 am
Contact:

Re: What does "order" do?

Post by Villfuk02 »

Thanks! But what happens when all the items have the same order?
Bilka
Factorio Staff
Factorio Staff
Posts: 3392
Joined: Sat Aug 13, 2016 9:20 am
Contact:

Re: What does "order" do?

Post by Bilka »

Villfuk02 wrote:Thanks! But what happens when all the items have the same order?
https://wiki.factorio.com/Types/Order wrote:When the order strings are equal the game then falls back to comparing the prototype names to determine order.
I'm an admin over at https://wiki.factorio.com. Feel free to contact me if there's anything wrong (or right) with it.
Villfuk02
Long Handed Inserter
Long Handed Inserter
Posts: 79
Joined: Mon Apr 30, 2018 7:23 am
Contact:

Re: What does "order" do?

Post by Villfuk02 »

Thanks. Sorry for being so incompetent to look it up myself.
User avatar
eradicator
Smart Inserter
Smart Inserter
Posts: 5211
Joined: Tue Jul 12, 2016 9:03 am
Contact:

Re: What does "order" do?

Post by eradicator »

Bilka wrote:The order string is a simple string that determines the order of items in your inventory (if automatic sorting is on), the order of recipes in the recipe gui, technologies in the technology GUI, bonuses in the bonus GUI, and entities in the map editor entity GUI. Most of these things are ordered by subgroup, and then by order string. The strings are sorted lexicographically in ASCII order (random link from google). For more info, see https://wiki.factorio.com/Types/Order
Would be nice if that page explained that the bracket syntax commonly used in base game is also simply lexicographically sorted. I.e. "a-[solar1]" before "a-[solar2]".
Bilka
Factorio Staff
Factorio Staff
Posts: 3392
Joined: Sat Aug 13, 2016 9:20 am
Contact:

Re: What does "order" do?

Post by Bilka »

eradicator wrote:Would be nice if that page explained that the bracket syntax commonly used in base game is also simply lexicographically sorted. I.e. "a-[solar1]" before "a-[solar2]".
The things in the brackets aren't lexicographically sorted, the entire string is. That's why I bolded simple string. It's just a string, and that's all there is to it.
I'm an admin over at https://wiki.factorio.com. Feel free to contact me if there's anything wrong (or right) with it.
User avatar
eradicator
Smart Inserter
Smart Inserter
Posts: 5211
Joined: Tue Jul 12, 2016 9:03 am
Contact:

Re: What does "order" do?

Post by eradicator »

Bilka wrote:
eradicator wrote:Would be nice if that page explained that the bracket syntax commonly used in base game is also simply lexicographically sorted. I.e. "a-[solar1]" before "a-[solar2]".
The things in the brackets aren't lexicographically sorted, the entire string is. That's why I bolded simple string. It's just a string, and that's all there is to it.
Well yea. Exactly. The brackets are nothing special. But they are a source of confusion exactly because they're not treated specially. There were quite a few people a few threads back (don't have a link handy :/) who assumed various special behavior rules for the brackets and their content, i.e. "stuff in brackets is ignored", "dashes are ignored" etcpp. So it would be kind of nice to have an explicit mention/example to debunk that "myth".
User avatar
bobingabout
Smart Inserter
Smart Inserter
Posts: 7352
Joined: Fri May 09, 2014 1:01 pm
Contact:

Re: What does "order" do?

Post by bobingabout »

I can figure out order for items, but for groups, I really can't figure it out. there's a group with order "aaa" in the base game for example. I tried adding a new group with order "1", "a", "zzz" etc, and it didn't show in game where I expected it to.
Creator of Bob's mods. Expanding your gameplay since version 0.9.8.
I also have a Patreon.
Post Reply

Return to “Modding help”