Order string doesn't work

Place to get help with not working mods / modding interface.
Natha
Fast Inserter
Fast Inserter
Posts: 199
Joined: Sun Mar 15, 2015 1:48 pm
Contact:

Order string doesn't work

Post by Natha »

Hi,

for my mod I want to reorder all oil-recipes (oil-processing, cracking, solid fuel). But the order string doesn't work (for another subgroup with only one base-recipe (the others are mod-own recipes), it does work).

That doesn't work:

Code: Select all

recipe = function(name, subgroup, order)
	data.raw.recipe[name].subgroup = subgroup
	data.raw.recipe[name].order = order
end

recipe("basic-oil-processing", "oil-processing", "a-a")
recipe("advanced-oil-processing", "oil-processing", "a-b")

recipe("heavy-oil-cracking", "oil-processing", "b-a")
recipe("light-oil-cracking", "oil-processing", "b-b")

recipe("solid-fuel-from-heavy-oil", "oil-processing", "c-a")
recipe("solid-fuel-from-light-oil", "oil-processing", "c-b")
recipe("solid-fuel-from-petroleum-gas", "oil-processing", "c-c")
In game I get this order:
- basic oil processing
- Heavy oil cracking
- Light oil cracking
- Advanced oil cracking
- Petroleum solid fuel
- heavy oil solid fuel
- Light oil solid fuel

If I write this with []-brackets, I get another order (but not the desired).

Can someone help me?
Rseding91
Factorio Staff
Factorio Staff
Posts: 14264
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: Order string doesn't work

Post by Rseding91 »

Which version of the game are you using?
If you want to get ahold of me I'm almost always on Discord.
Natha
Fast Inserter
Fast Inserter
Posts: 199
Joined: Sun Mar 15, 2015 1:48 pm
Contact:

Re: Order string doesn't work

Post by Natha »

Rseding91 wrote:Which version of the game are you using?
0.12.21
malcmiller
Burner Inserter
Burner Inserter
Posts: 8
Joined: Sat Jan 23, 2016 4:27 am
Contact:

Re: Order string doesn't work

Post by malcmiller »

I don't think that tables in lua code are actually ever kept in order. maybe you can use table_sort() on their order part of the recipe prototypes.
Post Reply

Return to “Modding help”