Prototype/Item/Order

Place to get help with not working mods / modding interface.
User avatar
ssilk
Global Moderator
Global Moderator
Posts: 12889
Joined: Tue Apr 16, 2013 10:35 pm
Contact:

Prototype/Item/Order

Post by ssilk »

In the docs it say: https://forums.factorio.com/wiki/inde ... Item#order

order Is used to order items in inventory (when sorting is enabled) and to sort recipes in crafting screen.

order = "a-b-c"

But in reality there is

order = "a[items]-b[basic-mining-drill]"

What does that in the square brackets mean? Is it a link to the item-subgroup or how does it work?
Cool suggestion: Eatable MOUSE-pointers.
Have you used the Advanced Search today?
Need help, question? FAQ - Wiki - Forum help
I still like small signatures...

User avatar
FreeER
Smart Inserter
Smart Inserter
Posts: 1266
Joined: Mon Feb 18, 2013 4:26 am
Contact:

Re: Prototype/Item/Order

Post by FreeER »

I don't think it's actually changed any from before, though I could be wrong I'll check when I get the chance, it should still just be based on the order of the strings. All characters have a numeric code (since computers only understand 1/0s this is obvious when thought about) and that is what is compared. You can google 'ascii table' if you want to see the actual numbers.

I think the new format is just a 'better' formatting standard, but again I'll check the code when I get the chance to see if it has some special significance in the sorting.

kovarex
Factorio Staff
Factorio Staff
Posts: 8195
Joined: Wed Feb 06, 2013 12:00 am
Contact:

Re: Prototype/Item/Order

Post by kovarex »

Yes, it is still same, but these brackets are just new standard.

Consider this list
  • a[items]-b[basic-mining-drill]
  • a[items]-c[some-other drill]
  • b[x-thing]-a[tralala]
  • b[x-thing]-b[some other tralala]
it will sort exactly the same as it was
  • a-b
  • a-c
  • b-a
  • b-b
But the first one is easier to understand, because you can easily see what is the a used for.

There is also other change, the ordering of items is determined by these priorities
  • 1) Item group
  • 2) Item subgroup
  • 3) Item order string
  • 4) Item name
So the order string is used just to order things inside one group, this is useful, because I can reorder whole groups or subgroups while keeping the ordering inside the group intact.

Edit: see https://wiki.factorio.com/Types/Order for a better explanation.

McGuten
Filter Inserter
Filter Inserter
Posts: 310
Joined: Tue Jun 24, 2014 3:06 pm
Contact:

Re: Prototype/Item/Order

Post by McGuten »

Hi.
i try to make a mod for factorio but the node order make me crazy.
I do not understand how it works, if someone can explain me... I will be eternally grateful because i can't use it :(

For example:

I define 4 items and I order just like that:

Code: Select all

order = "a[inserter]-a[item1]",
order = "a[inserter]-b[item2]",
order = "b[fast-inserter]-a[item3]",
order = "b[fast-inserter]-b[item4]",
And when I play, the items are placed just like that:
  1. Item 1
  2. Item 3
  3. Item 4
  4. Item 2
Image

McGuten
Filter Inserter
Filter Inserter
Posts: 310
Joined: Tue Jun 24, 2014 3:06 pm
Contact:

Re: Prototype/Item/Order

Post by McGuten »

McGuten wrote:Hi.
i try to make a mod for factorio but the node order make me crazy.
I do not understand how it works, if someone can explain me... I will be eternally grateful because i can't use it :(

For example:

I define 4 items and I order just like that:

Code: Select all

order = "a[inserter]-a[item1]",
order = "a[inserter]-b[item2]",
order = "b[fast-inserter]-a[item3]",
order = "b[fast-inserter]-b[item4]",
And when I play, the items are placed just like that:
  1. Item 1
  2. Item 3
  3. Item 4
  4. Item 2

Please someone can help me? i don't understand how to work "Order"
Image

YuokiTani
Smart Inserter
Smart Inserter
Posts: 1037
Joined: Thu May 08, 2014 7:57 pm
Contact:

Re: Prototype/Item/Order

Post by YuokiTani »

Sort-Order is random or luck however you want to call it.i had different sortings (recipe-screen) in same mod-version and different savegames. (sortings works surely not how you think to know)
you can use the rules, and hope in future this system works better.

make your item/entity-names in correct order and try this out like
name="inserter-a1"
name="inserter-slow1"
name="inserter-fast1"
name="inserter-fast2"
name="ins-n3"

i assume that -slow pops up at last place and "ins-" at first - against other order-rules ... so better avoid disorder from the nameing itself
it's not really clear if factorio uses the entity, item or recipe-order-rules ...

things in [] are ignored ...

Post Reply

Return to “Modding help”