order = "x[name]-x[otherName]" Meaning?
order = "x[name]-x[otherName]" Meaning?
What does the order thing do for things like fluids? On the docs it mentions it's like the order of the string, but the string for what? I'm not even sure where to begin testing this to see what does what.
Re: order = "x[name]-x[otherName]" Meaning?
Not just fluids either. I'd also like to know how this ordering works.
- DedlySpyder
- Filter Inserter
- Posts: 253
- Joined: Fri Jun 20, 2014 11:42 am
- Contact:
Re: order = "x[name]-x[otherName]" Meaning?
There's a great post by Rseding out there on the forums, bug I can't find it atm.
I forgot the names of some of these, but the idea is there. Basically, items are ordered by item-category first, then a sub item-category, then finally by the order string. The order string could just be a single letter and handle it properly, but the full string in the items are just there for more detail
I forgot the names of some of these, but the idea is there. Basically, items are ordered by item-category first, then a sub item-category, then finally by the order string. The order string could just be a single letter and handle it properly, but the full string in the items are just there for more detail
Re: order = "x[name]-x[otherName]" Meaning?
viewtopic.php?f=34&t=24649&p=158419#p158419
viewtopic.php?f=25&t=24163&p=152955#p152955Rseding91 wrote:Recipe sort order:
Recipe Group ID sort order:
- if the recipe group IDs are not identical sort by the recipe group IDs
- if the recipe sub group IDs are not identical: sort by the recipe sub group IDs
- if the recipe order strings are not identical sort by the recipe order strings
- else sort by the recipe names
Recipe Sub Group ID sort order:
- if the recipe group ID order strings are not identical sort by the order strings
- else sort by the recipe group ID names
Recipe group IDs are either the group of the recipe sub group or the recipe products sub group group.
- if the recipe sub group order strings are not identical sort by the order strings
- else sort by the recipe sub group ID names
Recipe sub group IDs are either manually defined in the prototype or the main recipe products sub group ID.
When I say "sort by" I mean the "<" operator which always ends up being "left string" < "right string" which uses the C++ string comparison: http://en.cppreference.com/w/cpp/algori ... al_compare
Item inventory sort order is applied the same way. When 2 items are identical additional logic is applied to sort them (such as durability, health, blueprint contents) but that's not adjustable through the prototype so that's not really useful in this context.
Rseding91 wrote:The [tags] thing was extremely confusing of Kovarex to say. They are literal strings - they're compared as such. There's no parsing of the string it's simply C++ std::string < comparison.DaveMcW wrote:The [tags] are optional, not used by the game, and only meant to help modders get the order right. That plan seems to have backfired.
So for:That will be used in the game via:Code: Select all
data.raw["item1"].order = "a-[b]-b[car]" data.raw["item2"].order = "a-[a]-b[car]"
And so the C++ std::string comparison operator says that item1.order is not < item2.order because "a" < "b".Code: Select all
std::string item1.order = "a-[b]-b[car]"; std::string item2.order = "a-[a]-b[car]"; return item1.order < item2.order;
In simple terms: It's pure string alphabetical order comparison. Ignore all the "[...] is ignored" stuff - it's not - it's this: https://en.wikipedia.org/wiki/Lexicographical_order
Re: order = "x[name]-x[otherName]" Meaning?
Ah thanks, seems like it won't break the game whatever I put in there .