Order
-
- Inserter
- Posts: 38
- Joined: Sun Apr 16, 2017 1:54 pm
- Contact:
Order
I want to display my item-group last but I dont understand how order works. How is it done? Whats the a, b, ... letters?
Re: Order
The order property is a simple string. When the game compares 2 like prototypes if the order strings aren't equal they're lexicographically compared to determine if a given prototype comes before or after another. Overall, this results in an alphabetical order.
https://wiki.factorio.com/Types/Order
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.
-
- Inserter
- Posts: 38
- Joined: Sun Apr 16, 2017 1:54 pm
- Contact:
Re: Order
I dont know if I am stupid but I dont get it. I am just randomly trying letters to get it work. I think there is lack of documentation for it.Bilka wrote:The order property is a simple string. When the game compares 2 like prototypes if the order strings aren't equal they're lexicographically compared to determine if a given prototype comes before or after another. Overall, this results in an alphabetical order.
https://wiki.factorio.com/Types/Order
- eradicator
- Smart Inserter
- Posts: 5206
- Joined: Tue Jul 12, 2016 9:03 am
- Contact:
Re: Order
He's saying that the order string is just "a string". There's nothing special about it. Neither the letters nor the brackets or hypens have any special meaning whatsoever.MineGame159 wrote: I dont know if I am stupid but I dont get it.
aaa
aab
aab-[aaa]
aab-[aab]
So if you want to be last in the order you have to start with a letter that is "after" all the other letters already used. The highest base game item-group value seems to be "f", so use "g" or "h" or something.
Author of: Belt Planner, Hand Crank Generator, Screenshot Maker, /sudo and more.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.
-
- Inserter
- Posts: 38
- Joined: Sun Apr 16, 2017 1:54 pm
- Contact:
Re: Order
So every prototype had some order letter and then based of that letter it is alphabrtical order. Thanks for explanation. I think that is better than what is on wiki because wiki says nothing.eradicator wrote:He's saying that the order string is just "a string". There's nothing special about it. Neither the letters nor the brackets or hypens have any special meaning whatsoever.MineGame159 wrote: I dont know if I am stupid but I dont get it.
aaa
aab
aab-[aaa]
aab-[aab]
So if you want to be last in the order you have to start with a letter that is "after" all the other letters already used. The highest base game item-group value seems to be "f", so use "g" or "h" or something.
Re: Order
MineGame159 wrote: So every prototype had some order letter and then based of that letter it is alphabrtical order. Thanks for explanation. I think that is better than what is on wiki because wiki says nothing.
I'm sorry if I'm being dense, but how is what I said "nothing"?Bilka wrote: Overall, this results in an alphabetical 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.
- eradicator
- Smart Inserter
- Posts: 5206
- Joined: Tue Jul 12, 2016 9:03 am
- Contact:
Re: Order
@Bilka:
I think the wiki article is lacking an explicit comment that none of the non-letters, i.e. mostly "-" and "[" have any special meaning for sorting. The linked wikipedia article is also one of those typical articles written for people who already know roughtly what it's about.
I.e. both your wiki article and the wiki article feel like they're aimed at advanced users, and lack guidance for beginners.
I think this is one of the "general cricisicms" i wrote down...way back...in some other topic. The fact that the wiki articles have no clear target-user structure. Some of them are filled to the brim with examples for beginners. Others (like this one) are condensed down to the minimum, which is nice for advanced users who just want to know the specifics (the group i consider myself part of), but isn't verbose enough for beginners to understand.
Personally i'd find it nice if those two target audiences were seperated. I.e. by having a "technical abstract" on the top of each article for advanced readers. Followed by the verbose explanation with examples for less experienced readers. (But ofc that would require a prohibitive amount of time to change.)
I don't know if there's an english word for "Berufsblindheit", a translation forum suggests "professional tunnel vision". I.e. you might be overestimating the programming-related knowledge of modding beginners, due to your own knowledge being "too advanced". Some modders here on the forums haven't even finished school ;).
(Excuse me if any of the above sounds like a personal attack. It's supposed to be a neutral observation. But i know people often misunderstand that intention when i write things down.)
I think the wiki article is lacking an explicit comment that none of the non-letters, i.e. mostly "-" and "[" have any special meaning for sorting. The linked wikipedia article is also one of those typical articles written for people who already know roughtly what it's about.
I.e. both your wiki article and the wiki article feel like they're aimed at advanced users, and lack guidance for beginners.
I think this is one of the "general cricisicms" i wrote down...way back...in some other topic. The fact that the wiki articles have no clear target-user structure. Some of them are filled to the brim with examples for beginners. Others (like this one) are condensed down to the minimum, which is nice for advanced users who just want to know the specifics (the group i consider myself part of), but isn't verbose enough for beginners to understand.
Personally i'd find it nice if those two target audiences were seperated. I.e. by having a "technical abstract" on the top of each article for advanced readers. Followed by the verbose explanation with examples for less experienced readers. (But ofc that would require a prohibitive amount of time to change.)
I don't know if there's an english word for "Berufsblindheit", a translation forum suggests "professional tunnel vision". I.e. you might be overestimating the programming-related knowledge of modding beginners, due to your own knowledge being "too advanced". Some modders here on the forums haven't even finished school ;).
(Excuse me if any of the above sounds like a personal attack. It's supposed to be a neutral observation. But i know people often misunderstand that intention when i write things down.)
Author of: Belt Planner, Hand Crank Generator, Screenshot Maker, /sudo and more.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.
-
- Inserter
- Posts: 38
- Joined: Sun Apr 16, 2017 1:54 pm
- Contact:
Re: Order
Imagine if you were beginner and you are reading that wiki page about order string will you understand it? Ok there is example but it just first: "a-d" and second: "a-b" and its saying that second will be shown before first but no explain. I dont want to judge you but its very "beginner-unfriendly". All that "-", "[]" its just being confusing for beginners.Bilka wrote:MineGame159 wrote: So every prototype had some order letter and then based of that letter it is alphabrtical order. Thanks for explanation. I think that is better than what is on wiki because wiki says nothing.I'm sorry if I'm being dense, but how is what I said "nothing"?Bilka wrote: Overall, this results in an alphabetical order.
Re: Order
I modifed https://wiki.factorio.com/Types/Order to do something like that, please tell me if the page is more understandable now.eradicator wrote:Personally i'd find it nice if those two target audiences were seperated. I.e. by having a "technical abstract" on the top of each article for advanced readers. Followed by the verbose explanation with examples for less experienced readers. (But ofc that would require a prohibitive amount of time to change.)
I'm an admin over at https://wiki.factorio.com. Feel free to contact me if there's anything wrong (or right) with it.
-
- Inserter
- Posts: 38
- Joined: Sun Apr 16, 2017 1:54 pm
- Contact:
Re: Order
Much better now.Bilka wrote:I modifed https://wiki.factorio.com/Types/Order to do something like that, please tell me if the page is more understandable now.
Re: Order
?darkfrei wrote:How to make it parametrically?
The order string is just that, a simple string.
- (minus) and [] (square brackets) are just added for human readability, but they don't influence the result*.
I'm not sure what you mean by parametrically/parametrisch.
* They do, somewhat, but you'll probably never get into any situation where it matters, so I'll just refer to https://wiki.factorio.com/Types/Order for further reading (ASCII/UTF8 sorting order and that kind of stuff).
- eradicator
- Smart Inserter
- Posts: 5206
- Joined: Tue Jul 12, 2016 9:03 am
- Contact:
Re: Order
@Bilka: Yes. Looks much nicer now. My brain is trying to decide if it would be better to write "a" to "z" instead of "a" <linebreak> "z", but i can't really say i like either version better. More importantly my brain still has problems parsing the grammar of the first sentence in "advanced":
Also the list of sorting order is really nice. I never knew the exact sort order of - and [], but the list should make it pretty clear that there really is no special meaning to them :).
I guess that it means "prototypes of the same type", but either the sentence has broken grammar, or my brain has broken grammar parsing :D.When the game compares 2 like prototypes if the order strings aren't equal[...]
Also the list of sorting order is really nice. I never knew the exact sort order of - and [], but the list should make it pretty clear that there really is no special meaning to them :).
Author of: Belt Planner, Hand Crank Generator, Screenshot Maker, /sudo and more.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.
Re: Order
Bilka is German and this is a simple translation error. "2 like prototypes" essentially means "2 similar prototypes" (or technically prototypes that have the same type, which should be reflected on the wiki page). Also, "to determine if a given prototype comes before or after another", comes is reserved for people, the word should be occurs or the sentence should be rewritten.eradicator wrote:...
Re: Order
I mean by the "parametrically/parametrisch" some code, when you make new items on the already existing items/fluids.daniel34 wrote:I'm not sure what you mean by parametrically/parametrisch.darkfrei wrote:How to make it parametrically?
For example, when I have some fluids like "water" or "crude-oil", then I can make new items like "barreled-water" and "barreled-crude oil". Some mods can also add new items/fluids to the game and my mod must work with all of them and add to this new items the right order.
Re: Order
Funnily enough, that sentence is nearly the same as what Rseding wrote when he first made the page, including the two things pointed out here. Though I could see myself making those mistakes :Pdaniel34 wrote:Bilka is German and this is a simple translation error. "2 like prototypes" essentially means "2 similar prototypes" (or technically prototypes that have the same type, which should be reflected on the wiki page). Also, "to determine if a given prototype comes before or after another", comes is reserved for people, the word should be occurs or the sentence should be rewritten.
That should be better :)updated page wrote:When the game compares 2 prototypes (of the same type) if the order strings aren't equal they're lexicographically compared to determine if a given prototype is shown before or after another.
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: Order
The wiki still has this entry (under Basic):
"something" is not defined, but it's apparent that it means Prototype. As for "comes", in this case I would say "it is processed/listed before ...".So, something with the order "a" comes before something with the order "b" or "c".
EDIT: I already updated the wiki , feel free to edit/undo the changes if they are not satisfactory.The order property is a simple string. When the game needs to sort prototypes, it looks at their order properties and sorts those alphabetically. A prototype with an order string of "a" will be listed before other prototypes with order string "b" or "c". The "-" or "[]" structures that can be found in vanilla order strings do not have any special meaning.
- eradicator
- Smart Inserter
- Posts: 5206
- Joined: Tue Jul 12, 2016 9:03 am
- Contact:
Re: Order
So am i btw. Thus it might have just been some irregular usecase/grammar that i don't know. Which is why i asked. (And i wasn't sure what Bilkas native language is.)daniel34 wrote:Bilka is German and this is a simple translation error.eradicator wrote:...
Btw, from a writing-aesthetic viewpoint i firmly remember my teacher being very strict about "numbers smaller than 10 must be written as words". So the whole "2 prototypes" thing always makes me cringe a little (i.e. instead of "two prototypes"). Is that really just me?
Let's look further:
is missing auxiliary verbs (and other fixes that are hopefully correct):Using a UTF-8 character list, the sort order of special characters can identified, here the sort order for common characters:
@darkfrei:Using an UTF-8 character list, the sorting order of special characters can be identified. This is the sort order for common characters:
Just use the old order string as a pre/postfix for your new stuff. i.e. order = "newstuff"..old_order.."newstuff"
Author of: Belt Planner, Hand Crank Generator, Screenshot Maker, /sudo and more.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.
Re: Order
I thought I fixed that! The German rules is words for under 13 afaik, no idea about the English rule.eradicator wrote: Btw, from a writing-aesthetic viewpoint i firmly remember my teacher being very strict about "numbers smaller than 10 must be written as words". So the whole "2 prototypes" thing always makes me cringe a little (i.e. instead of "two prototypes"). Is that really just me?
Google tells me it should be "sort order", so I'll keep that, the other things have been fixed.eradicator wrote:is missing auxiliary verbs (and other fixes that are hopefully correct):Using a UTF-8 character list, the sort order of special characters can identified, here the sort order for common characters:Using an UTF-8 character list, the sorting order of special characters can be identified. This is the sort order for common characters:
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: 5206
- Joined: Tue Jul 12, 2016 9:03 am
- Contact:
Re: Order
Let's do some more nitpicking while we're at it. (And if any native english speaker finds a mistake i'll be greatful for any corrections.)
If-then (Falls-dann) is used for situations where the occurance of the event is uncertain.
When (Wenn) is used to indicate temporal order of occurance for events that are certain to happen.
When the order strings are equal the game then falls back to comparing the prototype names to determine order.
Reason:If the order strings are equal (then) the gamethenfalls back to comparing the prototype names to determine order.
If-then (Falls-dann) is used for situations where the occurance of the event is uncertain.
When (Wenn) is used to indicate temporal order of occurance for events that are certain to happen.
Missing pural.Examples using the above ordering:
Author of: Belt Planner, Hand Crank Generator, Screenshot Maker, /sudo and more.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.