What does "order" do?
Posted: Fri May 04, 2018 3:42 pm
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.
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.
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
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]".
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]".