Order
Posted: Wed Sep 05, 2018 1:30 pm
I want to display my item-group last but I dont understand how order works. How is it done? Whats the a, b, ... letters?
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
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.
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.
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.
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.
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.)
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.
?darkfrei wrote:How to make it parametrically?
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[...]
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:...
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?
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.
"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.
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:...
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:
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:
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.
Missing pural.Examples using the above ordering: