What does "order" do?
What does "order" do?
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?
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.
Re: What does "order" do?
Thanks! But what happens when all the items have the same order?
Re: What does "order" do?
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.
Re: What does "order" do?
Thanks. Sorry for being so incompetent to look it up myself.
- eradicator
- Smart Inserter
- Posts: 5211
- Joined: Tue Jul 12, 2016 9:03 am
- Contact:
Re: What does "order" do?
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 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
Re: What does "order" do?
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.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]".
I'm an admin over at https://wiki.factorio.com. Feel free to contact me if there's anything wrong (or right) with it.
- eradicator
- Smart Inserter
- Posts: 5211
- Joined: Tue Jul 12, 2016 9:03 am
- Contact:
Re: What does "order" do?
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".Bilka wrote: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.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]".
- bobingabout
- Smart Inserter
- Posts: 7352
- Joined: Fri May 09, 2014 1:01 pm
- Contact:
Re: What does "order" do?
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.