Page 1 of 1

Need some help with groups and subgroups

Posted: Fri Apr 29, 2016 12:07 pm
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..

Re: Need some help with groups and subgroups

Posted: Fri Apr 29, 2016 1:52 pm
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.

Re: Need some help with groups and subgroups

Posted: Fri Apr 29, 2016 5:05 pm
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

Re: Need some help with groups and subgroups

Posted: Fri Apr 29, 2016 6:51 pm
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.

Re: Need some help with groups and subgroups

Posted: Sun May 01, 2016 7:38 am
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

Re: Need some help with groups and subgroups

Posted: Tue May 03, 2016 7:55 am
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.

Re: Need some help with groups and subgroups

Posted: Thu May 05, 2016 11:38 am
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.

Re: Need some help with groups and subgroups

Posted: Fri May 06, 2016 10:07 pm
by CloSteam
Well I guess no body knows... oh well

Re: Need some help with groups and subgroups

Posted: Sat May 07, 2016 12:11 am
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).

Re: Need some help with groups and subgroups

Posted: Tue May 10, 2016 10:23 am
by bobingabout
Still, I thought Rseding was going to explain it to us.

Re: Need some help with groups and subgroups

Posted: Tue May 10, 2016 10:30 am
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.

Re: Need some help with groups and subgroups

Posted: Tue May 10, 2016 2:00 pm
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.

Re: Need some help with groups and subgroups

Posted: Tue May 10, 2016 2:16 pm
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.

Re: Need some help with groups and subgroups

Posted: Wed May 11, 2016 1:05 am
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.

Re: Need some help with groups and subgroups

Posted: Wed May 11, 2016 11:56 am
by CloSteam
Yeah I was like oh awesome a device will explain no word of mouth or anything lol... um nope get wrecked lol

Re: Need some help with groups and subgroups

Posted: Wed May 11, 2016 12:24 pm
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.

Re: Need some help with groups and subgroups

Posted: Wed May 11, 2016 12:28 pm
by prg
They're not.