Need some help with groups and subgroups

Place to post guides, observations, things related to modding that are not mods themselves.
Post Reply
CloSteam
Burner Inserter
Burner Inserter
Posts: 10
Joined: Fri Apr 29, 2016 11:48 am
Contact:

Need some help with groups and subgroups

Post by CloSteam »

the quick and dirty,

trying to make a mod that changes and reorganizes the game craft menu and inventory. problem is no matter wat i put in i cant seen to work out how the sub group orders work. tried simple a,b,c. tried simple 1,2,3. hell i even thought i understood and started to segment a-b-c and stuff like that but nothing...

can anybody help me out here.

disclaimer: i am absolutely fresh to coding and modding... thing is i get new entities to work they way i wanted but i cant get a simple sort going... i really think im missing something..
Meant to get back to you but got lost in the spaghetti on my way here...

User avatar
bobingabout
Smart Inserter
Smart Inserter
Posts: 7352
Joined: Fri May 09, 2014 1:01 pm
Contact:

Re: Need some help with groups and subgroups

Post by bobingabout »

Items, Alphabetical.
Subgroups... the tabs, right? I actually have no idea on this one myself, I do what I think is right, and it just puts it anywhere it wants to.
Creator of Bob's mods. Expanding your gameplay since version 0.9.8.
I also have a Patreon.

CloSteam
Burner Inserter
Burner Inserter
Posts: 10
Joined: Fri Apr 29, 2016 11:48 am
Contact:

Re: Need some help with groups and subgroups

Post by CloSteam »

Yeah I have that problem although I was looking at some of ur logistic mods and such and I noticed that like ur pipes line up the way they should I managed to get one of my new groups working but the new ones are just doing wat ever lol... I wanna organize it so bad cuz vanilla is really all over the place... the closest thing ive seen is 5 dims how he reorganized his... I tried following something similar but got no where...

TL,DR: shit acts stupid and I still can't get it to follow what I'm asking it to do
Meant to get back to you but got lost in the spaghetti on my way here...

Rseding91
Factorio Staff
Factorio Staff
Posts: 13242
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: Need some help with groups and subgroups

Post by Rseding91 »

There are a few different sort things that are applied.

* Item sort order in the player inventory
* Recipe sort order in a given recipe tab
* Recipe sub group sort order (the items in a given recipe line in a tab)
* Recipe group sort order (the order the big tabs are displayed)

Which orders are you talking about? They've all got defined logic in how they work. Most likely you're excluding some property that one of the sorts would use so it defaults to some other value that you're not expecting it to and sorts using that.
If you want to get ahold of me I'm almost always on Discord.

CloSteam
Burner Inserter
Burner Inserter
Posts: 10
Joined: Fri Apr 29, 2016 11:48 am
Contact:

Re: Need some help with groups and subgroups

Post by CloSteam »

That makes sense that's why in certain tabs the order I expect is correct while others it's all borked. When I get home I'll take a look and post some screen shots... I wanna understand this so that as I expand the mod I can keep it organized
Meant to get back to you but got lost in the spaghetti on my way here...

User avatar
bobingabout
Smart Inserter
Smart Inserter
Posts: 7352
Joined: Fri May 09, 2014 1:01 pm
Contact:

Re: Need some help with groups and subgroups

Post by bobingabout »

Rseding91 wrote:* Recipe group sort order (the order the big tabs are displayed)
I know I'm kind of hijacking the topic here, but this is the one that I can't figure out.

well..
Rseding91 wrote:* Item sort order in the player inventory
This one confuses me too, but I usually don't let it bother me.
Creator of Bob's mods. Expanding your gameplay since version 0.9.8.
I also have a Patreon.

CloSteam
Burner Inserter
Burner Inserter
Posts: 10
Joined: Fri Apr 29, 2016 11:48 am
Contact:

Re: Need some help with groups and subgroups

Post by CloSteam »

No hijack away... I was out of town so I wasn't able to go near factorio or the forum this keeps it alive... I hope.
Meant to get back to you but got lost in the spaghetti on my way here...

CloSteam
Burner Inserter
Burner Inserter
Posts: 10
Joined: Fri Apr 29, 2016 11:48 am
Contact:

Re: Need some help with groups and subgroups

Post by CloSteam »

Well I guess no body knows... oh well
Meant to get back to you but got lost in the spaghetti on my way here...

User avatar
Arch666Angel
Smart Inserter
Smart Inserter
Posts: 1636
Joined: Sun Oct 18, 2015 11:52 am
Contact:

Re: Need some help with groups and subgroups

Post by Arch666Angel »

If you have issues that the sorting does not work like you would expect, you might simply need to change the order of the group, apparently the sorting is fucked if for example two groups have the same order (two groups with sort order "m" for example).

User avatar
bobingabout
Smart Inserter
Smart Inserter
Posts: 7352
Joined: Fri May 09, 2014 1:01 pm
Contact:

Re: Need some help with groups and subgroups

Post by bobingabout »

Still, I thought Rseding was going to explain it to us.
Creator of Bob's mods. Expanding your gameplay since version 0.9.8.
I also have a Patreon.

orzelek
Smart Inserter
Smart Inserter
Posts: 3911
Joined: Fri Apr 03, 2015 10:20 am
Contact:

Re: Need some help with groups and subgroups

Post by orzelek »

There was an explanation in one of threads. And it should work like standard alphabetical sort.
I'm still not sure if text in brackets is actually ignored or not.

Rseding91
Factorio Staff
Factorio Staff
Posts: 13242
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: Need some help with groups and subgroups

Post by Rseding91 »

bobingabout wrote:Still, I thought Rseding was going to explain it to us.
I'll make a write up about how each sort order is applied and when.
If you want to get ahold of me I'm almost always on Discord.

User avatar
bobingabout
Smart Inserter
Smart Inserter
Posts: 7352
Joined: Fri May 09, 2014 1:01 pm
Contact:

Re: Need some help with groups and subgroups

Post by bobingabout »

Rseding91 wrote:
bobingabout wrote:Still, I thought Rseding was going to explain it to us.
I'll make a write up about how each sort order is applied and when.
I look forward to reading it.
Creator of Bob's mods. Expanding your gameplay since version 0.9.8.
I also have a Patreon.

Rseding91
Factorio Staff
Factorio Staff
Posts: 13242
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: Need some help with groups and subgroups

Post by Rseding91 »

Recipe 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 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 Sub Group ID sort order:
  • 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 group IDs are either the group of the recipe sub group or the recipe products sub group group.

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.
If you want to get ahold of me I'm almost always on Discord.

CloSteam
Burner Inserter
Burner Inserter
Posts: 10
Joined: Fri Apr 29, 2016 11:48 am
Contact:

Re: Need some help with groups and subgroups

Post by CloSteam »

Yeah I was like oh awesome a device will explain no word of mouth or anything lol... um nope get wrecked lol
Meant to get back to you but got lost in the spaghetti on my way here...

orzelek
Smart Inserter
Smart Inserter
Posts: 3911
Joined: Fri Apr 03, 2015 10:20 am
Contact:

Re: Need some help with groups and subgroups

Post by orzelek »

One thing I'm missing - are parts of item orders in [] removed in any way?
I vaguely remember reading they are but after this description I'm not so sure.

User avatar
prg
Filter Inserter
Filter Inserter
Posts: 947
Joined: Mon Jan 19, 2015 12:39 am
Contact:

Re: Need some help with groups and subgroups

Post by prg »

They're not.
Automatic Belt (and pipe) Planner—Automate yet another aspect of constructing your factory!

Post Reply

Return to “Modding discussion”