[MOD 0.16.x, 0.17.x, 0.18.x, 1.1.x] SCTM
Re: [MOD 0.16.x] SCTM
hmm, looks like change to debug messages triggered reprocessing of migration script, not sure why. should be fixed now.
Re: [MOD 0.16.x] SCTM
Thanks, but now I updated scm and a different error comes up
Error while applying migration: ScienceCostTweaker Mod (mexmer): ScienceCostTweaker_0.16.28.lua
...CostTweakerM__/migrations/ScienceCostTweaker_0.16.28.lua:1: module sctmlib not found; no such file __ScienceCostTweakerM__/migrations/sctmlib.lua no such file C:/Program Files (x86)/Steam/steamapps/common/Factorio/data/core/lualib/sctmlib.lua
edit: I'm playing Seablock with this, I did disable all the other mods and error still appears
Error while applying migration: ScienceCostTweaker Mod (mexmer): ScienceCostTweaker_0.16.28.lua
...CostTweakerM__/migrations/ScienceCostTweaker_0.16.28.lua:1: module sctmlib not found; no such file __ScienceCostTweakerM__/migrations/sctmlib.lua no such file C:/Program Files (x86)/Steam/steamapps/common/Factorio/data/core/lualib/sctmlib.lua
edit: I'm playing Seablock with this, I did disable all the other mods and error still appears
Re: [MOD 0.16.x] SCTM
can you send me save, i tried with different saves and migration doesn't trigger in first place. it should be already applied if you save has 0.16.28 or newer version of mod.Aviator wrote:Thanks, but now I updated scm and a different error comes up
Error while applying migration: ScienceCostTweaker Mod (mexmer): ScienceCostTweaker_0.16.28.lua
...CostTweakerM__/migrations/ScienceCostTweaker_0.16.28.lua:1: module sctmlib not found; no such file __ScienceCostTweakerM__/migrations/sctmlib.lua no such file C:/Program Files (x86)/Steam/steamapps/common/Factorio/data/core/lualib/sctmlib.lua
edit: I'm playing Seablock with this, I did disable all the other mods and error still appears
anyway i reuploaded 0.16.42 with migration script from elder version.
Re: [MOD 0.16.x] SCTM
0.16.43 was just released, this was intended to be mostly about mod maintenance and some standardization of function usage, so it should not break stuff (imo), but in the end i also added py intermediates integration, just to test out how my function lib works.
Re: [MOD 0.16.x] SCTM
Yes please!Future plans
- add space science pack components (ingredients will be from space)
Surface composition samples, magnetic field measurements, multispectral imaging data, captured solar particles: all those things could be brought from space for a further scientific research.
There is no such thing as unarmed spaceship © Isaac Arthur
Re: [MOD 0.16.x] SCTM
0.16.45
there is not much changes, just added Xander mod compatibility (tested only with xander alone, no other mods involved), and reduced log spam by slight margin.
there is not much changes, just added Xander mod compatibility (tested only with xander alone, no other mods involved), and reduced log spam by slight margin.
Re: [MOD 0.16.x] SCTM
(Bringing this over from the Seablock thread)
The cost scaling of SCT expensive recipes is extreme. In the Vanilla game expensive recipes for science cost somewhere in the neighborhood of 10x as much, combining a 4x increase in technology prices with a 1x-4x increase in resources required for each science pack.
The cost scaling of SCT expensive recipes is extreme. In the Vanilla game expensive recipes for science cost somewhere in the neighborhood of 10x as much, combining a 4x increase in technology prices with a 1x-4x increase in resources required for each science pack.
Vanilla comparison
SCT has similar scaling for each component, but by applying this to intermediate products as well, it makes the resources required become much higher by compounding the 2x-3x increase over multiple steps.SCT+sea block comparison
The most extreme change is 3 iron to almost 200 iron for green science packs.Re: [MOD 0.16.x] SCTM
i had not done any calculation with seablock, and tbh. don''t even plan to. i rebalanced most recipes for vanilla to get 2-4 increase in finale pack price (red is somewhate over 2, high tech and production are close to 4).
i will need to look more into bobs/angels + sct, because there are also expensive recipes in play on some materials used in science recipes, so they still scale higher than 4 when bobs + angels is in play, but it's not 100x increase, like it was for blue science.
i still need to redo calculation on science labs too, but probly next week.
i will need to look more into bobs/angels + sct, because there are also expensive recipes in play on some materials used in science recipes, so they still scale higher than 4 when bobs + angels is in play, but it's not 100x increase, like it was for blue science.
i still need to redo calculation on science labs too, but probly next week.
Re: [MOD 0.16.x] SCTM
Compatibility issue with v0.16.46:
In CircuitProcessing and SeaBlock (and maybe other mods), there are a bunch of places with a pattern like
The new update sets normal = { the usual properties }, expensive = false in a fair number of places, which makes those checks fail when they try to access the .expensive property. It works if I remove the expensive = false lines and move the properties from .normal into the recipe itself. I think you could also set the expensive property to be equal to the normal property as well.
There are also a couple of places in SeaBlock 0.2.12 that just assume that the .normal property exists on certain recipes, which breaks when I move those properties out, but that's something that they need to fix depending on what changes you make here.
As far as the rebalanced expensive costs, they look good. The increased scaling from base ingredients being more expensive (like green circuits using 2x iron in Circuit Processing, or ore using 2x mineral sludge in Sea Block) isn't an issue at all.
In CircuitProcessing and SeaBlock (and maybe other mods), there are a bunch of places with a pattern like
Code: Select all
if data.raw.recipe['something'].normal then
data.raw.recipe['something'].normal.something = something
data.raw.recipe['something'].expensive.something = something
else
data.raw.recipe['something'].something = something
end
There are also a couple of places in SeaBlock 0.2.12 that just assume that the .normal property exists on certain recipes, which breaks when I move those properties out, but that's something that they need to fix depending on what changes you make here.
As far as the rebalanced expensive costs, they look good. The increased scaling from base ingredients being more expensive (like green circuits using 2x iron in Circuit Processing, or ore using 2x mineral sludge in Sea Block) isn't an issue at all.
- eradicator
- Smart Inserter
- Posts: 5207
- Joined: Tue Jul 12, 2016 9:03 am
- Contact:
Re: [MOD 0.16.x] SCTM
Or you make the other ppl fix their code? :P
Code: Select all
if data.raw.recipe['something'].normal then
data.raw.recipe['something'].normal.something = something
end
if data.raw.recipe['something'].expensive then
data.raw.recipe['something'].expensive.something = something
end
if not (data.raw.recipe['something'].normal or data.raw.recipe['something'].expensive) then
data.raw.recipe['something'].something = something
end
Author of: Belt Planner, Hand Crank Generator, Screenshot Maker, /sudo and more.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.
Re: [MOD 0.16.x] SCTM
As far as I can find there isn't a single instance of "expensive = false" in the base game or any of the mods I have downloaded, so I'm not sure that it's even intended to work.
- eradicator
- Smart Inserter
- Posts: 5207
- Joined: Tue Jul 12, 2016 9:03 am
- Contact:
Re: [MOD 0.16.x] SCTM
Doesn't really matter if it's false or nil for checking existance. While i agree that nil would be the correct way, the assumption that existance of .normal implies existance of .expensive is simply wrong, and thus any code failing based on that needs fixing, as both normal without expensive and expensive without normal are valid recipes. There are many things that the base mod doesn't use but the engine supports. If "all modders agree on a certain way to do things" was a reasonable approach you could make assumptions like that. But that's not gonna happen :D.minno wrote:As far as I can find there isn't a single instance of "expensive = false" in the base game or any of the mods I have downloaded, so I'm not sure that it's even intended to work.
Author of: Belt Planner, Hand Crank Generator, Screenshot Maker, /sudo and more.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.
Re: [MOD 0.16.x] SCTM
false for dificulty variant is correct, as stated in https://wiki.factorio.com/Prototype/Recipe (see example at end of article)minno wrote:As far as I can find there isn't a single instance of "expensive = false" in the base game or any of the mods I have downloaded, so I'm not sure that it's even intended to work.
i've also discussed this with bilka and rseding some time ago on discord.
and rest was pointed by @eradicator
presence of expensive doesn't imply normal, presence of normal, doesn't imply expensive. and modders should check for that.
- eradicator
- Smart Inserter
- Posts: 5207
- Joined: Tue Jul 12, 2016 9:03 am
- Contact:
Re: [MOD 0.16.x] SCTM
Personally i'd be very interested in the reasoning of using false instead of nil. At the very least it'll break when someone does:mexmer wrote:false for dificulty variant is correct, as stated in https://wiki.factorio.com/Prototype/Recipe (see example at end of article)
i've also discussed this with bilka and rseding some time ago on discord.
Code: Select all
if recipe.expensive ~= nil then
end
Author of: Belt Planner, Hand Crank Generator, Screenshot Maker, /sudo and more.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.
Re: [MOD 0.16.x] SCTM
honestly, i don't know. i had quite long discussion with them about that, but there was not clear explanation why.eradicator wrote:Personally i'd be very interested in the reasoning of using false instead of nil. At the very least it'll break when someone does:mexmer wrote:false for dificulty variant is correct, as stated in https://wiki.factorio.com/Prototype/Recipe (see example at end of article)
i've also discussed this with bilka and rseding some time ago on discord.Which will work fine in all other circumstances and "looks" correct (other than being a bit verbose, but new modders aren't usually lua experts) if you don't know that some people put a boolean there instead.Code: Select all
if recipe.expensive ~= nil then end
but if you do test
if not recipe.normal then
it works with both nil and false. lua is loose typed language
i used false, since it's used in example, and also because i found other mod, that did the same. can't remember now name of mod.
when i was solving compatibility issues with other mods, i found some that used false, because at first i was testing for nil too.
anyways, using false for dificulty was decision made by devs, not moders, moders only can adopt to it
- eradicator
- Smart Inserter
- Posts: 5207
- Joined: Tue Jul 12, 2016 9:03 am
- Contact:
Re: [MOD 0.16.x] SCTM
I know. But nil looks cleaner to me. And has none of the drawbacks of having an unexpected type.mexmer wrote:it works with both nil and false. lua is loose typed language
If the only place where that "decision" is communicated is a single example at the very end of a wiki page that's certainly not enough to convince me to not use nil ;). Anything that the engine doesn't enforce is not a fixed decision in my book. I guess i'll just go ask them myself...mexmer wrote:anyways, using false for dificulty was decision made by devs, not moders, moders only can adopt to it
Thanks for the answers. Back to → on topic.
Author of: Belt Planner, Hand Crank Generator, Screenshot Maker, /sudo and more.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.
Re: [MOD 0.16.x] SCTM
nobody tells you to not use nil, you can use both.eradicator wrote:I know. But nil looks cleaner to me. And has none of the drawbacks of having an unexpected type.mexmer wrote:it works with both nil and false. lua is loose typed languageIf the only place where that "decision" is communicated is a single example at the very end of a wiki page that's certainly not enough to convince me to not use nil . Anything that the engine doesn't enforce is not a fixed decision in my book. I guess i'll just go ask them myself...mexmer wrote:anyways, using false for dificulty was decision made by devs, not moders, moders only can adopt to it
Thanks for the answers. Back to → on topic.
just use test, that expects either.
- eradicator
- Smart Inserter
- Posts: 5207
- Joined: Tue Jul 12, 2016 9:03 am
- Contact:
Re: [MOD 0.16.x] SCTM
Well, i went ahead and asked Bilka, and the result is that false is not the same as nil:mexmer wrote: nobody tells you to not use nil, you can use both.
just use test, that expects either.
Code: Select all
recipe.expensive = false
Code: Select all
recipe.expensive = util.table.deepcopy(recipe.normal)
recipe.expensive.enabled = false
The wiki text has been updated to mention this: https://wiki.factorio.com/Prototype/Recipe#Recipe_data
Author of: Belt Planner, Hand Crank Generator, Screenshot Maker, /sudo and more.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.
Re: [MOD 0.16.x] SCTM
well, that's interesting, i should probly copy factorio discord log, from time, when i was asking about that. and was complaining, that it should be nil, and not false.eradicator wrote:Well, i went ahead and asked Bilka, and the result is that false is not the same as nil:mexmer wrote: nobody tells you to not use nil, you can use both.
just use test, that expects either.behaves equivalent toCode: Select all
recipe.expensive = false
So if you use it on anything that doesn't have a technology to unlock it, it'll never be craftable on that difficulty. Which means nil is really the better option if you're not trying some super-special shenanigans.Code: Select all
recipe.expensive = util.table.deepcopy(recipe.normal) recipe.expensive.enabled = false
The wiki text has been updated to mention this: https://wiki.factorio.com/Prototype/Recipe#Recipe_data
doesn't matter tho, it's good they updated article
Re: [MOD 0.16.x] SCTM
so i tested behavior and for SCT nil/false is no change, because all recipes are unlocked trough technology, and they are enabled = false by default.
problem is with some mods, that either expect both dificulties (well, those we discussed above) or do own normalization, and then fail on false/nil dificulties.
so guess i will stick with duplicating dificulty settings, rather than leaving it nil/false
problem is with some mods, that either expect both dificulties (well, those we discussed above) or do own normalization, and then fail on false/nil dificulties.
so guess i will stick with duplicating dificulty settings, rather than leaving it nil/false