Page 1 of 1

What does "order" do?

Posted: Fri May 04, 2018 3:42 pm
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.

Re: What does "order" do?

Posted: Fri May 04, 2018 3:51 pm
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

Re: What does "order" do?

Posted: Fri May 04, 2018 3:59 pm
by Villfuk02
Thanks! But what happens when all the items have the same order?

Re: What does "order" do?

Posted: Fri May 04, 2018 4:10 pm
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.

Re: What does "order" do?

Posted: Fri May 04, 2018 4:13 pm
by Villfuk02
Thanks. Sorry for being so incompetent to look it up myself.

Re: What does "order" do?

Posted: Sat May 05, 2018 1:13 am
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]".

Re: What does "order" do?

Posted: Sat May 05, 2018 9:12 am
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.

Re: What does "order" do?

Posted: Sun May 06, 2018 11:55 pm
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".

Re: What does "order" do?

Posted: Tue May 08, 2018 8:41 am
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.